GATE 2024 CS (CS2) – Question 31
An instruction format has the structure: Instruction Number: Opcode destination reg, source reg-1, source reg-2. Consider the sequence: I1: DIV R3, R1, R2; I2: SUB R5, R3, R4; I3: ADD R3, R5, R6; I4: MUL R7, R3, R8. Which of the following statements is/are TRUE?
Practise this question in The GATE Grind →
Show answer and explanation
Correct answer: (A) There is a RAW dependency on R3 between I1 and I2
Explanation
I1 writes R3 and I2 reads it: RAW (A true). I1 writes R3 and I3 writes R3: WAW, not WAR (B false). I2→I3 dependency is on R5, not R3 (C false). I4 only reads R3, so no WAW with I3 (D false).