Question: Problem 1 Consider the following assembly language code: 10: add SR3,SR5,SR6 11: and SR4,SR2,SR1 12: add SR4,SR1,SRO 13: sub SR9,SR3,SR4 14: lw SR2,100(SR9) I5: lw
Problem 1 Consider the following assembly language code: 10: add SR3,SR5,SR6 11: and SR4,SR2,SR1 12: add SR4,SR1,SRO 13: sub SR9,SR3,SR4 14: lw SR2,100(SR9) I5: lw SR1,0(SR2) 16: and SR9,SR9,SR1 17: bez SR9,SR1, label1 //ADD R3 = R5 + R6; //AND R4 = R2 & R1; ADD R4-R1 +RO; /SUB R9- R3 -R4 //LDW R2 = MEMIR9 + 100]; LDWRI -MEMIR2+0) AND R9-R9 & R1; //lf SR9-SRI-? goto label 1 ; Consider a pipeline with forwarding, hazard detection, and 1 delay slot for branches. The pipeline is the typical 5-stage IF, ID, EX, MEM, 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, EX, MEM, 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? 10 cycles (b) Verify your result in part (a) There is a total of (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
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
