Question

The EX stage of a pipelined processor performs the memory read operations for LOAD instructions, and the operations for the arithmetic and logic instructions. Let tEXt_{EX} denote the time taken by the EX stage to perform the operation for an instruction. For each instruction type, the values of tEXt_{EX} and MM (the number of instructions of that type in a sequence of 100 instructions for a program P), are given in the table below.

The duration of the pipeline clock cycle is 1 nanosecond. Assume that the latch time for the interstage buffers in the pipeline is negligible.

InstructiontEXt_{EX} in nanosecondsMM
LOAD1.815
IMUL1.510
IDIV2.55
FADD1.710
FSUB1.75
FMUL2.815
FDIV3.25
All other instructionsLess than 1.035

When program P is executed, the number of clock cycles for which the pipeline is stalled due to structural hazards in the EX stage is ______. (answer in integer)

Official answer and solution
Official answer
95
From
Official GATE 2026 answer key

Solution

For each instruction type, compute the number of EX clock cycles ⌈tEX/1 ns⌉\lceil t_{EX} / 1\text{ ns} \rceil and the resulting stall cycles ⌈tEX⌉−1\lceil t_{EX} \rceil - 1 per instruction.

Since the pipeline clock cycle is 1 ns1\text{ ns}, an instruction requiring tEX nst_{EX}\text{ ns} in the EX stage occupies the EX stage for ⌈tEX⌉\lceil t_{EX} \rceil clock cycles, causing ⌈tEX⌉−1\lceil t_{EX} \rceil - 1 structural-hazard stall cycles:

  • LOAD (tEX=1.8 nst_{EX} = 1.8\text{ ns}): (⌈1.8⌉−1)×15=1×15=15(\lceil 1.8 \rceil - 1) \times 15 = 1 \times 15 = 15 stalls
  • IMUL (tEX=1.5 nst_{EX} = 1.5\text{ ns}): (⌈1.5⌉−1)×10=1×10=10(\lceil 1.5 \rceil - 1) \times 10 = 1 \times 10 = 10 stalls
  • IDIV (tEX=2.5 nst_{EX} = 2.5\text{ ns}): (⌈2.5⌉−1)×5=2×5=10(\lceil 2.5 \rceil - 1) \times 5 = 2 \times 5 = 10 stalls
  • FADD (tEX=1.7 nst_{EX} = 1.7\text{ ns}): (⌈1.7⌉−1)×10=1×10=10(\lceil 1.7 \rceil - 1) \times 10 = 1 \times 10 = 10 stalls
  • FSUB (tEX=1.7 nst_{EX} = 1.7\text{ ns}): (⌈1.7⌉−1)×5=1×5=5(\lceil 1.7 \rceil - 1) \times 5 = 1 \times 5 = 5 stalls
  • FMUL (tEX=2.8 nst_{EX} = 2.8\text{ ns}): (⌈2.8⌉−1)×15=2×15=30(\lceil 2.8 \rceil - 1) \times 15 = 2 \times 15 = 30 stalls
  • FDIV (tEX=3.2 nst_{EX} = 3.2\text{ ns}): (⌈3.2⌉−1)×5=3×5=15(\lceil 3.2 \rceil - 1) \times 5 = 3 \times 5 = 15 stalls
  • All other instructions (tEX<1.0 nst_{EX} < 1.0\text{ ns}): (1−1)×35=0(1 - 1) \times 35 = 0 stalls

Total stall clock cycles =15+10+10+10+5+30+15+0=95= 15 + 10 + 10 + 10 + 5 + 30 + 15 + 0 = 95.

Final answer

95

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

Source

Paper
GATE 2026 Computer Science and Information Technology - Session 1 (CS1)
Question
60 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.