EC2002 8085 Microprocessors: Sachin Kumar Jain

Download as pdf or txt
Download as pdf or txt
You are on page 1of 54

EC2002

8085 Microprocessors

Sachin Kumar Jain


PDPM-IIITDM Jabalpur
[email protected]

Teachers open the door but you must enter by yourself


---Chinese Proverb
Reviewing Fundamentals
Software:
Set of instructions to perform certain task.

Stand up
Go to nearest switchboard
Switch Off the FAN
Switch On the Lamp

Come back to your seat

Sit down
Reviewing Fundamentals
Hardware:
Physical components of any machine or system.
Reviewing Fundamentals
Language:
A medium to communicate with others.

Low Level Language:


• Machine (Instructions in binary form)

•Assembly (Instructions in mnemonic form)

High Level Language:

• Basic, Pascal, Fortran, C, C+ etc.

Mnemonic: symbolic code (English word) for each instruction


Lets
Get
Started
Computer Vs Human
CPU/Brain

Output

Input

Memory
Veins
CPU
Buses Nerves
I/O

Signal Carriers
Computer Vs Human
CPU/Brain

Output

Input

• Control Events
• Remember Events
• Make Decisions
• Instruct other parts
What is microprocessor ?

• Analogous to Human Brain


• Electronic IC Chip consisting of variety of
digital circuits e.g. logic gates, flip-flops,
registers etc.
• Multipurpose Programmable logic device.
• High-speed instruction set executer
• An obedient and intelligent companion
How it works ?
• The microprocessor executes a given list
of instructions, and accordingly
performs the task or series of tasks.

Piano generates
notes with its key
and sequential keys
produce ‘Music’.
Evolution of μP
Processor Year Address Bus Data Bus
4004 1971 10 bit 4 bit
8008 1972 14 bit 8 bit
8080 1974 16 bit 8 bit
8085 1976 16 bit 8 bit
8086 1978 20 bit 16 bit
Pentium 1993 32 bit 32 bit
Pentium 4 2000 36 bit 64 bit
8085 Internal Architecture

Accumulator Register Array


Arithmetic & B C

Address Bus
Logic Unit

Control Bus
D E
Data Bus
(ALU)
H L
Flag Stack Pointer (SP)
Instruction Program Counter (PC)
Decoder

Timing & Control Unit


8085 Pin Configuration

8085
8085 Internal Architecture
Arithmetic Logic Unit (ALU)

It performs the computing functions like, addition, subtraction,


logical operations, etc. It includes the accumulator, temporary
registers, the arithmetic and logic circuits, flag register, etc.
The accumulator is an 8-bit register associated with ALU that is
used to hold one of the operands of an arithmetic or logical
operation. The results of an arithmetic or logical operation is stored
in the accumulator, except few exceptions.
Temporary register is also an 8-bit register associated with ALU. It
holds data during an arithmetic or logical operation. This register is
used by the microprocessor, and it is not accessible to the
programmer. These registers W and Z are reserved registers. We
can’t use these registers in arithmetic operations.
8085 Internal Architecture
Arithmetic Logic Unit (ALU)

Flag Register is also a part of ALU having five flip-flops that serves
as status flag. These flip-flops set or reset after an arithmetic/logical
operation according to the data conditions of the result in the
accumulator.
These flags play crucial role in decision making process of the
microprocessor.
These five flip-flops are part of an 8-bit register, known as Program
Status Word. Its three bits remain undefined. It is presented as:

D7 D6 D5 D4 D3 D2 D1 D0

S Z AC P CY
8085 Internal Architecture
Arithmetic Logic Unit (ALU)
D7 D6 D5 D4 D3 D2 D1 D0

S Z AC P CY

Sign Flag (S): After any operation if the MSB (B(7)) of the result is 1, it indicates
the number is negative and the sign flag becomes set, i.e. 1. If the MSB is 0, it
indicates the number is positive and the sign flag becomes reset.

Zero Flag (Z): After any arithmetical or logical operation if the result is 0 (00)H,
the zero flag becomes set i.e. 1, otherwise it becomes reset i.e. 0.

Auxiliary Carry Flag (AC): This flag is used in the BCD number system(0-9).
If after any arithmetic or logical operation D(3) generates any carry and passes it on to
D(4) this flag becomes set i.e. 1, otherwise, it becomes reset i.e. 0. This is the only
flag register that is not accessible by the programmer.
8085 Internal Architecture
Arithmetic Logic Unit (ALU)
D7 D6 D5 D4 D3 D2 D1 D0

