Unit I Microprocessor Notes

You might also like

Download as doc, pdf, or txt
Download as doc, pdf, or txt
You are on page 1of 15

Dr. C.

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

Third generation microprocessors (1979 – 80)


This age is dominated by 16 – bits microprocessors
S.S.B.N. DEGREE & PG COLLEGE (AUTONOMOUS) 1
Dr. C. SARITHA
DEPT. OF ELECTRONICS

Some of them were:


Intel’s 8086/80186/80286
Motorola’s 68000/68010
 They were designed using HMOS technology
 HMOS provides some advantages over NMOS as
 Speed-power-product of HMOS is four times better than that of NMOS
 HMOS can accommodate twice the circuit density compared to NMOS
 Intel used HMOS technology to recreate 8085A and named it as 8085AH with a
higher price tag.
Fourth Generation (1981 – 1995)
This era marked the beginning of 32 bits microprocessors
Intel introduced 432, which was a bit problematic
Then a clean 80386 is launched.
Motorola introduced 68020/68030.
 They were fabricated using low-power version of the HMOS technology called HCMOS.
 Motorola introduced 32-bit RISC processors called MC88100
Fifth Generation (1995 – till date)
In this age the emphasis is on introducing chips that carry on-chip functionalities and
improvements in the speed of memory and I/O devices along with introduction of 64-bit
microprocessors.
Intel leads the show here with Pentium, Celeron and very recently dual and quad core processors
working with up to 3.5GHz speed.
Salient features of 8085 microprocessor

The main features of 8085 μp are:


 It is a 8 bit microprocessor
 It is manufactured with N-MOS technology
 It is a 40 pin LSI chip
 Operates at Single + 5V Supply

S.S.B.N. DEGREE & PG COLLEGE (AUTONOMOUS) 2


Dr. C. SARITHA
DEPT. OF ELECTRONICS

 Operates with 3MHz single phase clock


 On-chip clock generator
 It supports external interrupt request
 It has 16-bit address bus (A0-A15 )
 It has 8-bit data bus (D0 – D7 )
 A 16 bit program counter (PC)
 A 16 bit stack pointer (SP)
 Six 8-bit general purpose registers : B, C, D, E, H and L.
Architecture of 8085 Microprocessor :

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.

S.S.B.N. DEGREE & PG COLLEGE (AUTONOMOUS) 3


Dr. C. SARITHA
DEPT. OF ELECTRONICS

Fig (1): Functional Block Diagram of 8085 Microprocessor

Arithmetic and Logic Unit

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.

S.S.B.N. DEGREE & PG COLLEGE (AUTONOMOUS) 4


Dr. C. SARITHA
DEPT. OF ELECTRONICS

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.

S.S.B.N. DEGREE & PG COLLEGE (AUTONOMOUS) 5


Dr. C. SARITHA
DEPT. OF ELECTRONICS

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.

General Purpose Registers :-

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’.

S.S.B.N. DEGREE & PG COLLEGE (AUTONOMOUS) 6


Dr. C. SARITHA
DEPT. OF ELECTRONICS

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 two control signals:

1. - This is an active low control signal used for read operation.

2. -This is an active low control signal used for write operation.

There are three status signals used in microprocessor S0, S1 and IO/ . It changes its status
according to the provided input to these pins.

S.S.B.N. DEGREE & PG COLLEGE (AUTONOMOUS) 7


Dr. C. SARITHA
DEPT. OF ELECTRONICS

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.

8085 Bus Structure :


Bus is a group of conducting wires which carries information, all the peripherals are connected to
microprocessor through Bus.

There are three buses in 8085 Microprocessor:

1. Address Bus

2. Data Bus

3. Control Bus

S.S.B.N. DEGREE & PG COLLEGE (AUTONOMOUS) 8


Dr. C. SARITHA
DEPT. OF ELECTRONICS

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 :

S.S.B.N. DEGREE & PG COLLEGE (AUTONOMOUS) 9


Dr. C. SARITHA
DEPT. OF ELECTRONICS

Intel 8085 is an 8-bit, N-channel Metal Oxide semiconductor (NMOS) microprocessor. It is a 40


pin IC package fabricated on a single Large Scale Integration (LSI) chip. The Intel 8085 uses a
single +5V DC supply for its operation. Its clock speed is about 3MHz. It has 80 basic
instructions and 246 opcodes. The 8085 is an enhanced version of its predecessor, the 8080A.

Pin diagram of 8085

The 8085 signals are grouped as follows:


