Indicate the type of data hazards (RAW, WAR, and WAW) that

Indicate the type of data hazards (RAW, WAR, and WAW) that exist between the following instructions:
I1:ADD R1, R2, R3        ; R1 = R2 + R3
I2:ADD R4, R1, R4        ; R4 = R1 + R4
I3:ADD R3, R1, R2        ; R3 = R1 + R2
I4:ADD R1, R1, R4        ; R1 = R1 + R4
 
My doubt is whether hazards can exist in single instruction?(as in I2 and I4)

 

2Comments
Nishant Vijayvergiya @nishantv
18 Dec 2014 01:05 pm

No. Hazards exist between instructions like I1 & I2 but not between I2 & I2 or I4 & I4

Arvind Rawat @arvind.rawat
18 Dec 2014 02:00 pm

A data hazard occurs when the same variable(data) is accessed by two instructions and atleast one of the instruction performs a write operation on that variable(data). So, hazards cant be exist in a single instruction.

Pages