8086 Microprocessor Architecture
8086 Microprocessor Architecture
MICROPROCESSOR
By
A. Sanyasi Rao
Assoc. Prof
BIES, NSPT
1
Features
• It is a 16-bit μp.
• 8086 has a 20 bit address bus can access up to 220
memory locations (1 MB).
• It can support up to 64K I/O ports.
• It provides 14, 16 -bit registers.
• Word size is 16 bits and double word size is 4 bytes.
• It has multiplexed address and data bus AD0- AD15
and A16 – A19.
• It requires single phase clock with 33% duty cycle to
provide internal timing.
2
• 8086 is designed to operate in two modes, Minimum and
Maximum.
3
Intel 8086 Internal Architecture
4
Internal architecture of 8086
6
EXECUTION UNIT
• Decodes instructions fetched by the BIU
• Generate control signals,
• Executes instructions.
8 bits 8 bits
AH AL
AX Accumulator
BH BL Base
BX
CH CL
CX Count
DH DL
DX Data
SP
Stack Pointer
Pointer BP
Base Pointer
SI
Source Index
Index
DI
Destination Index
8
EXECUTION UNIT – General Purpose Registers
Register Purpose
AX Word multiply, word divide, word I /O
AL Byte multiply, byte divide, byte I/O, decimal
arithmetic
10
• SI: Source Index register
– is required for some string operations
– When string operations are performed, the SI register
points to memory locations in the data segment which is
addressed by the DS register. Thus, SI is associated with
the DS in string operations.
U U U U OF DF IF TF SF ZF U AF U PF U CF
U - Unused 12
EXECUTION UNIT – Flag Register
Flag Purpose
Carry (CF) Holds the carry after addition or the borrow after subtraction.
Also indicates some error conditions, as dictated by some
programs and procedures .
Parity (PF) PF=0;odd parity, PF=1;even parity.
Auxiliary (AF) Holds the carry (half – carry) after addition or borrow after
subtraction between bit positions 3 and 4 of the result
(for example, in BCD addition or subtraction.)
Zero (ZF) Shows the result of the arithmetic or logic operation.
Z=1; result is zero. Z=0; The result is 0
Sign (SF) Holds the sign of the result after an arithmetic/logic instruction
execution. S=1; negative, S=0
13
Flag Purpose
A control flag.
Trap (TF) Enables the trapping through an on-chip debugging
feature.
A control flag.
Interrupt (IF) Controls the operation of the INTR (interrupt request)
I=0; INTR pin disabled. I=1; INTR pin enabled.
A control flag.
Direction (DF) It selects either the increment or decrement mode for DI
and /or SI registers during the string instructions.
Overflow occurs when signed numbers are added or
Overflow (OF) subtracted. An overflow indicates the result has exceeded
the capacity of the Machine
14
Execution unit – Flag Register
• Six of the flags are status indicators reflecting
properties of the last arithmetic or logical instruction.
• For example, if register AL = 7Fh and the instruction
ADD AL,1 is executed then the following happen
AL = 80h
CF = 0; there is no carry out of bit 7
PF = 0; 80h has an odd number of ones
AF = 1; there is a carry out of bit 3 into bit 4
ZF = 0; the result is not zero
SF = 1; bit seven is one
OF = 1; the sign bit has changed
15
BUS INTERFACE UNIT (BIU)
Contains
• 6-byte Instruction Queue (Q)
• The Segment Registers (CS, DS, ES, SS).
• The Instruction Pointer (IP).
• The Address Summing block (Σ)
16
THE QUEUE (Q)
yes
Opcode No
Take 2nd byte from Q as
Opcode queue opcode, decode 2nd byte
Opcode 2nd byte opcode
00000
The memory in an 8086/88
based system is organized as
segmented memory. Code segment (64KB)
1 MB
address 1Mbyte of memory.
Extra segment (64KB)
The Complete physically
available memory may be Stack segment (64KB)
divided into a number of logical
segments.
FFFFF
20
• The size of each segment is 64 KB
• A segment is an area that begins at any location which is
divisible by 16.
• A segment may be located any where in the memory
• Each of these segments can be used for a specific function.
23
24
MEMORY
00000
BIU
Segment Registers 34BA0
CODE (64k)
44B9F
34BA
CSR 44EB0
DATA (64K)
1 MB
44EB 54EAF
DSR
54EB0
ESR 54EB EXTRA (64K)
64EAF
695E 695E0
SSR
STACK (64K)
795D
F
34BA0(CS)+
8AB4(IP)
3 D 6 5 4 (next address)
44B9F
28
• Example For Address Calculation (segment: offset)
Segment Address
0001 0000 0000 0000 0000
29
Segment and Address register
combination
• CS:IP
• SS:SP SS:BP
• DS:BX DS:SI
30
Summary of Registers & Pipeline of 8086 µP
EU BIU
AX AH AL
BH BL IP
BX
CH CL Fetch &
CX D
store code CS DS ES SS
DH DL E
DX bytes in
C C
O PIPELINE C
O D PIPELINE O IP BX DI SP
SP D D
E (or) DI BP
BP E O QUEUE E
U I SI
SI R N
T
DI
Default Assignment
Timing
FLAGS ALU control
31