Unit IIppt
Unit IIppt
Architecture
Introduction of 8085
Microprocessor is CPU on a Chip.
Introduced in 1976 and is a 8 bit processor.
Intel 8085 is an NMOS microprocessor.
It is a 40 pin IC package fabricated on a single LSI chip.
It uses +5 V for its operation.
Its clock speed is about 3 MHz and clock cycle is 320 ns.
It has 80 basic instructions and 246 opcodes.
Intel has produced large number of peripheral devices for
microprocessor based system.
Figure 1. Intel 8085 40 pin chip
Figure 2. Block Diagram of Intel 8085
The block diagram shows three important sections:
a) Arithmetic and Logic unit
b) Timing and control unit
c) Set of registers
Arithmetic and Logic Unit
• It performs various arithmetic and logical operations
which includes:
Addition Logical AND
Subtraction Logical OR
Increment Complement
Decrement EX-OR
Timing and Control Unit
• It acts as a brain of the computer system.
• It generate timing, control and status signals which are
required for the operations of processor, memory and I/O
devices.
• It controls data flow between processor, memory and
peripheral devices.
X1
Timing and Control Unit
X2
Crystal oscillator
Registers
Registers are used by the microprocessor for temporary storage
and manipulation of data and instructions.
Data remains in the registers till they are sent to the memory or
I/O devices.
Intel 8085 has following set of registers
a) Accumulator, i.e. register A
b) General purpose register, i.e. B, C, D, E, H, L
c) Stack Pointer
d) Program Counter
e) Instruction register
f) Temporary register
g) Status Flags
Accumulator
• It is an 8 bit register associated with the ALU.
• It holds one of the operands of the arithmetic and logical
(AL) operation.
• The other operand is stored in the memory or in the
general purpose registers.
• The final result of AL operation is placed in the
accumulator.
• These are true for general cases, not for some typical or
special cases.
Case-I
Some logical instructions need only one operand.
Example-
INR – The content of the accumulator are
incremented by one.
RAL – The content of the accumulator are rotated
left by one bit.
• Some instruction has operand which is of 16 bit.
Example-
DAD – 16 bit addition
One of the operand is in H-L pair and the other is in B-C
or D-E pair. Result is placed in H-L pair.
General Purpose registers
• The 8085 microprocessor has six 8-bit GPR, i.e. B, C, D,
E, H, L.
• To hold 16 bit data a combination of two 8-bit registers can
be employed.
• The combination of two 8 bit register is known as register
pair.
• There are three register pairs, i. e. B-C, D-E, H-L.
• H-L pair is the default memory or data pointer.
The general purpose registers and accumulator are
accessible to the programmers.
Special purpose registers
a) Program counter –
• It is a 16 bit register which contains or hold the address
of next instruction to be executed.
• It takes care of the program flow or control.
b) Instruction register –
• It is a 8 bit register
• It holds the opcode of the instruction which is being
decoded and executed.
Opcode and Operand
• Instruction contains two parts: operation code (opcode)
and operand.
• Opcode – It specifies the task to be performed by the
computer.
• Operand – It specifies the data to be operated on. It can
be in various forms, i.e.
i. 8 bit or 16 bit data
ii. 8 bit or 16 bit address
iii. Register
Instruction decoder and Machine cycle Encoder
• After the instruction is fetched in the IR, it is decoded
into this block with the help of Micro program.
• Micro program is a program written by chip designer
(manufacturer) to make the processor understand what a
instruction is or it indicates the type of operation to be
performed for an instruction.
• Number of Machine cycles are assigned according to
the type of instruction.
c) Temporary register
• It is a 8 bit register associated with the ALU.
• It holds the data during an arithmetic and logical
operation.
• It is used by the microprocessor in some instructions.
• They are not accessible by the users.
• W, Z are 8 bit temporary registers.
d) Stack pointer
• It is a 16 bit register which contains the address of the
data present at top of the stack.
• It points to top of stack.
Stack
• It is a part of R/W memory.
• Stores the content of accumulator, flags, program counter,
GPR during the execution of the program.
• Stores the content of Program counter when subroutines
are used.
• Any portion of the memory can be used as stack.
• It is based on LIFO (last in first out).
Flag register
• The 8085 microprocessor contains five flip-flops to serve
as status flags.
• The FF are set/reset according to the condition which
arises during an AL operation.
D7 D6 D5 D4 D3 D2 D1 D0
S Z X AC X P X CY
Memory
Microprocessor
DMA Controller
I/O device
1 TRAP V 0024 H
E
2 M RST 7.5 C 003C H
A T
S O
3 RST 6.5 R 0034 H
K
A E
4 B RST 5.5 D 002C H
L
5 E INTR
Manual Monitor
Flowchart Lookup Hex Program To Memory
8085 Binary
Mnemonics code code for Storage
Execute cycle Processor gets data from memory or I/O devices and
perform specific operation
Time
Fetch Cycle
Execute Operation
After the instruction is being decoded, execution begins.
If the operand is in the GPR (one byte instruction), then
execution is immediately performed and the time taken is
one clock cycle.
If the instruction contains data or memory address (two or
three byte instruction).
Processor performs read operation and gets data from the
memory.
In some instruction write operation is performed.
Execution cycle contains one or more read cycles.
Instruction cycle
Operation Control
Signals
0 0 1 Fetch
0 0 1 M/M Read
0 1 0 M/M Write
1 0 1 I/O Read
1 1 0 I/O Write
74LS32
8085
𝐼𝑂/ 𝑀 𝑀𝐸𝑀𝑅
𝑅𝐷
𝑊𝑅
𝑀𝐸𝑀𝑊
74LS04
𝐼𝑂𝑅
74LS32- quadruple two input
OR gate
74LS04-Hex Inverter 𝐼𝑂𝑊
𝐼𝑂𝑅
𝐼𝑂𝑊
8085 Demultiplexed Address and Data Bus with Control Signals
Interfacing
Designing logic circuits (hardware) and writing
instructions (software) to enable the microprocessor to
communicate with peripherals is called interfacing.
In large and minicomputers, the memories and I/O
devices are interfaced to CPU by the manufacturer.
In microprocessor based system the designer has to select
compatible memories & I/O devices to interface.
Additional electronic circuit resolve the incompatibility
issue and interface memory & I/O device with processor.
Memory I/O Device
Data Bus
Control Bus
Unused
Reserved for
future
Memory Interfacing
The address of the memory location and control signals
are sent by the microprocessor to initiate a read or write
operation.
Interfacing process involves designing a circuit that will
match the memory requirement with microprocessor
signals.
Decoding circuit selects the corresponding memory chip
or I/O device.
Decoding can be performed by decoder, comparator,
PLA.
74LS138 (i.e. 1 to 8 lines decoder)
A15 A Y0 EPROM 1
A14 B Y1 EPROM 2
A13 C Y2 RAM 1
Y3 RAM 2
74LS138
5V G1 Y4 RAM 3
𝐼𝑂/ 𝑀 G2A
Y5 RAM 4
G2B
Y6 RAM 5
Vcc Y7 RAM 6
GND
Decoder
Internal
Memory
Decoder
Internal
2048X8
A0 A0
Output Buffer 𝐶𝑆
𝑅𝐷 Output Buffer
𝑅𝐷
A15 A14 𝐸 1𝐸 2 E3
A14 A13 O7
A13 A12 3 to 8
A12 Decoder
O0
A0 A0
O7 O0
D7
Data Bus Output Lines
D0
Interfacing R/W Memory
A14 A15
𝐼𝑂/ 𝑀 𝑅𝐷
𝑊𝑅
A13 𝐸1𝐸2 E3
A12 3-to-8 𝐶𝐸𝑂𝐸𝑊𝐸
A11 Decoder A10
74LS138 O1 6116
𝑀𝐸𝑆𝐿1 R/W Memory
A0 2048 x 8
D7 D0
Data Lines
Interfacing the 8155 Memory Segment
The SDK-85 is a single-board microcomputer designed
by Intel and widely used in college laboratories.
It consists of
8085 microprocessor
8155 comprises of multiple devices on the same chip
which includes R/W memory, programmable I/O ports
and a timer.
𝐼𝑂/ 𝑀 Port A
Logic to
256 X 8 𝐼𝑂/ 𝑀 Generate
𝑀𝐸𝑀𝑊
A 𝑊𝑅
Static
Port B 𝑅𝐷
control 𝑀𝐸𝑀𝑅
RAM signals
𝐶𝐸 B 𝐶𝐸
ALE ALE 𝐴7 Static
𝑅𝐷 8155 Port C
𝑊𝑅 𝐴𝐷7 Latch 𝐴 0 RAM
RESET Timer C
𝐴𝐷 0 256 X 8
TIMER CLK 𝑉 𝑐𝑐
𝑉 𝑠𝑠
𝑇𝐼𝑀𝐸𝑅 𝑂𝑈𝑇
(a) (b)
E1 E2 E3
A13 O4 𝐶𝐸
A12 3-to-8
Decoder
𝐼𝑂/ 𝑀
A11 ALE 256 X 8
8205 𝑅𝐷 Static
R/W
𝑊𝑅 Memory
RESET 8155
𝐴𝐷7
𝐴𝐷 0
Interfacing the 8155 Memory Schematic from the SDK-85 System
Absolute vs. Partial Decoding
Absolute decoding- All the high-order address lines were
decoded to select the memory chip, and the memory chip
is selected only for the specified logic level on these high
order address lines.
Partial decoding- Some of the address lines were not
decoded, resulting in multiple addresses.
Advantage of partial decoding- Cost Saving