Question: Consider the following assembly language code: I 0 : lw $R 9 , 4 , ( $R 1 ) / / LDW R 9 =

Consider the following assembly language code:
I0: lw $R9,4,($R1)// LDW R9= MEM[R1+4];
I1: add $R3,$R4,$R9//ADD R3= R4+ R9;
I2: lw $R1,100($R3)//LDW R1= MEM[R3+100];
I3: add $R4,$R1,$R0//ADD R4= R1+ R0;
I4: lw $R1,0($R3)//LDW R1= MEM[R3+0];
I5: sub $R3,$R1,$R4//SUB R3= R1- R4;
I6: and $R9,$R9,$R7//AND R9= R9 & R7;
I7: lw $R2,100($R4)//LDW R2= MEM[R4+100];
I8: sw $R4,100($R2)//STW MEM[R2+100]= R4;
I9: add $R1,$R5,$R4//ADD R1= R5+ R4;
Consider a pipeline with forwarding, hazard detection, and 1 delay slot for branches. The pipeline is the typical 5-stage IF, ID, E, M, WB MIPS design. For the above code, complete the pipeline diagram below (instructions on the left, cycles on top) for the code. Insert the characters IF, ID, E, M, WB for each instruction in the boxes. Assume that there two levels of bypassing, that the second half of the decode stage performs a read of source registers, and that the first half of the write-back stage writes to the register file. Label all data stalls (Draw an X in the box). Label all data forwards that the forwarding unit detects (arrow between the stages handing off the data and the stages receiving the data).
a) What is the final execution time of the code?
T0
T1
T2
T3
T4
T5
T6
T7
T8
T9
T10
T11
T12
T13
T14
T15
T16
T17
I0
I1
I2
I3
I4
I5
I6
I7
I8
I9
There is a total of _____ cycles
b) Verify that the program takes number of cycles found in the previous part
c) Assuming that the timings for the five pipeline stages are the ones given in the table below, find how long would it take to execute the code in part (a) and the respective speedups:
i) Using a single-cycled processor.
ii) Using a pipelined processor.
IF
ID
EX
MEM
WB
Pipeline Register
45ps
50ps
35ps
65ps
30ps
15ps

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 Databases Questions!