UNIT-I
What is Microprocessors
• The microprocessor is nothing but the CPU and it is an essential component of the
computer.
• It is a silicon chip that comprises millions of transistors and other electronic
components that process millions of instructions per second.
• A Microprocessor is a versatile chip, that is combined with memory and special-
purpose chips and preprogrammed by software.
• It accepts digital data as i/p and processes it according to the instructions stored in
the memory.
• The microprocessor has many functions like functions of data storage, interact with
various other devices, and other time-related functions.
• But, the main function is to send and receive the data to make the function of the
computer well.
Evolution of Microprocessor
• Microprocessors have evolved through five generations, categorized by their bit
size and performance characteristics.
• The first generation, starting in 1971, featured 4-bit and 8-bit processors, like the
Intel 4004 and Intel 8008.
• Subsequent generations saw the rise of 8-bit, 16-bit, 32-bit, and finally, 64-bit
processors, with increasing performance and complexity
First Generation (1971-1972):
• Key Feature: Introduction of the first commercially available microprocessors.
• Examples: Intel 4004, Intel 8008.
• Characteristics: 4-bit and 8-bit architectures, limited memory addressing, and
slower processing speeds.
• Note: Primarily used in calculators and early embedded systems.
Second Generation (1973
onwards):
• Key Feature: Focus on 8-bit processors with improved performance and memory
capabilities.
• Examples: Intel 8080, Zilog Z80.
• Characteristics: Increased instruction sets, faster processing speeds, and larger
memory address spaces compared to the first generation.
Third Generation (1978 onwards):
• Key Feature: Introduction of 16-bit processors, offering significantly higher
performance.
• Examples: Intel 8086, Intel 80286.
• Characteristics: Faster processing speeds, larger memory addressing, and
the beginning of the x86 architecture, which is still widely used.
Fourth Generation (1980s
onwards)
• Key Feature: Transition to 32-bit processors, enabling more complex
applications and multitasking.
• Examples: Intel 80386, Intel 80486.
• Characteristics: Increased processing power, larger memory capacity, and
the introduction of features like virtual memory.
Fifth Generation (1995 onwards):
• Key Feature: 64-bit processors with significant advancements in performance,
multi-core designs, and higher clock speeds.
• Examples: Intel Pentium, Core, and Core i series processors.
• Characteristics: High performance, multi-core processing, enhanced multimedia
capabilities, and complex instruction sets.
• 4-bit Microprocessor
• The INTEL 4004/4040 was invented in the year 1971 by Stanley Mazor & Ted Hoff.
The clock speed of this microprocessor is 740 KHz. The number of transistors
used in this microprocessor is 2,300 and instruction per second is 60K. The
number of pins of this microprocessor is 16.
• 8-bit Microprocessor
• The 8008 processor was invented in the year 1972. The clock speed of this
microprocessor is 500 KHz and instruction per second is 50K
• The 8080 microprocessor was invented in the year 1974. The clock speed is 2
MHz. The number of transistors used is 60k and instruction per second is 10 times
quicker as compared with 8008 processor.
• The 8085 microprocessor was invented in the year 1976. The clock speed is 3
MHz. The number of transistors used is 6,500 and instruction per second is
769230. The number of pins of this microprocessor is 40
• 16-bit Microprocessor
• The 8086 microprocessor was invented in the year 1978. The clock speed is 4.77,
8 & 10 MHz. The number of transistors used is 29000 and instruction per second
is 2.5 Million. The number of pins of this microprocessor is 40
• The 8088 microprocessor was invented in the year 1979 and instruction per
second is 2.5 Million
• The microprocessors like 80186 or 80188 were invented in the year 1982. The
clock speed is 6 MHz
• The 80286 microprocessor was invented in the year 1982. The clock speed is 8
MHz. The number of transistors used is 134000 and instruction per second is 4
Million. The number of pins of this microprocessor is 68.
32-bit Microprocessor
• The Intel 80386 microprocessor was invented in the year 1986. The clock speed
is 16 MHz to 33 MHz. The number of transistors used is 275000. The number of
pins of this microprocessor is 132 14X14 PGA
• The Intel 80486 microprocessor was invented in the year1986. The clock speed is
16MHz to 100 MHz. The number of transistors used is 1.2 Million transistors and
instruction per second is 8 KB of cache memory. The number of pins of this
microprocessor is 168 17X17 PGA (Pin Grid Array)
• The PENTIUM microprocessor was invented in the year 1993. The clock speed is
66 MHz and instruction per second is Cache memory 8-bit for instructions 8- bit
for data. The number of pins of this microprocessor is 237 PGA
64-bit Microprocessor
• The INTEL core 2 microprocessor was invented in the year 2006. The clock speed
is 1.2 GHz to 3 GHz. The number of transistors used is 291 Million and instruction
per second is 64 KB of L1 cache for each core 4 MB of L2 cache.
• The i3, i5, i7 microprocessors were invented in the years 2007, 2009, 2010 2. The
clock speed is 2GHz to 3.3GHz, 2.4GHz to 3.6GHz & 2.93GHz to t 3.33GHz.
8085 Microprocessors
• The features of 8085 microprocessor are as given below:
1. It is an 8-bit microprocessor i.e. it can accept, process, or provide 8-bit data simultaneously.
2. It operates on a single +5V power supply connected at Vcc power supply ground
is connected to Vss.
3. It operates on clock cycle with 50% duty cycle.
4. It has on chip clock generator. This internal clock generator requires tuned circuit like LC, RC or crystal.
The internal clock generator divides oscillator frequency by 2 and generates clock signal, which can be
used for synchronizing external devices.
5. It can operate with a 3 MHz clock frequency. The 8085A-2 version can operate at the maximum
frequency of 5 MHz.
6. It has 16 address lines, hence it can access (216) 64 Kbytes of memory.
7. It provides 8 bit 1/0 addresses to access (25) 256 1/O ports.
8. In 8085, the lower 8-bit address bus (An-A7) and data bus (Do-D7) are multiplexed to reduce number of
external pins. But due to this, external hardware (latch) is required to separate address lines and data
lines.
9. It supports 74 instructions with the following addressing modes:
10. The Arithmetic Logic Unit (ALU) of 8085 performs:
a) 8 bit binary addition with or without carry b) 16 bit binary addition.
c) 2 digit BCD addition. d) 8-bit binary subtraction with or without borrow
e) 8-bit logical AND, OR, EX-OR, complement (NOT), and bit shift operations.
11. It has 8-bit accumulator, flag register, instruction register, six 8-bit general
purpose registers (B, C, D, E, H and L) and two 16-bit registers (SP and PC).
Getting the operand from the general purpose registers is more faster than from
memory. Hence skilled programmers always prefer general purpose registers to
store program variables than memory.
12. It provides five hardware interrupts: TRAP, RST 7.5, RST 6.5, RST 5.5 and INTR.
13. It has serial I/O control which allows serial communication.
14. It provides control signals (IO/M, RD, WR) to control the bus cycles, and hence
external bus controller is not required.
• 15. The external hardware (another microprocessor or equivalent master) can
detect which machine cycle microprocessor is executing using status signals
(IO/M, So ,S₁). This feature is very useful when more than one processors are
using common system resources (memory and I/O devices).
• 16. It has a mechanism by which it is possible to increase its interrupt handling
capacity.
• 17. The 8085 has an ability to share system bus with Direct Memory Access
controller. This feature allows to transfer large amount of data from I/O device to
memory or from memory to I/O device with high speeds.
• 18. It can be used to implement three chip microcomputer with supporting I/O
devices like IC 8155 and IC 8355
Architecture of 8085
• Fig. shows the architecture of 8085.
• It consists of various functional blocks as listed below:
Registers
Arithmetic and Logic Unit
Instruction decoder and machine cycle encoder
Address buffer
Address/Data buffer
Incrementer/ Decrementer Address Latch
Interrupt control
Serial I/O control
Timing and control circuitry.
Register Structure
• The Fig. shows the register structure of
8085.
• The shaded portion of this register model is
called programmer's model of 8085.
• It includes six 8-bitregisters- (B, C, D, E, H
and L) one accumulator, one flag register
and two16-bit registers (SP and PC).
• All these registers are accessible to
programmer and hence they are included in
the programmer's model.
• The remaining registers temporary, W and Z
are not accessible to the programmers; they
are used by microprocessor for internal,
intermediate operations.
The 8085 registers are classified as:
1. General Purpose Registers
2. Temporary Registers
a) Temporary data register b) W and Z registers
3. Special Purpose Registers
a) Accumulator b) Flag registers c) Instruction register
4. Sixteen Bit Registers
a) Program Counter (PC) b) Stack Pointer (SP)
General Purpose Registers:
• B, C, D, E, H, and L are 8-bit general purpose registers can be used as a separate
8-bitregisters or as 16-bit register pairs, BC, DE, and HL.
• When used in register pair mode, the high order byte resides in the first register
(i.e. in B when BC is used as a register pair)and the low order byte in the second
(i.e. in C when BC is used as a register pair).
2. Temporary Registers
a) Temporary Data Register: The ALU has two inputs.
• One input is supplied by the accumulator and other from temporary data register.
• The programmer can not access this temporary data register.
• However, it is internally used for execution of most of the arithmetic and logical instructions.
• For example: ADD B is the instruction in the arithmetic group of instructions which adds the
contents of register A and register B and stores result in register A.
• The addition operation is performed by ALU. The ALU takes inputs from register A and
temporary data register.
• The contents of register B are transferred to temporary data register for applying second
input to the ALU.
• b) W and Z Registers: W and Z registers are temporary registers.
• These registers are used to hold 8-bit data during execution of some instructions. These
registers are not available for programmer, since 8085 uses them internally.
3. Special Purpose Registers:
• a) Register A (Accumulator): It is a tri-state eight bit register.
• It is extensively used in arithmetic, logic, load, and store operations, as well as
in, input/output (I/O) operations.
• Most of the times the result of arithmetic and logical operations is stored in the
register A.
• Hence it is also identified as accumulator.
b) Flag Register (VVI)
• It is an 8-bit register, in which five of the bits carry significant information
in the form of flags:
S (Sign flag),
Z (Zero flag),
AC (Auxiliary carry flag),
P (Parity flag), and
CY (carry flag), as shown in Fig.
S-Sign flag: After the execution of arithmetic or logical operations, if bit D7, of the
result is 1, the sign flag is set. In a given byte if D7, is 1, the number will be viewed as
negative number. If D7, is 0, the number will be considered as positive number.
Z-Zero flag: The zero flag sets if the result of operation in ALU is zero and flag resets
if result is non zero. The zero flag is also set if a certain register content becomes
zero following an increment or decrement operation of that register.
AC-Auxiliary Carry flag: This flag is set if there is an overflow out of bit 3 i.e., carry
from lower nibble to higher nibble (D3 bit to D, bit).
• This flag is used for BCD operations and it is not available for the programmer.
P-Parity flag: Parity is defined by the number of ones present in the accumulator.
• After an arithmetic or logical operation if the result has an even number of ones, i.e.
even parity, the flag is set. If the parity is odd, flag is reset.
CY-Carry flag: This flag is set if there is an overflow out of bit 7. The carry flag also
serves as a borrow flag for subtraction. In both the examples shown below, the carry
flag
• For example 1100 0000 & 1000 0000
• When we add the above two numbers, a carry is generated in the most significant bit.
• The number in the extreme right is least significant bit, while the number in extreme left is most
significant bit.
• So, a ninth bit is generated due to the carry.
• So how to accommodate 9th bit in an 8-bit register?
• For this purpose, the Carry flag is used. The carry flag is set whenever a carry is generated and
reset whenever there is no carry.
• But there is an auxiliary carry flag? What is the difference between the carry flag and auxiliary carry
flag?
• Let’s discuss with an example.
• Consider the two numbers given below 0000 1100 & 0000 1001
• When we add both the numbers a carry is generated in the fourth bit from the least significant
bit.
• This sets the auxiliary carry flag. When there is no carry, the auxiliary carry flag is reset.
• So, whenever there is a carry in the most significant bit Carry flag is set.
• While an auxiliary carry flag is set only when a carry is generated in bits other than the most
• Parity checks whether it’s even or add parity.
• This flag returns a 0 if it is odd parity and returns a 1 if it is an even parity.
• Zero flag shows whether the output of the operation is 0 or not.
• If the value of Zero flag is 0 then the result of operation is not zero. If it is zero
the flag returns value 1.
• Sign flag shows whether the output of operation has positive sign or negative
sign.
• A value 0 is returned for positive sign and 1 is returned for negative sign.
C) Instruction Register: In a typical processor operation, the processor first fetches
the opcode of instruction from memory (i.e. it places an address on the address
bus and memory responds by placing the data stored at the specified address on
the data bus).
• The CPU stores this opcode in a register called the instruction register. This
opcode is further sent to the instruction decoder to select one of the 256
alternatives.
16 Bit Registers
Program counter
Stack pointer
Program counter
Program counter is a special purpose register.
• A program counter stores the address of the next instruction to be executed.
• In other words, the program counter keeps track of the memory address of the instructions that
are being executed by the microprocessor and the memory address of the next instruction that is
going to be executed.
• Microprocessor increments the program whenever an instruction is being executed, so that the
program counter points to the memory address of the next instruction that is going to be executed.
• Program counter is a 16-bit register.
Stack pointer
• Stack pointer maintains the address of the last byte that is entered into stack.
• Each time when the data is loaded into stack, Stack pointer gets decremented.
• Conversely it is incremented when data is retrieved from stack.
Arithmetic Logic Unit (ALU)
• There is always a need to perform arithmetic operations like +, -, *, / and to perform logical
operations like AND, OR, NOT etc.
• So, there is a necessity for creating a separate unit which can perform such types of operations.
• These operations are performed by the Arithmetic and Logic Unit (ALU).
• ALU performs these operations on 8-bit data.
• But these operations cannot be performed unless we have an input (or) data on which the
desired operation is to be performed.
• So, from where do these inputs reach the ALU? For this purpose, accumulator is used.
• ALU gets its Input from accumulator and temporary register.
• After processing the necessary operations, the result is stored back in accumulator.
• The 8085's ALU performs arithmetic and logical functions on eight bit variables.
• The arithmetic unit performs bitwise fundamental arithmetic operations such as addition and
subtraction.
• The logic unit performs logical operations such as complement, AND, OR and EX-OR, as well as
rotate and clear.
•
Instruction Register and Decoder
• The processor first fetches the opcode of instruction from memory and stores
this opcode in the instruction register.
• It is then sent to the instruction decoder.
• The instruction decoder decodes it and accordingly gives the timing and control
signals which control the register, the data buffers, ALU and external peripheral
signals depending on the nature of the instruction.
Address buffer and Address-Data
buffer
• The contents of the stack pointer and program counter are loaded into the
address buffer and address-data buffer.
• These buffers are then used to drive the external address bus and address-data
bus.
• As the memory and I/O chips are connected to these buses, the CPU can
exchange desired data to the memory and I/O chips.
• The address-data buffer is not only connected to the external data bus but also
to the internal data bus which consists of 8-bits.
• The address data buffer can both send and receive data from internal data bus.
Address bus and Data bus
• We know that 8085 is an 8-bit microprocessor i.e the data bus present in the
microprocessor is also 8-bits wide.
• So, 8-bits of data can be transmitted from or to the microprocessor.
• But 8085 processor requires 16-bit address bus as the memory addresses are 16-bit
wide.
• The 8 most significant bits of the address are transmitted with the help of address bus
and the 8 least significant bits are transmitted with the help of multiplexed
address/data bus.
• The eight-bit data bus is multiplexed with the eight least significant bits of address bus.
The address/data bus is time multiplexed.
• For this purpose, a signal called ALE (address latch enables) is used.
• The ALE signal, when high, indicates that the lower 8 bits of the address are available
on the AD0-AD7 lines. This allows external circuitry to latch the address, separating it
from the data bus.
Interrupt control
• As the name suggests this control interrupts a process.
• Consider that a microprocessor is executing the main program.
• Now whenever the interrupt signal is enabled or requested the microprocessor shifts the
control from main program to process the incoming request and after the completion of
request, the control goes back to the main program.
• The microprocessor temporarily stops the execution of main program and transfers
control to I/O device. After collecting the input data, the control is transferred back to
main program. Interrupt signals present in 8085 are:
INTR
RST 7.5
RST 6.5
RST 5.5
TRAP
INTR:- In the 8085 microprocessor, INTR (Interrupt Request) is a maskable, non-
vectored, and hardware interrupt line used by external devices to request the
processor’s attention.
RST5.5 is a maskable interrupt. When this interrupt is received the processor
saves the contents of the PC register into stack and branches to 2CH (hexadecimal)
address.
RST6.5 is a maskable interrupt. When this interrupt is received the processor
saves the contents of the PC register into stack and branches to 34H (hexadecimal)
address.
RST7.5 is a maskable interrupt. When this interrupt is received the processor
saves the contents of the PC register into stack and branches to 3CH (hexadecimal)
address.
TRAP is a non-maskable interrupt. When this interrupt is received the processor
saves the contents of the PC register into stack and branches to 24H (hexadecimal)
address.
Serial I/O Control
• In situations like, data transmission over long distance and communication with
it is necessary to transmit data bit by bit to reduce the cost of cabling.
• In serial communication one bit is transferred at a time over a single line.
• The 8085's serial I/O control provides two lines, SOD and SID for serial
communication.
• The serial output data (SOD) line is used to send data serially and serial input
data (SID) line is used to receive data serially.
Timing and Control Circuitry
• The control circuitry in the processor 8085 is responsible for all the operations.
• The control circuitry and hence the operations in 8085 are synchronized with the
help of clock signal.
• Along with the control of fetching and decoding operations and generating
appropriate signals for instruction execution, control circuitry also generates
signals required to interface external devices to the processor, 8085.
Pin Definitions of 8085
ADDRESSING MODES OF 8086
• In the 8086 microprocessor, addressing modes define how the CPU identifies the
location of operands (data) for instructions. These modes enhance flexibility and
efficiency in accessing data from registers, memory, or immediate values.
1. Immediate Addressing Mode
• - Operand is part of the instruction itself.
• - Example: MOV AX, 1234H
(Loads 1234H directly into AX)
2. Register Addressing Mode
- Both operands are registers.
- Example: MOV BX, AX
(Copies contents of AX into BX)
• 4. Register Indirect Addressing Mode
• - Memory address is held in a register (BX, SI, DI, BP).
• - Example: MOV AX, [BX]
• (Loads data from the address in BX)
5. Based Addressing Mode
- Effective address = Base register (BX or BP) + displacement.
- Example: MOV AX, [BX+04]
Instruction Set of 8085
• An instruction is a binary pattern designed inside a microprocessor to perform a
specific function.
• The entire group of instructions that a microprocessor supports is called
Instruction Set.
• 8085 has 246 instructions.
• Each instruction is represented by an 8-bit binary value.
• These 8-bits of binary value is called Op-Code or Instruction Byte.
Data Transfer Instruction
• An instruction that is used to transfer the data from one register to another is
known as data transfer instruction.
• So, the data transfer can be done from source to destination without changing
the source contents.
• Data transfer mainly occurs from one register to another register, from memory
location to register, register to memory, and between an I/O device &
accumulator.
Arithmetic Instruction of 8085
• The arithmetic instructions perform different operations like addition,
subtraction, increment & decrement on the data within memory & register in the
8085 microprocessor.
Logical Instruction
• Logical instructions are mainly used to perform different operations like logical or Boolean over
the data available in either memory or register.
• These instructions will modify the flag bits based on the operation executed.
Branching Instruction
• These types of instructions are mainly used to transfer or switch the
microprocessor from one location to another.
• So, it simply changes the general sequential flow.
Control Instruction
• These instructions are mainly used to control the microprocessor operations.
NOP (No operation)
• NOP stands for no operation. Once the 8085 microprocessor gets this instruction, then it
does not perform any operation based on execution.
DI (Disable Interrupts)
• DI is the disabling of the interrupt that is generated within the microprocessor. Interrupt
resetting will allow disabling all the interrupts apart from TRAP.
EI (Enable Interrupts)
• This type of instruction is mainly used to allow the interrupt. Once the interrupt enable
pin is set then leads to enabling the interrupts within the system.
HLT (Halt & Enter Wait State)
• Once the HLT interrupt is decoded through the microprocessor, it stops the current
operation and waits for further instruction. To escape from the halt condition either a
reset or an interrupt is necessary.
SIM (Set Interrupt Mask)
• SIM is the set interrupt mask, which is used to execute the hardware interrupts
programming & serial output.
RIM (Read Interrupt Mask)
• RIM is the read interrupt mask that is used to situate the preferred data at the
accumulator based on the serial input & interrupt