Skip to content
Advanced Microprocessor

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 220=1,048,576 bytes (1 MB)2^{20} = 1,048,576\text{ bytes } (1\text{ MB}) 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:

  1. 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.
  2. 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 (AX,BX,CX,DXAX, BX, CX, DX) or as two independent 8-bit registers (High byte: AH,BH,CH,DHAH, BH, CH, DH; Low byte: AL,BL,CL,DLAL, BL, CL, DL):

  • 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 LOOP instructions 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: DSDS).
  • Destination Index (DI): Offset register used in indexed addressing and as destination pointer in string instructions (strictly bound to ESES).

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 (CSCS).

The 16-Bit Flag Register

The 8086 Flag register contains 9 active flags (6 conditional status flags and 3 control flags):

1514131211109876543210
XXXXOFDFIFTFSFZFXAFXPFXCF
  • 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. +127+1=−128+127 + 1 = -128).
  • Control Flags (TF, IF, DF):
    • Trap Flag (TF): When set to 11, puts processor in single-step debugging mode, firing a Type 1 interrupt after every single instruction.
    • Interrupt Flag (IF): When 11, enables the external maskable INTR pin; when 00 (via CLI), masks INTR.
    • Direction Flag (DF): Controls auto-increment/decrement of SISI and DIDI in string instructions. DF=0DF=0 (via CLD) auto-increments forward; DF=1DF=1 (via STD) auto-decrements backward.

Memory Segmentation and 20-Bit Physical Address Calculation

The 1 MB1\text{ MB} physical address space (00000H−FFFFFH00000\text{H}-\text{FFFFF}\text{H}) is organized into logical segments. Each segment is at most 64 KB64\text{ KB} (2162^{16} bytes) in size, starting at an address evenly divisible by 1616 (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 161016_{10} or 10H10\text{H}) and adds the 16-bit offset:

Physical Address=(Segment Register×10H)+Offset\text{Physical Address} = (\text{Segment Register} \times 10\text{H}) + \text{Offset}
Fig 7.1: 8086 20-Bit Physical Address Generation from Segment and Offset Registers
Fig 7.1: 8086 20-Bit Physical Address Generation from Segment and Offset Registers
Address Generation Unit (BIU)

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.

Arithmetic PipelineInstruction Fetch (Code Segment + Instruction Pointer)
1. CS Register (16-bit Base):1000H
0001000000000000b
2. Shift Left 4 bits (CS × 10H):10000H
00010000000000000000b (4 zeros appended at LSB)
3. Add IP Offset (16-bit):+0250H
0000001001010000b
Computed 20-Bit Physical Address
10250H
Dec: 66128
00000H – FFFFFH
1 Megabyte Physical Memory Map
FFFFFH (1MB Top)
00000H (1MB Base)
64KB CS Window
10000H – 1FFFFH
Target: 10250H

• 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

Physical Address=(Segment Register×10H)+Offset Register\text{Physical Address} = (\text{Segment Register} \times 10\text{H}) + \text{Offset Register}

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.

Try it
Physical Address Calculation: If the Code Segment register CS=2400HCS = 2400\text{H} and the Instruction Pointer IP=0150HIP = 0150\text{H}, what physical memory address does the 8086 fetch?

Sources

  1. 1.Intel 8086 Microprocessor Datasheet · reference · Intel (opens in a new tab)

Was this chapter useful?

Editors read every answer.

Star this chapter

Each star goes once to every reader who improved this chapter.

Finished reading?

Mark it to keep your place in the course.