Question: Consider the following MIPS code and answer the following questions 3. Consider the following code (this should look familiar from HW3...) li $t0, 5 liSt1,0x10010004

Consider the following MIPS code and answer the following questions

Consider the following MIPS code and answer the following questions 3. Consider

3. Consider the following code (this should look familiar from HW3...) li $t0, 5 liSt1,0x10010004 addi Sto, Sto, -1 lw St1, 0(St1) bne Sto, Szero, loop addSvO, St0, Szero loop: a. [5Assume this is executed on a standard 5 stage MIPS pipeline with no branch prediction How many dynamic instructions are executed, including NOPs? How does this relate to the number ofcycles? b. [5] How many dynamic instructions and cycles would this take with perfect branch prediction? [101 Assume a 1 bit branch predictor is used, where the original state is Not Taken. Give the full logofthebranchhistory table, showing predictedandactualbranches. Underlinethe incorrectpredictions.Whatis thefinalstate ofthebranchprediction, andhowmany cycles were required intotal? c. d. [5Thiscodeis executed on asinglecyclemachine (M1)at 100MHz, andonamulticycle machinewith 1 bitbranchpredictor (M2)at 133.33MHz,Compute TexonbothM1 and M2. What is the total branch misprediction overhead (that is, what percentage of the total execution time is due to mispredicting the branch?) 3. Consider the following code (this should look familiar from HW3...) li $t0, 5 liSt1,0x10010004 addi Sto, Sto, -1 lw St1, 0(St1) bne Sto, Szero, loop addSvO, St0, Szero loop: a. [5Assume this is executed on a standard 5 stage MIPS pipeline with no branch prediction How many dynamic instructions are executed, including NOPs? How does this relate to the number ofcycles? b. [5] How many dynamic instructions and cycles would this take with perfect branch prediction? [101 Assume a 1 bit branch predictor is used, where the original state is Not Taken. Give the full logofthebranchhistory table, showing predictedandactualbranches. Underlinethe incorrectpredictions.Whatis thefinalstate ofthebranchprediction, andhowmany cycles were required intotal? c. d. [5Thiscodeis executed on asinglecyclemachine (M1)at 100MHz, andonamulticycle machinewith 1 bitbranchpredictor (M2)at 133.33MHz,Compute TexonbothM1 and M2. What is the total branch misprediction overhead (that is, what percentage of the total execution time is due to mispredicting the branch?)

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!