Lecture3-80x86 Microprocessor Architecture
Lecture3-80x86 Microprocessor Architecture
Review:
Microprocessors and Microcontrollers
1
10/4/2024
Outline
• 8086 internal structure
• 8086/88 pins, signals, and buses
2
10/4/2024
3
10/4/2024
Instruction queue
• A group of First-In-First-Out
(FIFO) in which up to 6 bytes of
instruction code are pre-fetched
from the memory ahead of time.
• This is done in order to speed up
the execution by overlapping
instruction fetch with execution.
• This mechanism is known as
pipelining.
and
Some of the 16 bit registers can be
Index registers (Source used as two 8 bit registers as:
Index, Destination Index)
each of 16-bits AX can be used as AH and AL
BX can be used as BH and BL
CX can
Microprocessors andbe used
Interfacing as CH and CL 8
DX can be used as DH and DL
4
10/4/2024
Registers
• On-chip storage: super fast & expensive
• Store information temporarily
• Six groups
5
10/4/2024
Flag Register
Auxiliary Carry Flag Carry Flag
This is set, if there is a carry from the This flag is set, when there is
lowest nibble, i.e, bit three during a carry out of MSB in case of
addition, or borrow for the lowest addition or a borrow in case
nibble, i.e, bit three, during subtraction. of subtraction. (8-/16-bit op.)
Sign Flag Zero Flag Parity Flag
This flag is set, when the This flag is set, if the result of This flag is set to 1, if the lower
result of any computation the computation or comparison byte of the result contains even
is negative performed by an instruction is number of 1’s; for odd number of
zero 1’s, set to zero.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
OF DF IF TF SF ZF AF PF CF
6
10/4/2024
7
10/4/2024
Pipelining in 8086
• BIU fetches and stores instructions once the queue has more than two
empty bytes
• EU consumes instructions pre-fetched and stored in the queue at the
same time
• Increases the efficiency of CPU
• When it works?
– Sequential instruction execution
– Branch penalty: when jump instruction executed, all pre-fetched instructions
are discarded
8086/8088 Pins
(Compare them and tell the difference)
GND 1 40 VCC(+5V) GND 1 40 VCC(+5V)
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
AD8 8 8086 33 MN/MX A8 8 8088 33 MN/MX
AD7 9 32 RD AD7 9 32 RD
CPU 31 HOLD(RQ/GT0)
CPU 31 HOLD(RQ/GT0)
AD6 10 AD6 10
AD5 11 30 HLDA(RQ/GT1) AD5 11 30 HLDA(RQ/GT1)
AD4 12 29 WR(LOCK) AD4 12 29 WR(LOCK)
AD3 13 28 M/IO(S2) AD3 13 28 M/IO(S2)
AD2 14 27 DT/R(S1) AD2 14 27 DT/R(S1)
AD1 15 26 DEN(S0) AD1 15 26 DEN(S0)
AD0 16 25 ALE(QS0) AD0 16 25 ALE(QS0)
NMI 17 24 INTA(QS1) NMI 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
Microprocessors and Interfacing 16
8
10/4/2024
Address/Data bus
MN/ MX
MINIMUM / MAXIMUM
9
10/4/2024
READY
CLK
10
10/4/2024
Min/Max Pins
The 8086 microprocessor can work in two
modes of operations : Minimum mode and
Maximum mode.
11
10/4/2024
Control Signals
• ~BHE: output, ~BHE=0, AD8-AD15 are used, ~BHE=1, AD8-AD15 are not in use
• ALE: output, used as the latch enable signal of the address latch
12
10/4/2024
Control Signals
◼ Minimum mode:MN / MX =1
◼ Single CPU;
◼ Maximum mode:MN / MX =0
◼ Multiple CPUs (8086+8087)
13
10/4/2024
READY
READY
RESET
Microprocessors and Interfacing 28
14
10/4/2024
DEN
RD
WR
READY
15
10/4/2024
Next Lecture
• 80x86 memory organization
– Memory segments
• Addressing modes
16