The document discusses the introduction to microprocessors and microcomputers. It begins by defining a microcomputer as a small, inexpensive computer with a microprocessor as its central processing unit. It then covers topics like the block diagram of a microcomputer, machine language, assembly language, what is a microprocessor, and the working of a microprocessor. It also provides details about the 8085 microprocessor architecture including its register array, ALU, instruction decoding, interrupts, I/O ports, pin descriptions and status signals.
Keeping Your Information Safe with Centralized Security Services
Introduction to microprocessor
1. K.C.S.KASI NADAR COLLEGE OF ARTS & SCIENCE
(Belongs to S.V.H.N.A. Dharma fund)
Accredited with B++ Grade by NAAC
DEPARTMENT OF COMPUTER SCIENCE
INTRODUCTION TO MICROPROCESSOR
By
Mrs.B.RAMA PRABHA,
ASSISTANT PROFESSOR,
DEPARTMENT OF COMPUTER SCIENCE
2. TOPICS TO BE COVERED
Introduction to Microprocessor
Introduction to Microcomputer
Assembly Language
2
3. Microcomputer
A microcomputer is a small, relatively inexpensive computer with
a microprocessor as its central processing unit (CPU).
It includes a microprocessor, memory, and input/output (I/O)
facilities.
Microcomputers became popular in the 1970s and 80s with the
advent of increasingly powerful microprocessors. •
Examples of Microcomputers are Intel 8051 controller-a single
board computer,
IBM PC and Apple Macintosh computer.
3
5. Machine Language
To communicate with computer, instruction is given in binary
language.
MP has 8 bit data so 2^8 = 256 combinations.
So difficult to write programs in set of 0’s and 1’s .
for eg: 0011 1100 – is an instruction that increments the
number in accumulator by 1
1000 0000– is an instruction that add the number in register B
to the accumulator content , and keep the result in A.
So it is very tedious and error inductive.
For convenience, written in Hexadecimal code. For example 0011 1100
is equivalent to 3C H 5
6. 8085 Assembly Language
Even program is written in Hexa decimal .. It is difficult to
understand.
Program is written in mnemonic.
For E.g.: binary code 0011 1100 (3C H in hexadecimal) is
represented by INR A
INR A –INR stands for Increment, A is accumulator this
symbol suggest the operation of incrementing the accumulator
by 1.
So MP has 246 such bit pattern amounting to 74 different
instruction for performing various operations.
6
7. 8085 Assembly Language
Microprocessor cannot understand a program written I Assembly
language.
A program known as Assembler is used to convert a Assembly
language program to machine language.
7
Assembly
language
program
Assembler
Machine
Language code
8. WHAT IS MICROPROCESSOR?
The word comes from the combination Micro (indicating
very small size) and Processor (process means to
manipulate e. g. certain operations on the numbers).
8
9. Definition of the Microprocessor
Microprocessor is a Programmable, Clock driven, Register based, Electronic device that
reads instruction from a storage device, takes the data from input unit and process the
data according to the instructions and provides the result to the output unit.
Programmable : Perform Different set operation on the data depending on the
sequence of instructions supplied by the programmer.
Clock Driven : Whole task is divided into basic operations, are divided into precise
system clock periods.
Register Based : Storage element
Electronic Device – fabricated on a chip
9
10. Microprocessor based system
From the above description, we can draw the following block diagram to represent a
microprocessor-based system: Output Input Memory
10
11. Inside the Microprocessor
ALU:- Arithmetic and logical operations like add, subtraction,
AND & OR.
Register Array: - Store data during the execution of program.
Control Unit: Provides necessary timing & control signal. It
controls the flow of data between microprocessor and
peripherals.
11
12. Inside the Microprocessor
Memory: Stores information such as instructions and data in
binary format (0 and 1). Sub-system” of microprocessor-based
system. sub-system includes the registers inside the
microprocessor .
Read Only Memory (ROM): used to store programs that do not
need alterations.
Random Access Memory (RAM) (R/WM): used to store
programs that can read and altered like programs and data.
Input/output: Communicates with the outside world.
System Bus: Communication path between the microprocessor
and peripherals. group of wires to carry bits.
12
13. How does a Microprocessor works
To execute a program, the microprocessor “reads” each
instruction from memory, “interprets” it, then “executes or
perform” it.
The right name for the cycle is
Fetch
Decode
Execute
This sequence is continued until all instructions are performed.
13
14. Features of 8085 Microprocessor
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 .
4.It has on chip clock generator.
6.It has 16 address lines, hence it can access (216) 64 Kbytes of memory.
7.It provides 8 bit I/O addresses to access (28 ) 256 I/O ports.
8.In 8085, the lower 8-bit address bus (A0 – A7) and data bus (D0 – D7) are Multiplexed to reduce
number of external pins. 14
15. Features of 8085 Microprocessor
It supports 74 instructions with the following addressing modes :
Immediate
Register
Direct
Indirect
Implied
10.The Arithmetic Logic Unit (ALU) of 8085 performs Arithmatic and logical 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).
12.It provides five hardware interrupts : TRAP, RST 7.5, RST 6.5, RST 5.5 and INTR.
15
18. 8085 Architecture
8085 architecture consists of
following blocks:
1. Register Array
2. ALU & Logical Group
3. Instruction decoder
&encoder,
4. Interrupt control Group
5. Serial I/O control Group
6. Timing and control circuitry 18
19. 1. Register Array
It has eight addressable 8-bit registers : A, B, C, D, E, H,
L, F, and two 16-bit registers PC and SP.
These registers can be classified as:
General Purpose Registers
Temporary Registers :
Temporary data register
W and Z registers
Special Purpose Registers :
Accumulator
Flag registers
Instruction register
Sixteen bit Registers :
Program Counter (PC)
Stack Pointer (SP)
19
20. 1. Register Array
General purpose register
There are 6 general purpose registers in
8085 processor,
i.e. B, C, D, E, H & L. Each register can
hold 8-bit data.
These registers can work in pair to hold
16-bit data and their pairing combination
is like B-C, D-E & H-L.
20
21. 1. Register Array
Temporary Register:
It is an 8-bit register associated with the
ALU. It holds data during an
arithmetic/logical operation.
It is used by the microprocessor.
It is not accessible to programmer.
21
22. 1. Register Array
Special Purpose Register:
Accumulator (A):
The accumulator is an 8-bit register
associated with the ALU.
The register 'A' is an accumulator in the
8085.
It is used to hold one of the operands of
an arithmetic and logical operation.
The final result of an arithmetic or
logical operation is also placed in the
accumulator.
22
23. 1. Register Array
Special Purpose Register:
Instruction Register:
The instruction register holds the opcode
(operation code or instruction code) of the
instruction which is being decoded and
executed.
23
24. 1. Register Array
Special Purpose Register:
Flags Register:
The Intel 8085 microprocessor contains five flip-flops
to serve as a status flags. The flip-flops are reset or set
according to the conditions which arise during an
arithmetic or logical operation.
The five status flags of Intel 8085 are:
Carry Flag (CS)
Parity Flag (P)
Auxiliary Carry Flag (AC)
Zero Flag(Z)
Sign Flag(S)
24
25. 1. Register Array
16 bit Register:
Program Counter (PC):
It is a 16-bit special purpose register.
It is used to hold the address of memory of the
next instruction to be executed.
It keeps the track of the instruction in a program
while they are being executed.
The microprocessor increments the content of the
next program counter during the execution of an
instruction
25
26. 1. Register Array
16 bit Register:
Stack Pointer (SP):
It is a 16-bit special function register used as
memory pointer.
A stack is nothing but a portion of RAM.
In the stack, the contents of only those registers are
saved, which are needed in the later part of the
program.
26
27. The Arithmetic and Logic Unit:
ALU performs the arithmetic and logical operations.
The result of an operation is stored in Accumalator
Instruction decoder and machine cycle encoder:
Decodes the op-code stored in the Instruction Register (IR) and establishes the sequence of
events to follow.
Encodes it and transfer to the timing & control unit to perform the execution of the instruction.
Timing and control circuitry
works as the brain of the CPU
For proper sequence and synchronization of all the operations of MP, this unit generates all the
timing and control signals necessary for communication between microprocessor and peripherals.
27
28. Interrupt Control group
Interrupt:- Occurrence of an external disturbance
After servicing the interrupt, 8085 resumes its normal working sequence
Transfer the control to special routines
Five interrupts: - TRAP, RST7.5, RST6.5, RST5.5, INTR
In response to INTR, it generates INTA signal
Serial I/O control Group
Data transfer red on D0- D7 lines is parallel data
But under some condition it is used serial data transfer
Serial data is entered through SID(serial input data) input (received)
Serial data is outputted on SOD(serial output data) input (send)
28
30. 8085 PIN DIAGRAM
The 40 pins of the microprocessor can be
divided into six groups
1. Power supply and clock signals
2. Address bus
3. Data bus
4. Control and status signals
5. Interrupts and externally initiated
signals
6. Serial I/O ports
30
31. 8085 PIN DIAGRAM
Power supply and Clock signals
Vcc: + 5 volt power supply
Vss: Ground
X1, X2 : Crystal or R/C network or LC network
connections to set the frequency of internal
clock generator.
CLK (output)-Clock Output is used as the
system clock for peripheral and devices
interfaced with the microprocessor.
31
32. 8085 PIN DIAGRAM
2. Address Bus
A8 - A15: (output; 3-state)
It carries the most significant 8 bits of the memory address
or the 8 bits of the I/O address.
3.Data Bus:
AD0 - AD7 (input/output; 3-state)
These multiplexed set of lines used to carry the lower order
8 bit address as well as data bus.
During the opcode fetch operation, in the first clock cycle,
the lines deliver the lower order address A0 - A7.
In the subsequent IO / memory, read / write clock cycle the
lines are used as data bus.
The CPU may read or write out data through these lines.
32
33. 8085 PIN DIAGRAM
Control and status signals:
ALE (output) - Address Latch Enable.
It is an output signal used to give information of AD0-AD7
contents.
It is a positive going pulse generated when a new operation
is started by uP.
When pulse goes high it indicates that AD0-AD7 are
address.
When it is low it indicates that the contents are data.
RD (output 3-state, active low)
Read memory or IO device.
This indicates that the selected memory location or I/O
device is to be read and that the data bus is ready for
accepting data from the memory or I/O device
33
34. 8085 PIN DIAGRAM
Control and status signals:
WR (output 3-state, active low)
Write memory or IO device.
This indicates that the data on the data bus is to be
written into the selected memory location or I/O
device.
IO/M (output) - Select memory or an IO device.
This status signal indicates that the read / write
operation relates to whether the memory or I/O
device.
It goes high to indicate an I/O operation.
It goes low for memory operations.
34
35. 8085 PIN DIAGRAM
Interrupts And Externally initiated operations
They are the signals initiated by an external device to
request the microprocessor to do a particular task or
work.
There are five hardware interrupts called,
• TRAP
• RST 7.5
• RST 6.5
• RST 5.5
• INTA
On receipt of an interrupt, the microprocessor
acknowledges the interrupt by the active low INTA
(Interrupt Acknowledge) signal.
35
36. 8085 PIN DIAGRAM
Interrupts And Externally initiated operations
Reset In (input, active low)
This signal is used to reset the microprocessor.
The program counter inside the microprocessor
is set to zero.
The buses are tri-stated.
Reset Out (Output)
It indicates CPU is being reset.
Used to reset all the connected devices when the
microprocessor is reset.
36
37. Status Signals: S1,S2
37
IO/M S1 S0 OPERATION
0 1 1 Opcode fetch
0 1 0 Memory read
0 0 1 Memory write
1 1 0 I/O read
1 0 1 I/O write
1 1 0 Interrupt acknowledge
Z 0 1 Halt
Z x x Hold
Z x x Reset