Understanding branch prediction
There are some queries about branch prediction that I am not able to confidently figure out.Assume that I have to work with a static branch predictor. At which stage of the pipeline should branch prediction happen? How to know that a prediction has gone wrong? How does the datapath come to know that a misprediction has happened? If it comes to know that a misprediction has happened, how does it send the signal to take up the not-taken branch? After it has gone wrong, I have to take up that address that was not taken earlier. In the meanwhile, what if some memory-write or register-write has