S Z AC P CY

Parity Flag (P): If after any arithmetic or logical operation the result has even
parity, an even number of 1 bit, the parity register becomes set i.e. 1, otherwise it
becomes reset i.e. 0.

Carry Flag (CY): Carry is generated when performing n bit operations and the
result is more than n bits, then this flag becomes set i.e. 1, otherwise, it becomes reset
i.e. 0. During subtraction (A-B), if A>B it becomes reset, and if (A<B) it becomes set.
Carry flag is also called the borrow flag.
8085 Internal Architecture
Instruction Register & Decoder

It is an 8-bit register that holds the instruction code that is being


decoded. The instruction is fetched from the memory. The decoder
decodes the instruction and establishes the sequence of events to
follow.

Timing and control unit


The timing and control unit comes under the CPU section, and it
controls the flow of data from the CPU to other devices. It is also
used to control the operations performed by the microprocessor and
the devices connected to it. There are certain timing and control
signals like Control signals, DMA Signals, RESET signals and Status
signals.
8085 Internal Architecture
Register Array

There are six general-purpose registers. These registers can hold 8-


bit values. These 8-bit registers are B,C,D,E,H,L. These registers
work as 16-bit registers when they work in pairs like B-C, D-E, and
H-L.

Program Counter

Program Counter holds the address value of the memory to the next
instruction that is to be executed. It is a 16-bit register.
8085 Internal Architecture
Stack Pointer

It works like a stack. In stack, the content of the register is stored


that is later used in the program. It is a 16-bit special register. The
stack pointer is part of memory, but it is part of Stack operations,
unlike random memory access.
Stack pointer works in a continuous and contiguous part of the
memory. whereas Program Counter (PC) works in random memory
locations. This pointer is very useful in stack-related operations like
PUSH, POP, and nested CALL requests initiated by Microprocessor.
It reserves the address of the most recent stack entry.
8085 Signals
Functional Block Diagram
Memory Classification
Memory

Storage
Prime Memory
Memory

Read/Write Read-Only Floppy Disks


Memory RAM Memory ROM Hard Disks
CD-ROM
Magnetic Tape
Charge Coupled
Static R/WM Device

Erasable Permanent
Dynamic
Memory Memory
R/WM
8085: How it works ?

• Program is Stored in the Memory Output Buffer


40
• Execution Command sends memory 1C
4E
address to the Program Counter 31

Address Decoder
6A
12

Accumulator Register Array


Arithmetic & B C
Address Bus
Bus

Logic Unit
Data Bus

D E
(ALU)
H L
Control

Flag Stack Pointer (SP)

Instruction PC : 2010
Input Buffer
Decoder

Timing & Control Unit


Memory

Microprocessor
8085: How it works ?
Program Counter contents are
send to address bus to locate the Output Buffer
40
instruction in memory. 1C
4E
31

Address Decoder
6A
12

Accumulator Register Array


Arithmetic & B C
Address Bus
Bus

Logic Unit
Data Bus

D E
(ALU)
H L
Control

Flag Stack Pointer (SP)

Instruction 2010 PC : 2010


Input Buffer
Decoder

Timing & Control Unit


Memory

Microprocessor
8085: How it works ?
Program Counter contents are
send to address bus to locate the Output Buffer
40
instruction in memory. 1C
4E
31

Address Decoder
6A
12

Accumulator Register Array


Arithmetic & B C
Address Bus
Bus

Logic Unit
Data Bus

D E
(ALU)
H L
Control

Flag Stack Pointer (SP)

Instruction 2010 PC : 2010


Input Buffer
Decoder

Timing & Control Unit


Memory

Microprocessor
8085: How it works ?
Program Counter contents are
send to address bus to locate the Output Buffer
40
instruction in memory. 1C
4E
31

Address Decoder
6A
12

Accumulator Register Array


Arithmetic & B C
Address Bus
Bus

Logic Unit
Data Bus

D E
(ALU)
H L
Control

Flag Stack Pointer (SP)

Instruction 2010 PC : 2010


Input Buffer
Decoder

Timing & Control Unit


Memory

Microprocessor
8085: How it works ?
Program Counter contents are
send to address bus to locate the Output Buffer
40
instruction in memory. 1C
4E
31

