Consider the following instruction sequence We want to run t

Consider the following instruction sequence. We want to run this code on pipelined MIPs.

add R3, R2,R7

lw R4, 20(R3)

and R6, R5,R4

sw R3, -40(R5)

add R4, R6, R3

sub R5, R6, R4

To reduce clock cycle time, we are considering a split of the MEM stage into two stages. Please find all hazards in this 6-stage pipeline for the same instruction sequence with and without forwarding.

Solution

the data hazard with forwarding is in the statement sw R3, -40(R5), This will create a problem as storing the word as a negative value will be a problem leading to the data hazard.

without forwarding the data hazard is present in statement lw R4, 20(R3) where the word is being loaded into register R4 and the word is present in a wrong way.First we need to store 20 into R3 and then load it not directly.

These are the two problems which will prevent the statements from being executed.This can lead to

errors in the output.

Consider the following instruction sequence. We want to run this code on pipelined MIPs. add R3, R2,R7 lw R4, 20(R3) and R6, R5,R4 sw R3, -40(R5) add R4, R6, R3

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site