Question:

A non-pipelined instruction execution unit that operates at 1.6 GHz clock takes an average of 5 clock cycles to complete the execution of an instruction. To improve the performance, the system was pipelined with a goal of achieving an average throughput of one instruction per clock cycle. However, it could operate only at 1.2 GHz due to pipeline overheads. While executing a program in the pipelined design, 30% of instructions encountered a stall of 2 cycles due to pipeline hazards. The speed-up obtained by the pipelined design over the non-pipelined one for this program is ______ (rounded off to two decimal places).

Note: \(1\text{G}=10^{9}\)

Show Hint

Find execution time per instruction for both designs using time = CPI divided by clock frequency, remembering the pipelined CPI must include the extra stall cycles for 30% of instructions, then take the ratio of the two times.
Updated On: Jul 22, 2026
Show Solution
collegedunia
Verified By Collegedunia

Correct Answer: 2.3

Solution and Explanation

Step 1: Find the time to run one instruction on the non-pipelined unit.
The non-pipelined unit runs at
\[ 1.6 \text{ GHz} = 1.6\times10^{9} \text{ cycles/second} \]
and needs 5 cycles per instruction on average, so the execution time per instruction is
\[ T_{\text{non-pipe}} = \frac{5}{1.6\times10^{9}} = 3.125\times10^{-9}\text{ s} = 3.125 \text{ ns} \]

Step 2: Find the average CPI (cycles per instruction) on the pipelined unit.
Ideally, a pipeline finishes 1 instruction every cycle, so the base CPI is 1. But 30% of the instructions face a stall of 2 extra cycles, meaning those instructions actually cost
\[ 1 + 2 = 3 \text{ cycles} \]
while the remaining 70% of instructions still cost 1 cycle. The average CPI is a weighted mix of the two:
\[ \text{CPI}_{\text{pipe}} = (0.70\times1) + (0.30\times3) \]
\[ = 0.70 + 0.90 = 1.6 \]

Step 3: Find the time to run one instruction on the pipelined unit.
The pipeline runs at
\[ 1.2\text{ GHz} = 1.2\times10^{9}\text{ cycles/second} \]
so the execution time per instruction is
\[ T_{\text{pipe}} = \frac{\text{CPI}_{\text{pipe}}}{1.2\times10^{9}} = \frac{1.6}{1.2\times10^{9}} = 1.3333\times10^{-9}\text{ s} = 1.3333 \text{ ns} \]

Step 4: Compute the speed-up.
Speed-up is the ratio of the old (slower) time to the new (faster) time:
\[ \text{Speed-up} = \frac{T_{\text{non-pipe}}}{T_{\text{pipe}}} = \frac{3.125}{1.3333} \]
\[ \approx 2.34 \]

Final Answer:
The pipelined design is about 2.34 times faster than the non-pipelined design for this program.
\[ \boxed{2.34} \]
Was this answer helpful?
0
0

Top GATE CS Computer Organization and Architecture Questions

View More Questions