Address Decoder
6A
12

Accumulator Register Array


Arithmetic & B C
Address Bus
Bus

Logic Unit
Data Bus

D E
(ALU)
H L
Control

Flag Stack Pointer (SP)

Instruction 2010 PC : 2010


Input Buffer
Decoder

Timing & Control Unit


Memory

Microprocessor
8085: How it works ?
Program Counter contents are
send to address bus to locate the Output Buffer
40
instruction in memory. 1C
4E
31

Address Decoder
6A
12

Accumulator Register Array


Arithmetic & B C
Address Bus
Bus

Logic Unit
Data Bus

D E
(ALU)
H L
Control

Flag Stack Pointer (SP)

Instruction 2010 PC : 2010


Input Buffer
Decoder

Timing & Control Unit


Memory

Microprocessor
8085: How it works ?
Program Counter contents are
send to address bus to locate the Output Buffer
40
instruction in memory. 1C
4E
31

Address Decoder
6A
12

Accumulator Register Array


Arithmetic & B C
2010 Address Bus
Bus

Logic Unit
Data Bus

D E
(ALU)
H L
Control

Flag Stack Pointer (SP)

Instruction PC : 2010
Input Buffer
Decoder

Timing & Control Unit


Memory

Microprocessor
8085: How it works ?
Program Counter contents are
send to address bus to locate the Output Buffer
40
instruction in memory. 1C
4E
31

Address Decoder
6A
12

Accumulator Register Array


Arithmetic & B C
Address Bus 2010
Bus

Logic Unit
Data Bus

D E
(ALU)
H L
Control

Flag Stack Pointer (SP)

Instruction PC : 2010
Input Buffer
Decoder

Timing & Control Unit


Memory

Microprocessor
8085: How it works ?
Program Counter contents are
send to address bus to locate the Output Buffer
40
instruction in memory. 1C
4E

2010
31

Address Decoder
6A
12

Accumulator Register Array


Arithmetic & B C
Address Bus
Bus

Logic Unit
Data Bus

D E
(ALU)
H L
Control

Flag Stack Pointer (SP)

Instruction PC : 2010
Input Buffer
Decoder

Timing & Control Unit


Memory

Microprocessor
8085: How it works ?
Program Counter contents are
send to address bus to locate the Output Buffer
40
instruction in memory. 1C
4E
2010 31

Address Decoder
6A
12

Accumulator Register Array


Arithmetic & B C
Address Bus
Bus

Logic Unit
Data Bus

D E
(ALU)
H L
Control

Flag Stack Pointer (SP)

Instruction PC : 2010
Input Buffer
Decoder

Timing & Control Unit


Memory

Microprocessor
8085: How it works ?
Program Counter contents are
send to address bus to locate the Output Buffer
40
instruction in memory. 1C
4E
2010 31

Address Decoder
6A
12

Accumulator Register Array


Arithmetic & B C
Address Bus
Bus

Logic Unit
Data Bus

D E
(ALU)
H L
Control

Flag Stack Pointer (SP)

Instruction PC : 2010
Input Buffer
Decoder

Timing & Control Unit


Memory

Microprocessor
8085: How it works ?
Program Counter contents are
send to address bus to locate the Output Buffer
40
instruction in memory. 1C
4E
2010 31

Address Decoder
6A
12

Accumulator Register Array


Arithmetic & B C
Address Bus
Bus

Logic Unit
Data Bus

D E
(ALU)
H L
Control

Flag Stack Pointer (SP)

Instruction PC : 2010
Input Buffer
Decoder

Timing & Control Unit


Memory

Microprocessor
8085: How it works ?
Program Counter contents are
send to address bus to locate the Output Buffer
40
instruction in memory. 1C
4E
2010 31

Address Decoder
6A
12

Accumulator Register Array


Arithmetic & B C
Address Bus
Bus

Logic Unit
Data Bus

D E
(ALU)
H L
Control

Flag Stack Pointer (SP)

Instruction PC : 2010
Input Buffer
Decoder

Timing & Control Unit


Memory

Microprocessor
8085: How it works ?
Program Counter contents are
send to address bus to locate the Output Buffer
40
instruction in memory. 1C
4E
31

Address Decoder
6A
12

Accumulator Register Array


Arithmetic & B C
Address Bus
Bus

Logic Unit
Data Bus

