Vous êtes sur la page 1sur 19

ELE 3230

Microprocessors and Computer


Systems
Part 3
8088 System Architecture
(Hall: ch2; Brey: ch2; Triebel: ch2)

ELE 3230 - Part 3 1


Historical Background
a 1 9 6 9 / 7 0 Intel 4004, first Microprocessor (M.E.Hoff) 4 bit microprocessor, originally
developed for Busicom, a small Japanese calculator company. Limited to 4096 memory
location (of 4 bit data), 45 instructions; integrated 2300 PMOS transistors.
a 1971 Intel 8008, first 8 bit microprocessor (16K x 8bit)
a 1973 Intel 8080, 10 x faster than 8008, more memory (64k)
a 1974 Other 8 bit processors: Motorola 6800, Fairchild F8,
a 1975 Signetic 2650, MOS Technology 6502 (used in Apple II), Rockwell PPS-8
a 1976 National IMP-PACE, first 16 bit microprocessor, followed by Texas Instrument,
TMS9900, Zilog Z80 (8 bit) (used in Radio Shack TRS-80)
a 1977 Intel 8085 (8080 with built-in clock & system controller)
a 1978 Motorola 6809 (8 bit), Intel 8086 (16 bit processor, 1M)
a 1978/79 Intel 8088 - variant of 8086 with 8 external data pins
a 1981 IBM adopts Intel 8088 for IBM PC/XT
(see http://bwrc.eecs.berkeley.edu/CIC/archive/cpu_history.html )
2 most popular microprocessor series:
a INTEL 8086, 80186, 80286, 80386, 80486, Pentium
a Motorola 68000, 68010, 68020, 68030, 68040

ELE 3230 - Part 3 2


Microprocessor Computer System

Central
Processing
Unit (CPU) Data Bus
Data Bus
Input Registers
Address Bus
Output Address Bus Memory
Unit Control Bus Control Unit (CU)
(I/O Unit) Control Bus
Arithmetic & Logic
Unit (ALU)

Processor Bus

Co-Processor
(e.g. Floating point unit)

ELE 3230 - Part 3 3


Microprocessor Computer System
a Control Unit (CU) generates all the control signals within the
CPU. It initializes the registers on power-up, generates the
signal to fetch instructions for the ALU.
The Control unit may be implemented (i) completely by Central
Processing
hardware (hard-wired controller e.g. using a state counter Unit (CPU)
Registers
and a Programmable Logic Array) or (ii) by a mixture of
software instructions (microcode stored in CPU) and Control Unit (CU)

hardware (microprogrammed control). Both the Intel 8086 Arithmetic & Logic
Unit (ALU)
family and Motorola 68000 family use microprogrammed
controllers.
a Registers - small, fast memory which usually store data and
addresses associated with the instruction being carried out.
a ALU performs arithmetic and logic operations
ELE 3230 - Part 3 4
Instruction Execution Cycle
Two main steps in the cycle:
1. Fetch the next instruction from main memory
2. Decode and Execute the instruction
The Fetch cycle consists of
i) use the instruction pointer (IP) to set the address bus with the
address of the next instruction and increment the instruction pointer;
ii) wait (few hundred nanoseconds) for data to be transferred to the
data bus from memory; and
iii) read the data from the data bus.
The Execution Cycle consists of
i) Decode the instruction and generate the correct sequence of internal
and external signals
ii) Execute the instruction and restart the Fetch Cycle
ELE 3230 - Part 3 5
Basic Instruction Cycle

START

Fetch the
Next Fetch Cycle
Instruction

Execute
the Execute Cycle
Instruction

HALT

ELE 3230 - Part 3 6


Pipelined Instruction Fetch and
Execution Cycles
Instruction Fetch and Execution pipeline
Fetch Execute Fetch Execute Fetch Execute Fetch

Is this efficient? How to improve it?


• The Fetch and Execution are implemented by two process units
inside CPU:
• Bus Interface Unit (BIU) fetches instructions from memory, passes the
instruction to the instruction stream byte queue and starts to fetch the
next instruction immediately
• Execution Unit (EU) removes instructions from the instruction queue
What are the advantages of allocating the functions to two separate units?
• Both BIU and EU can be working simultaneously without waiting for the
completion of the other task (pipelined parallel processing)

