You are on page 1of 1

Branch Predictor:

In this project I have built a simulator to model three different types of branch
predictors namely bimodal which does not use any past history of other branches in
the program, Gshare predictor which uses global branch history register and the
final one is hybrid predictor which nothing but the hybrid of bimodal and Gshare.
In the bimodal predictor we have a 2bit counter which saturates at 3 and 0. Each
counter in the predictor table is initialized with weakly taken state i.e the value of 2.
We increment the counter if the predictor is correct and decrement the counter if
prediction is wrong. The table is indexed only with PC.
In the Gshare predictor we have a global branch history register which is essentially
shift register that keeps track of all the branches in the program. Also we have a
counter table like the bimodal predictor. We index the table with the value that is
obtained with EXORING global history bits with lower order bits of PC. Combining
bits with XOR hopefully preserves valuable information from both PC and BHR.
Hybrid predictor is basically you have both bimodal and gshare but you choose the
prediction from either one of them based the chooser table counter value.
With results we obtained from the simulator I have inferred that bimodal predictor
has performed well for heavily biased branch. While the Gshare predictor gave good
results for unbiased branches. We also calculated the optimal area while taking
misprediction rate into consideration.

You might also like