GATE Computer ScienceHardGATE CS (PYQ pattern)

A branch behaves T, T, N, N repeatedly for 32 executions. A 2-bit saturating counter starts at state 0 and predicts taken in states 2 and 3. How many of the 32 predictions are wrong?

  1. A. 16
  2. B. 20
  3. C. 24
  4. D. 23

Correct answer: C. 24

Per period from state 0: T (predict N, wrong) →1, T (predict N, wrong) →2, N (predict T, wrong) →1, N (predict N, right) →0. Three misses a period, 8 periods = 24, so the pattern is as bad as random for this predictor.

More Computer Organization and Architecture questions

Exams that ask this topic