8086 and 8088 Microprocessor
8086 and 8088 Microprocessor
The first IBM PC was based on the i8088 processor. This device is fully software compatible with the
i8086, but it has an 8-bit external data bus (16-bit internally) and has a 4 byte instruction prefetch
queue. The 8086 and 8088 can really be considered together for our purposes.
The 8086/8088 microprocessor consists of two internal units: the execution unit (EU), which executes
the instructions, and the bus interface unit, which fetches instructions, reads operands and writes
results. This is sketched below (from Floyd’s book). The BIU allows some overlapping between
instruction fetching and execution.
Bus Interface
Unit(BIU)
Execution Unit
Fetches Opcodes,
(EU)
Reads Operands,
Writes Data
8086/8088 MPU
8086/8088 Architecture.
E U B IU
A d d r e s s B u s 2 0 b it s
A H A L S U M M A T IO N
B H B L
D a ta B u s
C H C L
C S
D H D L
D S
S P
S S
B P
E S
D I
IO
B I
I n te r n a l B us
C o m m u n i c a t io n s C o n tro l
R e g is te r s
8088
B us
T e m p o ra ry
R e g is t e r s
I n s tr u c t io n Q u e u e
A LU
E U
C o n tr o l
1 2 3 4
F la g s
Instruction Queue: this allows the next instructions or data to be fetched from memory while the
processor is executing the current instruction. The memory interface is usually much slower than the
processor execution time, so this decouples the memory cycle time from the execution time.
CS
IP
The Instruction Pointer (IP) and Address Summation: The IP contains the Offset Address of the next
instruction, which is the distance in bytes from the base address given by the current Code Segment
(CS) register. The figure shows how this is done.
The contents of the CS are shifted left by four. Bit 15 moves to the Bit 19 position. The lowest four
bits are filled with zeros. The resulting value is added to the Instruction Pointer contents to make up a
20-bit physical address. The CS makes up a segment base address and the IP is looked as an offset
into this segment.
This segmented model also applies to all the other general registers and segment registers in the
8086 device. For example, the SS and SP are combined in the same way to address the stack area in
physical memory.
Exercise:
1. The CS contains A820, while the IP contains CE24. What is the resulting physical address?
2. The CS contains B500, while the IP contains 0024. What is the resulting physical address?
The 8086 and 8088 microprocessors require some additional support circuit to operate in a
microcomputer system. For example, to fit in a 40-pin package, these processors multiplex the
address and data buses on the same pins. So some demultiplexing logic is needed to build up
separate address and data buses that can interface with devices like RAMs and ROMs. In fact, in
Maximum Mode the 8086 or 8088 needs to be supported by at least the following devices: 8288 Bus
Controller, 8284A Clock Generator as well as 74HC373 and 74HC245 devices. The block diagram is
as follows:
Note that in Maximum mode, the 8288 uses a set of status signals (S0, S1, S2) to rebuild the normal
bus control signals of the microprocessor (MRDC#, MWTC#, IORC#, IOWC# etc). We’ll just look at
the function of a few 8086/8288 pins briefly:
RESET: The processor reset input pin, clears the flags register, segment registers etc., sets the
effective program address to FFFF0h (CS=FFFFh, IP=0000).
BHE# (8086 only): Bus High Enable (BHE#) is used with the A0 signal to help interface the 16-bit data
bus of the 8086 to byte-wide memory. The table shows how BHE# and A0 are used together:
Byte-Wide addressing
ODD Addresses (8086) EVEN Addresses (8086)
(8088)
FFFFF FFFFF FFFFE
FFFFE FFFFD FFFFC
FFFFD FFFFB FFFFA
FFFFC FFFF9 FFFF8
A19..A1 A19..A1
D15:D8 D7:D0
BHE# A0
This scheme applies even when16-bit memories are used. It allows the 8086 to access byte data.
Similar schemes allow 32-bit processors like the 80386 to access byte data.
C lock
A ddress/
A ddress D ata Tim e
D ata
Tim e
Bus
ALE
O utput of
Microcom puter A ddressBus
74H C 373
A LE
LE
O E#
The 8288 Bus Controller generate the DEN# and DT/R# signals that control the Enable and Direction
Control inputs, respectively, of a 74HC245 bi-directional transceiver, which is placed between the
processor’s address/data bus and the data bus of the microcomputer.
Can you see why multiplexed address/data buses had to be abandoned in high performance Intel
processors?
The following figures show an 8086/8088 read, write and I/O cycles.
Recall that microprocessors are clocked synchronous state machines, that is, they perform some
action when they receive a clock edge. That’s why we show the clock signal in the following
diagrams: the processor bus unit takes some action when the clock signal occurs.
• The 4 processor clock cycles are called T states. Four cycles is the shortest time that the
processor can use for carrying out a read or an input cycle.
• At the beginning of T1, the processor outputs S2, S1, S0, A16/S3…A19/S6, AD0..AD15 and
BHE#/S7.
• The 8288 bus controller transitions the ALE signal from low to high, thereby allowing the address
to pass through the transparent latches (74HC373). The address, along with the BHE# signal is
latched when ALE goes low, providing the latched address A0..A19.
• During T2 the processor removes the address and data. S3..S6 status is output on the upper 4
address/status lines of the processor.
• The AD0..AD15 signals are floated as inputs, waiting for data to be read.
• Data bus transceivers (74HC245) are enabled towards the microprocessor (the READ direction)
by the DT/R# and DEN signals.
• The signals are maintained during T3. At the end of T3 the microprocessor samples the input
data.
• The 4 processor clock cycles are called T states. Four cycles is the shortest time that the
processor can use for carrying out a write or an output cycle.
• At the beginning of T1, the processor outputs S2, S1, S0, A16/S3…A19/S6, AD0..AD15 and
BHE#/S7.
• The 8288 bus controller transitions the ALE signal from low to high, thereby allowing the address
to pass through the transparent latches (74HC373). The address, along with the BHE# signal is
latched when ALE goes low, providing the latched address A0..A19.
• During T2 the processor removes the address and data. S3..S6 status is output on the upper 4
address/status lines of the processor.
• Data bus transceivers (74HC245) are enabled away from the microprocessor (the WRITE
direction) by the DT/R# and DEN signals.
• The MWRC# (ie MEMW#) or IOWC# (IOW#) signal is asserted at the beginning of T3.
• During T4 the memory and I/O control lines are de-asserted. In simple Intel Architecture systems,
the data is usually written to the memory or output device at the rising edge of the MWRC# or
IOWC# signal.
Wait States are used to help interface to slow memory or I/O devices. The READY input signal on the
8086 is used to insert wait states into the processor bus cycle, so that the processor stretches out its
read or write cycle, to accommodate the slow device.
The normal memory or I/O cycle on an 8086 is 4 clocks long – T1 to T4. Wait states , called Tw can
be inserted in the bus cycle as follows:
The 8086 READY line is sampled at the rising edge of T3. If READY is low, a WAUT state is inserted.
During the WAIT state the READY is sampled again at the next rising edge of the clock, and another
WAIT is inserted if READY is still low. A number of further WAIT states can be inserted in this way.
The memory or I/O device can initiate WAIT state generation by bringing a RDY signal low. To
synchronise the 8086 READY signal and to ensure that the 8086 timing requirements are met the
memory device’s RDY signal is normally connected to the 8284’s RDY input. The memory device
needs to bring RDY low prior to the rising edge of the 8086’s T2 clock. The 8284 drives the 8086
READY signal low at the falling edge of T2. When the 8086 samples READY at the rising of T3 it
finds that it is low, and it inserts a WAIT state for the next clock state. The memory device has to bring
RDY high early in T3 so that the 8284 can bring READY high before the rising edge of T3 if another
WAIT state is to be avoided.
The figure below shows a read or input cycle using WAIT states.