Skip to main content

GATE CSE 2024CO & Architecture › Instruction Pipelining & PerformanceVerified

GATE CSE 2024 PYQ: ​​​​​An instruction format has the following structure: Instruction Number: Opcode destination reg, source…

​​​​​An instruction format has the following structure:

Instruction Number: Opcode destination reg, source reg-1, source reg-2
 

Consider the following sequence of instructions to be executed in a pipelined processor:

I 1: DIV R3, R1, R2\text{I 1: DIV R3, R1, R2}

I 2: SUB R5, R3, R4\text{I 2: SUB R5, R3, R4}

I 3: ADD R3, R5, R6\text{I 3: ADD R3, R5, R6}

I 4: MUL R7, R3, R8\text{I 4: MUL R7, R3, R8}

Which of the following statements is/are TRUE?

  1. A
    There is a RAW dependency on R 3\text{R 3} between I 1\text{I 1} and I 2\text{I 2}
    Correct answer
  2. B
    There is a WAR dependency on R 3\text{R 3} between I 1\text{I 1} and I 3\text{I 3}
  3. C
    There is a RAW dependency on R 3\text{R 3} between I 2\text{I 2} and I 3\text{I 3}
  4. D
    There is a WAW dependency on R 3\text{R 3} between I 3\text{I 3} and I 4\text{I 4}

Answer

(A) There is a RAW dependency on R 3 \text{R 3} R 3 between I 1 \text{I 1} I 1 and I 2 \text{I 2} I 2

Approach

List which registers each instruction reads (source) and writes (destination), then for register R3 classify each earlier/later instruction pair as RAW (write→read), WAR (read→write), or WAW (write→write).

Only statement A correctly identifies a dependency type: I1 writes R3 and I2 reads it, giving a true RAW dependence on R3. The R3 relations in B, C and D are WAW, WAR and RAW respectively - mislabeled in each statement - so only A is true.

Reviewed by GateIQ Editorial Team: IIT & IISc Alumni.