Discussion
Which one of the following dependencies among the register operands of different instructions can cause a data hazard in a pipelined processor?
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.
Post your comment
Please log in or register to post a comment.
Examination Categories
- SSC Exams
- Banking Exams
- Teaching Exams
- Civil Services Exams
- Railways Exams
- Engineering Recruitment Exams
- Defence Exams
- State Government Exams
- Police Exams
- Insurance Exams
- Nursing Exams
- Other Government Exams
- NRA CET
- PG Entrance Exams
- Campus Placement
- MBA Entrance Exams
- CUET and UG Entrance
- Judiciary Exams
- Regulatory Body Exams
- Software Development