We have a program of 1000 instructions in the format of LD D

We have a program of 1000 instructions in the format of \"LD, DADD, LD, DADD, LD, DADD ...The DADD instruction depends (and only depends) on the LD instruction right before it. The LD instruction also depends (and only depends) on the DADD instruction right before it. If the program is executed on the MIPS 5-stage pipeline (assuming no structural hazard): Without forwarding, what would be the actual CPI? With forwarding, what would be the actual CPI?

Solution

a)
without forwarding, the value in register can only be read so that there have 2 cycles bubbles
which are between LW and other dependent ADD. Similarly we have another two bubbles between ADD and dependent
LW.
So we have total 6 cycles ==> 1 ADD + 2 bubbles + 1 ADD + 2 bubbles
So it takes 6 cyvles for completing two instructions.
So, Average CPI = 6/2 ===> 3

------------------------------------------------------------------------------------------
b)
With forwarding, only 1 bubble will be there between LW and ADD. and no bubble between ADD and LW.
So finally we have 3 cycles ==> 1 to complete LW + 1 bubble + 1 ADD

So 3 cycles to complete two instructions.
So average CPIC = 3/2 = 1.5

 We have a program of 1000 instructions in the format of \

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site