In computer architecture, a branch predictor is a digital
Added on -2019-09-20
| 2 pages
| 465 words
| 636 views
Trusted by 2+ million users, 1000+ happy students everyday
Incomputer architecture, abranch predictoris adigital circuitthat tries to guess which way abranch(e.g. anif-then-else structure) will go before this is known for sure. The purpose of the branch predictor is to improve the flow in theinstruction pipeline. Branch predictors play a critical role in achieving high effectiveperformancein many modernpipelinedmicroprocessorarchitectures such asx86.Figure 1: Example of 4-stage pipeline. The colored boxes represent instructions independent of each otherTwo-way branching is usually implemented with aconditional jumpinstruction. A conditional jump can either be "not taken" and continue execution with the first branch of code which follows immediately after the conditional jump, or it can be "taken" and jump to a different place in program memory where the second branch of code is stored. It is not known for certain whether a conditional jump will be taken or not taken until the condition has been calculated and the conditional jump has passed the execution stage in the instruction pipeline (see fig. 1).Without branch prediction, the processor would have to wait until the conditional jump instruction has passed the execute stage before the next instruction can enter the fetch stage in the pipeline. The branch predictor attempts to avoid this waste of time by trying to guess whether the conditional jump is most likely to be taken or not taken. The branch that is guessed to be the most likely is then fetched andspeculatively executed. If it is later detected that the guess was wrong then the speculatively executed or partially executed instructions are discarded and the pipeline starts over with the correct branch, incurring a delay.
Found this document preview useful?
You are reading a preview Upload your documents to download or Become a Desklib member to get accesss