GATE Computer ScienceModerateGATE CS (PYQ pattern)

A pipeline has a two-slot delayed branch: the two instructions after every branch always execute. The compiler fills the first slot with a useful instruction for 60% of branches and the second slot for 25% of branches; unfilled slots hold NOPs, which waste one cycle each. Branches are 20% of the useful instructions. In addition, 25% of the useful instructions are loads and 30% of those are followed by a dependent instruction that stalls for one cycle. What is the CPI measured per useful instruction (ideal 1)?

  1. A. 1.305
  2. B. 1.230
  3. C. 1.475
  4. D. 1.415

Correct answer: A. 1.305

Wasted NOP slots per branch = (1 − 0.6) + (1 − 0.25) = 1.15, so branches add 0.2 × 1.15 = 0.23; load-use stalls add 0.25 × 0.3 = 0.075. CPI = 1 + 0.23 + 0.075 = 1.305. Forgetting the loads gives 1.230; ignoring the filled slots (2 cycles per branch) gives 1.475.

More Computer Organization and Architecture questions

Exams that ask this topic