Three types of Hazards and the data hazard is further dividedinto WAR, RAW, and RAR. (noOp), placing an unrelated instructionbetween dependent instructions, and flushing the pipeline to solvethese hazards. Complete the following table:
Code |
Hazard |
Registers affected |
How to handle the Hazard |
In case of forwarding place arrows where it can be forwarded |
Add $t0,$t1,$t2 |
||||
Sub $t3,$t0,$t1 |
||||
Or $t4,$t0,$t2 |
Code |
Hazard |
Registers affected |
How to handle Hazard |
In case of forwarding place arrows |
Lw $t2, 60($t1) |
||||
Lw $t1,40($t2) |
||||
Add $t1,$t1,$t2 |
||||
Sw $t1,20($t2) |
||||
Please not load word and store word instructions use memorycalculated by adding contents of the register indicated with thenumber given. Just to let you know that CPU is involved incalculating the memory location.
Expert Answer
Answer to Three types of Hazards and the data hazard is further divided into WAR, RAW, and RAR. (noOp), placing an unrelated instr…