Question

Consider a 6-stage instruction pipeline, where all stages are perfectly balanced. Assume that there is no cycle-time overhead of pipelining. When an application is executing on this 6-stage pipeline, the speedup achieved with respect to non-pipelined execution if 25% of the instructions incur 2 pipeline stall cycles is ______________________.

Official answer and solution
Official answer
4
From
Official GATE 2014 answer key

Solution

Use the pipeline speedup formula comparing non-pipelined execution time to pipelined execution time with stalls.

Given parameters:

  • Number of stages k=6k = 6.
  • Non-pipelined execution time per instruction: Tnon-pipe=k=6T_{\text{non-pipe}} = k = 6 cycles.
  • Pipelined execution:
    • In an ideal pipeline with no stalls, CPIideal=1\text{CPI}_{\text{ideal}} = 1.
    • 25% (0.25) of instructions incur 2 stall cycles.
    • Remaining 75% of instructions incur 0 stall cycles.
    • Average stall cycles per instruction = 0.25×2=0.50.25 \times 2 = 0.5 cycles.
    • Effective CPIpipe=1+0.5=1.5\text{CPI}_{\text{pipe}} = 1 + 0.5 = 1.5 cycles per instruction.

Speedup achieved:

Speedup=Tnon-pipeTpipe=kCPIpipe=61.5=4\text{Speedup} = \frac{T_{\text{non-pipe}}}{T_{\text{pipe}}} = \frac{k}{\text{CPI}_{\text{pipe}}} = \frac{6}{1.5} = 4

Thus, the speedup is 4.

Final answer

4

Common trap

Adding stalls directly to the stage count kk instead of using the formula Speedup=k/CPI\text{Speedup} = k / \text{CPI}.

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

Source

Paper
GATE 2014 Computer Science and Information Technology (CS) Session 1
Question
53 of 65, printed as CS Q.43
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.