Question: 1 . ( 2 0 points ) The following sequence of instruction is executed in a basic fivestage pipelined processor discussed in the class. There

1.(20 points) The following sequence of instruction is executed in a basic fivestage pipelined processor discussed in the class. There is NO forwarding support.
```
ldur x2,[x1,#0]
add x3,x3,x2
add x4,x1,x3
sub x1,x4,x1
cbz x1, exit
stur x3,[x1,#0]
ldur x5,[x1,#8]
sub x2,x5,x6
add x6,x2,x3
exit:
add x1,x2,x3
```
(a) List all hazards in the above code. For each hazard, indicate the instruction which creates the hazard and all affected instructions.
(b) Rewrite the code including minimum number of nop instructions to eliminate potential hazards. You can reorder the instructions. Assume that the pipeline has full forwarding support. Also, assume that register read and write at the same address can happen in one clock cycle.
(c) Could branch prediction help eliminate the hazards in the code for this question? Please explain why or why not in one or two sentences.
1 . ( 2 0 points ) The following sequence of

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!