ELE 3230 - Part 3 7


Timing Diagram for Instruction
Pipeline Operation
Time
1 2 3 4 5 6 7 8 9 10 11 12 13 14

FI DI CO FO EI WO
Instruction 1
FI DI CO FO EI WO
Instruction 2
FI DI CO FO EI WO
Instruction 3
FI DI CO FO EI WO
Instruction 4
FI DI CO FO EI WO
Instruction 5
FI DI CO FO EI WO
Instruction 6
FI DI CO FO EI WO
Instruction 7
FI DI CO FO EI WO
Instruction 8
FI DI CO FO EI WO
Instruction 9

I: Instruction
O: Operand
Fetch Instruction – Decode Instruction – Check Operand – Fetch Operand (if needed) – Execute Instruction – Write Output
(“Operand” is defined in the Instruction Set part)
ELE 3230 - Part 3 8
Introduction to Intel 8086/8088
Microprocessors Some pins have different functions
for two different operation modes.
MAX MIN MIN MAX
{ MODE } { MODE }
MODE MODE
GND 1 40 Vcc GND 1 40 Vcc
AD14 2 39 AD15 A14 2 39 A15
AD13 3 38 A16/S3 A13 3 38 A16/S3
AD12 4 37 A17/S4 A12 4 37 A17/S4
AD11 5 36 A18/S5 A11 5 36 A18/S5
AD10 6 35 A19/S6 A10 6 35 A19/S6
AD9 7 34 BHE/S7 A9 7 34 SS0 (HIGH)
AD8 8 33 MN/MX A8 8 33 MN/MX
AD7 9 32 RD AD7 9 32 RD
10 8086 31 AD6 10 8088 31 HOLD (RQ/GT0)
AD6 RQ/GT0 (HOLD)
11 CPU 30 AD5 11 CPU 30 HLDA (RQ/GT1)
AD5 RQ/GT1 (HLDA)
AD4 12 29 LOCK (WR) AD4 12 29 WR (LOCK)
AD3 13 28 S2 (IO/M) AD3 13 28 IO/M (S2)
AD2 14 27 S1 (DT/R) AD2 14 27 DT/R (S1)
AD1 15 26 S0 (DEN) AD1 15 26 DEN (S0)
AD0 16 25 QS0 (ALE) AD0 16 25 ALE (QS0)
NM1 17 24 QS1 (INTA) NM1 17 24 INTA (QS1)
INTR 18 23 TEST INTR 18 23 TEST
CLK 19 22 READY CLK 19 22 READY
GND 20 21 RESET GND 20 21 RESET

8086 pin diagram 8088 pin diagram


ELE 3230 - Part 3 9
Introduction to Intel 8086/8088
Microprocessors
8088 and 8086 are almost identical except that 8088 has only 8
external data lines whereas the 8086 has 16 external data lines.

Both have
a 16-bit wide data bus internally in microprocessor
a 20 address pins, including 16 address/data (AD0-AD15) + 4
address/status (A16/S3-A19/S7) for 8086, allowing a maximum
memory address range of 1MByte
a multiplexed address/data pins (8088 only multiplexes 8 pins, AD0-
AD7)
a 2 modes of operation (the maximum and minimum modes)
a Same instruction set

ELE 3230 - Part 3 10


Internal Architecture of the 8088

aBoth 8088/8086 employ parallel processing.


aContain two processing units: Execution unit (EU) and Bus
interface unit (BIU); operate at the same time.
aThe BIU sends out addresses, fetches instructions from
memory, reads data from ports and memory, and writes data
to ports and memory, i.e. the BIU handles all transfers of data
and addresses on the buses for the execution unit.
aThe EU tells BIU where to fetch instruction or data from,
decodes instructions, and executes instructions.

ELE 3230 - Part 3 11


8086 Internal Block Diagram

ELE 3230 - Part 3 12


