Professional Documents
Culture Documents
Unit I Microprocessor Notes
Unit I Microprocessor Notes
Unit I Microprocessor Notes
SARITHA
DEPT. OF ELECTRONICS
UNIT – I
INTRODUCTION TO INTEL 8085 MICROPROCESSOR
Microprocessor :
Microprocessor is a Programmable integrated device that has computing and decision making
capability similar to that of the central processing unit of a computer.
Evolution of Microprocessors :
The evolution of microprocessors has been classified into five generations :
First generation (1971 – 73)
Intel Corporation introduced 4004, the first 4-bit microprocessor in 1971. It is evolved from
the development effort while designing a calculator chip.
There were three other microprocessors in the market during the same period:
Rockwell International’s PPS-4 (4 bits)
Intel’s 8008 (8 bits)
National Semiconductor’s IMP-16 (16 bits)
They were fabricated using PMOS technology which provided low cost, slow speed and
low output currents.
They were not compatible with TTL.
Second Generation (1974 – 1978)
This era marked the beginning of very efficient 8 – bit microprocessors.
Some of the popular processors were:
Motorola’s 6800 and 6809
Intel’s 8085
Zilog’s Z80
They were manufactured using NMOS technology.
This technology offered faster speed and higher density than PMOS
It is TTL compatible
The functional block diagram or architecture of 8085 Microprocessor, gives the complete details
about a Microprocessor. It includes the ALU (Arithmetic and logic unit), timing and control unit,
instruction registers and decoder, register array, interrupt control, and serial I/O control etc. To
connect all the blocks with each other we need some buses such as address bus, data bus and
control bus. Fig.1. shows the Block diagram of a Microprocessor.
There is always a need to perform arithmetic operations like +, -, *, / and logical operations like
AND, OR, NOT etc. So there is a necessity for creating a separate unit which can perform such
type of operations. These operations are performed by the Arithmetic and Logic Unit (ALU).
ALU performs these operations on 8-bit data.
Acumulator (A) :- It is an 8-bit register. It is used to store one of the operand in many
instructions. After the execution of most of the instructions the result is stored in the
accumulator. That’s why this is also called result register. It also works as a register for I/O
access.
Temporary Register :- It is a 8-bit register. As the name suggests this register acts as a
temporary memory during the arithmetic and logical operations. Unlike other registers, this
temporary register can only be accessed by the microprocessor and it is completely inaccessible
to programmers.
W and Z registers :- These are two 8- bit temporary registers used to hold temporary data
internally during the program execution. These are not accessible by the programmer.
Flags :-
Flags are nothing but a group of individual Flip-flops. The flags are mainly associated with
arithmetic and logic operations. The flags will show either a logic 0 or 1 (i.e.) a set or reset
depending on the data conditions in the accumulator or various other registers. A flag is actually
a latch which can hold some bits of information. It alerts the processor that some event has taken
place.
There are five flip-flops in the flag register. They are as follows:
1. Sign (S)
2. zero (Z)
3. Auxiliary carry (AC)
4. Parity (P)
5. Carry (C)
The bit position of the flip flops in flag register is:
1. Sign (S) – If MSB of the result of an operation has a value 1, this flag is set otherwise it is
reset.
2. Zero (Z) - If the result of an operation has a value zero, this flag is set otherwise it is reset.
3. Auxiliary carry (AC) – During the arithmetic operation, if a carry is transferred from D3 to
D4, this flag is set otherwise it is reset.
4. Parity (P) - If the result of an operation contains even number of 1s, this flag is set otherwise it
is reset.
5. Carry(C) - If the instruction resulted in a carry (from addition) or borrow (from either
subtraction or comparison) out of higher order bit, this flag is set otherwise it is reset.
Apart from the accumulator 8085 consists of six special type of registers called General Purpose
Registers. These general purpose registers are used to hold data like any other registers. The
general purpose registers in 8085 microprocessor are B, C, D, E, H and L. Each register can hold
8-bit data. These registers can also be used to work in pairs to hold 16-bit data.
They can work in pairs such as B-C, D-E and H-L to store 16-bit data. The H-L pair works as a
memory pointer. A memory pointer holds the address of a particular memory location. They can
store 16-bit address as they work in pair.
Program Counter :- It is a 16 bit special purpose register used to store the memory address of
the next instruction to be executed next. The execution of a program is initiated by loading the
PC by the address of the first instruction of the program. Once the first instruction is executed,
the PC is automatically incremented to point to the next instruction and this process is repeated
till the end of the program. Hence it is also called as ‘Memory Pointer’.
Stack Pointer :- It is a 16 bit special purpose register, which controls a portion of memory
known as stack and it holds the address of this stack top. This stack is used to save the content of
a register during the execution of a program.
Instruction registers (IR) :- It is an 8-bit register. It is used to hold the current instruction which
the microprocessor is about to execute. Note that this register is not accessible by the
programmer.
Instruction Decoder :- It interprets the instruction stored in the instruction register. It generates
various machine cycles depending upon the instruction. The machine cycles are then given to
the Timing and Control Unit.
Incrementer/Decrementer Register :- It is a 16-bit register used to increment or decrement the
contents of PC and stack pointer. It is also not accessible by the programmer.
Timing and Control Unit :- The timing and control unit is a section of the CPU. It generates
timing and control signals which are necessary for the execution of instructions. It provides
status, control and timing signals which are required for the operation of memory and I/O
devices. It controls the entire operation of the microprocessor and peripherals connected to it.
Thus it is seen that control unit of the CPU acts as a brain of the computer.
There are three status signals used in microprocessor S0, S1 and IO/ . It changes its status
according to the provided input to these pins.
Serial Input/Output Control :- There are two pins in this unit SID and SOD . This unit is used
for serial data communication.
Interrupt control :- There are 6 interrupt pins in this unit. Generally an external hardware is
connected to these pins. These pins provide interrupt signal sent by the external hardware to the
microprocessor and microprocessor sends acknowledgement for receiving the interrupt signal.
Generally is used for acknowledgement.
Note : Registers are small memories within the CPU. They are used by the microprocessor for
temporary storage and manipulation of data and instructions. Data remain in the registers till they
are sent to the memory or I/O devices.
1. Address Bus
2. Data Bus
3. Control Bus
Address Bus:
The address bus is a group of 16 lines generally identified as A0 to A15.
The address bus is unidirectional: bits flow in one direction - from the microprocessor to
peripheral devices.
The microprocessor uses the address bus to perform the first function: identifying a
peripheral or a memory location.
The Length of the address bus determines the amount of memory a system can address
(216=65535 bytes =64 Kb).
Data Bus:
The data bus is a group of eight lines used for data flow.
These lines are bi-directional - data flow in both directions between the microprocessor
and memory and peripheral devices.
The microprocessor uses the data bus to perform the second function: transferring binary
information.
The largest number that can appear on the data bus is 11111111.
Control Bus:
The control bus carries synchronization and timing signals.
The MPU generates specific control signals for every operation it performs.
These signals are used to identify a device with which the MPU wants to communicate.
Pin configuration of 8085 Microprocessor and its description :
Timing Diagram :
The graphical representation of the time taken for the execution of each instruction by a
microprocessor is known as timing diagram. The execution time is denoted by T-states. One T-
state is equal to the time period of the internal clock signal of the microprocessor.
For example, if the internal clock frequency of 8085 microprocessor is 3 MHz, one T-state is
equal to 1/f = 1/3x106 = 0.333x10-6 sec = 333x10-9 sec (333 nano seconds).
As far as execution of instructions is concerned, in 8085 microprocessor, each instruction
is divided into two parts: The operation code (op-code) and the operand. The op-code tells us
what the operation is and the operand is the necessary information required for the instruction.
The operand may be either data or an address or other information required for the instruction.
Each instruction is divided into machine cycles and each machine cycle is divided into clock
cycles or T-states.
The first machine cycle in every instruction is the op-code fetch. During this time the op-code is
fetched from memory and returned on the data bus to the microprocessor. The 8085 machine
cycles are divided into following six types. They are
Op-code fetch
Memory read
Memory write
I/O read
I/O write
Interrupt acknowledge
Machine Cycle
Machine cycle is defined as the time required for completing the operation of accessing either
memory or I/O device. In the 8085, the machine cycle may consist of three to six T states. The
T-state is defined as one sub division of the operation performed in one clock period. These sub
divisions are internal states synchronized with the system clock. In every machine cycle the first
operation is op-code fetch and the remaining will be read or write from memory or I/O devices.
Fetch Cycle
The first byte of an instruction is its op-code. An instruction may be more than one byte long.
The other bytes are data or operand address. The program counter (PC) keeps the memory
address of the next instruction to be executed. In the beginning of a fetch cycle the content of the
program counter, which is the address of the memory location where op-code is available, is sent
to the memory. The memory places the op-code on the data bus so as to transfer it to the
microprocessor.
Execute Cycle
The op-code fetched from the memory goes to the instruction register, IR. From the instruction
register it goes to the decoder circuitry which decodes the instruction. After the instruction is
decoded, execution begins. If the operand is in the general purpose registers, execution is
immediately performed.
The time taken for decoding and execution is one clock cycle. If an instruction contains data or
operand and address which are still in the memory, the microprocessor has to perform some read
operations to get the desired data. After receiving the data it performs execute operation. A read
cycle is similar to a fetch cycle. In case of a read cycle the quantity received from the memory
are data or operand address instead of an op-code. In some instructions write operation is
performed. In write cycle data are sent from the microprocessor to the memory or an output
device. Thus, in some cases an execute cycle may involve one or more read or write cycles or
both.
Applications of Microprocessor
Microprocessors are being used for numerous applications and the list of applications is
becoming longer and longer. Some of them are given below.