You are on page 1of 16

MICROPROCESSOR AND ASSEMBLY

LANGUAGE PROGRAMMING
(Course Code: 3330705)
COURSE OFFERED IN :
SEMESTER : 3, DIPLOMA COMPUTER ENGINEERING

UNIT 1: INTRODUCTION OF MICROPROCESSOR

TOPIC 3: Architecture of 8085

BY :- PROF. VINAY N SONI


LECTURER, COMPUTER ENGINEERING
DEPARTMENT
Outline

 Architecture of 8085
Architecture of 8085

As we know that Microprocessor 8085 is an 8-bit microprocessor designed


by Intel in 1977 using NMOS technology.

It has the following configuration −

µ p > 8-bit data bus


µ p > 16-bit address bus, which can address upto 64KB
µ p > A 16-bit program counter
µ p > A 16-bit stack pointer
µ p > 8-bit Accumulator
µ p > Six 8-bit registers arranged in pairs: BC, DE, HL
µ P > Requires +5V supply to operate at 3.2 MHZ single phase clock
Functional units of 8085
1. Registers
 Accumulator
 General purpose register
 Program counter
 Stack pointer
 Temporary register
 Flag register
2. Arithmetic and logic unit
3. Instruction register and decoder
4. Timing and control unit
5. Interrupt control
6. Serial Input/output control
7. Address buffer and address-data buffer
8. Address bus and data bus
Registers
The 8085 contains both 8-bit and 16-bit registers which are
used to store data.
1. Accumulator (A) : It is an 8-bit register used to perform
arithmetic, logical, I/O & LOAD/STORE operations. It is
connected to internal data bus & ALU.
It is used as default register in instruction while performing
Arithmetic and logical operations.

2. General Purpose registers : 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 pairs in order to hold 16-bit data

and their pairing combination looks like B-C, D-E & H-L.
Continue..
3. Program counter (PC) :
◦ Program counter is a special purpose register.
◦ It is 16-bits in size.
◦ It stores the address of the next instruction/ byte which is
fetch from memory after executing current instruction.
◦ Consider that an instruction is being executed by processor.
As soon as the ALU finished executing the instruction, the
processor looks for the next instruction to be executed.
◦ So, there is a necessity for holding the address of the next
instruction to be executed in order to save time. This is taken
care by the program counter.
◦ The content (i.e. address) of Program counter is increment
automatically after successful execution of current
instruction.
Continue..
4. Stack Pointer (SP):
◦ Stack pointer is also a 16-bit register which is used as a
memory pointer.
◦ A stack is nothing but the portion of RAM (Random access
memory).
◦ Generally stack is defined by using last location of Memory in
8085 which is FFFF H.
◦ Stack pointer maintains the address of the last byte that is
entered into stack.
◦ Each time when the data is loaded into stack, Stack pointer
gets decremented.
◦ Conversely it is incremented SP
when data is
-> FFFFH ->retrieved
XX from
byte
stack. FFFEH -> XY byte

FFFDH -> XZ byte

FFFCH -> 00
Continue..
5. Temporary registers (W & Z):
◦ This temporary registers can only be accessed by the
microprocessor and it is completely inaccessible to programmer
◦ Temporary register is an 8-bit register.
◦ This register is used by control systems to hold operand,
intermediate operand, and address of memory and I/O devices
temporarily.
6. Flag Register :
◦ Flag register is a group of flip flops used to give status of
different operations result.
◦ The flag register is connected with ALU.
◦ Once an operation is performed by ALU the result is transferred
on internal data bus and status of result will be stored in flip
flops.
D7 D6 D5 D4 D3 D2 D1 D0
S Z X AC X P X CY
Continue..
6. Flag Register :
1. Sign flag(S) : This flag is set using MSB of result. If MSB bit =0 then the
answer is consider as positive, else it is negative.

2. Zero flag(Z) : It is set to 1 when result of Arithmetic and logical


