0% found this document useful (0 votes)
3 views

Microprocessor 9-12

The document outlines the course structure for Microprocessors (EET-352) at the National Institute of Technology, Srinagar, detailing evaluation schemes and internal architecture of the 8085 microprocessor. It describes components such as the Arithmetic and Logic Unit (ALU), registers, and interrupt control mechanisms. Additionally, it explains the functions of various flags and registers, emphasizing their roles in arithmetic operations and program execution.

Uploaded by

jackke343
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views

Microprocessor 9-12

The document outlines the course structure for Microprocessors (EET-352) at the National Institute of Technology, Srinagar, detailing evaluation schemes and internal architecture of the 8085 microprocessor. It describes components such as the Arithmetic and Logic Unit (ALU), registers, and interrupt control mechanisms. Additionally, it explains the functions of various flags and registers, emphasizing their roles in arithmetic operations and program execution.

Uploaded by

jackke343
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

Department of Electrical Engineering

National Institute of Technology,


Srinagar

Microprocessors

Credits: 4 Course code:


EET-352 L:3 T:1 P:0

Course Evaluation Scheme

Mid-Semester Continuous End-Semester


(26 marks) Assessment (24 marks) (50 marks)

Tutorial/assignments (8)
Quiz/Presentation (8)
Attendance/Class response (8)

B.Tech (6th Semester) Course Incharge: Dr. Zahid Afzal Thoker

Internal Architecture of 8085 microprocessor

INTR INTA RST5.5 RST6.5 RST7.5 TRAP SID SOD

Interrupt Control Serial I/O Control

8 Bit internal bus

Accumulator Temporary Flag Instruction Multiplexer


(8) register (8) register 5 register (8)
W(8) Z(8)
Register Select

B(8) C(8)
Register Array

D(8) E(8)
Instruction
decoder H(8) L(8)

&
Stack Pointer (16)
ALU Machine
cycle Program Counter(16)

Increment/Decrement
Address Latch (16)

+5V GND

X1
Address buffer Data/Address

CLK Timing & Control (8) buffer (8)

X2
GEN Control Status DMA RESET

A15-A8 AD7-AD0
RD WR ALE S0 S1 IO/M HOLD HLDA
READY
CLK OUT

RESET OUT
RESET IN

Address Bus Address/Data Bus

Arithmetic and logical unit (ALU)

It performs addition, subtraction, multiplication, division, AND, OR operations. It includes the


accumulator, the temporary register, the circuits and five flags.

Accumulator: It is 8-bit programmable register where generally results are stored after
arithmetic and logical operations with some exceptions.

Temporary Register: It is 8-bit programmable register used to hold data during Arithmetic and
logical operations. The result is stored in accumulator and the flag (flip-flops) are set or reset
according to the result of operation.

Arithmetic and Logical unit: This unit performs numerical and logical operations. The ALU uses
data from memory and from accumulator to perform these operations.

+ - x / XOR, OR, AND


Arithmetic compare, compliment, rotate

Flags: These are flip flops that store bit 0 or 1 based on the arithmetic or logical operation
performed by ALU. In most of the operations the result is stored in accumulator. Therefore,
flags generally reflect the data conditions in the accumulator with some exceptions. There are
five flags present in 8085 processor. All the flags are present in an 8 bit register called as
status register or flag register. The flags generally reflect the status of arithmetic and logical
operations.
D7 D6 D5 D4 D3 D2 D1 D0

S Z X AC X P X CY

Sign Flag (S): After the execution of an arithmetic or logic operation, if bit D7, of the result
(usually in the accumulator) is 1, the sign flag is set. This flag is used with signed numbers.
In a given byte, if D7 is 1, the number will be viewed as a negative number; if it is 0, the
number will be considered positive.
In arithmetic operations with signed numbers, bit D7 is reserved for indicating the sign,
and the remaining seven bits are used to represent the magnitude of a number. However flag is
irrelevant for the operations of unsigned numbers. So, this flag is used for operation on signed
numbers.

Zero Flag (Z): The zero flag is set when the ALU operation results in 0, and the flag is reset if
the result is nonzero.
This flag is affected by the results in accumulator as well as in the other registers.

