Which one of the following dependencies among the register operands of different instructions can cause a data hazard in a pipelined processor?
GATE CS - 2026,
Answer: B
The dependence that causes a data hazard is Read-after-write.
In a read-after-write (true) dependence, a later instruction reads a register that an earlier instruction writes. In a pipeline the later instruction can reach its operand-read stage before the earlier one has written its result back, so it would read a stale value unless the pipeline stalls or forwards the result.
Read-after-read never causes a hazard, because reading does not change the register. Write-after-read and write-after-write are name dependences: in the standard in-order pipeline, where every instruction reads early and writes in the last stage in program order, they cannot go wrong. They become hazards only in pipelines that let instructions complete out of order, where register renaming removes them.
Please log in or register to report this question.