Unit-1 MPMC
Unit-1 MPMC
Architecture of 8086
microprocessors
Syllabus
UNIT - I
• Architecture of 8086 Microprocessor: Memory segmentation, BIU and E.U
General purpose registers. 8086 flag register and function of 8086 Flags. Pin
diagram of 8086-Minimum mode and maximum mode of operation. Timing
Diagram.
UNIT – II
• Instruction set of 8086: Addressing modes of 8086. Assembly directives. Simple
programs, procedures, and macros. Assembly language programs involving logical,
Branch & Call instructions, sorting, evaluation of arithmetic expressions, string
manipulation. Introduction to DOS and BIOS interrupts.
Applications: Design of an 8-bit Calculator
UNIT - III
• Interfacing with 8086: Interfacing with RAMs, ROMs along with the explanation of
timing diagrams. 8255 PPI – various modes of operation. Interfacing with key
boards, ADCs, and DACs Stepper Motor .Interrupt structure of 8086. Vector
interrupt table. Interrupt service routines. 8259 PIC Architecture and interfacing
cascading of interrupt controller and its importance.
Applications: Interfacing of a Temperature sensor with 8086
UNIT - IV
• The 8051 Architecture: Architecture of 8051 Micro controller, Memory Organization. Special Function
Registers. Input/Output Ports and Circuits, External Memory, Counter and Timers, Serial data
Input/Output, Interrupts.
UNIT – V
• Instruction set of 8051: Programming the 8051, Data Transfer and Logical Instructions. Arithmetic
Operations, Decimal Arithmetic. Jump and Call Instructions, Simple programs. Programs based on SFRs on
Timers ,Interrupts.
• Applications of 8051: Interfacing 7 segment LEDs, LCDs, Interfacing with ADCs. Interfacing with DACs.
UNIT – VI
• Introduction to ARM Processors: Harvard and Von Neumann architectures, CISC & RISC Architecture CPU
Registers, CPU Operating Modes, The ARM 7 TDMI architecture-ARM organization and implementation-
The ARM instruction set-The Thumb instruction set-Basic ARM assembly language programs
TEXT BOOKS :
• Advanced microprocessor & Peripherals - A.K.Ray&K.M.Bhurchandi, TMH, 2000.
• Microprocessors and interfacing – Douglas V. Hall, TMH, 2nd Edition, 1999.
• 8051 Microcontroller–Kenneth J. Ayala, Penram International/ Thomson, 3 rd Edition, 2005.
• The 8051 Microcontroller And Embedded Systems Using Assembly And C – Mazidi, Pearson Education
India,2nd edition, 2008. Jane W. S Liu, “ Real Time Systems” Pearson Higher Education ,3rd Edition, 2000.
• Steve Furber, ARM System on-chip Architecture, Addison Wesley
REFERENCES :
• 1. Micro computer systems, The 8086/8088 Family Architecture, Programming and Design – Y.Liu and G.A.
Gibson, PHI, 2nd Edition.
• 2. 8051 Micro Controllers and Embedded Systems – Dr. Rajiv Kapadia, Jaico Publishers.
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 10
Architecture of 8086
8086 14
Architecture of 8086
Functions of EU
• Receives opcode of an instruction from the queue.
• decodes the instructions.
• Executes the instruction.
• 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
15
8086 Architecture
BUS INTERFACE UNIT
8086 16
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 17
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 18
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 19
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 20
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 22
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 23
Register organization of 8086
Example – 1
• CF (carry flag) — carry out of 0011 0100 1101
MSB 1100
• PF (parity flag) — set to 1 if low- +0000 0111 0010
order 8 bits (low order byte)
contain even number of 1’s 1110
• AF (auxiliary carry flag) —carry 0011 1100 0000
out of bit 3 1010
• ZF (zero flag) — set to 1 if result CF = 0
is 0; to 0 if result is nonzero PF = 1
• SF (sign flag) —MSB of result AF = 1
• OF (overflow flag) — set if carry
ZF = 0
in to MSB is not equal to carry
out from MSB) SF = 0
OF = 0
8086 24
Register organization of 8086
Example – 2
• CF (carry flag) — carry out of 1111 1111
MSB 1110 0101
• PF (parity flag) — set to 1 if low- +1111 1111 1011
order 8 bits (low order byte) 0001
contain even number of 1’s 1 1111 1111 1001
• AF (auxiliary carry flag) —carry 0110
out of bit 3 CF = 1
• ZF (zero flag) — set to 1 if result PF = 1
is 0; to 0 if result is nonzero
• SF (sign flag) —MSB of result AF = 0
• OF (overflow flag) — set if carry ZF = 0
in to MSB is not equal to carry SF = 1
out from MSB)
OF = 0
8086 25
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 26
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 27
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 28
Register organization of 8086
8086 29
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 31
Generation of 20-bit(physical) address
8086 36
Memory segmentation
Non –overlapping segments:
Code Segment
Data Segment
Stack Segment
Extra Segment
8086 37
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 39
Advantages of memory segmentation
42
Pin Definitions
43
Pin Definitions
32 RD ‘ indicates a memory or I/O read is to be
performed.
__
33 MN / MX CPU is in minimum mode when strapped to
+5V and maximum mode when
grounded.
44
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.
45
Minimum mode 8086 system
46
Minimum mode 8086 system
48
maximum mode 8086 system
49
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.
___ ___ ___ ___ ___ ___ 50
Read Cycle timing Diagram for Minimum
Mode
51
Write Cycle timing Diagram for
Minimum Mode
52
56