The two-bit prediction scheme is extendable to an n-bit scheme.
Studies showed that a two-bit prediction scheme does almost as well as an n-bit scheme with nɮ.
Two-bit predictors can be implemented in the Branch Target Buffer (BTB) assigning two state bits to each entry in the BTB.
Another solution is to use a BTB for target addresses and a separate Branch History Table (BHT) as prediction buffer.
A mispredict in the BHT occurs due to two reasons:
- either a wrong guess for that branch,
- or the branch history of a wrong branch is used because the table is indexed.
In an indexed table lookup part of the instruction address is used as index to identify a table entry.