GateAI
Instruction Pipelining

GATE CSE 2022 · Q61

NAT2 marksMedium

Time

A processor X1X_1 operating at 2 GHz has a standard 5-stage RISC instruction pipeline having a base CPI (cycles per instruction) of one without any pipeline hazards. For a given program P that has 30% branch instructions, control hazards incur 2 cycles stall for every branch. A new version of the processor X2X_2 operating at same clock frequency has an additional branch predictor unit (BPU) that completely eliminates stalls for correctly predicted branches. There is neither any savings nor any additional stalls for wrong predictions. There are no structural hazards and data hazards for X1X_1 and X2X_2. If the BPU has a prediction accuracy of 80%, the speed up (*rounded off to two decimal places*) obtained by X2X_2 over X1X_1 in executing P is _________.

Your answerNumerical answer

Enter a value to check

Solution

Step-by-step verified solution

Official answer: 1.43 (±0.02) (±0.02)

Instruction Pipelining

Let the number of instructions in program P be II, and the clock cycle time be TclkT_{\text{clk}}. Both processors operate at the same clock frequency (2 GHz2\text{ GHz}).

  1. Average CPI for processor X1X_1:

    • Base CPI=1\text{CPI} = 1

    • Branch instructions =30%=0.30= 30\% = 0.30

    • Each branch causes 22 stall cycles.

    CPI1=1+(0.30×2)=1+0.60=1.60\text{CPI}_1 = 1 + (0.30 \times 2) = 1 + 0.60 = 1.60
  2. Average CPI for processor X2X_2:

    • Accuracy =80%  ⟹  = 80\% \implies Misprediction rate =100%−80%=20%=0.20= 100\% - 80\% = 20\% = 0.20

    • Correct predictions incur 00 stalls; mispredictions incur 22 stalls.

    • Average stall cycles per branch =0.20×2=0.40= 0.20 \times 2 = 0.40

    CPI2=1+(0.30×0.40)=1+0.12=1.12\text{CPI}_2 = 1 + (0.30 \times 0.40) = 1 + 0.12 = 1.12
  3. Speedup of X2X_2 over X1X_1:

    Speedup=Execution Time of X1Execution Time of X2=CPI1CPI2=1.601.12=107≈1.4286\text{Speedup} = \frac{\text{Execution Time of } X_1}{\text{Execution Time of } X_2} = \frac{\text{CPI}_1}{\text{CPI}_2} = \frac{1.60}{1.12} = \frac{10}{7} \approx 1.4286

Rounding off to two decimal places gives 1.43 (accepted range: 1.42 to 1.45).

Try the question first, then check your work.

Think the official key or this write-up is wrong?

Report error or challenge

Examiner trap

The misconception this question tests

This Instruction Pipelining previous year question is Q61 of the GATE CSE 2022 paper. Find more GATE CSE PYQs on Instruction Pipelining in Computer Organization and Architecture, or browse all GATE CSE PYQs.

Free diagnostic

Where do you stand for GATE?

Take the 20-minute diagnostic: the 3 topics that cost you the most marks, and a rank range. Or sit 5 related Instruction Pipelining PYQs now with no account.

One GATE CSE PYQ every morning

An official question by email at 7 AM IST, with a link to its verified solution. Unsubscribe in one click.

Instruction Pipelining in GATE CSE

Instruction Pipelining has 25 GATE CSE PYQs across 20 papers from 2011 to 2026. 16 of them are 2-mark NAT questions like this one, and it is the only one in GATE CSE 2022.

How GATE tests Instruction Pipelining

More from GATE CSE 2022

Share this solution

A plain-text card for WhatsApp or Telegram study groups.

GateAI solution cardGATE CSE 2022 · Q61 · NAT

A processor X1 operating at 2 GHz has a standard 5-stage RISC instruction pipeline having a base CPI (cycles per instruction) of one without any pipeline hazards. For a given program P that has 30% branch instructions, control hazards incur 2 cycles stall for every branch. A new version of the processor X2 operating at same clock frequency has an additional branch predictor unit (BPU) that completely eliminates stalls for correctly predicted branches. There is neither any savings nor any additional stalls for wrong predictions. There are no structural hazards and data hazards for X1 and X2. If the BPU has a prediction accuracy of 80%, the speed up (*rounded off to two decimal places*) obtained by X2 over X1 in executing P is …

Topic-wise GATE CS PYQs with verified steps

Independent practice explanation verified by the GateAI team. GATE is conducted by the IITs; question text follows the official paper.