GATE / CS ARCHIVE

GATE CSE 2014 SET 1 / QUESTION 43

GATE CSE 2014 Set 1 Q43

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

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

Pipelining & Hazards

Question 43, GATE 2014: A perfectly balanced six-stage instruction pipeline has no cycle-time overhead. While an application runs, 25% of its instructions incur two stall cycles each. Find the speedup relative to nonpipelined execution.
Tap to enlarge
Answer & solution

Official answer: 4

1. Method and setup. Measure time in units of one pipeline stage. Without pipelining an instruction consumes six such units; in steady state the pipeline completes one instruction per cycle plus stalls. Weight the stall penalty by the fraction of affected instructions rather than adding two cycles to every instruction.

2. Work through the result and its assumptions. The average cycles per instruction is 1+0.25·2=1.5. A nonpipelined instruction takes six balanced stage times, so steady-state speedup is 6/1.5=4. This ignores fill/drain effects; for a finite N-instruction run with exactly N/2 stall cycles, the usual timing is 6N/(1.5N+5), approaching4.

Original paper, page 18 · Answer key