Articles added in Mathematics Lab | Cyber Lab is now open | Astronomy Lab is now open | VLSI Lab is now open | 120 SEO Tips article published | More exciting articles coming soon!

# Architecture of 8085

## Introduction

The internal architecture of 8085 includes the ALU, timing and control unit, instruction register and decoder, register array, interrupt control and serial I/O control. The main heart of microprocessor is CPU. CPU comprises of ALU, timing and control unit, instruction register and decoder, register array, interrupt control and serial I/O control.

## Arithmetic and logical section

ALU:
• It is multi operational combinational logic circuit, same as IC 74181(ALU).It performs arithmetic and logical operations like ANDing, ORing, EX-ORing, ADDITON, SUBTRACTION, etc.

• It is not accessible by user.

• The word length of ALU depends upon of an internal data bus.

• IT is 8 bit. It is always controlled by timing and control circuits.

• It provides status or result of flag register.

• Figure shown below shows some functional sections of ALU:

• The ALU contains following blocks:
Adder: It performs arithmetic operations like addition, subtraction, increment, decrement, etc. The result of operation is stored into accumulator.

Shifter: It performs logical operations like rotate left, rotate right, etc. The result of operation is again stored into accumulator.

Status Register: Also known as flag register. It contains a no. of flags either to indicate conditions arising after last ALU operation or to control certain operations.

Accumulator:
• It is one of the general purpose register of microprocessor also called as A register.

• The accumulator is an 8-bit register that is a part of arithmetic/logic unit (ALU).

• This register is used to store 8-bit data and to perform arithmetic and logical operations.

• The result of an operation is stored in the accumulator.

• The user can access this register by giving appropriate instructions (commands).

• Temporary Register:
• It is also called as operand register (8 bit).

• It provides operands to ALU. ALU can store immediate result in temporary register.

• It is not accessible by user.

• Status or flag register:
• Flag register is a group of flip flops used to give status of different operations result.

• The flag register is connected to 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.

• They are called Zero (Z), Carry (CY), Sign (S), Parity (P), and Auxiliary Carry (AC) flags.
• Note: X represent unspecified bits termed as "don't care".

1. Carry flag(CY):
• If an operation performed in ALU generates the carry from D7 to next stage then CY flag is set, else it is reset.

• 2. Auxiliary carry(AC):
• If an operation performed in ALU generates the carry from lower nibble (D0 to D3) to upper nibble (D4 to D7) AC flag is set, else it resets.

• 3. Zero flag(z):
• If an operation performed in ALU results 0value of entire 8-bits then zero flag is set, else it resets.

• 4. Sign flag(s):
• If MSB bit =0 then the number is positive, else it is negative.

• 5. Parity flag(p):
• If the result contains even no. of ones this flag is set and for odd no. of ones this flag is reset.

• ## Register section:

CPU registers of INTEL 8085 are as follows:
1. Temporary register(W and Z):
• This temporary register can only be accessed by the microprocessor and it is completely inaccessible to programmers.

• 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.

• 2. General purpose register:
• Apart from accumulator 8085 consists of six special types of registers called General Purpose Registers.

• These general purpose registers are used to hold data like any other registers.

• The general purpose registers in 8085 processors are B, C, D, E, H and L. Each register can hold 8-bit data.

• Apart from the above function these registers can also be used to work in pairs to hold 16-bit data.

• They can work in pairs such as B-C, D-E and H-L to store 16-bit data.

• The H-L pair works as a memory pointer.

• A memory pointer holds the address of a particular memory location.

• They can store 16-bit address as they work in pair.

• 3. Special purpose register: i. Program counter:
• Program counter is a special purpose register.

• 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.

• A program counter stores the address of the next instruction to be executed.

• Microprocessor increments the program whenever an instruction is being executed, so that the program counter points to the memory address of the next instruction that is going to be executed. Program counter is a 16-bit register.

• ii. Stack pointer:
• 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).

• 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.

• iii. Increment/decrement register:
• The 8-bit contents of a register or a memory location can be incremented or decremented by 1.

• This 16-bit register is used to increment or decrement the content of program counter and stack pointer register by 1.

• Increment or decrement can be performed on any register or a memory location.

• 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.

• ## Interrupt control section:

• As the name suggests this control interrupts a process.

• Consider that a microprocessor is executing the main program. Now whenever the interrupt signal is enabled or requested the microprocessor shifts the control from main program to process the incoming request and after the completion of request, the control goes back to the main program.

• For example an Input/output device may send an interrupt signal to notify that the data is ready for input.

• The microprocessor temporarily stops the execution of main program and transfers control to specific special routine known as "Interrupt Service Routine"(ISR).

• After ISR control is transferred back to main program.

• Figure below shows the idea of communication between microprocessor and device with the help of interrupt.

• Interrupt signals present in 8085 are:
1. INTR
2. RST 7.5
3. RST 6.5
4. RST 5.5
5. TRAP

Description
• Of the above four interrupts TRAP is a NON-MASKABLE interrupt control and other three are maskable interrupts.

• A non-maskable interrupt is an interrupt which is given the highest priority in the order of interrupts.
• Suppose you want an instruction to be processed immediately, then you can give the instruction as a non-maskable interrupt.

• Further the non-maskable interrupt cannot be disabled by programmer at any point of time.

• Whereas the maskable interrupts can be disabled and enabled using EI and DI instructions.

• Among the maskable interrupts RST 7.5 is given the highest priority above RST 6.5 and least priority is given to INTR.

• ## Serial I/O control section:

• The input and output of serial data can be carried out using 2 instructions in 8085:

• 1. SID-Serial Input Data
2. SOD-Serial Output Data
• Two more instructions are used to perform serial-parallel conversion needed for serial I/O devices.

• Instruction register and decoder:
• Instruction register is 8-bit register just like every other register of microprocessor.

• 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.

• This unit consists of an oscillator and controller sequencer which sends control signals needed for internal and external control of data and other units.

• The oscillator generates two-phase clock signals which aids in synchronizing all the registers of 8085 microprocessor.

• Signals that are associated with Timing and control unit are:

• 1. Control Signals: READY, RD(bar), WR(bar), ALE
2. Status Signals: S0, S1, IO/M(bar)
3. DMA Signals: HOLD, HLDA
4. RESET Signals: RESET IN(bar), RESET OUT.

CACKLE comment system