What Is A Microprocessor?
What Is A Microprocessor?
The computer’s Central Processing Unit (CPU) built on a single Integrated Circuit
The microprocessor contains millions of tiny components like transistors, registers, and
diodes that work together.
Block Diagram of a Microcomputer
Evolution of Microprocessors
The first generation microprocessors were introduced in the year 1971-1972 by
Intel Corporation. It was named Intel 4004 since it was a 4-bit processor.
The second generation microprocessors were introduced in 1973 again by Intel. It
was a first 8 - bit microprocessor which could perform arithmetic and logic
operations on 8-bit words. It was Intel 8008, and another improved version was
Intel 8088.
The third generation microprocessors, introduced in 1978 were represented
by Intel's 8086, Zilog Z800 and 80286, which were 16 - bit processors with a
performance like minicomputers.
Several different companies introduced the 32-bit microprocessors, but the most
popular one is the Intel 80386.
Basic Terms used in Microprocessor
Instruction Set - The group of commands that the microprocessor can
understand is called Instruction set. It is an interface between hardware and
software.
Bus - Set of conductors intended to transmit data, address or control information
to different elements in a microprocessor. A microprocessor will have three types
of buses, i.e., data bus, address bus, and control bus.
IPC (Instructions Per Cycle) - It is a measure of how many instructions a CPU
is capable of executing in a single clock.
Clock Speed - It is the number of operations per second the processor can
perform. It can be expressed in megahertz (MHz) or gigahertz (GHz). It is also
called the Clock Rate.
Contd…
Bandwidth - The number of bits processed in a single instruction is
called Bandwidth.
When it is not used under such as reset, hold and halt etc this buffer is used tristate high order
address bus.
Data/Address buffer
8 bit bi-Directional buffer
Used to drive the low order address (A0 to A7) and data (D0 to D7) bus.
Under certain conditions such as reset, hold and halt etc this buffer is used tristate low order address bus.
Features of Microprocessor- 8085
20
8085 is developed by INTEL
It generates 8 bit I/O addresses, hence it can access 2^8 = 256 I/O ports.
It provides DMA.
21
8085 Pin Diagram
Operation S1 S0
2. S1 and S0 (Status Signal): (Pin 33 and 29) HALT 0 0
Status signals to specify the kind of operation being performed . WRITE 0 1
Usually un-used in small systems. READ 1 0
FETCH 1 1
Control Signals
Control Pins – RD, WR, IO/M(active low)
1. RD: Read(Active low) (Pin 32)
Read Memory or I/O device and indicates that data is to be read either from memory or I/P device and
data bus is ready for accepting data from the memory or I/O device.
2. WR: Write(Active low) (Pin 31)
Write Memory or I/O device indicates that data on the data bus are to be written into selected memory
or I/O device.
3. IO/M: (Input Output/Memory-Active low) (Pin 34)
Signal specifies that the read/write operation relates to whether memory or I/O device.
When (IO/M=1) the address on the address bus is for I/O device
When (IO/M=0) the address on the address bus is for memory
IO/M(active low) RD WR Control Signal Operation
0 0 1 MEMR M/M Read
0 1 0 MEMW M/M write
1 0 1 IOR I/O Read
1 1 0 IOW I/O Write
26
Interrupts
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, (Pin 6-11)
Accumulator 16-bit
Address Bus
Register Array
ALU
Memory Pointer
Flags Registers 8-bit Data
Bus
Instruction
Decoder
Control Bus
Timing and Control Unit
Accumulator (8-bit) Flag Register (8-bit)
S Z AC P CY
B (8-bit) C (8-bit)
D (8-bit) E (8-bit)
H (8-bit) L (8-bit)
Stack Pointer (SP) (16-bit)
Program Counter (PC) (16-bit)
1.Accordi
ng to 2.According
addressin to size
g modes
3.According to
operation
Addressing Modes of 8085
To perform any operation, we have to give the corresponding
instructions to the microprocessor.
In each instruction, programmer has to specify 3 things:
1. Operation to be performed i.e. Opcode
2. Address of source of data i.e. Operands
3. Address of destination of result.
Definition
The various ways of specifying operands for an instruction are called the addressing
modes.
The various addressing modes that are defined in a given instruction set architecture
define how machine language instructions in that architecture identify the operand(s)
of each instruction.
In any microprocessor instruction, the source and destination operands can be a
Register
Memory Location
8-bit number
The method by which the address of source of data and the address of the destination of the result is
given in the instruction are called the Addressing modes.
8085 uses the following addressing modes:
• 1-byte instruction
• 2-byte instruction
• 3-byte instruction
1.One byte instruction
• A one byte instruction includes the operand and
the op-code in same byte.
• These type of instructions occupy only one
memory location.
• For example:
Opcode Operand Hex Code
MOV C,A 4F
ADD B 80
CMA 2F
2.Two byte instruction
• A two byte instruction includes the op-code and the 8-bit
data or address.
• This type of instruction occupies 2-memory location.
• For example:
Arithmetic Instructions
Logical Instructions
Branching Instructions
Control Instructions
Data Transfer Instructions
This instruction copies the contents of the source register into the
destination register.
Instruction: MOV A, B
B 89 h B 89 h
MEMORY MEMORY
2003 7Ah 2003 7Ah
2004 C2h 2004 C2h
2005 45h 2005 45h
2006 F4h 2006 F4h
Data Transfer Instructions
Instruction: LDAX D
Register contents
Register contents after
before Execution
Execution
HL 74F1h HL 45C2h
MEMORY MEMORY
2004 7Ah 2004 7Ah
2005 C2h 2005 C2h
2006 45h 2006 45h
MEMORY MEMORY
2003 7Ah 2003 7Ah
2004 C2h 2004 C2h
2005 45h 2005 87h
2006 F4h 2006 F4h
Data Transfer Instructions
Example: STAX B
Example
Instruction: STAX B
BC 4020h BC 4020h
MEMORY MEMORY
401F 7Ah 401F 7Ah
4020 C2h 4020 A4h
4021 45h 4021 45h
4022 F4h 4022 F4h
Data Transfer Instructions
Register contents
Register contents after
before Execution
Execution
HL 74F1h HL 74F1h
MEMORY MEMORY
2004 7Ah 2004 7Ah
2005 A4h 2005 F1h
2006 45h 2006 74h
Example: XCHG
Example
Instruction: XCHG
DE 5678 h DE 1234 h
Data Transfer Instructions
Example: SPHL
Data Transfer Instructions
Example: XTHL
Data Transfer Instructions
Example: PCHL
Data Transfer Instructions
Example: PUSH B
Data Transfer Instructions
Example: POP H
Data Transfer Instructions
Example: OUT 78 H
Data Transfer Instructions
Example: IN 8C H
Arithmetic Instructions
Addition
Subtract
Increment
Decrement
Arithmetic Instructions
ADD
•ADD r or M
•ADC r or M
•ADI 8 bit data
•ACI 8 bit data
•DAD rp
SUB
•SUB r or M
•SBB r or M
•SUI 8 bit data
•SBI 8 bit data
INR r or M
DCR r or M
INX rp
DCX rp
DAA
Addition
Instruction: ADD B
A 9A h A 23 h
B 89 h B 89 h
1001 1010
1000 1001
0010 0011
Flag: S=0, Z=0, AC=1 , P=0 and CY=1
Note: All flags are affected during the execution of arithmetic instruction.
Arithmetic Instructions
The contents of register or memory and Carry Flag (CY) are added to the
contents of accumulator.
Instruction: ADC B
A 9A h A 24 h
B 89 h B 89 h
Example: ADI 45 H
Example
A C4 h A 76 h
The 8-bit data and the Carry Flag (CY) are added to the
contents of accumulator.
Example: ACI 45 H
Example
A 38 h A 4E h
Example: DAD B
Example
Instruction: DAD B
BC 1122 h BC 1122 h
The contents of the register or memory location are subtracted from the
contents of the accumulator.
Instruction: SUB M
HL 8500h HL 8500h
MEMORY
MEMORY
84FF 7Ah
84FF 7Ah
8500 08h
8500 08h
8501 45h 0010 0000
0000 1000 8501 45h
8502 F4h
0001 1000 8502 F4h
Flag: S=0, Z=0,
Flag: S=0, Z=0, AC=1
AC=0 , P=0 and
, P=1 and CY=0
CY=1
Arithmetic Instructions
The contents of the register or memory location and Borrow Flag (i.e. CY)
are subtracted from the contents of the accumulator.
Instruction: SBB B
A 40 h A 1F h
B 20 h B 20 h
Example: SUI 45 H
Example
A 05 h A F2 h
The 8-bit data and the Borrow Flag (i.e. CY) is subtracted
from the contents of the accumulator.
Example: SBI 45 H
Example
A 18 h A 04 h
Instruction: INR E
Example: INX H
Example
Instruction: INX D
Instruction: DCR M
MEMORY MEMORY
84FF 7Ah 84FF 7Ah
8500 08h 8500 07h
8501 45h 8501 45h
8502 F4h 8502 F4h
Example: DCX H
Example
Instruction: DCX H
AND
OR
XOR
Rotate
Compare
Complement
AND, OR, XOR
OR operation
XOR operation
Instruction: ANA C
A 62 h A 42 h
C 4A h C 4A h
The contents of the accumulator are XORed with the contents of the register or memory.
If the operand is a memory location, its address is specified by the contents of H-L pair.
Instruction: XRA E
A EE h A B4 h
E 5A h E 5A h
1110 1110
Flag: S=0, Z=0, AC=0
Flag: S=0, Z=0, 0101 1010 , P=1 and CY=0
AC=0 , P=0 and 1011 0100
CY=0
The contents of the accumulator are logically ORed with the contents of the register or
memory.
If the operand is a memory location, its address is specified by the contents of H-L pair.
Instruction: ORA C
A 62 h A 6A h
C 4A h C 4A h
Instruction: RLC
Register contents
before Execution
CY A
1 0 1 1 0 1 0 1 1
Instruction: RRC
Register contents
before Execution
CY A
1 0 1 1 0 1 0 1 1
Instruction: RAL
Register contents
before Execution
CY A
0 1 1 1 0 0 0 0 1
Instruction: RAR
Register contents
before Execution
CY A
0 1 1 1 0 0 0 0 1
Greater Than
Less Than
Instruction: CMP L
A 45 h A 45 h
L 75 h C 75 h
Instruction: CMA
1001 1010
0110 0101
SP 1001 h
STACK
1000
SP 1001 00h
SP 1002 80h
SP 1003 9Ch
Instruction: RET
SP 1001 h SP 1003 h
STACK
STACK
1000
1001 1000
00
1001
1002 90h
1002
1003 9Ch
1003 9Ch
Note: No Flags are affected.
Branching Instructions
RST 1 0008 H
RST 2 0010 H
RST 3 0018 H
RST 4 0020 H
RST 5 0028 H
RST 6 0030 H
RST 7 0038 H
Control Instructions
No operation is performed.
The instruction is fetched and decoded but no
operation is executed.
Example: NOP
Control Instructions