Assume a processor that always predicts that conditional branches are not taken.
ID: 3859931 • Letter: A
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 of code? li Sr1, 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: _____Explanation / Answer
Q-3 a) when branch is not taken
here out of 6 times , 5 times it predicts correctly , so percentage correct = 5/6 = 83.34
b)
in case of second scenrios
1st time it will predict wrongly, from 2nd to 5th time it will predict correct , on 6th time it will predict wrongly,
so percentage of correct = 4/6 = 66.67
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.