GATE Computer ScienceHardNIELIT Scientist B

A classic 5-stage pipeline (IF, ID, EX, MEM, WB) has no forwarding; the register file writes in the first half of a cycle and reads in the second half. Instructions in order: I1: r1 ← mem, I2: r3 ← r1 + r2, I3: r4 ← r3 − r1, I4: r5 ← r4 & r3, I5: r6 ← r7 | r8. I2 to I4 cannot read operands before the producer's WB. How many cycles from the IF of I1 until WB of I5 completes?

  1. A. 13
  2. B. 17
  3. C. 19
  4. D. 15

Correct answer: D. 15

I2 waits until I1's WB, I3 until I2's WB, I4 until I3's WB, and I5 follows in order; the last WB falls at cycle 15.

More Computer Organization and Architecture questions

Exams that ask this topic