GATE / CS ARCHIVE

GATE CSE 2024 SET 2 / QUESTION 58

Compute speedup from effective CPI

Computer Organization & Architecture · Pipelining & Hazards · Full GATE CSE 2024 Set 2 paper

GATE 2024 Set 2, Q58 2 marks · NAT
Report issue

Pipelining & Hazards

Question 58, GATE 2024: A nonpipelined 2 GHz unit averages 6 cycles/instruction. A 5-stage redesign at the same frequency ideally achieves 1 instruction/cycle. In program P, 20% of instructions incur 2 stall cycles for data hazards and 20% incur 3 stall cycles for control hazards. Find steady-state speedup to one decimal.
Tap to enlarge
Answer & solution

Official answer: 2.9 to 3.1

Our answer: 3.0

Approach: Add average stall cycles per instruction to ideal CPI and compare elapsed time at equal clock rate.

1. Derivation. The pipelined average CPI is 1+0.20×2+0.20×3=2. Both designs have the same 2GHz frequency, so their steady-state speedup is 6/2=3.0. The5-stage fill/drain overhead is ignored in this throughput model; instruction count is not supplied. Hazard penalties are treated as additive non-overlapped stalls.

2. Explanation and checks. For a conceptual batch of 100 instructions, ideal execution costs 100 cycles, data stalls add 20×2=40, and control stalls add 20×3=60, totaling 200. The old design costs 600 cycles, so the ratio is three. Pipeline depth alone is not the speedup: it affects overlap, while actual CPI includes stalls. No program length is supplied for computing fill/drain effects, and the conventional average calculation treats the stated penalties additively.

Original paper, page 38 · Answer key