Advance Microprocessor Notes
Advance Microprocessor Notes
Module I
Evolution of microprocessors, 8086 Microprocessor - Architecture and signals,
Memory organisation, Minimum and maximum mode of operation, Minimum
mode Timing Diagram. Comparison of 8086 and 8088.
What is Microprocessor?
A single chip processor is called microprocessor. It is also called Central
Processing Unit (CPU). It is the brain of a computer system. It is also used in
many electronic devices.
Microprocessor is a semiconductor device consisting of electronic logic circuits
manufactured by techniques such as large scale integration (LSI) or very large
scale integration. It is capable of performing computing functions and
making decisions to change the sequence of program execution. A
computer built with a microprocessor is called micro computer.
Examples
Intel 8086, Intel 80286, Pentium II
A microprocessor in which most instructions operate on n-bit data and its
registers are of n-bit size is said to be a n-bit microprocessor.
Evolution of microprocessors
4-bit Microprocessors
The first microprocessor was introduced in 1971 by Intel Corp. It was named Intel
4004 as it was a 4 bit
processor. It was a processor on a single chip. It could perform simple
arithmetic and logic operations such as addition, subtraction, boolean AND and
boolean OR. Intel introduced the enhanced version of 4004, the 4040.
8-bit Microprocessors
The first 8 bit microprocessor which could perform arithmetic and logic operations
on 8 bit words was
introduced in 1973 again by Intel. This was Intel 8008 and was later followed
by an improved version, Intel 8088.
16-bit Microprocessors
The 8-bit processors were followed by 16 bit processors. They are Intel 8086 and
80286.
1
Advance Microprocessor
32-bit Microprocessors
The 32 bit microprocessors were introduced by several companies but the
most popular one is Intel 80386.
Pentium Series
Instead of 80586, Intel came out with a new processor namely Pentium processor.
Its performance is
closer to RISC performance. Pentium was followed by Pentium Pro CPU.
Pentium Pro allows allow multiple CPUs in a single system in order to achieve
multiprocessing. The MMX extension was added to Pentium Pro and the result
was Pentiuum II. The low cost version of Pentium II is celeron.
The Pentium III provided high performance floating point operations for certain
types of computations by using the SIMD extensions to the instruction set. These
new instructions makes the Pentium III faster than high-end RISC CPUs.
Interestingly Pentium IV could not execute code faster than the Pentium III when
running at the same clock frequency. So Pentium IV had to speed up by
executing at a much higher clock frequency.
8086 Microprocessor
8086 Microprocessor is an enhanced version of 8085Microprocessor that was
designed by Intel in 1976. It is a 16-bit Microprocessor having 20 address lines
and16 data lines that provides up to 1MB storage. It consists of powerful
instruction set, which provides operations like multiplication and division
easily.
It supports two modes of operation, i.e. Maximum mode and Minimum mode.
Maximum mode is suitable for system having multiple processors and
Minimum mode is suitable for system having a single processor.
2
Advance Microprocessor
Features of 8086
The most prominent features of a 8086 microprocessor are as follows –
20
It has a 20 bit address bus can access upto 2 memory location
Support upto 64 KB I/O Ports
Word size is 16 bits
40 pin dual in line package
Address ranges from 00000H to FFFFFH
Memory is addressable- every byte has a separate address
It has an instruction queue, which is capable of storing six instruction
bytes from the memory resulting in faster processing.
It was the first 16-bit processor having 16-bit ALU, 16-bit registers,
internal data bus, and 16-bit external data bus resulting in faster
processing.
It is available in 3 versions based on the frequency of operation −
o 8086 → 5MHz
o 8086-2 → 8MHz
o 8086-1 → 10 MHz
It uses two stages of pipelining, i.e. Fetch Stage and Execute Stage,
which improves performance.
Fetch stage can prefetch up to 6 bytes of instructions and stores them in the
queue.
Execute stage executes these instructions.
It has 256 vectored interrupts.
It consists of 29,000 transistors.
Architecture of 8086
The following diagram depicts the architecture of a 8086 Microprocessor –
8086 Microprocessor is divided into two functional units, i.e., EU (Execution
Unit) and BIU (Bus Interface Unit).
3
BIU (Bus Interface Unit)
BIU takes care of all data and addresses transfers on the buses for the EU like
sending addresses, fetching instructions from the memory, reading data
from the ports and the memory as well as writing data to the ports and the
memory.
EU has no direction connection with System Buses so this is possible with the
BIU. EU and BIU are connected with the Internal Bus.
It has the following functional parts −
Instruction queue − BIU contains the instruction queue. BIU gets upto 6
bytes of next instructions and stores them in the instruction queue. When
EU executes instructions and is ready for its next instruction, then it
simply reads the instruction from this instruction queue resulting in
increased execution speed.
Fetching the next instruction while the current instruction executes is called
pipelining.
Segment register − BIU has 4 segment buses, i.e. CS, DS, SS& ES. It
holds the addresses of instructions and data in memory, which are used by
the processor to access memory locations. It also contains 1 pointer
register IP, which holds the address of the next instruction to executed by
the EU.
o CS − It stands for Code Segment. It is used for addressing a
memory location in the code segment of the memory, where the
executable program is stored.
o DS − It stands for Data Segment. It consists of data used by the
program and is accessed in the data segment by an offset address or
the content of other register that holds the offset address.
o SS − It stands for Stack Segment. It handles memory to store data
and addresses during execution.
o ES − It stands for Extra Segment. ES is additional data segment,
which is used by the string to hold the extra destination data.
Instruction pointer − It is a 16-bit register used to hold the address of the
next instruction to be executed.
BIU contains a separate adder to perform physical address calculation.
EU (Execution Unit)
Execution unit gives instructions to BIU stating from where to fetch the data
and then decode and execute those instructions. Its function is to control
operations on data using the instruction decoder & ALU. EU has no direct
connection with system buses as shown in the above figure, it performs
operations over data through BIU.
ALU
It handles all arithmetic and logical operations, like +, −, ×, /, OR, AND, NOT
operations.
Flag Register
It is a 16-bit register that behaves like a flip-flop, i.e. it changes its status
according to the result stored in the accumulator. It has 9 flags and they are
divided into 2 groups − Conditional Flags and Control Flags. Conditional Flags
It represents the result of the last arithmetic or logical instruction executed.
Following is the list of conditional flags −
Carry flag − This flag indicates an overflow condition for arithmetic operations.
Auxiliary flag − When an operation is performed at ALU, it results in a
carry/barrow from lower nibble (i.e. D0 – D3) to upper nibble (i.e. D4 –
D7), then this flag is set, i.e. carry given by D3 bit to D4 is AF flag. The
processor uses this flag to perform binary to BCD conversion.
Parity flag − This flag is used to indicate the parity of the result, i.e.
when the lower order 8-bits of the result contains even number of 1’s,
then the Parity Flag is set. For odd number of 1’s, the Parity Flag is reset.
Zero flag − This flag is set to 1 when the result of arithmetic or logical
operation is zero else it is set to 0.
Sign flag − This flag holds the sign of the result, i.e. when the result of
the operation is negative, then the sign flag is set to 1 else set to 0.
Overflow flag − This flag represents the result when the system capacity is
exceeded.
Control Flags
Control flags controls the operations of the execution unit. Following is the list of
control flags −
Trap flag − It is used for single step control and allows the user to
execute one instruction at a time for debugging. If it is set, then the
program can be run in a single step mode.
Interrupt flag − It is an interrupt enable/disable flag, i.e. used to
allow/prohibit the interruption of a program. It is set to 1 for interrupt
enabled condition and set to 0 for interrupt disabled condition.
Direction flag − It is used in string operation. As the name suggests
when it is set then string bytes are accessed from the higher memory
address to the lower memory address and vice-a- versa.
General purpose register
There are 8 general purpose registers, i.e., AH, AL, BH, BL, CH, CL, DH,
and DL. These registers can be used individually to store 8-bit data and can be
used in pairs to store 16bit data. The valid register pairs are AH and AL, BH
and BL, CH and CL, and DH and DL. It is referred to the AX, BX, CX, and
DX respectively.
AX register − It is also known as accumulator register. It is used to store
operands for arithmetic operations.
BX register − It is used as a base register. It is used to store the
starting base address of the memory area within the data segment.
CX register − It is referred to as counter. It is used in loop instruction to store
the loop counter.
DX register − This register is used to hold I/O port address for I/O instruction.
Stack pointer register
It is a 16-bit register, which holds the address from the start of the segment to
the memory location, where a word was most recently stored on the stack.
Register Organization
A register is a very small amount of fast memory that is built in the CPU (or
Processor) in order to speed up the operation. Register is very fast and efficient
than the other memories like RAM, ROM, external memory etc,.
The 8086 microprocessor has a total of fourteen registers that are accessible to
the programmer. All these registers are 16-bit in size. The registers of 8086 are
categorized into 5 different groups.
a) General registers
b) Index registers
c) Segment registers
d) Pointer registers
e) Status Register(Flag register)
SF (Sign Flag): This flag represents sign of the result. 0-Result is Positive
1-Result is Negative
ZF (Zero Flag): ZF is set if the result produced by an instruction is zero.
Otherwise, ZF is reset. PF (Parity Flag): This flag is set to 1, if the
lower byte of the result contains even number of 1’s. 0- Odd parity
1- Even parity
CF (Carry Flag)
This flag is set, when there is a carry out of MSB in case of addition or
borrow in case of subtraction. 0- No Carry/ Barrow
1- Carry/ Barrow
TF (Trap Flag): It is used for single step control and allows the user to execute
one instruction at a time for debugging. If it is set, then the program can be run in
a single step mode.
IF (Interrupt Flag):
If this flag is set, the maskable interrupts are recognized by the CPU, otherwise they
are ignored.
DF (Direction Flag):
This is used by string manipulation instructions.
0- The string is processed beginning from the lowest address to the
highest address, i.e., auto incrementing mode.
1- The string is processed from the highest address towards the lowest
address, i.e., auto incrementing mode.
AC (Auxiliary Carry Flag):
This is set when there is a carry from the lowest nibble (i.e, bit three during
addition), or borrow for the lowest nibble (i.e, bit three, during subtraction).
OF(Over flow Flag):
This flag is set, if an overflow occurs, i.e, if the result of a signed operation is
large enough to accommodate in a destination register.
8086 Pin Diagram
8086 was the first 16-bit microprocessor available in 40-pin DIP (Dual Inline
Package) chip. Here is the pin diagram of 8086 microprocessor −
Power supply and frequency signals
Vcc- +5V power supply for the operation of internal circuit
GND – ground for internal circuits
Clock signal
Clock signal is provided through Pin-19. It provides timing to the
processor for operations. Its frequency is different for different versions,
i.e. 5MHz, 8MHz and 10MHz.
Address/data bus
AD0-AD15. These are 16 address/data bus. AD0-AD7 carries low order
byte data and AD8- AD15 carries higher order byte data. During the first
clock cycle, it carries 16-bit address and after that it carries 16-bit data.
During T1 state , address are on the lines and data is available on the data
bus during T2, T3,Tw and T4. Tw is a wait state
Address/status bus(A19/S6,A18/S5,A17/S4,A16/S3)
During T1 state the four address lines for memory operations. During
I/O operations these lines are low. During T2, T3 and T4 states status
information is available on these lines.
S5: The status of the
interrupt flag S6: is always
low
0 0 Extra segment
access
0 1 Stack segment
access
1 0 Code segment
access
1 1 Data segment
access
S7/BHE
BHE stands for Bus High Enable. It is available at pin 34 and used to
indicate the transfer of data using data bus D8-D15. This signal is low
during the first clock cycle, thereafter it is active. S7: not currently used
Read
It is available at pin 32 and is used to read signal for Read operation.
Ready
It is available at pin 32. It is an acknowledgement signal from I/O
devices that data is transferred. It is an active high signal. When it is high,
it indicates that the device is ready to transfer data. When it is low, it
indicates wait state.
RESET
It is available at pin 21 and is used to restart the execution. It causes the
processor to immediately terminate its present activity. This signal is
active high for the first 4 clock cycles to RESET the microprocessor.
INTR
It is available at pin 18. It is an interrupt request signal, which is sampled
during the last clock cycle of each instruction to determine the availability
of interrupt request.
NMI
It stands for non-maskable interrupt and is available at pin 17,indicate
interrupt response at the end of current instruction.
TEST
This signal is like wait state and is available at pin 23. When this signal
is high, then the processor has to wait for IDLE state, else the execution
continues.
MN/MX
It stands for Minimum/Maximum and is available at pin 33. It indicates
what mode the processor is to operate in; when it is high, it works in the
minimum mode and vice-versa.
INTA
It is an interrupt acknowledgement signal and id available at pin 24.
When the microprocessor receives this signal, it acknowledges the
interrupt.
ALE
It stands for address enable latch and is available at pin 25. This signal
indicates the availability of a valid address on the address/data lines.
DEN
It stands for Data Enable and is available at pin 26. It is used to indicate
the availability of valid data over address/data lines
DT/R
It stands for Data Transmit/Receive signal and is available at pin 27.
When it is high, data is transmitted out and when it is low, data is
received by processor
M/IO
This signal is used to distinguish between memory and I/O operations.
When it is high, it indicates I/O operation and when it is low indicates
the memory operation.
WR
It stands for write signal and is available at pin 29. It is used to write the
data into the memory or the output device depending on the status of M/IO
signal.
HLDA
It stands for Hold Acknowledgement signal and is available at pin 30.
This signal acknowledges the HOLD signal.
HOLD
This signal indicates to the processor that external devices are
requesting to access the address/data buses. It is available at pin 31.
QS1 and QS0
These are queue status signals and are available at pin 24 and 25. These
signals provide the status of instruction queue. Their conditions are
shown in the following table −
QS0 QS1 Status
0 0 No operation
S0, S1, S2
These are the status signals that provide the status of operation, which is
used by the Bus Controller 8288 to generate memory & I/O control signals.
These are available at pin 26, 27, and 28. Following is the table showing their
status −
S2 S1 S0 Status
0 0 0 Interrupt acknowledgement
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 Passive
LOCK
It indicates to another system bus master, not to gain control of the system bus
while LOCK is active Low.
RQ/GT1 and RQ/GT0
These are the Request/Grant signals used by the other processors requesting the
CPU to release the system bus. When the signal is received by CPU, then it
sends acknowledgment. RQ/GT0 has a higher priority than RQ/GT1.
Memory Segmentation
Segmentat
ion
It is the process in which the main memory of computer is divided into different
segments and each segment has its own base address.
* Segmentation is used to increase the execution speed of computer system so
that processor can able to fetch and execute the data from memory easily and
fastly.
Segmentation in 8086
The size of address bus of 8086 is 20 and is able to address 1 Mbytes
of physical memory. The compete 1 Mbytes memory can be divided
into 16 segments, each of 64 Kbytes size. Only four segments can be
addressed at a time
Types of Segmentation
Overlapping segment
• A segment starts at a particular address and its maximum size can go up to 64
Kbytes. But if another segment starts along this 64 Kbytes location of the first
segment, the two segments are said to be overlapping segment.
• The area of memory from the start of the second segment to the possible
end of the first segment is called as overlapped segment.
Non Overlapped Segment
• A segment starts at a particular address and its maximum size can go up to 64
Kbytes. But if another segment starts before this 64 Kbytes location of the first
segment, the two segments are said to be Non- overlapping segment.
Advantages of segmentation
The main advantages of the segmented memory scheme are as follows: Allows
the memory capacity to be 1 Mbyte although the actual addresses to be handled
are of 16-bit size Allows the placing of code data and stack portions of the
same program in different parts (segments) of memory, for data and code
protection. Permits a program and/ or its data to be put into different areas of
memory each time program is executed, ie, provision for relocation may be done.
Memory Address Generation
• The BIU has a dedicated adder for determining physical memory addresses.
Physical Address (20 Bits) Adder Segment Register (16 bits) 0 0 0 0 Offset
Value (16 bits)
Logical Address is specified as segment: offset
• Physical address is obtained by shifting the segment address 4 bits to the
left and adding the offset address.
Physical Memory Organization
● The total memory (1mb) of 8086 is arranged in two banks. An
odd bank and an even bank. Both the banks have equal no. of
locations.
● The odd bank contains odd numbered memory Locations. It is known as
upper bank.
● The even bank contains only even numbered memory. Locations.
It is known as lower bank.
● This arrangement is done in order to speed up the operation Every
memory location has two kinds of address – physical and logical.
● A physical address is the 20-bit value that uniquely identifies
each byte location in the Mega byte memory space.
● These may range from 0 to FFFFF Hex.
● All exchanges between the CPU and memory components use this
physical address
● Programs deal with logical, rather than physical, addresses.
● A logical address consists of a segment base value and an offset value.
Byte data with even address is referred on D15 D8 .D7 D0 and byte
data with odd address is transferred on
The processor provides two enable A0 for selecting of either even or odd or
signals, BHE and banks. both the
FIG
A0 Function
BHE
0 0 Whole word
0 1 Upper byte/ odd address
1 0 Lower byte/even address
1 1 none
Status bits S3 to S7 are multiplexed with higher order address bits and
the BHE signal. Address is valid during T1 while status bits S3 to S7
are valid during T2 through T4.
General Bus Cycle
The microprocessor 8086 is operated in minimum mode by strapping its MN/MX pin to
logic 1
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 latches are generally buffered output D-type flip-flops, like, 74LS373 or
8282. They are used for separating the valid address from the multiplexed
address/data signals and are controlled by the ALE signal generated by 8086.
Transreceivers are the bidirectional buffers they are required to separate the
valid data from the time multiplexed address/data signal.
They are controlled by two signals, namely, DEN and DT/R. The DEN signal
indicates that the valid data is available on the data bus, while DT/R indicates
the direction of data, i.e. from or to the processor.
Usually, EPROMS are used for monitor storage, while RAMs for users program
storage. A system may contain I/O devices for communication with the
processor as well as some special purpose I/O devices. The clock generator
generates the clock from the crystal oscillator for the system.
The timing diagram can be categorized in two parts, the first is the timing
diagram for read cycle and the second is the timing diagram for write cycle.
Fig shows the read cycle timing diagram. The read cycle begins in T1 with the
assertion of the address latch enable (ALE) signal and also M/IO signal. During
the negative going edge of this signal, the valid address is latched on the local
bus.
The BHE and A0signals address low, high or both bytes. From Tl to T4,
the M/IO signal indicates a memory or I/O operation.
At T2 the address is removed from the local bus and is sent to the output. The
read (RD) control signal is also activated in T2
The read (RD) signal causes the addressed device to enable its data bus drivers.
After RD goes low, the valid data is available on the data bus.
The addressed device will drive the READY line high, when the processor
returns the read signal to high level, the addressed device will again tristate its
bus drivers.
A write cycle also begins with the assertion of ALE and the emission of
the address. The M/IO signal is again asserted to indicate a memory or I/O
operation. In T2 after sending the address in Tl the processor sends the data to be
written to the addressed location.
The data remains on the bus until middle of T4 state. The WR* becomes
active at the beginning of T2 (unlike RD is somewhat delayed in T2 to provide
time for floating).
The BHE and A0 signals are used to select the proper byte or bytes of memory
or I/O word to be read or written. The M/IO, RD and WR signals indicate the
types of data transfer as specified in Table
useful for multiprocessor systems. AEN and IOB are generally grounded. CEN
pin is usually tied to +5V.
The significance of the MCE/PDEN output depends upon the status of the IOB
pin. If IOB is grounded, it acts as master cascade enable to control cascaded
8259A; else it acts as peripheral data enable used in the multiple bus
configurations
INTA pin is used to issue two interrupt acknowledge pulses to the interrupt
controller or to an interrupting device.
IORC, IOWC are I/O read command and I/O write command signals
respectively. These signals enable an IO interface to read or write the data from
or to the addressed port.
The MRDC, MWTC are memory read command and memory write command
signals respectively and may be used as memory read and write signals.
All these command signals instruct the memory to accept or send data from or
to the bus. For both of these write command signals, the advanced signals
namely AIOWC and AMWTC are available. They also serve the same purpose,
but are activated one clock cycle earlier than the IOWC and MWTC signals,
respectively.
Fig Maximum Mode 8086 System
The maximum mode system timing diagrams are also divided in two portions as
read (input) and write (output) timing diagrams. The address/data and
address/status timings are similar to the minimum mode. ALE is asserted in T1,
just like minimum mode. The only difference lies in the status signals used and
the available control and advanced command signals.
Intel 80186
Architecture
Features
The 80286 CPU contains almost the same set of registers, as in 8086,
namely
1. Eight 16-bit general purpose registers
2. Four 16-bit segment registers
3. Status and control registers
4. Instruction Pointer
D2, D4, D6, D7 and D11 are called as status flag bits. The bits D8
(TF) and D9 (IF) are used for controlling machine operation and
thus they are called control flags. The additional fields available
in 80286 flag registers are :
The machine status word consists of four flags – PE, MP, EM and
TS of the four lower order bits D19 to D16 of the upper word of
the flag register. The LMSW and SMSW instructions are
available in the instruction set of 80286 to write and read the
MSW in real address mode.
O
R
The Internal Architecture of 80386 is divided into 3 sections.
•Central processing unit
•Memory management unit
•Bus interface unit
• The barrel shifter increases the speed of all shift and rotate
operations.
•The data buffers interface the internal data bus with the system bus.
Intel 80486 Feature
Improved 80386 CPU (6 extra instructions)
Hard-wired implementation of frequently used instructions (as in
RISCs)
A 5 stage instruction pipeline
An 8K Cache Memory + cache controller (previously a separate
device)
An on-chip Floating Point coprocessor
Longer Prefetch Queue (32-bytes as opposed to 16 on the 80386)
Higher frequency operation
About a million transistors
Like the 80386 it uses real, protected and virtual 8086
modes and its Memory Management Unit include a
Segmentation Unit and a Paging Unit.
Pentium II
Pentium II is also a 32-bit processor with 64-bit data bus and
36-bit address bus to address up to 64GB of physical memory
space. It is actually a Pentium pro processor with on-chip MMX
(Multi Media Extension). It is available with maximum internal
ratings of 233 MHz to 450 MHz.
The features of Pentium II processor are;