The following branch prediction algorithms are suggested:
1) Guess that the branch will be taken if the previous one was taken; predict not taken otherwise.
2) Guess that the branch will be taken if the last two branches where taken; predict not taken otherwise.
(a) Sketch a branch prediction state diagram for each (as shown in class.)
(b) Illustrate a sequence of instruction where the rst method is better.
(c) Illustrate a sequence of instruction where the second method is better.