1. Address bus
2. Address/data bus
3. Control and status signals
4. Interrupt signals
5. DMA signals
6. Timing and synchronization signals
7. Serial I/O signals
8. Power supply
(1) Address signals: A15 – A8
These signals form the higher order address lines

S.S.B.N. DEGREE & PG COLLEGE (AUTONOMOUS) 10


Dr. C. SARITHA
DEPT. OF ELECTRONICS

(2) Address/Data signals: AD7 – AD0


This is a time multiplexed address and data bus used for carrying both
lower order address signals
Data signal at different time intervals
Address bus is unidirectional and data bus is bidirectional
(3) Control and Status signals:
(a) Control Signals:
- This is an active low signal. This signal indicates that selected I/O or memory device is to
be read and that the data is available on the data lines.
- This is also an active low signal. This signal indicates that the data on the data bus is to be
written into the selected memory or I/O location.
(b) Status Signals:
- used to differentiate between I/O and memory operation.
1 – I/O operation 0 – Memory operation
S1, S0 – These signals along with are used to identify various operations of the
microprocessor.
ALE – This signal is generated during the first clock period of every machine cycle. It is used to
demultiplex the multiplexed lower order address and data bus.
(4) Interrupt Signals:
An interrupt is a request to the microprocessor to suspend the execution of the main program
temporarily and execute another program called Interrupt Service Routine (ISR) corresponding
to a device which has requested microprocessor through any of the 5 interrupt lines i.e., TRAP,
RST 7.5, RST 6.5, RST 5.5 & INTR. is an acknowledgement to a maskable interrupt.
(5) DMA Signals:
DMA (Direct Memory Access) is the process of transferring data from the I/O device to memory
without the interference of the microprocessor. We must keep in mind that for initiating the
DMA process microprocessor is needed.
HOLD – This signal indicates a peripheral such as DMA controller is requesting for the use of
address and data bus.

S.S.B.N. DEGREE & PG COLLEGE (AUTONOMOUS) 11


Dr. C. SARITHA
DEPT. OF ELECTRONICS

HLDA – This output signal acknowledges the HOLD request.


(6) Timing and synchronization signals:
- when the signal on this pin goes low, the program counter is set to 0, buses are
tristated and microprocessor is reset.
RESET OUT – This signal indicates that the microprocessor is reset and can be used to reset
other devices.
CLKOUT – This signal can be used as system clock for other devices.
X1 and X2 – The crystal is connected across these pins. The frequency is internally divide by 2.
Thus, to operate a system at 3MHz, the crystal must have a frequency of 6MKz.
READY – This input signal is used to delay the microprocessor read/write cycles until an I/O
device is ready to send/accept data.
(7) Serial I/O signals:
SID – serial input data: The data on this line is loaded into accumulator bit – 7 whenever a RIM
instruction is executed.
SOD – Serial output data: This line is set or reset as specified by the SIM instruction.
These two signals are used to establish serial communication between the microprocessor and
external serial I/O devices.
(8) Power supply signals:
VCC - +5V Power supply
VSS – ground reference

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

S.S.B.N. DEGREE & PG COLLEGE (AUTONOMOUS) 12


Dr. C. SARITHA
DEPT. OF ELECTRONICS

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

Instruction Cycle, Machine Cycle, Fetch and Execute Cycles :


Instruction Cycle :
The time taken for the execution of an instruction is called instruction cycle (IC). An instruction
cycle (IC) consists of a fetch cycle (FC) and an execute cycle (EC). A fetch cycle is the time
required for the fetch operation in which the machine code of an instruction (op-code) is fetched
from the memory. This time is a fixed slot of time. An execute cycle is of variable width which
depends on the instruction to be executed. The total time for the execution is given by IC = FC +
EC.

S.S.B.N. DEGREE & PG COLLEGE (AUTONOMOUS) 13


Dr. C. SARITHA
DEPT. OF ELECTRONICS

Fig (a): An instruction cycle showing FC, EC and IC

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.

S.S.B.N. DEGREE & PG COLLEGE (AUTONOMOUS) 14


Dr. C. SARITHA
DEPT. OF ELECTRONICS

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.

►Personal Computer ► Numerical Control

►Mobile Phones ►Automobiles


►Bending Machines ►Medical Diagnostic Equipment
►Automatic voice recognizing systems ►Prosthetics
►Traffic light Control ►Entertainment Games
►Digital Signal Processing ►Communication terminals
►Process Control ►Calculators
►Sophisticated Instruments ►Telecommunication Switching Systems
►Automatic Test Systems.

S.S.B.N. DEGREE & PG COLLEGE (AUTONOMOUS) 15

You might also like