Pipelining in the Intel 8086

The Intel 8086 microprocessor introduced a basic form of pipelining, which was a significant achievement for its time. Pipelining allows the processor to overlap the instruction fetch and execution stages, increasing overall performance. Below is a detailed description of pipelining in the 8086:

What Is Pipelining?

Pipelining is a technique in which several instructions are processed simultaneously at different execution stages. In the 8086, pipelining is implemented using a two-stage pipeline:

Fetch Stage: the processor fetches the next instruction from memory.

Execution Stage: the processor decodes and executes the fetched instruction.

By overlapping these stages, the 8086 processor can achieve higher throughput compared to processors without pipelining.

How Pipelining Works in the 8086

In the 8086, pipelining is implemented by the bus interface unit (BIU) and the execution unit (EU):

Bus Interface Unit (BIU)


Responsible for fetching instructions from memory.

Controls the address and data buses.

Contains the instruction queue — a 6-byte buffer that holds prefetched instructions.

Execution Unit (EU)


Responsible for decoding and executing instructions.

Contains the arithmetic logic unit, registers and control logic.

Instruction Execution Pipeline

The pipelining process in the 8086 works as follows:

Fetch Stage (BIU):


The BIU fetches instructions from memory and stores them in the instruction queue.

While the EU executes the current instruction, the BIU prefetches the next instruction (or instructions) in the background.

Execution Stage (EU):


The EU decodes and executes the instruction fetched by the BIU.

If an instruction requires memory access, the EU sends a request to the BIU.

Overlap:


While the EU executes one instruction, the BIU fetches the next instruction (or instructions) from memory.

This overlap reduces idle time and increases performance.

Instruction Queue

The 6-byte instruction queue is a key feature of 8086 pipelining.

It allows the BIU to prefetch up to 6 bytes of instructions while the EU is busy executing the current instruction.

The queue maintains a steady flow of instructions, minimizing the delays caused by memory access latency.

Advantages of Pipelining in the 8086

Increased Performance: by overlapping the fetch and execution stages, the 8086 can process instructions faster.

Efficient Use of Resources: the BIU and EU work in parallel, reducing idle time.

Prefetching: the instruction queue ensures that the EU is always ready to execute instructions, reducing wait time.

Limitations of Pipelining in the 8086

Simple Pipeline: the 8086 has only a two-stage pipeline, which is less advanced compared to modern processors with deeper pipelines.

Branch Penalties: if a branch instruction is encountered, the prefetched instructions in the queue may be discarded, which causes a delay.

Memory Bottleneck: pipeline performance depends on memory access speed. Slow memory can stall the pipeline.

Example of Pipelining in Action

Consider the following instruction sequence:

mov     ax, 5
add     bx, ax
sub     cx, bx

Pipelining:

Cycle 1:

The BIU fetches mov ax, 5.

The EU is idle (there is no instruction to execute yet).

Cycle 2:

The BIU fetches add bx, ax.

The EU executes mov ax, 5.

Cycle 3:

The BIU fetches sub cx, bx.

The EU executes add bx, ax.

Cycle 4:

The BIU fetches the next instruction (if any).

The EU executes sub cx, bx.

This overlapping of the fetch and execution stages increases performance.

Comparison with Processors Without Pipelining

In a Processor Without Pipelining:

The processor must complete the fetch, decoding and execution stages of one instruction before starting the next one.

This leads to idle time and reduced performance.

In the 8086:

The fetch and execution stages overlap, reducing idle time and increasing performance.

Impact on Modern Processors

The concept of pipelining introduced in the 8086 laid the foundation for modern processors, which use deeper pipelines (for example, 10–20 stages) and advanced techniques such as superscalar execution and out-of-order execution to further increase performance.

Summary

Pipelining in the Intel 8086 is a two-stage process involving the bus interface unit (BIU) and the execution unit (EU). By overlapping instruction fetch and execution, the 8086 delivers higher performance compared to processors without pipelining. Despite its simplicity by modern standards, this pipelining technique was a significant innovation at the time and paved the way for more advanced architectures.