GATE Computer ScienceHardGATE CS (PYQ pattern)

A loop branch is taken 9 times and then falls through (T×9, N), and the whole 10-outcome pattern repeats 5 times. A 2-bit saturating counter starts at state 3 (strongly taken). The 1-bit last-outcome predictor starts as taken. What are the total mispredictions (2-bit, 1-bit)?

  1. A. 5 and 13
  2. B. 10 and 9
  3. C. 5 and 9
  4. D. 9 and 5

Correct answer: C. 5 and 9

The 2-bit counter pays only for each loop exit (the N), because one N cannot flip it from the taken half: 5. The 1-bit predictor pays for the exit and for the first T of the next run: 5 + 4 (the very first outcome T is predicted correctly) = 9.

More Computer Organization and Architecture questions

Exams that ask this topic