GATE / CS ARCHIVE

GATE CSE 2020 / QUESTION 43

GATE CSE 2020 Q43

Computer Organization & Architecture · Pipelining & Hazards · Full GATE CSE 2020 paper

GATE 2020, Q43 2 marks · NAT
Report issue

Pipelining & Hazards

Question 43, GATE 2020: A nonpipelined 2.5 GHz processor takes 5 cycles/instruction. Its five-stage pipeline runs at 2 GHz. Program mix: 30% memory,60% ALU,10% branch. Of memory instructions,5% cause 50-cycle stalls. Of branches,50% cause 2-cycle stalls. ALU instructions cause none. Find steady-state speedup to two decimals.
Tap to enlarge
Answer & solution

Official answer: 2.15 to 2.18

Our answer: 2.16

Worked explanation

Use time per instruction, since the two designs have different clocks. For 1000 representative instructions, 300 are memory, of which 15 stall for 750 cycles total; 100 are branches, of which 50 stall for 100 cycles total. Add the ideal 1000 pipeline cycles to obtain 1850, or CPI=1.85. Nonpipelined cycle time is 1/2.5 GHz=0.4 ns, so an instruction takes 2 ns. Pipeline cycle time is 0.5 ns, making average time 0.925 ns. Speedup is old time/new time=2/0.925=2.162162…, rounded 2.16. Counting 5% of all instructions as cache misses would overstate the penalty because that rate is conditional on memory instructions.

Derivation and answer

The non-pipelined time per instruction is 5/(2.5GHz)=2 ns. The pipeline average CPI is 1+0.30*0.05*50+0.10*0.50*2=1.85. At2GHz its average time is 1.85*0.5=0.925 ns per instruction. Speedup=2/0.925=2.162162..., or 2.16, within the official 2.15–2.18 range. This is the long-program steady-state calculation; the fixed pipeline fill/drain cost is neglected because program length is not supplied.

Original paper, page 14 · Answer key