Skip to content
Official PYQ · 2003

GATE CS 2003 Q10 — Instruction Pipelining

Explain with AI

For a pipelined CPU with a single ALU, consider the following situations

  1. The j+1st{j+1}^{st} instruction uses the result of the jthj^{th} instruction as an operand

  2. The execution of a conditional jump instruction

  3. The jthj^{th} and j+1st{j+1}^{st} instructions require the ALU at the same time.

Which of the above can cause a hazard

Choose one option
View worked solution

Answer: D

In a pipelined processor, hazards prevent the next instruction in the instruction stream from executing in its designated clock cycle. Let us analyze each of the given situations:

  1. Situation I: The (j+1)th(j+1)^{\text{th}} instruction uses the result of the jthj^{\text{th}} instruction as an operand.
    This introduces a dependency where a register is read before it is written by the preceding instruction. This causes a Data Hazard (specifically, a Read-After-Write or RAW hazard).

  2. Situation II: The execution of a conditional jump instruction.
    Since the target address and the branch outcome are not known immediately, the pipeline cannot confidently fetch the next instruction. This causes a Control Hazard (or branch hazard).

  3. Situation III: The jthj^{\text{th}} and (j+1)th(j+1)^{\text{th}} instructions require the ALU at the same time.
    Because the CPU has only a single ALU, both instructions cannot use this hardware resource simultaneously. This resource conflict causes a Structural Hazard.

Since all three situations can cause a hazard, the correct option is D.

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

Published
Report a correction
Keep exploringMore Instruction Pipelining questions