GATE Computer ScienceVery hardGATE CSE · NIELIT

The backward branch of an inner loop executes 10 times per entry (taken 9 times, then not taken once), and the inner loop is entered 20 times in a row. A 1-bit predictor (predict the last outcome; initial state not taken) is used for this branch. How many mispredictions occur over all 200 executions?

  1. A. 20
  2. B. 40
  3. C. 41
  4. D. 39

Correct answer: B. 40

Every entry mispredicts twice: the first taken (the predictor holds not-taken from the previous exit or the initial state) and the exit itself; 2 × 20 = 40.

More Computer Organization and Architecture questions

Exams that ask this topic