GATE Computer ScienceVery hardGATE CS (PYQ pattern)

A pipeline with ideal CPI 1 handles branches (frequency 20%, of which 40% are taken) in one of three ways: (a) stall for 3 cycles on every branch; (b) predict not-taken, so only taken branches cost 3 cycles; (c) predict taken as soon as the target is computed, which costs 1 cycle if the branch is taken and 3 cycles if it is not. Which gives the lowest CPI, and what is it?

  1. A. predict-not-taken, CPI 1.24
  2. B. stalling, CPI 1.60
  3. C. predict-taken, CPI 1.44
  4. D. predict-not-taken, CPI 1.34

Correct answer: A. predict-not-taken, CPI 1.24

(a) 1 + 0.2×3 = 1.60; (b) 1 + 0.2×0.4×3 = 1.24; (c) 1 + 0.2×(0.4×1 + 0.60×3) = 1.44. The best choice flips with the taken fraction.

More Computer Organization and Architecture questions

Exams that ask this topic