MPI- Material (3)
MPI- Material (3)
Module II
1
8086 Micro processor Features
1. It is a 16-bit μp.
2. 8086 has a 20 bit address bus can access up to 220
memory locations (1 MB).
3. It can support up to 64K I/O ports.
4. It provides 14, 16 -bit registers.
5. Word size is 16 bits.
6. It has multiplexed address and data bus AD0- AD15
and A16 – A19.
7. It requires single phase clock with 33% duty cycle to
provide internal timing.
2
1. 8086 is designed to operate in two modes, Minimum
and Maximum.
4
Internal architecture of 8086
1. 8086 has two blocks BIU and EU.
2. The BIU handles all transactions of data and
addresses on the buses for EU.
6
EXECUTION UNIT
1. Control Circuitry
2. Instruction decoder
3. ALU
7
EXECUTION UNIT – General Purpose Registers
16 bits
8 bits 8 bits
AH AL Accumulator
AX
BX
BH BL Base
CX
CH CL Count
DX DH DL
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 - 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
1. Six of the flags are status indicators reflecting
properties of the last arithmetic or logical instruction.
2. 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
1. 6-byte Instruction Queue (Q)
2. The Segment Registers (CS, DS, ES, SS).
3. The Instruction Pointer (IP).
4. The Address Summing block (Σ)
16
THE QUEUE (Q)
1. The BIU uses a mechanism known as an instruction
stream queue to implement a pipeline architecture.
17
1. These pre-fetching instructions are held in its
FIFO queue. With its 16 bit data bus, the BIU
fetches two instruction bytes in a single memory
cycle.
18
Physical Memory
Segmented Memory
00000
1 MB
address 1Mbyte of memory.
Extra segment (64KB)
19
1. The size of each segment is 64 KB
2. A segment is an area that begins at any location which
is divisible by 16.
3. A segment may be located any where in the memory
4. Each of these segments can be used for a specific
function.
22
23
MEMORY
00000
BIU
Segment Registers 34BA0
CODE (64k)
44B9F
CSR 34BA
44EB0
DATA (64K)
MB
1
DSR 44EB 54EAF
54EB0
ESR 54EB EXTRA (64K)
64EAF
SSR 695E 695E0
STACK (64K)
795DF
3 4 BA 0 ( C S ) +
8A B 4 ( I P )
3 D 6 5 4 (next address)
44B9F
27
Example For Address Calculation
(segment: offset)
If the data segment starts at location 1000h and a
data reference contains the address 29h
where is the actual data?
28
Segment and Address register
combination
1. CS:IP
2. SS:SP SS:BP
3. DS:BXDS:SI
29
Summary of Registers &
Pipeline of 8086 µP
EU BIU
AX AH AL
BX BH BL IP
CX CH CL D Fetch &
store code CS DS ES SS
DX DH DL E
bytes in
C C
O PIPELINE C
O O IP BX DI SP
D PIPELINE
SP D D
E (or) DI BP
E O QUEUE E
BP SI
U I
SI R N
T
DI
Default Assignment
Timing
FLAGS
ALU control
30
8086 Pin diagram
31
Power Connections
33
Pin Description
34
Address Lines
A14 2 39 A15
A13 3
A12 4
38 A16
A11 5
A10 6
37 A17
A9 7
A8 8 8086
A7 9 36 A18
A6 10
A5 11 35 A19
A4 12
A3 13
A2 14
A1 15
A0 16
Continued…
35
A19/S6, A18/S5, A17/S4, A16/S3 – Pin no. 35-38
Continued…
36
A17/S4 A16/S3 Characteristics
0 (LOW) 0 Alternate Data
0 1 Stack
1(HIGH) 0 Code or None
1 1 Data
S6 is 0 (always
LOW)
This information indicates which relocation register is
presently being used for data accessing.
37
Status Pins S0-S7
38 S3
37 S4
36 S5
35 S6
34 S7
8086
28 S2 (M/ I O )
27 S1 (DT/ R )
S 0 ( DE N)
26
Continued…
38
Pin Description
Continued…
39
These signals float to 3-state OFF in “hold acknowledge”.
These status lines are encoded as shown.
40
Status Details
S2 S1 S0 Indication
0 0 0 Interrupt Acknowledge
0 0 1 Read I/O port
0 1 0 Write I/O port
0 1 1 Halt
1 0 0 Code access
1 0 1 Read memory
1 1 0 Write memory
1 1 1 Passive
Continued…
41
S4 S3 Indications
0 0 Alternate data
0 1 Stack
1 0 Code or none
1 1 Data
Continued…
42
S5 ----- Value of Interrupt Enable flag
43
Interrupts
Pin Description:
NMI – Pin no. 17 – Type I
8086
Non – Maskable Interrupt: an edge
triggered input which causes a type 2
NMI 17
interrupt. A subroutine is vectored to via
INTR 18 an interrupt vector lookup table located
in system memory. NMI is not maskable
internally by software. A transition from
a LOW to HIGH initiates the interrupt at
the end of the current instruction. This
input is internally synchronized.
Continued…
44
INTR – Pin No. 18 – Type I
Interrupt Request: is a level triggered input which is sampled
during the last clock cycle of each instruction to determine if
the processor should enter into an interrupt acknowledge
operation. A subroutine is vectored to via an interrupt vector
lookup table located in system memory. It can be internally
masked by software resetting the interrupt enable bit. INTR
is internally synchronized. This signal is active HIGH.
45
Min mode signals
33 VCC MN/ MX
31 HOLD
30 HLDA
29 WR
28 M/I O
8086
27 DT/ R
26 DEN
25 ALE
24 INTA
Continued…
46
Pin Description
HOLD, HLDA – Pin no. 31, 30
HOLD: indicates that another master is requesting a
local bus “hold”. To be acknowledged, HOLD must be
active HIGH. The processor receiving the “hold” request
will issue HLDA (HIGH) as an acknowledgement in the
middle of a T1 clock cycle. Simultaneous with the
issuance of HLDA the processor will float the local bus
and control lines. After HOLD is detected as being LOW,
the processor will LOWer the HLDA, and when the
processor needs to run another cycle, it will again drive
the local bus and control lines.
The same rules as apply regarding when the local bus will
be released.
HOLD is not an asynchronous input. External
synchronization should be provided if the system can not
otherwise guarantee the setup time.
Continued…
47
WR* - Pin no. 29
Write: indicates that the processor is performing a write
memory or write I/O cycle, depending on the state of the
M/IO* signal. WR* is active for T2, T3 and TW of any write cycle.
It is active LOW, and floats to 3-state OFF in local bus “hold
acknowledge”.
Continued…
48
DT/R* - Pin no. 27
Data Transmit / Receive: needed in minimum system that
desires to use an 8286/8287 data bus transceiver. It is used
to control the direction of data flow through the
transceiver. Logically DT/R* is equivalent to S1* in the
maximum mode, and its timing is the same as for M/IO*.
(T=HIGH, R=LOW). This signal floats to 3-state OFF in
local bus “hold acknowledge”.
DEN* - Pin no. 26
Data Enable: provided as an output enable for the
8286/8287 in a minimum system which uses the transceiver.
DEN* is active LOW during each memory and I/O access
and for INTA cycles. For a read or INTA* cycle it is active
from the middle of T2 until the middle of T4, while for a
write cycle it is active from the beginning of T2 until the
middle of T4. DEN* floats to 3-state OFF in local bus “hold
acknowledge”.
Continued…
49
ALE – Pin no. 25
Address Latch Enable: provided by the processor to latch
the address into the 8282/8283 address latch. It is a HIGH
pulse active during T1 of any bus cycle. Note that ALE is
never floated.
50
Max mode signals
33 GND
31 RQ/ GT0
30 RQ/ GT1
29 LOCK
28 S2
8086
27 S1
26 S0
25 QS0
24 QS1
Continued…
51
Pin Description:
RQ*/GT0*, RQ*/GT1* - Pin no. 30, 31
Request /Grant: pins are used by other local bus masters to
force the processor to release the local bus at the end of
the processor’s current bus cycle. Each pin is bidirectional
with RQ*/GT0* having higher priority than RQ*/GT1*.
RQ*/GT* has an internal pull up resistor so may be left
unconnected.The request/grant sequence is as follows:
Continued…
52
1. A pulse of 1 CLK wide from another local bus master
indicates a local bus request (“hold”) to the 8086 (pulse 1)
2. During a T4 or T1 clock cycle, a pulse 1 CLK wide from the
8086 to the requesting master (pulse 2), indicates that the
8086 has allowed the local bus to float and that it will enter
the “hold acknowledge” state at the next CLK. The CPU’s
bus interface unit is disconnected logically from the local bus
during “hold acknowledge”.
3. A pulse 1 CLK wide from the requesting master indicates to
the 8086 (pulse 3) that the “hold” request is about to end
and that the 8086 can reclaim the local bus at the next CLK.
Continued…
53
Each master-master exchange of the local bus is a sequence
of 3 pulses. There must be one dead CLK cycle after each
bus exchange. Pulses are active LOW.
If the request is made while the CPU is performing a
memory cycle, it will release the local bus during T4 of the
cycle when all the following conditions are met:
Request occurs on or before T2.
Current cycle is not the low byte of a word (on an odd
address)
Current cycle is not the first acknowledge of an interrupt
acknowledge sequence.
A locked instruction is not currently executing.
Continued…
54
LOCK* - Pin no. 29 – Type O
LOCK* : output indicates that other system bus masters are not
to gain control of the system bus while LOCK* is active LOW.
The LOCK* signal is activated by the “LOCK” prefix instruction
and remains active until the completion of the next instruction.
This signal is active LOW, and floats to 3-state OFF in “hold
acknowledge”.
QS1, QS0 – Pin no. 24, 25 – Type O
Queue Status: the queue status is valid during the CLK cycle
after which the queue operation is performed.
QS1 and QS0 provide status to allow external tracking of the
internal 8086 instruction queue.
Continued…
55
QS1 QS0 Characteristics
0(LOW) 0 No operation
0 1 First Byte of Op Code from Queue
1 (HIGH) 0 Empty the Queue
1 1 Subsequent byte from Queue
56
Common Signals
Continued…
57
Pin Description:
Continued…
58
TEST* - Pin No 23
TEST* : input is examined by the “Wait” instruction. If the TEST* input
is LOW execution continues, otherwise the processor waits in an “idle”
state. This input is synchronized internally during each clock cycle on
the leading edge of CLK.
Continued…
59
BHE*/S7- Pin No. 34
Bus High Enable / Status: During T1 the Bus High Enable signal
(BHE*) should be used to enable data onto the most significant half of
the data bus, pins D15-D8. Eight bit oriented devices tied to the upper
half of the bus would normally use BHE* to condition chip select
functions. BHE* is LOW during T1 for read, write, and interrupt
acknowledge cycles when a byte is to be transferred on the high portion
of the bus. The S,7 status information is available during T2, T3 and T4.
The signal is active LOW and floats to 3-state OFF in “hold”. It is LOW
during T1 for the first interrupt acknowledge cycle.
BHE* A0 Characteristics
0 0 Whole word
0 1 Upper byte from / to odd address
1 0 Lower byte from / to even address
1 1 None
Continued…
60
MN/MX* - Pin no. 33
Minimum / Maximum: indicates what mode the
processor is to operate in.
If the local bus is idle when the request is made the two
possible events will follow:
Local bus will be released during the next clock.
A memory cycle will start within 3 clocks. Now the
four rules for a currently active memory cycle apply with
condition number 1 already satisfied.
61
Minimum Mode 8086 System
MRD
MWR
DMUX IORD
IOWR
62
A minimum mode of 8086 configuration depicts a
stand alone system of computer where no other
processor is connected. This is similar to 8085 block
diagram with the following difference.
The Data transceiver block which helps the signals
traveling a longer distance to get boosted up. Two
control signals data transmit/ receive are connected
to the direction input of transceiver
(Transmitter/Receiver) and DEN* signal works as
enable for this block.
63
Read Cycle timing Diagram for Minimum
Mode
64
In the bus timing diagram, data transmit / receive
signal goes low (RECEIVE) for Read operation. To
validate the data, DEN* signal goes low. The
Address/ Status bus carries A16 to A19 address lines
during BHE* (low) and for the remaining time carries
Status information. The Address/Data bus carries A0
to A15 address information during ALE going high
and for the remaining time it carries data. The RD*
line going low indicates that this is a Read operation.
The curved arrows indicate the relationship between
valid data and RD* signal.
The TW is Wait time needed to synchronize the fast
processor with slow memory etc. The Ready pin is
checked to see whether any peripheral needs more
time for data transmission.
Continued…65
Write Cycle timing Diagram for Minimum
Operation
66
This is the same as Read cycle Timing Diagram
except that the DT/R* line goes high indicating it is a
Data Transmission operation for the processor to
memory / peripheral.
Again DEN* line goes low to validate data and
WR* line goes low, indicating a Write operation.
67
Bus Request & Bus Grant Timings in
Minimum Mode System
69
In the maximum mode of operation of 8086, wherein
either a numeric coprocessor of the type 8087 or another
processor is interfaced with 8086.
The Memory, Address Bus, Data Buses are shared
resources between the two processors.
The control signals for Maximum mode of operation are
generated by the Bus Controller chip 8788.
The three status outputs S0*, S1*, S2* from the processor
are input to 8788. The outputs of the bus controller are the
Control Signals, namely DEN, DT/R*, IORC*, IOWTC*,
MWTC*, MRDC*, ALE etc.
These control signals perform the same task as the
minimum mode operation.
However the DEN is an active HIGH signal which has to be
converted to active LOW by means of an inverter.
70
Memory Read timing in Maximum Mode
Here MRDC* signal is used instead of RD* as in case of Minimum
Mode S0* to S2* are active and are used to generate control signal.
71
Memory Write Timing in Maximum Mode
Here the maximum mode write signals are shown. Please note that the T states
correspond to the time during which DEN* is LOW, WRITE Control goes LOW,
DT/R* is HIGH and data output in available from the processor on the data bus.
72
RQ*/ GT* Timings in Maximum Mode
Request / Grant pin may appear that both signals are active
low. But in reality, Request signal goes low first (input to
processor), and then the processor grants the request by
outputting a low on the same pin.
73
8284 Clock Generator
74
8284 Block Diagram
TANK
F/C CSYNC
X1 OSC
X2 CLOCK
PCLK
LOGIC
EFI CLK
RDY1
AEN1 READY
READY
RDY2 LOGIC
AEN 2
RESET LOGIC
RES RESET
75