Assume that your hardware uses branch prediction which always assumes that branch not taken. Show the pipeline of the fo
Posted: Fri May 20, 2022 4:58 pm
Assume that your hardware uses branch prediction which always assumes that branch not taken. Show the pipeline of the following code. Forwarding is allowed. Note 1: Use 5 stages for each instruction including "j" and "Jr”. Note 2: Unconditional jumps calculate the jumping address at EX stage. Therefore, at the end of EX stage, you will know which instruction to execute. Note 3: Please fill the boxes for each part. You may not need to use all boxes. E.g. if your answer takes only 12 clock cycle, you don't need to fill remaining boxes. add $to, $to, $t1 sw $t0, 4($80) beq $t1, $t2, L1 sub $t1, $t2, $t3 Exit L1: beq $t0,$t2, $L2 sw $t0, 4($81) j Exit L2: iw $t0,($s0) Exit: add $v0, $v0, $t0 jr $ra a-) Assume that $t1 != $t2 add Sw beq sub j L1: beq SW j L2: lw Exit: add jr
b-) Assume that $t1 $t2 and $t0 != $t2 add sw beq sub j L1: beq sw j L2: lw Exit: add jr C-) Assume that $t1 == = $t2 and $t0 == $t2 add sw beq sub j beq L1: sw j L2: lw Exit: add jr
b-) Assume that $t1 $t2 and $t0 != $t2 add sw beq sub j L1: beq sw j L2: lw Exit: add jr C-) Assume that $t1 == = $t2 and $t0 == $t2 add sw beq sub j beq L1: sw j L2: lw Exit: add jr