GATE Computer ScienceHardGATE CS (PYQ pattern)

A pipeline (ideal CPI 1) can predict branches not-taken (a taken branch costs 3 cycles, a not-taken one 0) or predict taken (a taken branch costs 1 cycle, a not-taken one 3). Branches are 20% of instructions. Above what fraction of taken branches is predict-taken better, and what is the better CPI when 65% of branches are taken?

  1. A. 50%; CPI 1.34
  2. B. 60%; CPI 1.39
  3. C. 75%; CPI 1.34
  4. D. 60%; CPI 1.34

Correct answer: D. 60%; CPI 1.34

Per branch: not-taken scheme 3t, taken scheme t + 3(1 − t) = 3 − 2t. Equal at 3t = 3 − 2t → t = 0.6. At t = 0.65: predict-taken 1 + 0.2 × (0.65 + 1.05) = 1.34, versus 1 + 0.2 × 1.95 = 1.39 for predict-not-taken.

More Computer Organization and Architecture questions

Exams that ask this topic