Question discussion

In a pipeline, the instruction I1: ADD R1, R2, R3 is immediately followed by I2: SUB R4, R1, R5. Which type of data hazard can occur?

1730Medium DSSSB TGT Computer Science 0 replies

In a pipeline, the instruction I1: ADD R1, R2, R3 is immediately followed by I2: SUB R4, R1, R5. Which type of data hazard can occur?

  • AWAR (write after read)
  • BRAW (read after write)
  • CWAW (write after write)
  • DStructural hazard
Correct answer: B

Explanation

I2 reads R1 which I1 has yet to write, so it is a read-after-write (true dependency) hazard.

Discussion 0

Nobody has replied yet. Start the discussion!