Auxiliary Carry Flag (AC): In an arithmetic operation, then a carry is generated by digit D3 and
passed on to digit D4, the AC flag is set.
Among the five flags, AC flag is used internally for BCD arithmetic operations and is not
available for the programmer to change the sequence of the program with a jump instruction.

Parity Flag (P): After the ALU operation, if the result contains even number of ones (even parity)
the parity flag is set and if result has odd number of one (odd parity) the parity flag resets.

Even parity P=1 Odd parity P=0

Carry Flag (CY): If an arithmetic operation results in a carry, the carry flag is set, otherwise it
is reset. It works as a borrow flag during subtraction.

Register Array

Registers

Temporary General Purpose Special Purpose


Registers Registers Registers
W and Z B, C, D, E, H & L SP & PC

Temporary Registers
The temporary registers W and Z are used to store data/address temporarily. It is only used by
microprocessor to perform internal operations during the programme execution. This register is
also called invisible register because they are not available for user during programme.

General Purpose Registers


The 8085 Microprocessor consists of six general purpose registers i.e. B, C, D, E, H and L. They
all are 8-bit registers and can be accessed by the programmer. In addition to that general
purpose register also forms three 16-bit register pair as BC, DE and HL pairs.

Accumulator can also be used along with status register to form a 16-bit programmable register
called program status word (PSW). Accumulator acts as one source of operand to the ALU and
destination to the result. During I/O data transfer, data is transferred between accumulator and
I/O device.

Note: The general purpose registers put together is called ‘Scratch pad memory’.

Special Purpose Registers


There are two 16-bit special purpose registers called program counter (PC) and stack pointer
(SP). They are user accessible.

Program Counter (PC): It is a 16-bit special purpose register used to sequence the execution of
program. During the programme it is required to keep track of the address of next instruction
to be fetched from the memory for execution. In other words we can say that the PC provides
the address of next instructions to memory which has to be executed. When a byte is fetched
then PC is automatically incremented by one (1), to point to next memory location.

Note: When MPU is reset, the PC sets to zero [0000 H].

Stack pointer (SP): It is a 16-bit special purpose register used as a memory pointer. Stack pointer
provides the top-address of stack. A memory location in R/W memory is called 'STACK'. It is a
part of RAM, which is used during subroutines, PUSH and POP operations.
STACK grows from bottom to top following LIFO (last in first out) structure and the SP contents
keep decreasing as the stack grows.

Increment and Decrement latch: It is used for increment and decrement of 16-bit address, always
increment and decrement by 1.

Timing and Control Unit

The control unit is the nerve centre of any MPU. It synchronizes all the microprocessor operations
with the CLK and generates the control signals necessary for communication between the
microprocessors and peripherals. In this unit X1 and X2 pins are used to connect external crystals
or LC circuit to generate internal clock.
Mathematically we have,
fCLK = fCRYSTAL/2 and T-state = 1/fCLK

Instruction Register and Decoder

Instruction Register and Decoder are parts of ALU.

Instruction Register: When an instruction is fetched into the processor from memory, it is loaded in
the instruction register. This register is only used for storing the opcode of instruction. It is
invisible to user.

Instruction Decoder: The output of IR is connected to the decoder. The decoder decodes the
instruction and establishes the sequence of events to follow.

Interrupt control

Whenever 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. e.g., an I/O device may send an interrupt signal to notify that
data is ready for input. The microprocessor temporarily stops the execution of main program and
transfers control to I/O device. After collecting the input data the control is transferred back to
main program. Interrupt signals present in 8085 microprocessor are:

Hardware Interrupts

TRAP (RST 4.5) (0024)H Vectored Non-Maskable

RST 7.5 (003C)H Vectored Maskable

RST 6.5 (0034)H Vectored Maskable

RST 5.5 (002C)H Vectored Maskable

INTR - Non-Vectored Maskable

Software Interrupts

RST 0 RST 1 RST 2 RST 3 RST 4 RST 5 RST 6 RST 7

0000 H 0008 H 0010 H 0018 H 0020 H 0028 H 0030 H 0038 H

All software interrupts are vectored

B.Tech (6th Semester) Course Incharge: Dr. Zahid Afzal Thoker

You might also like