I was reading the dynamic branch prediction section in Chapter 5 of Computer Organization and Design: The Hardware/Software Interface 5th Edition by Patterson and Hennessy when I came across the following diagram for the states of the 2-bit predictor :
The 2-bit predictor should change it's prediction after it predicts wrong twice. But according to this diagram when we start from the bottom left state, if the machine predicts "NOT TAKEN" twice when the branch should have been "TAKEN", then the top right PREDICT TAKEN state is reached. However here the machine will change state to the bottom right PREDICT NOT TAKEN even if it predicts wrongly when the branch should have been "NOT TAKEN" just once.
Isn't that wrong behavior and does this mean the state machine is wrong or am I missing something?
On the bottom NOT TAKEN dark colored state when the branch is TAKEN twice, you can see that the state reached is the light colored "unsure" state, whereas it should have been according to me the dark colored "sure" state, since the branch did the same action twice in a row.