GATE Computer ScienceHardGATE CS (PYQ pattern)

A branch target buffer (BTB) lets the fetch unit predict taken branches with no bubble when it hits and predicts correctly. Branches are 20% of instructions; 90% hit in the BTB, and on a hit the prediction is right 95% of the time. A BTB miss or a wrong prediction costs 4 cycles. What is the CPI (ideal 1)?

  1. A. 1.116
  2. B. 1.036
  3. C. 1.120
  4. D. 1.080

Correct answer: A. 1.116

Probability a branch is not handled cleanly = 0.1 (miss) + 0.9 × 0.05 (hit but wrong) = 0.145; CPI = 1 + 0.2 × 0.145 × 4 = 1.116. Adding 0.05 instead of 0.9 × 0.05 ignores that mispredictions occur only on hits.

More Computer Organization and Architecture questions

Exams that ask this topic