Skip to content
Official PYQ · 2026

GATE CS 2026 Set 1 Q6 — Pipeline Hazards

Explain with AI

Which one of the following dependencies among the register operands of different instructions can cause a data hazard in a pipelined processor?

Choose one option
View worked solution

Answer: B

A data hazard occurs when instructions that overlap in execution have data dependencies, and the pipeline must be stalled or bypassed to ensure correct execution.

Let's analyze the given dependencies between two instructions, I1I_1 (earlier) and I2I_2 (later):

  1. Read-After-Write (RAW) / True Dependency:

    I2I_2 tries to read a register before I1I_1 writes to it. If I2I_2 reads the register before I1I_1 updates it, it will receive the old (incorrect) value. This is a true data dependency and causes a data hazard in almost all pipelined processors (including standard in-order pipelines).

  2. Write-After-Read (WAR) / Anti-Dependency:

    I2I_2 tries to write to a register before it is read by I1I_1. In a standard in-order pipeline, reads occur in an early stage (e.g., Instruction Decode) and writes occur in a late stage (e.g., Write Back), so I1I_1 always reads the value before I2I_2 overwrites it. Thus, WAR does not cause a hazard in standard in-order pipelines.

  3. Write-After-Write (WAW) / Output Dependency:

    I2I_2 tries to write to a register before I1I_1 writes to it. In an in-order pipeline, writes happen in program order, so this does not cause a hazard.

  4. Read-After-Read (RAR):

    Both instructions only read the register. Since no instruction modifies the register value, no hazard can ever occur.

Thus, Read-after-write (RAW) is the dependency that causes a data hazard in a pipelined processor.

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

Published
Report a correction
Keep exploringMore Pipeline Hazards questions