Skip to main content

GATE CSE 2026CO & Architecture › Instruction Pipelining & PerformanceVerified

GATE CSE 2026 PYQ: The EX stage of a pipelined processor performs the memory read operations for LOAD instructions, and the…

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_{E X} denote the time taken by the EX stage to perform the operation for an instruction. For each instruction type, the values of tEXt_{E X} 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.

InstructiontEX innanosecondsMLOAD1.815IMUL1.510IDIV2.55FADD1.710FSUB1.75FMUL2.815FDIV3.25All otherinstructionsLess than1.035 \begin{array}{|l|c|c|} \hline \text{Instruction} & \begin{array}{c} t_{EX}\ \text{in} \\ \text{nanoseconds} \end{array} & M \\ \hline \text{LOAD} & 1.8 & 15 \\ \hline \text{IMUL} & 1.5 & 10 \\ \hline \text{IDIV} & 2.5 & 5 \\ \hline \text{FADD} & 1.7 & 10 \\ \hline \text{FSUB} & 1.7 & 5 \\ \hline \text{FMUL} & 2.8 & 15 \\ \hline \text{FDIV} & 3.2 & 5 \\ \hline \begin{array}{l} \text{All other} \\ \text{instructions} \end{array} & \begin{array}{c} \text{Less than} \\ 1.0 \end{array} & 35 \\ \hline \end{array}
When program P\text{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)

    Answer

    95

    Approach

    Since the pipeline clock period is 1 ns, an EX operation that needs $t_EX$ ns occupies the EX stage for $ceil(t_EX)$ cycles. The extra cycles beyond one cycle are structural-hazard stall cycles for each occurrence of that instruction type. Sum these extra cycles over all instruction counts M.

    The pipeline is stalled whenever an EX operation cannot fit in the 1 ns clock cycle. Each instruction of a type with $t_EX$ requiring c = $ceil(t_EX)$ cycles adds c−1 stall cycles. Summing over the 100 instructions gives 95 stall cycles.

    Reviewed by GateIQ Editorial Team: IIT & IISc Alumni.