Consider the following code segment within a loop body:
if ( n % 2 == 0 ) branch 1 a++; if ( n % 10 == 0 ) branch 2 b++;
Assume that the following list of 10 values of n is to be processed by 10 iterations of this loop: 18, 29, 30, 41, 52, 60, 79, 80, 91, 100
List the predictions for the following branch prediction schemes and calculate the prediction accuracies for each scheme.
(a) Always taken. (b) Always not taken. (a) 1-bit predictor, initialized to predict taken. (b) 2-bit predictor, initialized to weakly predict taken.
6. The heat/A/C control can be either a program constant or allow for user input.

+1 862 207 3288 