MP04 - 8086 Hardware
MP04 - 8086 Hardware
Objectives
ä Operation modes.
ä Pin descriptions.
ä Memory cycles.
References
1
1 Pin-outs of 8086 Processor
The pins of 8086 processor can be divided into different groups such as:
1. Address bus.
2. Data bus.
4. Interrupt pins
5. ...
2
ä The address/data and address/status buses are multiplexed to reduce the device
pin count. These buses are used to convey more than one signals at different
times.
The 20 pins (AD15 − AD0 and A19 /S6 − A16 /S3 ) are used to convey address,
data, and status signals.
ä The bus can be de-multiplexed using latches, transceivers, and control signals
to separate data and status signals from address signals.
ä Three signals ALE, DEN , and DT /R are used to control the operation of latches
and transceivers.
ALE used to store address in external latch
DEN indicates that valid data is available on the bus. It is used to enable
transceivers.
DT /R specify the direction of data flow through transceiver. DT /R = 1 in write
cycle and 0 for read cycle
8088 and 8086 microprocessors can be configured to run in one of two modes:
ä Pull M N /M X to logic 1
ä The 8086 directly produces the control signals for interfacing to memory and I/O
devices.
3
Minimum mode Pin Description
ä Address latch enable ALE: used along with 74LS373 latches to demultiplex
address data bus.
S4 – S3 Function
00 Extra segment
01 Stack segment
10 Code or no segment
11 Data segment
ä Reset: cause 80867 processor to terminate its present activity and perform
reset sequence.
ä Ready: used by memory and I/O device to indicate the presence of data on
the bus.
ä Bank High Enable BHE: this signal used with A0 to identify M/IO access as
follows:-
4
3.2 Maximum Mode
ä Pull M N /M X logic 0
ä Control signals are encoded in the status lines and need to be decoded externally
(8288 bus controller).
ä The 8086/8088 operate in maximum mode, so they are configured primarily for
multiprocessor operation or for working with 8087 coprocessor.
5
4 Bus Cycle and Time States
ä The processor communicates with memory/IO devices via the system bus to
transfer data or fetch instructions. This process is called bus cycle.
ä Types of bus cycle: memory read, memory write, input/output read and in-
put/output write.
ä During these operations, a series of control signals are also produced by the
processor to control the direction and timing of the bus.
ä Each bus cycle consists of at least four clock periods, T1, T2, T3, and T4. These
1
clock periods are also called the T-States ⇒ T =
f requency
ä The transfer rate depends on the operating frequency of the 8086 processor (5,
6, and 8 MHz) and data bus sizes.
1
T = = 200 ns
5 M Hz
Bus cycle = 4T = 800 ns
f bus − width
Data transfer rate = ∗ bytes per second.
n 8
5 16
For 16 bit data bus and f = 5 MHz, the maximum transfer rate = ∗ = 2.5
4 8
Mbyte/s
ä Each access to memory or IO device requires at least four clocks (each called T
state). During each clock period one or more operations are performed.
T1
1. The 8086 outputs the 20-bit address on the multiplexed address/data/status bus
via AD0 − AD15 and A19 /S6 − A16 /S3 .
6
5. BHE is used to enable/disable high memory bank.
T2
3. For the read cycle, AD15 − AD0 floated as input waiting for data from mmeory.
RD is delayed to provide time for floating.
For write cycle, data appears on the bus. WR becomes active at the beginning
of T2.
4. The DEN = 0 to turn the transceiver on. It remains active from the middle of
T2 to the middle of T4 .
5. READY signal is sampled at the end of T2. If memory is not ready (READY = 0),
T2 is repeated (T3 become wait state) until it READY become 1
T3
T4
2. All bus and control signals are deactivated in preparation for the next clock cycle.
7
5 Memory Interface and Address Decoding
ä Address decoder circuit is used to activate the intended device when the output
address is within its address range.
ä Unused pins are used to enable/disable memory. The output of the decoder is
connected to the CS (chip select) or OE (output enable) pins.
ä A single address decoder with n address input bits can serve up to 2n devices of
same size.
8
ä Address decoding circuits can be implemented with three different methods:
1. Logic gates.
2. Decoders
3. Programmable logic devices (PLDs) such as PLA, PAL, FPGA, and ASIC.
ä The I/O port address decoder is much like the memory address decoder, except
the I/O port decoder decodes only a l6-bit or 8 bit address.
1. Isolated I/O
2. Memory mapped I/O
ä The address space for I/O is isolated from that for memory. The full range of
addresses available for memory and I/O devices.
9
ä The I/O operations are performed by IN and OUT instructions).
ä 8-bit port address is used to access devices located on the system board (timer,keyboard)
ä 16-bit port address used to access (external devices), such as serial, parallel,
video card, and disk drive.
ä Depending on the length of port address, there are two type of addresses:
ä The address space is participated by memory and I/O devices (i.e. The CPU
treats the status, control, and data register as memory locations).
ä The same machine instructions are used to access both memory and I/O module.
ä Disadvantages:
10
Isolated versus Memory-mapped I/O
Example 4 - interface an input port 74LS245 to read the status of switches SW1-
SW8. Store status in BL register. The address of the port is 0740h.
XOR CL, CL
IN AL, 08
next1: RCR AL, 1
JC next2
11
INC CL
JMP next1
next2: MOV AL, CL
OUT 0Ah, AL
12