Overview

When the CPU encounters a branch (like an 'if' statement), it needs to know two things: whether the branch will be taken, and if so, where it will jump to. The BTB provides the 'where'.

How it Works

The BTB stores the address of the branch instruction and the address it jumped to the last time it was executed. When the CPU sees that branch address again, it can immediately start fetching instructions from the predicted target address.

Importance

Essential for reducing the 'branch penalty' in deeply pipelined processors, as it allows the CPU to start fetching the next instructions before the branch is even decoded.