CPUs and architecture
What is the purpose of branch prediction in a CPU?
- ATo predict the outcome of branch instructions and execute ahead, reducing pipeline stalls
- BTo predict power consumption and control the power supply
- CTo predict main memory capacity
Show answer and explanation
Answer: A. To predict the outcome of branch instructions and execute ahead, reducing pipeline stalls
In a pipeline, the next instruction to execute is not known until the branch outcome is determined, so processing stalls. Branch prediction predicts the branch target from past history and continues execution, redoing work only when the prediction is wrong. Prediction accuracy has a large effect on performance.