ISRO Scientist/Engineer CSE 2020Computer Organization and Architecture › Instruction Set and Addressing Modes
ISRO Scientist/Engineer CSE 2020 PYQ: One instruction tries to write an operand before it is written by previous instruction. This may lead to a…
One instruction tries to write an operand before it is written by previous instruction. This may lead to a dependency called
- ATrue dependency
- BAnti-dependency
- COutput dependencyCorrect answer
- DControl Hazard
Answer
(C) Output dependency
Approach
The situation describes two instructions writing the same operand/register, with a later instruction attempting to perform its write before the earlier instruction has performed its write. In pipelined/out-of-order execution terminology, this is a Write-After-Write (WAW) hazard. WAW hazards are also called output dependencies because the final value of the operand depends on preserving the program-order sequence of writes: the earlier instruction must write first, and only then may the later instruction overwrite it. If their order is reversed, the wrong value may remain in the register. The other options describe different hazards: True dependency is Read-After-Write (RAW), where an instruction reads a value produced by an earlier instruction. Anti-dependency is Write-After-Read (WAR), where a later instruction writes a location that an earlier instruction still needs to read. Control hazard is a branch/fetch hazard and is unrelated to operand write ordering. Therefore, the dependency caused by a later write occurring before an earlier write is output dependency, option C. The primary attempt's option_analysis and final reasoning correctly identify WAW/output dependency and option C, although its stored correct_answer field says B; that field is inconsistent with its own reasoning. The verifier correctly recognized that the intended and technically correct option is C.
Reviewed by ISRO IQ Editorial Team.