In: Electrical Engineering
Show what occurs with the control hazards in the following code sequence. Using forwarding. Write out the instructions one at a time, not every instruction is executed, pay attention to following which instruction is fetched, the order is not in sequence. Assume Taken.
J label A
Add r1, r2, r3
Add r4, r5, r6
Add r7, r8, r9
Add r10, r11, r12
Add r13, r14, r15
Label B Add r16, r7, r18
Add r19, r20, r21
J end
Add r22, r23, r24
Label A BEZ r4, Label B (Branch is evaluated to be Taken)
Add r1, r2, r3
Add r4, r5, r6
Add r7, r8, r9
Add r10, r11, r12
End
Add r13, r14, r15