GATE Computer ScienceVery hardGATE CS (PYQ pattern)

A classic 5-stage pipeline (IF, ID, EX, MEM, WB) runs: I1: ADD R1, R2, R3; I2: LW R4, 8(R1); I3: AND R5, R4, R1; I4: OR R6, R5, R4; I5: LW R7, 0(R6); I6: SUB R8, R7, R2. Without hazards I1 finishes WB in cycle 5. Machine F has full forwarding (EX/MEM and MEM/WB to the ALU inputs), so only a load followed immediately by a user stalls, for one cycle. Machine N has no forwarding, but its register file is written in the first half of a cycle and read in the second half. In which cycle does I6 finish WB on F and on N?

  1. A. 12 and 25
  2. B. 11 and 20
  3. C. 12 and 20
  4. D. 13 and 21

Correct answer: C. 12 and 20

F: two load-use pairs (I2→I3, I5→I6) cost one bubble each: 10 + 2 = 12. N: a consumer may be in ID in its producer's WB cycle (producer ID + 3); ID cycles I1 2, I2 5, I3 8, I4 11, I5 14, I6 17, so WB at 20. Without the split-cycle register file N would need 25.

More Computer Organization and Architecture questions

Exams that ask this topic