GATE Computer ScienceHardGATE CS (PYQ pattern)

A 5-stage pipeline with full forwarding has a base CPI of 1. 30% of instructions are loads and half of the loads are immediately followed by a dependent instruction, costing 1 stall cycle. 20% of instructions are branches, 60% of them are taken, and a taken branch costs 2 stall cycles. The average CPI is:

  1. A. 1.55
  2. B. 1.39
  3. C. 1.70
  4. D. 1.27

Correct answer: B. 1.39

CPI = 1 + 0.3 × 0.5 × 1 + 0.2 × 0.6 × 2 = 1 + 0.15 + 0.24 = 1.39. Ignoring the fractions that actually stall gives 1.70, and charging taken branches only 1 cycle gives 1.27.

More Computer Organization and Architecture questions

Exams that ask this topic