Pipelining
- Pipelining is a common way to increase the instruction throughput of a microprocessor.
- Throughput is the amount of data processed by a processor.
- In Pipeline instruction execution After the instruction fetch unit fetches the first instruction.
- The decode unit decodes it while the instruction fetch unit simultaneously fetches the next instruction and so on.
- The idea of pipelining is illustrated in Figure 2.4.

- For pipelining to work well, instruction execution must be decomposable into roughly equal length stages.
- Each instruction requires the same number of cycles.
- Branches pose a problem for pipelining, since it is not possible to know the address of the next instruction.
- One solution is to stall the pipeline when a branch is in the pipeline.
- An alternative is to guess the way the branch will go and fetch the next instruction.
- if right, proceed with no penalty,
- if wrong this incurrs a penalty.
- Modern pipelined microprocessors have built in sophisticated branch predictors.
