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 denote the time taken by the EX stage to perform the operation for an instruction. For each instruction type, the values of and (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.
| Instruction | in nanoseconds | |
|---|---|---|
| LOAD | 1.8 | 15 |
| IMUL | 1.5 | 10 |
| IDIV | 2.5 | 5 |
| FADD | 1.7 | 10 |
| FSUB | 1.7 | 5 |
| FMUL | 2.8 | 15 |
| FDIV | 3.2 | 5 |
| All other instructions | Less than 1.0 | 35 |
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 and the resulting stall cycles per instruction.
Since the pipeline clock cycle is , an instruction requiring in the EX stage occupies the EX stage for clock cycles, causing structural-hazard stall cycles:
- LOAD (): stalls
- IMUL (): stalls
- IDIV (): stalls
- FADD (): stalls
- FSUB (): stalls
- FMUL (): stalls
- FDIV (): stalls
- All other instructions (): stalls
Total stall clock cycles .
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.