The GATE Grind

GATE 2024 CS (CS2) – Question 58

Computer Organization and Architecture · Instruction Pipelining and Pipeline Hazards · 2 marks · Numerical answer

A non-pipelined unit at 2 GHz takes an average of 6 cycles per instruction of program P. The unit is redesigned as a 5-stage pipeline at 2 GHz with ideal throughput of 1 instruction per cycle. In program P, 20% instructions incur an average of 2 cycles stall due to data hazards and 20% incur an average of 3 cycles stall due to control hazards. The speedup (rounded off to one decimal place) of the pipelined design over the non-pipelined design is _________

Practise this question in The GATE Grind →

Show answer and explanation

Correct answer: 3

Explanation

**1. Calculate average stall cycles per instruction.** Data hazards add $0.20(2)=0.4$ cycles/instruction. Control hazards add $0.20(3)=0.6$ cycles/instruction.

**2. Add stalls to ideal pipeline CPI.** Ideal throughput corresponds to CPI = 1, so average pipelined CPI is $1+0.4+0.6=2$. The percentages are already population fractions and must not be multiplied by five pipeline stages.

**3. Compare execution times at equal clock frequency.** For the same instruction count and 2 GHz clock, speedup is $CPI_{old}/CPI_{new}=6/2=\mathbf{3.0}$. This uses the stated steady-state throughput model rather than counting pipeline fill separately.

More Instruction Pipelining and Pipeline Hazards questions

All Instruction Pipelining and Pipeline Hazards questions →