GATE Computer ScienceEasyGATE CS (PYQ pattern)
A classic 5-stage pipeline (IF, ID, EX, MEM, WB) has no forwarding; the register file is written in the first half of a cycle and read in the second half (a consumer may be in ID during its producer's WB). Without hazards I1 finishes WB in cycle 5. Program: I1: ADD R1, R2, R3; I2: SUB R4, R1, R5; I3: MUL R6, R4, R1; I4: ADD R7, R6, R4; I5: BEQ R7, R1, L3; I6: ADD R8, R8, R7. The branch is not taken (no flush), and MUL is a single-cycle EX operation. In which cycle does I6 finish WB?
- A. 22
- B. 18
- C. 10
- D. 17
Correct answer: B. 18
Each of I2, I3, I4, I5 depends on the instruction just before it, so each waits until its producer's WB: ID cycles I1 2, I2 5, I3 8, I4 11, I5 14, I6 15; I6 needs R7 from I4 (WB at 14) and is in ID at 15, WB at 18. Without the split register file it would be 22; 10 is the hazard-free time.
Practise more Computer Organization and Architecture questionsComputer Organization and Architecture: notes and key points
More Computer Organization and Architecture questions
- A hierarchy has L1 (1 ns), L2 (4 ns), L3 (15 ns) and DRAM (120 ns); each level is accessed only after the previous one misses. Measured…
- A 16 × 16 matrix of 4-byte ints is stored in row-major order from address 0. It is traversed column by column on a direct-mapped 2 KB…
- An unpipelined multiplier is busy for 4 cycles starting in the cycle a multiply issues; a later multiply that reaches issue while it is…
- Which of the following are correct for addressing modes? I. PC-relative addressing helps make code position independent. II. Register…
- Each interrupt costs 5000 cycles of fixed overhead (save, vector, restore) and its handler then spends 2000 cycles on every event it…
- A program sums a 64 × 64 matrix of 4-byte ints stored in row-major order starting at address 0, once row by row and once column by column…