D E
(ALU)
H L
Control

Flag Stack Pointer (SP)

Instruction PC : 2010
Input Buffer
Decoder

Timing & Control Unit


Memory

Microprocessor
8085: How it works ?
uP sends memory read command
Output Buffer
signal to memory chip. 40
1C
4E
31

Address Decoder
6A
MEMR (Read Command) 12

Accumulator Register Array


Arithmetic & B C
Address Bus
Bus

Logic Unit
Data Bus

D E
(ALU)
H L
Control

Flag Stack Pointer (SP)

Instruction PC : 2010
Input Buffer
Decoder

Timing & Control Unit


Memory

Microprocessor
8085: How it works ?
uP sends memory read command
Output Buffer
signal to memory chip. 40
1C
4E
31

Address Decoder
6A
MEMR (Read Command) 12

Accumulator Register Array


Arithmetic & B C
Address Bus
Bus

Logic Unit
Data Bus

D E
(ALU)
H L
Control

Flag Stack Pointer (SP)

Instruction PC : 2010
Input Buffer
Decoder

Timing & Control Unit


Memory

Microprocessor
8085: How it works ?
uP sends memory read command
Output Buffer
signal to memory chip. 40
1C
4E
31

Address Decoder
6A
MEMR (Read Command) 12

Accumulator Register Array


Arithmetic & B C
Address Bus
Bus

Logic Unit
Data Bus

D E
(ALU)
H L
Control

Flag Stack Pointer (SP)

Instruction PC : 2010
Input Buffer
Decoder

Timing & Control Unit


Memory

Microprocessor
8085: How it works ?
uP sends memory read command
Output Buffer
signal to memory chip. 40
1C
4E
31

Address Decoder
6A
MEMR (Read Command) 12

Accumulator Register Array


Arithmetic & B C
Address Bus
Bus

Logic Unit
Data Bus

D E
(ALU)
H L
Control

Flag Stack Pointer (SP)

Instruction PC : 2010
Input Buffer
Decoder

Timing & Control Unit


Memory

Microprocessor
8085: How it works ?
uP sends memory read command
Output Buffer
signal to memory chip. 40
1C
4E
31

Address Decoder
6A
MEMR (Read Command) 12

Accumulator Register Array


Arithmetic & B C
Address Bus
Bus

Logic Unit
Data Bus

D E
(ALU)
H L
Control

Flag Stack Pointer (SP)

Instruction PC : 2010
Input Buffer
Decoder

Timing & Control Unit


Memory

Microprocessor
8085: How it works ?
uP sends memory read command
Output Buffer
signal to memory chip. 40
1C
4E
31

Address Decoder
6A
MEMR (Read Command) 12

Accumulator Register Array


Arithmetic & B C
Address Bus
Bus

Logic Unit
Data Bus

D E
(ALU)
H L
Control

Flag Stack Pointer (SP)

Instruction PC : 2010
Input Buffer
Decoder

Timing & Control Unit


Memory

Microprocessor
8085: How it works ?
uP sends memory read command
Output Buffer
signal to memory chip. 40
1C
4E
31

Address Decoder
6A
MEMR (Read Command) 12

Accumulator Register Array


Arithmetic & B C
Address Bus
Bus

Logic Unit
Data Bus

D E
(ALU)
H L
Control

Flag Stack Pointer (SP)

Instruction PC : 2010
Input Buffer
Decoder

Timing & Control Unit


Memory

Microprocessor
8085: How it works ?
uP sends memory read command
Output Buffer
signal to memory chip. 40
1C
4E
31

Address Decoder
6A
MEMR (Read Command) 12

Accumulator Register Array


Arithmetic & B C
Address Bus
Bus

Logic Unit
Data Bus

D E
(ALU)
H L
Control

Flag Stack Pointer (SP)

Instruction PC : 2010
Input Buffer
Decoder

Timing & Control Unit


Memory

Microprocessor
8085: How it works ?
40
As soon as Read signal reaches to the Output Buffer

chip, contents are placed on the data bus. 40


1C
4E
31

Address Decoder
6A
MEMR (Read Command) 12

Accumulator Register Array


Arithmetic & B C
Address Bus
Bus

Logic Unit
Data Bus

D E
(ALU)
H L
Control

Flag Stack Pointer (SP)

Instruction PC : 2010
Input Buffer
Decoder

