Question: Question a1 120 Points]: Consider the following code fragment. Assume this program is executed on a 5 -stage pipelined Mips processor with the longest stage


Question a1 120 Points]: Consider the following code fragment. Assume this program is executed on a 5 -stage pipelined Mips processor with the longest stage pipeline equals to 200 ps. Predict the branch instruction as always taken. Moreover, assume that the conditional branch is always resolved at the decode stage. Answer the following questions. Uregistex initialization $1=0,$2=0,$3=0, and $4=400. Loop: 1 w $1,0($4) 1w $2,400($4) add $3,$1,$2 an $3,0($4) addi $4,$4,4 bnez $4, Loop Initialiy, 1. 15 Points| List all of the data dependences in the first iteration of the code above by filing the table below. You can refer to the instructions above as x1,12,13,14,15, and x. 2. [4 Points] Calculate the CPI and the execution time of the code above when the processor does not implement data forwarding. 3. [6 Points] Calculate the CPI and the execution time of the code above when the processor implements data forwarding. Calculate the speedup gain due to forwarding. 4. [5 Points] Assume you are asked to run the code above on another machine that relies on the compiler to order the instructions or insert nop instructions, such that, the dependent instructions are correctly executed. Reorder the instructions in the code above and/or insert nop instructions, such that, it runs on this machine with minimal latencies. Then, compute the average CPI after the reordering
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
