Consider the following repeating pattern of branch outcomes
     Consider the following repeating pattern of branch outcomes: T, NT, NT, T, NT.  Calculate accuracy for 1-bit predictor for \'always-not-taken\'  Calculate accuracy for 1-bit predictor in steady state. Assume that the 1-bit predictor is initialized to 0 (\'NT\'). Please use the following table to make entries for calculating accuracy.  Repeat (b) except that you now assume that the 1-bit predictor is initialized to 1 (\'NT\'). Please use the following table to make entries for calculating accuracy.  What is the accuracy of the two bit predictor for the first five branches as defined by the pattern, assuming that the predictor starts off in the bottom left state from figure below (predict not taken).  Please use the following table to make entries for calculating accuracy.  What is the accuracy of the two bit predictor in steady state, assuming that the predictor starts off in the bottom left state from figure shown in (d). 
  
  Solution
a) Accuracy for 1-bit predictor for \"always-not-taken\":
Actual T NT NT NT T
Predict NT NT NT NT NT
Accuracy = 3/5 = 0.6
b)
Actual T NT NT NT T | T NT NT NT T | T NT NT NT T |
Predictor 0 1 0 0 0 | 1 2 1 0 0 | 1 2 1 0 0 |
Predict NT NT NT NT NT | NT T NT NT NT | NT T NT NT NT |
Steady-state Accuracy = 2/5 = 0.4
d)
Actual T NT T NT T
Predict NT T NT T NT
Accuracy = 0/5 = 0
e)
 Actual T NT T NT T | T NT T NT T | T NT T NT T | T NT T NT T | T NT T NT T |
Predictor 0 1 0 1 0 | 1 2 1 2 1 | 2 1 2 1 2 | 3 2 3 2 3 | 3 2 3 2 3 |
Predict NT NT NT NT NT| NT T NT T NT| T NT T NT T | T T T T T | T T T T T |
Steady-state Accuracy = 3/5 = 0.6

