GATE 2017 CS (CS1) – Question 60
Instruction execution in a processor is divided into 5 stages, Instruction Fetch (IF), Instruction Decode (ID), Operand Fetch (OF), Execute (EX), and Write Back (WB). These stages take 5, 4, 20, 10, and 3 nanoseconds (ns) respectively. A pipelined implementation of the processor requires buffering between each pair of consecutive stages with a delay of 2 ns. Two pipelined implementations of the processor are contemplated:
(i) a naive pipeline implementation (NP) with 5 stages and
(ii) an efficient pipeline (EP) where the OF stage is divided into stages OF1 and OF2 with execution times of 12 ns and 8 ns respectively.
The speedup (correct to two decimal places) achieved by EP over NP in executing 20 independent instructions with no hazards is ________.
Practise this question in The GATE Grind →
Show answer and explanation
Correct answer: 1.50 to 1.52
Explanation
**NP (naive pipeline).** Stage times: IF 5, ID 4, OF 20, EX 10, WB 3. The clock period is set by the slowest stage plus the 2 ns buffer: $20+2=22$ ns. For 20 instructions on 5 stages:
$$T_{NP}=(5+20-1)\times22=24\times22=528\text{ ns}.$$
**EP (efficient pipeline).** OF is split into OF1 (12 ns) and OF2 (8 ns), giving 6 stages: 5, 4, 12, 8, 10, 3. The slowest stage is 12 ns, so the period is $12+2=14$ ns:
$$T_{EP}=(6+20-1)\times14=25\times14=350\text{ ns}.$$
$$\text{Speedup}=\frac{528}{350}=\mathbf{1.51}.$$