Which one of the following dependencies among the register operands of different instructions can cause a data hazard in a pipelined processor?
Correct Answer :
Read-after-write
Solution :
The correct option is Read-after-write.
In a pipelined processor, data hazards occur when instructions that are close together in the instruction stream depend on the same register operands, and the execution overlap causes the operands to be accessed in an incorrect order.
Let us analyze the different types of register dependencies to understand why a Read-after-write (RAW) dependency causes a data hazard in standard pipelined processors:
1. Read-After-Write (RAW) Dependency:
This is also known as a true data dependency. It occurs when an instruction (say, Instruction B) reads a register that is written by a preceding instruction (say, Instruction A).
If Instruction B tries to read the register value before Instruction A has finished writing the updated value to it, Instruction B will read stale (incorrect) data. This represents a data hazard because the pipeline must be stalled, or data forwarding must be used, to ensure Instruction B receives the correct, updated value.
2. Read-After-Read (RAR) Dependency:
This occurs when two instructions both read from the same register. Since neither instruction modifies the value of the register, the order of reading does not affect the correctness of the program. Therefore, RAR dependencies never cause a data hazard.
3. Write-After-Read (WAR) Dependency:
This is also known as an anti-dependency. It occurs when an instruction (Instruction B) writes to a register that is read by an earlier instruction (Instruction A).
In a standard, in-order execution pipeline, Instruction A will always read the register value before Instruction B reaches its writeback stage to modify it. Thus, it does not cause a data hazard in simple pipelines.
4. Write-After-Write (WAW) Dependency:
This is also known as an output dependency. It occurs when an instruction (Instruction B) writes to the same register that is written by a preceding instruction (Instruction A).
In standard in-order pipelines, writes to the register file occur in program order during the Write-Back stage, meaning Instruction B will write its result after Instruction A, leaving the correct final value in the register. Hence, WAW dependencies do not cause hazards in simple pipelines.
Consequently, among the given dependencies, only Read-after-write represents a true data dependency that can cause a data hazard in a pipelined processor.
Access expert-curated educational resources and study materials—completely free.
Create, conduct, and manage professional online assessments with Mindyard. Perfect for teachers and institutes.
Copyright © 2026 Mindyard. All Rights Reserved.