The GATE Grind

GATE 2024 CS (CS2) – Question 31

Computer Organization and Architecture · Instruction Pipelining and Pipeline Hazards · 1 mark · Multiple select

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?

  1. There is a RAW dependency on R3 between I1 and I2
  2. There is a WAR dependency on R3 between I1 and I3
  3. There is a RAW dependency on R3 between I2 and I3
  4. There is a WAW dependency on R3 between I3 and I4

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).