GATE / CS ARCHIVE

GATE CSE 2014 SET 3 / QUESTION 43

GATE CSE 2014 Set 3 Q43

Computer Organization & Architecture · Pipelining & Hazards · Full GATE CSE 2014 Set 3 paper

GATE 2014 Set 3, Q43 2 marks · NAT
Report issue

Pipelining & Hazards

Question 43, GATE 2014: An old pipeline has IF,ID/RF,EX,MEM,WB with delays 1,2.2,2,1,0.75 ns. A new eight-stage pipeline splits ID/RF into ID,RF1,RF2 of 2.2/3 ns each, and EX into EX1,EX2 of 1 ns each. Branches are 20% of instructions and resolve at the end of EX (old) or EX2 (new); after fetching a branch, IF stalls until its next PC is known. Other instructions have average CPI 1. For old/new program times P,Q, find P/Q.
Tap to enlarge
Answer & solution

Official answer: 1.50 to 1.60

Our answer: 1.54

Step 1: Ignoring latch overhead, the old period is max(1,2.2,2,1,0.75)=2.2 ns. The new longest stage is 1 ns. Step 2: In the old design, a branch fetched in cycle 1 resolves at the end of stage 3, so it blocks two following fetch slots. Average CPI is 1+0.2×2=1.4. Step 3: In the new design, EX2 is stage 6: IF,ID,RF1,RF2,EX1,EX2. A branch blocks five following fetch slots, yielding CPI 1+0.2×5=2. Step 4: In the steady-state model, time per instruction is CPI×period. Therefore P/Q=(1.4×2.2)/(2×1)=1.54. Pipeline fill/drain and register overhead are omitted; without program length an exact finite-program ratio is not specified.

Original paper, page 63 · Answer key