MPMC Unit 1
MPMC Unit 1
MPMC Unit 1
Architecture of 8086
microprocessors
What is microprocessor ?
• A microprocessor is a computer processor
that incorporates the functions of a computer
's central processing unit (CPU) on a single
integrated circuit (IC).
• The microprocessor is a multipurpose,
programmabledevice that accepts digital data
as input, processes it according to
instructions stored in its memory, and
provides results as output
Generation of Microprocessor
8086 8
8086 Architecture
8086 11
8086 Architecture
Functions of EU
• Receives opcode of an instruction from the queue.
• decodes the instructions.
• Executes the instruction.
Functions of various parts of EU
• Control circuitry: Directs internal operations.
• Instruction Decoder: Translates instructions fetched from
memory into series of actions.
• ALU: Performs arithmetic and logical operations.
• FLAGS: Reflects the status of program.
• General purpose registers: Used to store Temporary data.
• Index and Pointer registers: Specifies/ informs about offset of
operand
8086
12
8086 Architecture
BUS INTERFACE UNIT
8086 13
8086 Architecture
Functions of BIU
• Handles transfer of data and address between processor
and memory / I/O devices.
• Compute physical address and send it to memory
interfaces.
• Fetches instruction codes and stores it in Queue.
8086 14
8086 Architecture
Functions of various parts of BIU
• Segment registers : Used to hold the starting address of
the segment .
• Queue register: Used to store prefetched instructions and
inputs it to EU. which is an 6-byte FIFO register set. When
the EU is ready for its next instruction,it simply reads the
instruction byte(s) for the instruction from the queue
which is present in BIU.
• Instruction Pointer: Used to point to the next instruction
to be executed by EU.
8086 15
Register organization of 8086
• The various registers available internal to 8086
microprocessors are :
1. Flag Register
2. General purpose registers
AX ( AH,AL)
BX (BH,BL)
CX (CH,CL)
DX (DH,DL)
3. Pointer and Index registers (IP,SP,BP & SI,DI)
4. Segment registers (ES, CS, DS,SS)
8086 16
Register organization of 8086
Flag Register
• Flag register is part of EU.
• 8086 microprocessor has a 16-bit flag register.
• The flag register contents indicate the result of compuitation
in the ALU.It is also known as PSW ( Program Status Word).
• The flag register/psw can be divided into 2-parts:
Conditional /status flags
Machine Control flags
• 8086 microprocessor has 9- active flags
6- conditional flags
3- control flags
• Conditional flags: The lower byte of the flag register along
with overflow flag, they reflect the status of program.
8086 17
Register organization of 8086
• Control Flags : Higher byte of the flag register , It has 3-
flags i.e., direction flag, interrupt flag and trap flag.
They control the working of machine(microprocessor)
BIT 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
X X X X O D I T S Z X AC X P X C
O Overflow flag, D Direction flag, I Interrupt flag,
T Trap flag, S Sign flag, Z Zero flag,
AC Auxiliary Carry flag, P Parity flag
CY Carry flag, X Not used / Undefined
8086 19
Register organization of 8086
Flag Register
Condition flags
• Bit – 6 : ZF (zero flag) — set to 1 if result is 0; to 0
if result is nonzero
• Bit – 7 : SF (sign flag) —set to 1 if equal to MSB of
result is 1.Thus this flag indicates whether the
result is positive or negative.
• Bit – 11 : OF (overflow flag) — set if overflow
occurs (that is, the result can not be included in
the available capacity)
8086 20
Register organization of 8086
Example – 1
• CF (carry flag) — carry out of 0011 0100 1101 1100
MSB
• PF (parity flag) — set to 1 if low- +0000 0111 0010 1110
order 8 bits (low order byte) 0011 1100 0000 1010
contain even number of 1’s CF = 0
• AF (auxiliary carry flag) —carry
out of bit 3 PF = 1
• ZF (zero flag) — set to 1 if result AF = 1
is 0; to 0 if result is nonzero
ZF = 0
• SF (sign flag) —MSB of result
• OF (overflow flag) — set if carry SF = 0
in to MSB is not equal to carry OF = 0
out from MSB)
8086 21
Register organization of 8086
Example – 2
• CF (carry flag) — carry out of 1111 1111 1110 0101
MSB +1111 1111 1011 0001
• PF (parity flag) — set to 1 if low- 1 1111 1111 1001 0110
order 8 bits (low order byte) CF = 1
contain even number of 1’s
• AF (auxiliary carry flag) —carry PF = 1
out of bit 3 AF = 0
• ZF (zero flag) — set to 1 if result
is 0; to 0 if result is nonzero ZF = 0
• SF (sign flag) —MSB of result SF = 1
• OF (overflow flag) — set if carry OF = 0
in to MSB is not equal to carry
out from MSB)
8086 22
Register organization of 8086
Flag Register
Control flags
• TF (trap flag) — if set, a trap is executed after
each instruction (single step execution).
• IF (interrupt enable flag) — if set, a maskable
interrupt can be recognized by the CPU;
otherwise, these interrupts are ignored.
• DF (direction flag) — used by string manipulation
instructions; if clear to 0, then process string from
low address to high; if set to 1, then process
string from high address to low.
8086 23
Register organization of 8086
General Purpose Register
• In 8086 there are 4- general purpose registers i.e.,
AX,BX,CX,DX.
• These registers are of 16-bit size and can be used either as
a whole 16-bit register ( the letter X used in the
representation of the register indicates that the complete
16 – bit register is being used) or the upper and lower
bytes can be accessed separately ( the letters H and L
indicates the higher order and lower order bytes
respectively in the representation of the registers )
• The general purpose registers can be used to store both
operands and temporary results and each of them can be
accessed as whole or as sub-registers.
8086 24
Register organization of 8086
General Purpose Register
• In addition to serving as general purpose registers
AX,BX,CX,DX have special uses as addressing, counting,
and I/O roles.
• The special uses of the general purpose registers is:
AX used as accumulator
BX used as a base register in address
calculation for some of the instructions
CX used as an counter by certain instructions
(ex : Loop)
DX used as a destination register in case of
multiplication and division instructions
8086 25
Register organization of 8086
8086 26
Register organization of 8086
• Code segment register :It is used to address
the code segment of memory, where the
executable program is stored.
• Data segment register: is points to data
segment of memory, where the data is
resided.
• Extra segment register :It is another data
segment of memory. Thus extra segment also
contains data.
• Stack segment register: It is used to address
the stack segment of memory .which is used
to store stack data.
Register organization of 8086
Pointer and index registers
•The 8086 contains 3 pointer registers(IP,SP,BP) and 2
index registers(SI,DI).All these registers are 16-bit
registers.
•The pointer registers contain the offsets with in the
particular segments as follows:
IP Offset within the Code segment.
BP Offset within the Data segment.
SP Offset within the Stack segment.
•The SI register is used to store the offset of sourse data
in data segment, while DI register is used to store the
offset of destination in data in data or extra segment.
•The index registers are particularly useful for string
manipulations.
8086 28
Generation of 20-bit(physical) address
8086 33
Memory segmentation
Non –overlapping segments:
Code Segment
Data Segment
Stack Segment
Extra Segment
8086 34
Memory segmentation
Overlapping segments:In Overlapping
segments the next segments starts before the
present segment 64-KB are completed.
Memory segmentation
Segment-1
End of Data/Code
64 KB
Starting of segment-2
Ending of segment-1
Segment-2
64 KB
Ending of segment-2
8086 36
Advantages of memory segmentation
39
Pin Definitions
40
Pin Definitions
32 RD ‘ indicates a memory or I/O read is to be
performed.
41
Pin Definitions
35-38 A19/S6 - during the first part of the bus cycle the
A16/S3
upper 4 bits of the address are output and
During the remainder of the bus cycle status
is output. S3 & S4 indicate the segment
register being used as follows:
S4 S3 Register
0 0 ES
0 1 SS
1 0 CS or none
0 0 DS
S5 gives the current setting of IF.
S6 is always 0.
42
Minimum mode 8086 system
43
Minimum mode 8086 system
• 8086 operated in minimum mode when
MN/MX’=1
• In this all the control signals are given out by
microprocessor chip itself.
• There is a single microprocessor in minimum
mode.
Minimum mode system
___
24 INTA Indicates recognition of an interrupt request.
45
maximum mode 8086 system
46
Maximum mode system
24,25 QS1,QS0 Reflects the status of the instruction queue.
__ __ __
26 – 28 S0,S1,S2 Indicates the type of transfer to take place during the current bus
cycle.
__ __ __
S2 S1 S0 QS1 QS0 Indication
0 0 0 Interrupt acknowledge 0 0 No operation
0 0 1 Read I/O port 0 1 First byte of op-
code
0 1 0 Write I/O port from the
queue
0 1 1 Halt 1 0 Empty Queue
1 0 0 Instruction fetch 1 1 Subsequent byte
from 1 0 1 Read memory the queue.
1 1 0 Write memory
1 1 1 Inactive – passive
_____
29 LOCK Indicates the bus will not be released to other potential bus
masters until the instruction with prefix LOCK is executed.
___ ___
30 RQ / GT1 for inputting bus requests and outputting bus grants.
___ ___ ___ ___ ___ ___ 47
48
49
50
51