Detecting Data Hazards
EX Hazard:
ID/EX.RegWrite and((ID/EX.RegDst=0 and ID/EX.WriteRegisterRt=IF/ID.ReadRegister1)or(ID/EX.RegDst=1 and ID/EX.WriteRegisterRd=IF/ID.ReadRegister1)or(ID/EX.RegDst=0 and ID/EX.WriteRegisterRt=IF/ID.ReadRegister2)or(ID/EX.RegDst=1 and ID/EX.WriteRegisterRd=IF/ID.ReadRegister2))
MEM Hazard:
EX/MEM.RegWrite and((EX/MEM.WriteRegister=IF/ID.ReadRegister1)or(EX/MEM.WriteRegister=IF/ID.ReadRegister2))
WB Hazard:
MEM/WB.RegWrite and((MEM/WB.WriteRegister=IF/ID.ReadRegister1)or(MEM/WB.WriteRegister=IF/ID.ReadRegister2))