ENCYCLOPEDIA 4U .com



Encyclopedia Home Page

Google
  Web Encyclopedia4u.com

 

Branch prediction

Branch prediction is a technique used in some computer processors with instruction prefetch to guess whether a conditional branch will be taken or not and prefetch code from the appropriate location.

When a branch instruction is executed, its address and that of the next instruction executed (the chosen destination of the branch) are stored in the Branch Target Buffer. This information is used to predict which way the instruction will branch the next time it is executed so that instruction prefetch can continue. When the prediction is correct, executing a branch does not cause a pipeline break.

Most modern microprocessors use some variation of the above algorithm to correctly predict branches with 90% to 99% accuracy. This high percentage is the result of the way most computer programs are written, especially the ones with many repetitive loops.

Some later CPUs simply prefetch both paths instead of trying to predict which way the branch will go.

An extension of the idea of branch prediction is speculative execution. See also lazy evaluation, eager evaluation.

Not to be confused with branch predication.


This article (or an earlier version of it) contains material from FOLDOC, used with permission.




Content on this web site is provided for informational purposes only. We accept no responsibility for any loss, injury or inconvenience sustained by any person resulting from information published on this site. We encourage you to verify any critical information with the relevant authorities.



Copyright © 2005 Par Web Solutions All Rights reserved.
| Privacy

This article is licensed under the GNU Free Documentation License. It uses material from the Wikipedia article "Branch prediction".