Question: Assume a processor that always predicts that conditional branches are not taken. What percentage of the time would it predict correctly for the following block
Assume a processor that always predicts that conditional branches are not taken. What percentage of the time would it predict correctly for the following block of code? li $r1, 1 li $r0, 5 topOfLoop: beq $r0, $zero, endLoop add $r1, $r0, $r1 addi $r0, $r0, -1 b topOfLoop endLoop: Percentage Correct: _____ If we modify the hardware so that the first time it encounters a conditional branch it predicts that it is taken but after that it predicts it will do whatever it did on the previous time it executed the loop what will be the percentage of the time it will predict correctly? Modified Percentage Correct: _____
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
