8086 BIU/EU Architecture & 1 MB Memory Segmentation
Pipelined Bus Interface Unit (BIU), Execution Unit (EU), 6-byte queue, segment registers, and 20-bit physical address math.
Knova editors12 min readQuick checkSources
8086 Internal Architecture and Memory Segmentation
Introduced by Intel in 1978, the 8086 is a true 16-bit microprocessor with a 16-bit internal Arithmetic and Logic Unit, a 16-bit external data bus, and a 20-bit address bus capable of directly addressing of physical memory.
BIU and EU: Pipelined Architecture
Unlike preceding processors that interleaved instruction fetching and execution sequentially, the 8086 divides internal operations into two autonomous functional processing units:
- Bus Interface Unit (BIU): Handles all external bus transactions. The BIU is responsible for:
- Generating 20-bit physical addresses using segment registers and address adders.
- Fetching instruction opcodes from memory and storing them in an internal 6-byte FIFO Instruction Queue.
- Reading and writing operand bytes to/from external memory and I/O ports.
- Execution Unit (EU): Decodes and executes instructions received from the queue. The EU contains:
- The 16-bit ALU, general registers, pointer and index registers.
- The 16-bit Flag register.
- Control circuitry that receives opcodes from the BIU queue, decodes them, and directs internal data paths.
16-Bit Register Set
The 8086 register file contains 14 sixteen-bit registers categorized into four functional groups:
1. General-Purpose Data Registers
Four 16-bit registers that can be accessed as either a whole 16-bit word () or as two independent 8-bit registers (High byte: ; Low byte: ):
- AX (Accumulator): Preferred register for arithmetic, logical, and all I/O port instructions (
IN,OUT). Required in word multiplications and divisions. - BX (Base Register): Serves as a base pointer for data access in memory addressing modes (
MOV AL, [BX]). - CX (Count Register): Serves as an automatic loop counter for
LOOPinstructions and shift/rotate instructions (SHL AX, CL). - DX (Data Register): Holds upper 16 bits of 32-bit arithmetic results, and stores 16-bit port addresses for indirect I/O instructions (
IN AL, DX).
2. Pointer and Index Registers
- Stack Pointer (SP): 16-bit offset into the Stack Segment pointing to the current top of stack.
- Base Pointer (BP): 16-bit base offset into the Stack Segment, predominantly used in high-level language subroutines to access passed parameters on the stack frame.
- Source Index (SI): Offset register used in indexed addressing and as the source pointer in string instructions (default segment: ).
- Destination Index (DI): Offset register used in indexed addressing and as destination pointer in string instructions (strictly bound to ).
3. Segment Registers and Instruction Pointer
- CS (Code Segment): Holds base segment address of the executable instructions.
- DS (Data Segment): Holds base segment address of program variables and data.
- SS (Stack Segment): Holds base segment address of the system stack.
- ES (Extra Segment): Holds base segment address for additional data (e.g., string destinations).
- IP (Instruction Pointer): 16-bit offset of the next instruction byte to be fetched within the Code Segment ().
The 16-Bit Flag Register
The 8086 Flag register contains 9 active flags (6 conditional status flags and 3 control flags):
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| X | X | X | X | OF | DF | IF | TF | SF | ZF | X | AF | X | PF | X | CF |
- Status Flags (CF, PF, AF, ZF, SF, OF): Carry, Parity, Auxiliary Carry, Zero, Sign, and Overflow (OF). Overflow is set when a signed arithmetic operation yields a result exceeding signed magnitude (e.g. ).
- Control Flags (TF, IF, DF):
- Trap Flag (TF): When set to , puts processor in single-step debugging mode, firing a Type 1 interrupt after every single instruction.
- Interrupt Flag (IF): When , enables the external maskable
INTRpin; when (viaCLI), masksINTR. - Direction Flag (DF): Controls auto-increment/decrement of and in string instructions. (via
CLD) auto-increments forward; (viaSTD) auto-decrements backward.
Memory Segmentation and 20-Bit Physical Address Calculation
The physical address space () is organized into logical segments. Each segment is at most ( bytes) in size, starting at an address evenly divisible by (called a paragraph boundary).
To generate a 20-bit physical memory address from a 16-bit Segment Register and a 16-bit Offset Register, the Bus Interface Unit shifts the Segment Register left by 4 bit positions (multiplying by or ) and adds the 16-bit offset:
8086 20-Bit Physical Address & Segmentation Calculator
Adjust 16-bit Segment Base and Offset to witness the 4-bit left shift and arithmetic addition that yields the 20-bit address across 1 MB memory space.
1 Megabyte Physical Memory Map
• Logical Segment: Exactly 64 KB (2¹⁶ bytes), relocatable anywhere on a 16-byte boundary (called a paragraph).
• Segmentation Benefit: Programs can be relocated in memory simply by updating segment registers, leaving code displacement offsets untouched.
• Overlapping Segments: Segments can overlap completely, partially, or be completely disjoint.
8086 20-Bit Physical Address Generator
The 8086 hardware shifts the 16-bit segment base address left by 4 bits (multiplying by 16 in decimal or 10H in hex) and adds the 16-bit offset to form a 20-bit address capable of accessing 1 MB of RAM.