Question

A non-pipelined instruction execution unit operating at 2 GHz takes an average of 6 cycles to execute an instruction of a program P. The unit is then redesigned to operate on a 5-stage pipeline at 2 GHz. Assume that the ideal throughput of the pipelined unit is 1 instruction per cycle. In the execution of program P, 20% instructions incur an average of 2 cycles stall due to data hazards and 20% instructions incur an average of 3 cycles stall due to control hazards. The speedup (rounded off to one decimal place) obtained by the pipelined design over the non-pipelined design is _________

Official answer and solution
Accepted answers
2.9 to 3.1
From
Official GATE 2024 answer key

Solution

Compute CPIpipe=1+0.2×2+0.2×3\text{CPI}_{\text{pipe}} = 1 + 0.2 \times 2 + 0.2 \times 3 and divide CPInon-pipe=6\text{CPI}_{\text{non-pipe}} = 6 by CPIpipe\text{CPI}_{\text{pipe}} (since both operate at 2 GHz).

Since both the non-pipelined and pipelined units operate at the same clock frequency (2 GHz2\text{ GHz}), the speedup is the ratio of their average cycles per instruction (CPI):

  1. CPInon-pipe=6\text{CPI}_{\text{non-pipe}} = 6.
  2. CPIpipe=CPIideal+Stallsdata+Stallscontrol=1+(0.20×2)+(0.20×3)=1+0.4+0.6=2.0\text{CPI}_{\text{pipe}} = \text{CPI}_{\text{ideal}} + \text{Stalls}_{\text{data}} + \text{Stalls}_{\text{control}} = 1 + (0.20 \times 2) + (0.20 \times 3) = 1 + 0.4 + 0.6 = 2.0.
  3. Speedup:
    Speedup=CPInon-pipeCPIpipe=62.0=3\text{Speedup} = \frac{\text{CPI}_{\text{non-pipe}}}{\text{CPI}_{\text{pipe}}} = \frac{6}{2.0} = 3
Final answer

3

The answer is the one in the official GATE answer key. The solution is this site's own explanation.

Source

Paper
GATE 2024 Computer Science and Information Technology - Set 2 (CS2)
Question
58 of 65
Section
Computer Science and Information Technology

Report an error in this question

GATE questions are the work of the organising institutes. This site is independent and is not affiliated with them.