MPMC (r15) Unit 1b
MPMC (r15) Unit 1b
MPMC (r15) Unit 1b
ON
MICROPROCESSORS
&
MICROCONTROLLERS
BY
K.RAVICHANDRA
ASST.PROF/ECE
VISVODAYA ENGINEERING COLLEGE,
KAVALI,SPSR NELLORE (DT.), ANDHRA PRADESH – 524201
UNIT-1
1. Introduction to Microcomputer
2. Introduction to 8086 µp
3. Architecture of 8086 µp
- Block diagram of 8086
- Registers of 8086
- Memory Segmentation
- 20 bit Physical address calculation
4. Pin configuration of 8086
5. Min. Mode operation of 8086 with Timing diagram
6. Max. Mode operation of 8086 with Timing diagram
7. 8086 Interrupts and Interrupt Vector Table
Bit: A bit is a single binary digit.
Word: A word refers to the basic data size or bit size that
can be processed by the arithmetic and logic unit of the
processor. A 16-bit binary number is called a word in a
16-bit processor.
Bus: A bus is a group of wires/lines that carry similar
information.
System Bus: The system bus is a group of wires/lines
used for communication between the microprocessor and
peripherals.
Memory Word: The number of bits that can be stored in
a register or memory element is called a memory word.
Address Bus: It carries the address, which is a unique
binary pattern used to identify a memory location or an I/O
port. For example, an eight bit address bus has eight lines
and thus it can address 2^8 = 256 different locations. The
locations in hexadecimal format can be written as 00H –
FFH.
Data Bus: The data bus is used to transfer data between
memory and processor or between I/O device and
processor. For example, an 8-bit processor will generally
have an 8-bit data bus and a 16-bit processor will have 16-
bit data bus.
Control Bus: The control bus carry control signals, which
consists of signals for selection of memory or I/O device
from the given address, direction of data transfer and
synchronization of data transfer in case of slow devices.
8086 FEATURES
1. The 8086 is a 16-bit µp
2. It has 16-bit ALU
1. The BIU handles all transfer of address, data and code on Buses.
2. It sends out 20-bit Physical address, fetches instruction code bytes from memory and
stores them in Instruction Queue.
3. The BIU is responsible for all read & write operations of Memory and I/O.
4. The BIU consists of
(i) Instruction Queue
(ii) Segment Registers
(iii) Instruction Pointer
(iv) 20-bit Physical address calculation circuit
(i) Instruction Queue:
The segment registers are used to define the starting address of logical
segments.
The segment register holds the upper 16-bits of starting address of logical
segments. The BIU inserts ZERO’s for lower 4-bits of 20-bit starting
address.
(iii) Instruction Pointer (IP):
The segment register defines the segment base i.e., starting address of a
segment.
The Index Registers are used to hold the 16-bit offset address of data stored in Data
and Extra segments.
These registers are used in string operations to hold the offset address of Source string
and Destination strings.
The directional flag (DF) selects either increment (or) decrement mode for SI and DI
registers during String instructions manipulation.
DF=0 selects increment mode and
DF = 1 selects decrement mode
(iv) Pointers :
The Pointers are used to hold the offset address relative to data
and stack segments.
The stack pointer (SP) is used to hold the address of stack top.
(v) Flag Register / Program Status Word (PSW)
The flag register is used to indicate the status information (or) condition
produced by an instruction execution.
The 8086 has 6- status flags and 3-control flags.
Conditional Flags / Status Flags :
These flags are Set or Reset according to the condition produced by an
instruction execution.
The 6- conditional flags of 8086 are CF, PF, AF, ZF, SF, OF
Control flags:
These flags control the operation of the processor.
The 3- control flags of 8086 are DF, IF, TF.
FLAG REGISTER / PSW
If TF = 1, the processor enters the ‘Single step execution mode’ i.e., the 8086
gets interrupted automatically at the end of every instruction execution.
MEMORY SEGMENTATION
The 8086 uses memory segmentation. In this scheme, the
complete 1 MB memory is divided into number of logical
segments.
Note that the 8086 does not work the whole 1 MB memory at
any given time. However it works only with four segments at
any given instant of time.
MEMORY SEGMENTATION
The four segment registers define the starting addresses of the
four memory segments with which the 8086 is working at that
instant of time.
Data Segment :
The Data segment is used to store data variables and constants of the
program.
The Data Segment register (DS) is used to define the starting address of the
Data segment.
Data are accessed from Data segment by an Offset address.
The SI, DI, BX, BP registers are used to store the offset address for data
segment
Extra Segment :
The Extra segment is an additional data segment used to in String
operations.
The Extra Segment register (ES) is used to define the starting address of
the Extra segment.
Stack Segment :
The Stack segment defines the area of memory used for stack.
The Bus Interface Unit generates the 20-bit Physical Address by adding
Segment base to the Offset address.
The segment register defines the segment base i.e., starting address of a
segment.
A location within a segment can be addressed by 16-bit offset address.
Provides use of separate memory areas for program, data and stack
Allows the processor to access the data from memory easily and
fastly, which increases the speed of operation
VIDEO LECTURE
ON
MICROPROCESSORS
&
MICROCONTROLLERS
BY
K.RAVICHANDRA
ASST.PROF/ECE
VISVODAYA ENGINEERING COLLEGE,
KAVALI,SPSR NELLORE (DT.), ANDHRA PRADESH – 524201
PIN DIAGRAM
The pin diagram of 8086 is shown in Figure.
It consists of 40-pins.
AD0 – AD15
A16/S3 - A19/S6
and BHE / S7
The 8086 issues two different sets of signals (Pins 24 to 31) in
Minimum mode and Maximum mode operation
AD0 - AD15 (Address / Data lines) :
The higher order 4-address lines (A16 - A19) are multiplexed with Status lines (S3 -
S6).
S4 S3 Segment
All the above multiplexed pins are at high-impedance state during DMA operation.
BHE/S7 :
The Bus High Enable (BHE) signal is used to enable the higher
order data bus (D8 - D15) connected to HIGH BANK.
BHE/S7 :
The 1 M bytes Physical memory of 8086 is divided into two banks for accessing 16-
bit numbers.
Each bank size is 512 K bytes.
The Bus High Enable (BHE) signal is used to enable to HIGH BANK which is
connected to higher order data bus (D8 - D15)
INTR:
It is a level triggered maskable Interrupt Request.
It can be disabled by using software i.e., the processor will get
interrupted only if IF=1. Otherwise the processor cannot get
interrupted even INTR is active.
It is a non-vectored interrupt.
CLK:
The clock input provides the basic timing for the
microprocessor and bus control activity.
The clock frequencies of different versions of 8086 are 5
MHz, 10 MHz, 8 MHz.
RESET :
It forces all the registers to a predefined values and
microprocessor gets reset.
When Reset is active DS, ES, SS, IP and FLAG registers are
initialized to 0000H and CS is initialized to FFFF H.
After Reset, the processor starts execution from FFFF0 H.
READY:
A slow peripheral (or) memory device can be connected to
microprocessor through READY line.
It is used by the MPU to sense whether the peripheral is ready
to transfer data (or) not.
It is used to insert wait states in bus cycles as needed to
interface with slow memory & I/O.
If READY =1, peripheral is ready to transfer data.
The 8086 enters into WAIT state after the execution of WAIT
instruction.
If TEST = 0, the WAIT instruction functions as NOP
MN/MX :
This pin is used to select the mode of operation of 8086 processor.
MN/MX = 1 for Minimum mode operation
The 8086 enters into WAIT state after the execution of WAIT instruction.
TEST = 0.
MN/MX :
This pin is used to select the mode of operation of 8086 processor.
MN/MX = 1 for Minimum mode operation
The 8086 enters into WAIT state after the execution of WAIT instruction.
TEST = 0.
MN/MX :
This pin is used to select the mode of operation of 8086 processor.
MN/MX = 1 for Minimum mode operation
•In this mode, all the control signals are given out by the
microprocessor chip itself. There is a single microprocessor in
the minimum mode system.
•The remaining components in the system are latches,
transreceivers, clock generator, memory and I/O devices.
Some type of chip selection logic may be required for
selecting memory or I/O devices, depending upon the address
map of the system.
CLK Generator(8284) :
Generates a clock frequency of 5MHZ.
Adress latches :
These are used for demultiplexing of AD0-AD15 ,A16/S3-A19/S6 ,BHE‾/S7 Signals.
The ALE signal is used to enable the address latches.
The ALE signal indicates the presence of valid address information on
multiplexed bus.
The DT/R‾ Signal is used to specify the direction of data flow through
data bus buffers.
DT/R‾=1 =>Data transmission.
DT/R‾=0 =>Data reception.
The minimum mode signals are INTA‾(pin 24), ALE , DEN‾ DT/R‾, M/IO‾,
WR‾, HLDA, HOLD(pin 31).
MINIMUM MODE SIGNALS
INTA ( pin-24) :
The interrupt acknowledge signal is a response to the INTR.
It indicates the recognition of an Interrupt Request.
ALE (pin-25) :
The address latch enable signal is used to indicate the presence of valid address information on
multiplexed bus (AD0 - AD15 ) .
This pin is connected to the Latch enable input of Address Latches.
The address latches are used to separate the address and data lines.( de-multiplexing)
DEN (pin-26) :
The data bus enable signal is used to enable the bi-directional data bus buffers.
The data bus buffers( transmitters/receivers) are used to maintain proper signal quality.
DT / R (pin-27) :
The data transmit / receive signal is used to select the direction of data flow
through the data bus buffers.
DT / R = 1 for transmitting data
DT / R = 0 for receiving data
M / IO (pin-28) : This pin selects either Memory or I/O operation
M / IO = 1 selects memory operation
M / IO =0 selects I/O operation
WR (pin-29) :
This control signal is active whenever the processor is writing data to Memory or I/O
HOLD & HLDA (pins 31 & 30):
These two signals are used in DMA operation
The HOLD input indicates the processor that other bus master is requesting for the
use of system bus.
When HOLD =1, the p stops the normal program execution and places address, data
& control buses at high-impedance state and sends HLDA signal to the DMA controller.
The HLDA signal indicates that the processor has accepted the HOLD request and the
gain control of the system bus is transferred to the DMA controller.
During HLDA =1 , the DMA controller is the master of the system bus.
After removal of HOLD request, the HLDA becomes Low.
VIDEO LECTURE
ON
MICROPROCESSORS
&
MICROCONTROLLERS
BY
K.RAVICHANDRA
ASST.PROF/ECE
VISVODAYA ENGINEERING COLLEGE,
KAVALI,SPSR NELLORE (DT.), ANDHRA PRADESH – 524201
MAXIMUM MODE
• The maximum mode operation is used only when the system contains
arithmetic co-processor such as 8087 numeric co-processor.
• Max. Mode signals QS1, QS0, S0, S1, S2, LOCK, RQ/GT1, RQ/GT0
QS1 & QS0 (pins-24&25):
The Queue status pins indicate the status of Instruction Queue of 8086
processor.
These status signals indicate the function of the current bus-cycle. i.e., the type
of operation being carried out by the processor.
S2 S1 S0 Bus cycle
0 0 0 INTA
0 0 1 I/O Read
0 1 0 I/O Write
0 1 1 Halt
1 0 0 Opcode Fetch
1 0 1 Memory Read
1 1 0 Memory Write
1 1 1 Inactive
LOCK : ( pin-29)
The Request/Grant pins are used to request a DMA action during Maximum
mode operation.
These are bidirectional and used to request and grant the DMA operation.
Timing diagrams for Max. mode
After executing ISR ,the control is transferred back again to the main program.
Whenever a no.of devices interrupt a CPU at a time and if the processor is able
to handle them properly,it is said to have multiple interrupt processing
capability.
8086 has two interrupt pins NMI and INTR.
INTR interrupt may be masked using Interrupt Flag. INTR is of 256 types.
The INTR types may be from 00 to FF H. If more than one type of INTR
interrupt occurs at a time,then an external chip called Programmable Interrupt
Controller is required to handle them.
TYPES OF INTERRUPTS
When the interrupt is enabled, the present IP and CS are pushed on to the stack
and loaded with the address of ISR, which is available in Interrupt vector table.
Interrupt Vector
It is a memory block which contains address of ISR
The size of Interrupt vector is 4-bytes (to store CS and IP of ISR)