Timing & Control Unit


Memory

Microprocessor
8085: How it works ?
40
This data called OPCODE is than Output Buffer
40
transferred to Instruction Register. 1C
4E
31

Address Decoder
6A
MEMR (Read Command) 12

Accumulator Register Array


Arithmetic & B C
Address Bus
Bus

Logic Unit
Data Bus

D E
(ALU)
H L
Control

Flag Stack Pointer (SP)

Instruction PC : 2010
Input Buffer
Decoder

Timing & Control Unit


Memory

Microprocessor
8085: How it works ?
40
This data called OPCODE is than Output Buffer
40
transferred to Instruction Register. 1C
4E
31

Address Decoder
6A
MEMR (Read Command) 12

Accumulator Register Array


Arithmetic & B C
Address Bus
Bus

Logic Unit
Data Bus

D E
(ALU)
H L
Control

Flag Stack Pointer (SP)

Instruction PC : 2010
Input Buffer
Decoder

Timing & Control Unit


Memory

Microprocessor
8085: How it works ?
40
This data called OPCODE is than Output Buffer
40
transferred to Instruction Register. 1C
4E
31

Address Decoder
6A
MEMR (Read Command) 12

Accumulator Register Array


Arithmetic & B C
Address Bus
Bus

Logic Unit
Data Bus

D E
(ALU)
H L
Control

Flag Stack Pointer (SP)

Instruction PC : 2010
Input Buffer
Decoder

Timing & Control Unit


Memory

Microprocessor
8085: How it works ?
40
This data called OPCODE is than Output Buffer
40
transferred to Instruction Register. 1C
4E
31

Address Decoder
6A
MEMR (Read Command) 12

Accumulator Register Array


Arithmetic & B C
Address Bus
Bus

Logic Unit
Data Bus

D E
(ALU)
H L
Control

Flag Stack Pointer (SP)

Instruction PC : 2010
Input Buffer
Decoder

Timing & Control Unit


Memory

Microprocessor
8085: How it works ?
This data called OPCODE is than Output Buffer
40
transferred to Instruction Register. 1C
40 4E
31

Address Decoder
6A
MEMR (Read Command) 12

Accumulator Register Array


Arithmetic & B C
Address Bus
Bus

Logic Unit
Data Bus

D E
(ALU)
H L
Control

Flag Stack Pointer (SP)

Instruction PC : 2010
Input Buffer
Decoder

Timing & Control Unit


Memory

Microprocessor
8085: How it works ?
This data called OPCODE is than Output Buffer
40
transferred to Instruction Register. 1C
4E
31

Address Decoder
6A
MEMR (Read Command) 12
40
Accumulator Register Array
Arithmetic & B C
Address Bus
Bus

Logic Unit
Data Bus

D E
(ALU)
H L
Control

Flag Stack Pointer (SP)

Instruction PC : 2010
Input Buffer
Decoder

Timing & Control Unit


Memory

Microprocessor
8085: How it works ?
This data called OPCODE is than Output Buffer
40
transferred to Instruction Register. 1C
4E
31

Address Decoder
6A
MEMR (Read Command) 12

Accumulator Register Array


Arithmetic & B C
Address Bus
Bus

Logic Unit
Data Bus

D E
(ALU)
H L
Control

Flag Stack Pointer (SP)

Instruction
40 PC : 2010
Input Buffer
Decoder

Timing & Control Unit


Memory

Microprocessor
8085: How it works ?
This data called OPCODE is than Output Buffer
40
transferred to Instruction Register. 1C
4E
31

Address Decoder
6A
MEMR (Read Command) 12

Accumulator Register Array


Arithmetic & B C
Address Bus
Bus

Logic Unit
Data Bus

D E
(ALU)
H L
Control

Flag Stack Pointer (SP)

Instruction PC : 2010
Input Buffer
Decoder (40)

Timing & Control Unit


Memory

Microprocessor
8085: How it works ?
Input Buffer
Microprocessor than acts according to the 40
1C
instruction received. PC incremented. 4E
31

Address Decoder
6A
12

Accumulator Register Array


Arithmetic & B C
Address Bus
Bus

Logic Unit
Data Bus

D E
(ALU)
H L
Control

Flag Stack Pointer (SP)


PC : 2012
Instruction Output Buffer
Decoder

Timing & Control Unit


Memory

Microprocessor

You might also like