Professional Documents
Culture Documents
Archi & Organization
Archi & Organization
Archi & Organization
Module 2
Architecture of 8086 Microprocessor
Major features of 8086 processor.
8086 CPU Architecture and the
pipelined operation.
Programmer’s Model.
Memory Segmentation.
Features of 8086
Basic features of 8086
16-bit processor
16 bit ALU
16 bit registers and internal data bus
16-bit external data bus
Three versions based on the basis of frequency of operation
8086 – 5 MHZ
8086-2 – 8 MHZ
8086-1 – 10 MHZ
20-bit address lines to access memory
2^20 = 1MB memory locations
16-bit address lines to access I/O devices
It can access 2^16 = 64K I/O locations
Prepared by AJIT SARAF 2
Features of 8086
Special features of 8086
Pipelined processor
2 stage pipeline (Fetch stage and Execute stage)
Improves the performance
Operate in 2 modes
Minimum mode – A system with only 1 processor i.e. 8086
Maximum mode – A system with 8086 and other processor like
8087 (Math Co-processor), 8089 (IO processor) or multiple
8086 processor
Uses memory banks
Entire data is not stored sequentially within a single memory of
1 MB but divided into two banks of 512 KB each.
16-bit data can be accessed in an single access even though the
memory chip can store only 8-bit at a location.
Prepared by AJIT SARAF 3
Features of 8086
Special features of 8086
Uses memory segmentation
16-bit address in an instruction can access a memory
location however 8086 has 20 address lines.
Features of 8086
Miscellaneous features of 8086
256 vectored interrupts
Architecture
Architecture
8086 CPU is divided into two units
The bus interfacing unit (BIU)
The execution unit (EU)
Architecture
8086 CPU
Tasks of BIU Tasks of EU
It sends out addresses It tells the BIU, from where to fetch the
instruction or data.
It fetches instructions from memory It decodes the fetched instructions.
It reads data from memory and ports. It It executes the decoded instructions.
also writes data to memory and ports.
BIU takes care of all the address and data EU takes care of performing operations
transfer on the buses. on the data.
Flag Register
A flag is a flipflop.
Part of EU.
Flag Register
Sign
6 status flags
3 control flags
Flag Register
Three control flags
The trap flag (TF)
Puts the processor into single step mode for debugging.
In single stepping mode microprocessor executes a
instruction and enters into single step ISR.
User can check registers or memory contents.
This utility is to debug the program.
If TF = 1, the CPU automatically generates an internal
interrupt after each instruction .
It allows a program to be inspected as it executes
instruction by instruction.
Flag Register
Three control flags
The interrupt flag (IF)
CPU will recognize external (maskable) interrupt
requests.
Clearing IF disables these interrupts.
It has no effect on either non-maskable external or
internally generated interrupt.
It is used to allow or prohibit the interruption of a
program.
Flag Register
Three control flags
The direction flag (DF)
Specifically used for string instructions.
SI = Source Index, DI = Destination Index.
It controls direction of SI and DI pointers.
If DF = 1, the string instructions will automatically
decrement the pointers (SI & DI).
If DF = 0, the string instructions will automatically
increment the pointers (SI & DI).
Flag Register
Six Conditional (status) flags
Parity flag
Zero flag
Sign flag
Auxiliary carry flag
Carry flag
Overflow flag
8-bit registers – AH, AL, BH, BL, CH, CL, DH, DL.
16-bit registers – AX, BX, CX, DX, SI, DI, SP, BP.
Control Circuitry
Part of EU
Used for directing the internal operations.
Decoder
Decoding - Process of translation from instructions into
action.
But mainly they are used to hold the 16-bit offset of data word
in one of the segments.
Base Pointer (BP) register.
It holds 16 bit offset relative to the stack segment (SS)
register.
Used whenever we pass a parameter by way of stack.
Used as an offset register in base addressing mode.
Significance of queue
These instruction bytes are stored in the 6 byte queue on the first in
first out (FIFO) basis.
Thus the Queue will always hold the instruction bytes of the next
instructions to be executed by the EU.
Prepared by AJIT SARAF 28
Advantage of pipelining
Eliminates the waiting time of EU and speeds up the
processing.
8086 BIU will not initiate a fetch unless and until there are two
empty bytes in its queue.
What is Segmentation?
1MB of external memory is virtually or logically divided into
16 equal segments.
Adder
CODE
64K Data
Segment
STACK
DATA
EXTRA CS:0
64K Code
Segment
Segment
Registers
0FFFFFH
4000H
CS: 0400H
4056H
IP 0056H CS:IP = 400:56
Left-shift 4 Logical Address
bits Memory
Segment Register 0400 0
+ 0056
Offset 0FFFFFH
04056H
Physical or
Absolute Address
The offset is the distance in bytes from the start of the segment.
The offset is given by the IP for the Code Segment.
Instructions are always fetched Prepared by AJIT SARAF
with using the CS register. 38
Memory
0A00 0
Segment Register
+ 010 0
Offset
0FFFFFH
0A100H
Physical Address
The offset is given by the SP register.
The stack is always referenced with respect to the stack segment register.
The stack grows toward decreasing memory locations.
The SP points to the last or top item on the stack.
PUSH - pre-decrement the SP Prepared by AJIT SARAF 39
POP - post-increment the SP
05C00H
DS: 05C0
05C50H
EA 0050 DS:EA
Memory
Segment Register 05C0 0
+ 0050
Offset
0FFFFFH
05C50H
Physical Address
Data is usually fetched with respect to the DS register.
The effective address (EA) is the offset.
The EA depends on the addressing mode.
Prepared by AJIT SARAF 40
DS SI
ES DI
SS SP or BP
Advantages of Segmentation
Provides powerful memory management mechanism.
Instruction Pointer
Special purpose register in the BIU.
ES Extra Segment
BIU registers
(20 bit adder) CS Code Segment
SS Stack Segment
DS Data Segment
IP Instruction Pointer
EU registers AX AH AL Accumulator
BX BH BL Base Register
CX CH CL Count Register
DX DH DL Data Register
SP Stack Pointer
BP Base Pointer
SI Source Index Register
DI Destination Index Register
FLAGS
Dec-2016
2) Discuss the functions of general purpose registers of 8086. Explain the function of each
register and instruction support for these functions. (10 Marks)
May-2017
3) Explain memory segmentation of 8086. (05 Marks)
Dec-2017
4) Explain advantages of memory segmentation. (05 Marks)
Dec-2018
7) Draw and Explain the Flag register of 8086 microprocessor. (05 Marks)
May-2019
8) What is memory segmentation of 8086? Explain in brief. (05 Marks)
9) If (CS) = 5000H, (DS) = 6000H, (SS) = 7000H and (ES) = 8000, draw the memory map
8086 cpu with starting and end physical address of each segment. (05 Marks)
Dec-2019
10) Explain the instruction pipelining features of 8086. Give its advantages and disadvantages.
(05 Marks)