Chapter 2 8086
Chapter 2 8086
PROGRAMMING
CHAPTER 2
16 BIT
MICROPROCESSOR 8086
FEATURES OF 8086 MICROPROCESSOR
16 bit microprocessor
20 address lines i.e 2^20=1MB memory addressed.
16 bit address and data bus multiplexed i.e AD0-AD7 to
minimize no of pin on IC
Clock frequency between 5Mhz-10Mhz
Arithmetic operation on 8 bit or 16 bit signed or unsigned data
including multiplication 7 division.
Operate in single processor or multiprocessor
Instruction set-> powerful->flexible.
256 interrupt
Operate in max& min mode to achieve high performance
Support multiprogramming
Separate instruction set for string manipulation.
Architecture of 8086 microprocessor
ARCHITECTURE OF 8086
It is divided into 2 parts
1) Bus interface unit (BIU)
2) Execution unit (EU)
Bus Interface unit :=
- It acts as interface between system bus and the execution unit.
- Fetches instruction from memory.
- Reads data from I/O ports and memories.
- Writes data to ports and memories
- Supports pipelining.
- BIU handles transfer of data on all the buses for the execution unit.
Blocks of BIU:=
1) Queue=
- To speed up the program execution BIU fetches as many as 6 instruction
bytes from memory .
- These pre-fetched instruction byte for execution unit in FIFO group of
registers called a QUEUE.
Concept of pipelining:=
-fetching the next instruction while recent instruction executes is known as
pipelining.
- 6
5
4
3
2
1
I1 I2 I3 I4 I5 I6 I7 I8 I9
1 2 3 4 5 6 7 8 9
Clock
cycle F I1 I2 I3 I4 I5 F-Fetch
D I1 I2 I3 I4 D-Decode
E I1 I2 I3 E-Executes
Clock
Fig: pipelined execution of 3 instruction
cycle 1 2 3 4 5
1. On non pipelined processor 9 clock cycle are required for individual fetch ,
decode & execute for 3 instruction.
2. On pipelined processor fetch, decode & execute operation are performed in
parallel.
3. -only 5 cycle are required to execute 3 instruction.
4. - 1 instruction requires -> 3 cycle to completes.
5. Additional instruction complete at rate of one per cycle.
6. During clock cycle 5 I3 instruction executing , I4 is decoding , I5 instruction
fetched.
7. If 1000 instruction it requires 3000 clock cycle on non pipelined
processor.----> require 1002 clock cycle on pipelined processor.
8. In 8086 performs fetch , decode , & executes instruction in parallel.
2) Segment Register :=
-The BIU contain 4 16 bit segment registers
- it hold upper 16 bit of starting address of 4 memory segment that 8086 is
working with particular time .
- Es hold upper 16 bits of starting address of extra segment
- Cs hold upper 16 bits of starting address of code segment
- Ss & Ds hold upper 16 bit of starting address of stack segment & data
segment.
ES
Segment Register
CS
SS
DS
IP Instruction pointer
Multiplexed address
& status pins
Multplexed address
and data bus
Interrupt Pins
- 8086 operates into 2 modes
- 1) minimum mode
2) Maximum mode
The following pins are important in both minimum & maximum mode
1) CLK( pin no-19)
- The maximum clock frequency 5-10MHZ
- Provides basics timing for processor & bus controller.
- It is symmetric square wave with 33% duty cycle.
-
10) INTR (pin no-18) Interrupt request
-High level triggered interrupt request i/p
-Checked last clock to check availability of request
-If request is not occurred ,processor enters interrupt acknowledge cycle
7) HOLD
-Active high i/p signal
8) HLDA
- Active high o/p signal
* Signal description of pins for maximum mode:=
1) Qs1 ,Qs0 (pin no-24,25) queue status
Qs1 Qs0 features
0 0 no operation
0 1 first byte of opcode from queue
1 0 empty the queue
1 1 subsequent byte from queue
- Are status lines which indicate the type of operation, being carried out by
processor.
S2 S1 S0 Status
0 0 0 Interrupt Acknowledge
0 0 1 I/O read
0 1 0 I/O write
0 1 1 Halt
1 0 0 Op-code Fetch
1 0 1 Memory Read
1 1 0 Memory Write
1 1 1 Passive
Intel
Adder
6FFE0 H SP = FFE0
Physical address
0123
Start of stack
60000 H
segment SS: 60000
+
SP: FFE0
=
Physical address 6FFE0
x1 Clock
x2 Clock Logic OSC
EF1 PCLK
RDY1
AEN1
Ready Logic
RDY2 READY
AEN2
+5V
Clock CLK M /IO
REA DY Control
generator INTA
RES RES ET Bus
RD
AE N2 WR
AE N1
F/C M N/M X +5V
8086 C P U
AD0-AD 15 Latch
A16-A19
BHE BHE
D0 - D15
(74LS245)
8286 16
DT/R T
DEN OE
PROCESSOR TIMING DIAGRAM OF 8086 (MINIMUM
MODE)
FOR MEMORY OR I/O READ
T1 T2 T3 T4
CLOCK
__
DT/R
ALE
__
IO/M if I/O ACCESS this is HIGH, if MEMORY ACCESS this is LOW
____
RD
______
DEN
PROCESSOR TIMING DIAGRAM OF 8086 (MINIMUM
MODE)
FOR MEMORY OR I/O WRITE
T1 T2 T3 T4
CLOCK
__
DT/R
ALE
__
IO/M if I/O ACCESS this is HIGH, if MEMORY ACCESS this is LOW
____
WR
______
DEN
8086 System Maximum Mode
+5V
M N/M X Gnd CLK M RDC
CLK
S0 S0
Clock REA DY M W TC
RES S1 S1
B u s C o n tro lle r
generator AM W C
S2 S2
8 2 88
RES ET IORC
DEN IOW C
DT/R AIOW C
Wait-State ALE INTA
Generator
8086 C P U
STB A0 - A19
OE
Address Bus
8282
AD0-AD 15
A16-A19 Latch BHE
T
OE DATA
8286
Transceiver
PROCESSOR TIMING DIAGRAM OF 8086(MAXIMUM
MODE)
FOR MEMORY OR I/O READ
T1 T2 T3 T4
CLOCK
__
DT/R
ALE
MDRC/IORC
______
DEN
PROCESSOR TIMING DIAGRAM OF 8086(MAXIMUM
MODE)
FOR MEMORY OR I/O WRITE
T1 T2 T3 T4
CLOCK
__
DT/R
ALE
MWTC &IOWC
AMWC/AIOWC
______
DEN