instruction is zero (i.e. All zeros are in result) else it is reset(0).

3. Auxiliary Carry flag(AC) : If an operation performed in ALU generates the


carry from lower nibble (D0 to D3) to upper nibble (D4 to D7) then AC flag is
set, else it is reset.

4. Parity flag(P) : It is set to 1 if result of arithmetic and logical operation has


even number of 1’s, also called even parity else it is reset(0) for odd
parity(i.e. odd no of 1’s).

5. Carry flag(CY) : It is an overflow from 8-bit addition. If an operation


performed in ALU generates the carry after MSB(D7) then CY flag is set, else
it is reset.
Continue..
6. Flag Register :
Example :
1. Let A = 67 H and B = E2 H
2. Now perform Arithmetic instruction which is ADD B

CY -> 1 1 0 1 1
A=67H 0 1 1 0 0 1 1 1
B=E2 H 1 1 1 0 0 0 1 0
CY -> 1 0 1 0 0 1 0 0 1

S : MSB bit is 0 So Sign flag is reset (negative result)


Z : there is non-zero result so Zero flag is reset.
AC : there is no carry after lower nibble So AC is reset.
P : No of 1’s are 3 So Parity Flag is reset (odd parity).
CY : there is carry after MSB, So carry flag is set.
Arithmetic and logic unit
◦ It is logic circuit which is responsible for performing all the
arithmetic and logical operations.
◦ The ALU receives the inputs from the accumulator and
temporary registers and also stores result into accumulator.
◦ The ALU also access flag register in order to set or reset the
individual flags according to the result it has computed.

Instruction Register and Decoder


• Instruction Register is 8-bit in size.
• The instruction may be anything like adding two data's, moving
a data, copying a data etc.
• When such an instruction is fetched from memory, it is directed to
Instruction register. So the instruction registers are specifically to
store the instructions that are fetched from memory.
• There is an Instruction decoder which decodes the information
present in the Instruction register for further processing.
Timing and control unit
◦ Timing and control unit is a very important unit as it
synchronizes the registers and flow of data through various
registers and other units.
◦ Once the instruction decoder decodes the instruction, it sends
necessary signals to timing and control section to perform
necessary step in order to complete the execution of the
instruction.
◦ Signals that are associated with Timing and control unit are:
1. Control Signals: READY, RD, WR, ALE
2. Status Signals: S0, S1, IO/M
3. DMA Signals: HOLD, HLDA
4. RESET Signals: RESETIN, RESET OUT.
◦ The timing and control unit is fully responsible to control all
the operations performed by microprocessor.
Interrupt control
 As the name implies it controls the interrupts during a process.
When a main program is being executed from the microprocessor
some interruptions may arise. So, to avoid this interruption the
microprocessor shifts the control from the main program to
process the incoming request. After the request is completed, the
control returns back to the main program.
 There are 5 interrupt signals in 8085 microprocessor: INTR, RST
7.5, RST 6.5, RST 5.5, TRAP.
Serial Input/output control
◦ It controls the serial data communication by using these two pins: SID
(Serial input data) and SOD (Serial output data).

Address buffer and address-data buffer


• The contents of the stack pointer and program counter are loaded into the
address buffer and address-data buffer.
• These buffers are then used to drive the external address bus and
address-data bus.
• As the memory and I/O chips are connected to these buses, the CPU can
exchange desired data to the memory and I/O chips.
• The address-data buffer is not only connected to the external data bus
but also to the internal data bus which consists of 8-bits.
• The address data buffer can both send and receive data from internal data
bus.
Address bus and data bus

 Data bus carries the data to be stored, It is bidirectional


 Whereas address bus carries the location to where it should be
stored and it is unidirectional.
 It is used to transfer the data & Address to I/O devices /
memory.
Thank You !!!

Next Topic : 1. Demultiplexing of Address/ Data Bus


2. Generation of Control Signals

You might also like