Microprocessor 9-12
Microprocessor 9-12
Microprocessors
Tutorial/assignments (8)
Quiz/Presentation (8)
Attendance/Class response (8)
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
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
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.
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.
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 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.
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’.
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.
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.
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: 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
Software Interrupts