Worked example 1
A non-pipelined processor takes 8 ns to execute one instruction. A functionally equivalent 4-stage pipelined processor is designed. Due to latch overhead, the clock cycle time for the pipelined processor is 2.5 ns. Calculate the time saved by using the pipelined processor to execute 200 instructions.
Show solution outline
To solve this, we calculate the total time for each processor and then find the difference.
1. Non-Pipelined Processor Time: Total Time = Number of instructions × Time per instruction Total Time = 200 × 8 ns = 1600 ns
2. Pipelined Processor Time: The formula for a pipelined processor is: Time = (k + n - 1) × T_cycle Where k = number of stages, n = number of instructions, T_cycle = clock cycle time. Time = (4 + 200 - 1) × 2.5 ns Time = 203 × 2.5 ns = 507.5 ns
3. Time Saved: Time Saved = Time_non-pipelined - Time_pipelined Time Saved = 1600 ns - 507.5 ns = 1092.5 ns
Answer: The time saved is 1092.5 ns.