Académique Documents
Professionnel Documents
Culture Documents
INTRODUCTION
I t may initially appear to be a long step from the generic microprocessor of the previous sec-
tion to a real PC system, but in reality it’s not. In this section we will investigate how ad-
vanced microprocessors used in 8-, 16-, 32- and 64-bit systems expand the basic concepts
developed in the $1.98 computer. This investigation includes the 80386SX microprocessor
used in the Turbo-PC system. The overall operation of both systems is based on the same
fundamental, binary concepts. As a matter of fact, both computers could have been con-
structed using only the basic NAND and NOR gates.
Figure 1 depicts the various blocks that make up an 8088-based, XT-compatible system and
illustrates how these blocks are connected together. Understanding and working with any
electronic system (digital systems included) requires that you understand the function of the
individual blocks which make up the system.
At the heart of PC and PC-XT compatible systems is the 40-pin 8088 mP. The 8088 is a high
performance HMOS microprocessor which has attributes of both 8 and 16-bit processors. Its
internal structure supports 16-bit words but it only uses an 8-bit data bus. In this manner, its
internal data registers can be used as single 16-bit registers, divided into higher and lower or-
der bytes, or used as independent 8-bit register pairs. This allows the 8088 to perform both 8
and 16-bit signed and unsigned arithmetic operations, using binary or decimal numbers.
These operations include both multiplication and division. The 8088 supports a 20-bit ad-
dress bus that allows it to directly access 1 Megabyte (1,048,576) of memory and I/O ad-
dresses.
The 8088-2 version can run at either of two standard clock rates; a 4.77 MHz normal clock
frequency and a high-speed (Turbo) 8 MHz clock frequency. In addition, the 8088 can be
used in two configuration modes: (1) maximum mode, in which the system uses a full line of
8088 support chips and can accommodate high speed numeric and I/O co-processors, and (2)
minimum mode, where the 8088 handles system functions, such as bus control, by itself. In
PC compatibles, the 8088 is configured for maximum mode operation.
Figure 2:
Inside the 8088
The most interesting of these registers has to be the data group (AX, BX, CX and DX).
These highly flexible registers are unique in that each can be treated as a single 16-bit regis-
ter, or they may be used as two, independent 8-bit registers (AH and AL, BH and BL, CH and
CL, and DH and DL). The “H” and “L” designators refer to the higher and lower order bytes
of the basic 16-bit register. All of these registers correspond roughly to the accumulator reg-
ister. Arithmetic and logic operations can be performed, and results can be stored in each of
the data registers. (These operations can also be performed in the two index and pointer reg-
isters).
Although the data registers can be used to perform a number of different functions, each is
assigned at least one specialized function. The AX register is designated as the 8088’s “offi-
cial” accumulator register. It is also used in all input and output instructions, such as fetching
data from the keyboard buffer and outputting data bytes to the display memory. The BX or
base register is used by the 8088 to perform a special form of memory addressing called in-
dexed addressing. The CX, or count register is used as a counter to keep track of the number
of times certain repetitive operations are performed. The DX, or data register is used by the
system to hold I/O port addresses during input/output instructions.
Figure 3:
8088 Addressing
During execution cycles, the address produced is the sum of the operand address portion of
the instruction word and the contents of one of the segment registers (DS, SS, or ES). In spe-
cial addressing operations involving the Stack, the contents of the Stack Segment (SS) reg-
ister is added to the contents of either the Base Pointer (BP) or the Stack Pointer (SP)
registers to obtain the address. The Data Segment (DS) register is used whenever data is
moved to or from the memory. These combinations can be confusing at times, but fortu-
nately, most of the time these combinations are performed automatically by the hardware.
Another interesting aspect of the 8088’s internal structure is the presence of four, 1-byte in-
struction registers configured for First-In, First-Out (FIFO) operation. This block of regis-
ters is referred to as the instruction queue and is used by the 8088 to pre-fetch instructions
from memory before they are needed. This speeds up the execution of programs by allowing
the 8088 to execute instructions from the on-board queue instead of waiting for a Memory
Read cycle to be performed.
The 8088’s control unit works to keep the instruction queue filled at all times. When a JUMP
instruction is encountered in the program, the control unit “dumps” the contents of the queue
and begins reloading it, starting with the instruction at the address indicated by the JUMP in-
struction. The operation of the instruction queue is performed automatically by the 8088.
Figure 4:
8088 Pin
Assignments
The most notable of the multiplexed pins are the address/data lines (AD0–AD7) and the ad-
dress/status pins (A16/S3–A19/S6). Pins AD0 through AD7 are time-multiplexed to act as
address lines during the first clock pulse of the machine cycle, and then turn into bi-
directional data lines throughout the remainder of the machine cycle. Likewise, the ad-
dress/status pins are multiplexed to act as address lines during the first clock pulse and then
change to processor status lines for the remainder of the machine cycle. The S3 through S6
lines are special status lines used to indicate the segment register used during memory ac-
cesses. These lines could be used for advanced addressing techniques, but most XT-
compatibles do not use them.
Collectively, the AD0–AD7, A8–A15, and A16/S3–A19/S6 lines are combined to form the
system’s 20-bit address bus. The XT type computer uses two 74LS373 transparent octal
latches to latch address bits AD0–AD7 and A16–A19 during the first clock pulse and hold
them throughout the machine cycle. A line buffer IC is used for the non-multiplexed address
bits (A8–A11). The outputs of these three devices provide the demultiplexed, 20-bit address
bus for the system. In addition, they also free-up the lines to carry data through the remainder
of the machine cycle. The operation of the address latches is controlled by the Address
Latch Enable (ALE) signal from the bus controller IC (see the Status/Control Lines below).
The 8088 uses the entire 20-bits when it is addressing memory locations, but only lines A0
through A15 are used when addressing Input/Output devices.
Figure 5:
System Bus
Demultiplexing
Status/control Lines
In maximum mode, the 8088 employs an 8288 bus controller IC to allow some of its pins to
perform more advanced functions. The 8088 issues binary coded control signals to the 8288
via its S0-S2 status lines. The 8288 decodes these signals and develops bus control signals
for the system. We’ve already discussed several of these signals in the preceding section.
When the 8088 is used in minimum mode, its pins assume many of the typical microproces-
sor control line definitions.
The NMI pin represents a slightly different type of interrupt request, in that its effects cannot
be ignored by the processor. When a high priority device, such as the power supply, parity
checking circuitry, or other circuits which require the ability to absolutely interrupt the mP,
needs to communicate with the mP, it simply places a signal on the NMI line and the 8088
must respond. Unlike the INTR line, which is active high, the NMI line is an edge-triggered
signal, meaning that it is activated by a transition from one logic level to the other, instead of
by a given logic level.
The 8088’s READY line serves exactly the same purpose as the one described there. Any de-
vice which cannot place data on the data bus in the time allotted by the 8088’s machine cycles
can force the mP to stop and wait, by dropping this line to a low logic level. The 8088 pro-
duces the WAIT state by inserting extra clock cycles into its machine cycle. During the
WAIT state, the 8088 does nothing but wait for its READY line to return to a high logic level.
If the READY line is held low for longer than 2 microseconds, the 8088 will lock-up and stop
processing (crash).
The READY line is also used by the DMA controller to cause the 8088 to insert extra wait-
state clock pulses in its machine cycle during high speed DMA transfer activities. During
these activities, the DMA controller takes control of the system’s data, address, and control
buses at the end of a machine cycle, to carry out high-speed data transfers. These transfers are
also dependent on the 8088’s LOCK line being in a high state. This line is used by the 8088 to
deny other processors, or processor-like devices, such as the DMA controller or math co-
processors, access to memory locations during critical operations.
Miscellaneous Pins
As is the case with all IC chips, the 8088 must have power supply connections. These consist
of a single +5Vdc pin (40) and two ground pins (1 and 20). Recall that without proper supply
voltages, IC’s simply don’t work.
Equally essential to a mP is its clock input. The 8088’s clock input is supplied by an 8284
clock generator whose purpose is to keep te different devices in the system synchronized.
The signal applied to the 8088 is an asymmetrical square wave with a 33% duty factor. That
is, the clock signal is high only 33% of the time. The 8088-2 version of the 8088 mP has two
standard clock rates that it can operate with; a standard 4.77MHz signal and the turbo 8MHz
clock signal. In these turbo machines, the 8088’s clocking mode can usually be selected by a
software command, or by a hardware jumper located on the system board.
The function of the 8088’s RESET line is the same as that of the RESET pin . When the sys-
tem is booted-up (either a cold or a warm boot), the RESET line goes high and the 8088
clears its DS, ES and SS, and its IP registers to zero. The CS register is set to FFFF. There-
fore, the first instruction word address produced by the 8088 after the RESET Line returns to
a high logic state is FFFF0. This is, of course, the starting address of the ROM BIOS start-up
routine.
Although PC and PC-XT compatibles use the 8088 in maximum mode, it can also be used in
minimum mode (without the 8288 bus controller) quite effectively. The 8088’s mode of op-
eration is governed by the logic level applied to the MN/MX pin. A high logic level at this pin
places the 8088 in minimum mode, while a low logic level places it in maximum mode.
The Turbo-PC only uses the 8088 in maximum mode, so the MN/MX pin is tied low (GND).
It’s worth noting that in maximum mode, the two remaining pins, Read Data (RD) and a spe-
cial status line (SS0) are not used.
Table 1:
S2 S1 S0 CHARACTERISTICS
8288 Select Codes
0 (LOW) 0 0 INTERRUPT ACKNOWLEDGEMENT
0 0 1 READ I/O
0 1 0 WRITE I/O
0 1 1 HALT
When the bus controller receives the status signals from the 8088, it decodes them and gener-
ates either a memory read (MEMR), memory write (MEMW), I/O read (IOR), or I/O
write (IOW) signal, to carry out the CPU’s wishes. The signal is produced after it has caused
the address to be latched into the 74LS373, through it’s ALE signal. All of the control bus
signals are active low. (They are normally held in a high logic state and go to a low logic state
when the bus controller activates them).
The machine cycle for the 8088 requires at least four clock cycles. These are referred to as
T1, T2, T3, and T4: T1 always begins the machine cycle and T4 will always indicate the end
of the machine cycle. A machine cycle for a Read I/O operation is illustrated in Figure 7. This
figure shows the major signals necessary to read a byte of data from an I/O port.
The first signal to note is the clock. As described earlier, its purpose is to keep the different
chips of the system synchronized. The clock signal comes from the clock generator IC. The
next signals of importance are the status lines from the 8088. Finally, there are the address
bus signals shown as AD0 - AD7, A8 - A15, A16/S3 - A19/S6. The remainder of the signals
originate from the bus controller.
During T1, the 8088 outputs an address of the I/O port to read from. This address is specified
on AD0 - AD7 and A8 - A15. Recall that during I/O data transfers, only the 16 lower address
lines are used. This is why the other address lines (A16/S3 - A19/S6) are shown as low logic
in Figure 7. During this part of the bus cycle, the time multiplexed address signals (AD0 -
AD7 and A16/S3 - A19/S6) contain only address information. Address signals A8 - A15 are
not multiplexed; therefore they maintain address information throughout the entire bus cy-
cle.
Also during T1, the bus controller activates its ALE pin, which is used to latch address infor-
mation from the time-multiplexed lines into the 74LS373 latch. The latching occurs on the
falling edge of the ALE signal (when ALE makes a transition from high logic to low logic
since this is an edge-triggered signal). The 74LS373 will hold this address until it receives
another falling edge of ALE.
During T2 the AD0 - AD7 lines float to a high impedance state (effectively disconnecting
themselves from the bus) while they change over inside the 8088 to become bi-directional
data lines. During this period, A16/S3 - A19/S6 lines also change functions to become status
signals S3 - S6. These status lines are not used in an XT-compatibles. However, these lines
have to be separated from the bus because the address lines A16 - A19 are needed and this
phase of the operation is inherent to the 8088. During T2, the bus controller activates the IOR
signal to indicate to the I/O port that it is to output data form the selected address. At the be-
ginning of T2 the bus controller also activates the DT/R line, which determines data direc-
tion through the 74LS245 buffer, along with a DEN signal to enable the 74LS245.
At the beginning of T3 the data lines (D0 - D7) are ready to accept data from the addressed
I/O port. The IOR, DT/R, DEN lines remain active to pass this data to the 8088. In the middle
of T3 the status lines S0 - S2 go to a high logic state to indicate to the bus controller that the
8088 is nearing the last portion of the bus cycle and that T4 is approaching.
During T4 the 8088 and bus controller will finish the bus cycle. At this time the 8088 will ac-
cept the data that is on the data lines and all control signals will be deactivated, so IOR, DT/R,
DEN return to high logic indicating the end of the bus cycle.
All of the events in this description have been for the specific example of a Read I/O opera-
tion. However the other bus cycle types do not differ much from this sequence. The major
difference occurs with the read or write signal used. For example, if we examined a Memory
Write operation, the difference would be that MEMW is used instead of IOR, and that the
DT/R line would remain at high logic since data would travel from the 8088 to memory
through the 74LS245. The other actions in the bus cycle would remain the same. Basically,
the microprocessor can only do one of two things when it accesses the bus and that is either
read data or write data. In more specific terms, the microprocessor can perform a read or
write operation on either memory or an I/O port.
Any of the read or write bus cycles may have wait states inserted into them. The wait states
are added between states T3 and T4. When the 8088 is executing a bus cycle, it will sample
the condition of the READY line just prior to the beginning of T3. If this line is low, the mi-
croprocessor will insert wait-states into the bus cycle. When the 8088 is inserting wait-states,
other bus masters may gain access to the buses.