Bus Interface Unit (BIU)
a Perform bus operation such as instruction fetching, reading/writing of
data operand for memory, inputting/outputting data for I/O peripherals.
a Perform other functions such as instruction queuing and data
acquisitions.
a 8-bit (16-bit) bi-directional data bus for 8088 (8086).
a 20-bit address bus Æ can address any one of the 220 (1,048,576) byte-
memory .
a Contain segment register, instruction pointer, address generation adder,
bus control logic, and an instruction queue.
a Use instruction queue to implement a pipelined architecture (prefetch
up to 4 (6) bytes of instruction code for 8088 (8086) and then store and
access the codes in FIFO order).
a See Part-9 for the detail discussion on instruction set and segment
registers.
ELE 3230 - Part 3 13
Execution Unit (EU)

a Responsible for decoding and executing instruction.


a Contains: arithmetic logic unit (ALU), status and control flags, general
purpose registers, and temporary-operand register.
a EU accesses the instruction from output end of the instruction queue
and data from general-purpose register.
a It reads one instruction at a time, decodes them, generates operand
address if necessary, passes them to BIU and requests to perform the
read/write cycle to memory or I/O, and performs the operation specified
by the instruction on operand.
a During execution, EU may test the status and control flags and update
these flags based on the results of execution.

ELE 3230 - Part 3 14


Flag Register
a The flag indicates the condition of the microprocessor as well as
controls its operations.
a A flag register is a flip-flop which indicates some conditions
produced by the execution of an instruction or controls certain
operations of the EU. A 16-bit flag register in the EU contains nine
active flags. (Each flag occupies one bit in the flag register.)
a Two types of flags:
`conditional flags: Six flags are conditional flags. They are set or reset
by the EU on the basis of the results of some arithmetic operation.
`control flags : The three remaining flags in the flags register are used
to control certain operations of processor. They are called the control
flags.

ELE 3230 - Part 3 15


Flag Registers

bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0

U U U U OF DF IF TF SF ZF U AF U PF U CF

U=Undefined Carry Flag (CF)- set by carry out of MSB.


Parity Flag (PF)- set if result has even parity.
Auxiliary carry Flag (AF)- for BCD
Conditional Flags Zero Flag (ZF)- set if results = 0
Sign Flag (SF) = MSB of result
Overflow Flag (OF)- overflow flag
MSB: Most Significant Bit
IF- interrupt enable flag
Control Flags DF- string direction flag
TF- single step trap flag
See Examples in Part-6
ELE 3230 - Part 3 16
Conditional Flags
a carry flag (CF)- indicates a carry after addition or a borrow after
subtraction, also indicates error conditions.
a parity flag (PF)- is a logic “0” for odd parity and a logic “1” for even parity.
a auxiliary carry flag (AF)- important for BCD addition and subtraction;
holds a carry (borrow) after addition (subtraction) between bit-3 and bit-4.
Only used for DAA and DAS instructions to adjust the value of AL after a
BCD addition (subtraction).
a zero flag (ZF)- indicates that the result of an arithmetic or logic operation
is zero.
a sign flag (SF)- indicates arithmetic sign of the result after an arithmetic
operation.
a overflow flag (OF)- a condition that occurs when signed numbers are
added or subtracted. An overflow indicates that the result has exceeded
the capacity of the machine.

(See Part-6 for more details)


ELE 3230 - Part 3 17
Control Flags

a The control flags are deliberately set or reset with specific


instructions YOU put in your program. The three control flags are:
`trap flag (TF) - used for single stepping through a program (for
debugging);
`interrupt flag (IF) - used to allow or prohibit the interruption of
a program;
`direction flag (DF) - used with string instructions.

a No specific instruction to set TF. See example 12-1 in Brey’s for


more details.

ELE 3230 - Part 3 18


General-Purpose Registers
a EU has eight 8-bit general-purpose registers, labeled AH, AL, BH, BL,
CH, CL, DH, and DL. These registers can be used individually for
temporary storage of 8-bit data.
a Register pairs AH-AL, BH-BL, CH-CL, and DH-DL can be used together
to form register AX, BX, CX, and DX and can be used to store 16-bit data
words.
a The AL register is also called the accumulator. It has some features that
the other general-purpose registers do not have.
a The advantage of using internal registers is :
It can be accessed more quickly than from external memory. No memory
reference or memory cycle is needed to get the data.

(See Part-6 for more details)

ELE 3230 - Part 3 19

Vous aimerez peut-être aussi