The GATE Grind

GATE 2014 CS (CS3) – Question 53

Computer Organization and Architecture · Instruction Pipelining and Pipeline Hazards · 2 marks · Numerical answer

A five-stage instruction pipeline has stages IF, ID/RF, EX, MEM, WB with latencies 1,2.2,2,1,0.75 ns. ID/RF is split into ID,RF1,RF2, each 2.2/3 ns, and EX into EX1,EX2, each 1 ns, making eight stages. A program has 20% branch instructions, computing the next instruction pointer at the end of EX in the old pipeline and EX2 in the new. After fetching a branch, IF stalls until that pointer is computed. Other instructions average CPI = 1 in both designs. Execution times are P and Q ns for old and new designs. Find P/Q.

Practise this question in The GATE Grind →

Show answer and explanation

Correct answer: 1.50 to 1.60

Explanation

Old clock period is2.2ns, and each branch stalls fetch for2cyclesuntil EXends, giving meanCPI1+0.2×2=1.4. New period is1ns, with5stallcyclesuntil EX2ends, givingCPI2. ThereforeP/Q=(2.2×1.4)/(1×2)=**1.54**, ignoring finite fill/drain overhead as intended.