GATE / CS ARCHIVE

GATE CSE 2022 / QUESTION 61

GATE CSE 2022 Q61

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

GATE 2022, Q61 2 marks · NAT
Report issue

Pipelining & Hazards

Question 61, GATE 2022: X1 runs at 2 GHz, base CPI 1, with 30% branches and two stall cycles per branch. X2 has the same frequency and base CPI, but predicts 80% of branches correctly, eliminating stalls for those; mispredictions keep the same two-cycle penalty. No other hazards occur. Find speedup rounded to two decimals.
Tap to enlarge
Answer & solution

Official answer: 1.42 to 1.45

Our answer: 1.43

Without prediction, CPI1=1+0.30*2=1.6. With 80 percent correct predictions, only 20 percent of branches still pay the two-cycle penalty, so CPI2=1+0.30*0.20*2=1.12. Both processors have the same frequency and execute the same program, giving speedup 1.6/1.12=10/7, or 1.43 to two decimal places. This uses the stated steady-state CPI model, without separately charging pipeline fill/drain.

Speedup is old execution time/new execution time, not new CPI/old CPI. For N instructions at frequency F, times are N·1.6/F and N·1.12/F, so N and F cancel. The branch predictor saves 0.30×0.80×2=0.48 cycles per instruction, reducing CPI from 1.60 to 1.12.

Original paper, page 39 · Answer key