Skip to content
Official PYQ · 2024

GATE CS 2024 Set 2 Q48 — Instruction Pipelining

Explain with AI
A non-pipelined instruction execution unit operating at 2GHz2 \mathrm{GHz} takes an average of 66 cycles to execute an instruction of a program P\text{P}. The unit is then redesigned to operate on a 55 -stage pipeline at 2GHz2 \mathrm{GHz}. Assume that the ideal throughput of the pipelined unit is 11 instruction per cycle. In the execution of program P\text{P}, 20%20 \% instructions incur an average of 22 cycles stall due to data hazards and 20%20 \% instructions incur an average of 33 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 ____________.
View worked solution

Answer: 3

To find the speedup obtained by the pipelined design over the non-pipelined design, we compare the average execution time per instruction for both designs.

1. Non-Pipelined Design

  • Clock frequency (fnpf_{np}) = 2 GHz2\text{ GHz}
  • Average cycles per instruction (CPInpCPI_{np}) = 66

Since the clock frequency is the same for both designs, we can directly work with the average clock cycles per instruction (CPICPI).

2. Pipelined Design

  • Clock frequency (fpf_p) = 2 GHz2\text{ GHz}
  • Ideal CPICPI = 11
  • Data hazard stalls: 20%20\% of instructions incur an average of 22 stall cycles.
  • Control hazard stalls: 20%20\% of instructions incur an average of 33 stall cycles.

We calculate the average CPICPI for the pipelined design (CPIpCPI_p) as:

CPIp=Ideal CPI+Average Stall Cycles per Instruction=1+(0.20×2)+(0.20×3)=1+0.4+0.6=2\begin{aligned} CPI_p &= \text{Ideal } CPI + \text{Average Stall Cycles per Instruction} \\ &= 1 + (0.20 \times 2) + (0.20 \times 3) \\ &= 1 + 0.4 + 0.6 \\ &= 2 \end{aligned}

3. Speedup Calculation

Since the clock cycle time (TclkT_{\text{clk}}) is identical for both configurations (1/2 GHz=0.5 ns1 / 2\text{ GHz} = 0.5\text{ ns}), the speedup is given by:

Speedup=Execution TimenpExecution Timep=CPInp×TclkCPIp×Tclk=CPInpCPIp\text{Speedup} = \frac{\text{Execution Time}_{np}}{\text{Execution Time}_p} = \frac{CPI_{np} \times T_{\text{clk}}}{CPI_p \times T_{\text{clk}}} = \frac{CPI_{np}}{CPI_p} Speedup=62=3\text{Speedup} = \frac{6}{2} = 3

Thus, the speedup obtained by the pipelined design is 3.

Free practice · Your answers on this page are not saved.

Published
Report a correction
Keep exploringMore Instruction Pipelining questions