The GATE Grind

GATE 2020 CS – Question 53

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

Consider a non-pipelined processor operating at 2.5 GHz. It takes 5 clock cycles to complete an instruction. You are going to make a 5-stage pipeline out of this processor. Overheads associated with pipelining force you to operate the pipelined processor at 2 GHz. In a given program, assume that 30% are memory instructions, 60% are ALU instructions and the rest are branch instructions. 5% of the memory instructions cause stalls of 50 clock cycles each due to cache misses and 50% of the branch instructions cause stalls of 2 cycles each. Assume that there are no stalls associated with the execution of ALU instructions. For this program, the speedup achieved by the pipelined processor over the non-pipelined processor (round off to 2 decimal places) is ______.

Practise this question in The GATE Grind →

Show answer and explanation

Correct answer: 2.15 to 2.18

Explanation

Non-pipelined: clock $2.5$ GHz, 5 cycles per instruction, so the time per instruction is $\dfrac5{2.5}=2$ ns.

Pipelined: clock $2$ GHz, so a cycle is $0.5$ ns. The CPI is the base CPI of 1 plus the average stall cycles:
- Memory instructions (30%): 5% of them stall 50 cycles: $0.30\times0.05\times50=0.75$.
- Branches (10%): 50% of them stall 2 cycles: $0.10\times0.5\times2=0.10$.
- ALU instructions: no stalls.

$\text{CPI}=1+0.75+0.10=1.85$, so time per instruction $=1.85\times0.5=0.925$ ns.

$$\text{Speedup}=\frac{2}{0.925}\approx\mathbf{2.16}.$$

More Instruction Pipelining and Pipeline Hazards questions

All Instruction Pipelining and Pipeline Hazards questions →