Forum Discussion
Altera_Forum
Honored Contributor
19 years agoBranch prediction is to help the processor avoid pipeline stalls when it jumps. The processor is constantly looking ahead to the next instruction but jumps will prevent this sequential flow. Typically after a jump the pipeline needs to be flushed because the CPU went ahead and loaded the next instruction(s).
Branch prediction will help avoid the stall by giving the CPU a hint that it shouldn't load the next instruction but some other instruction (wherever your jump location is). The difference between static and dynamic is fairly straight forward. Static means that the table can't adapt to new jumps as the code runs. Dynamic means as your code runs the "branch prediction table" will update during runtime which gives you even few stalls because your branch prediction adapts to the state your processor happens to be in. For more information take a look at the document smcnutt stated or google search "Branch prediction" since it's used in other processors as well.