up10388
up10388

Reputation: 1

Why forwarding unit in MIPS processor does not store always data from WB stage to ID stage?

Hey to everyone I am trying to understand 5 stage pipeline MIPS with forwarding unit So I found a problem which has raw data hazards The problem is the following :

Ι1 and $1, $1, $2
Ι2 add $2, $1, $2
Ι3 lw  $2, –20($3)
Ι4 sub $4, $2, $4

Dependencies : (Ι1, Ι2, $1) , (Ι3, Ι4, $2)

the pipeline with hazards is the following :

enter image description here

The solution of the forwarding unit is :

enter image description here

But I could not understand why forwarding unit store data from (EX to EX , WB to EX) And not to WB to ID for these two dependencies Also why we have to use a NOP instruction between I3 and I4 instruction

My solution is the following :

enter image description here

Upvotes: 0

Views: 149

Answers (0)

Related Questions