CPUs and architecture

What is the purpose of branch prediction in a CPU?

  1. ATo predict the outcome of branch instructions and execute ahead, reducing pipeline stalls
  2. BTo predict power consumption and control the power supply
  3. 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.

Practice this topic Back to topic

More CPUs and architecture questions

  1. What is the main reason GPUs are well suited to matrix operations and AI training and inference?
  2. If the cache access time is 10 ns, the main memory access time is 100 ns, and the cache hit rate is 90%, what is the average access time?
  3. In a CMOS circuit, if only the supply voltage is halved with everything else unchanged, what happens to dynamic power consumption?
  4. What do names like ARM, x86 and RISC-V mainly refer to?
  5. Which is a characteristic of RISC-V?