Presentation 1
Presentation 1
S-Sign flag: After the execution of arithmetic or logical operations, if bit D, of the result is 1, the sign flag
is set. In a given byte if D, is 1, the number will be viewed as negative number. If D, is 0, the number will
be considered as positive number.
Z-Zero flag: The zero flag sets if the result of operation in ALU is zero and flag resets if result is non
zero. The zero flag is also set if a certain register content becomes zero following an increment or
decrement operation of that register.
AC-Auxiliary Carry flag: This flag is set if there is an overflow out of bit 3 i.e., carry from lower
nibble to higher nibble (D3 bit to D4 bit). This flag is used for BCD operations and it is not available
for the programmer.
P-Parity flag: Parity is defined by the number of ones present in the accumulator. After an arithmetic
or logical operation if the result has an even number of ones, i.e. even parity, the flag is set. If the
parity is odd, flag is reset.
CY-Carry flag: This flag is set if there is an overflow out of bit 7. The carry flag also serves as a borrow
flag for subtraction. In both the examples shown below, the flag is set.
c) Instruction Register: In a typical processor operation, the processor first fetches the opcode of
instruction from memory (i.e. it places an address on the address bus and memory responds by placing
the data stored at the specified address on the data bus). The CPU stores this opcode in a register called
the instruction register. This opcode is further sent to the instruction decoder to select one of the 256
alternatives.
d) Program Counter (PC): The program counter is a special purpose register which, at a given time,
stores the address of the next instruction to be fetched. Since address of 8085 is 16-bit, the PC is 16-bit.
Program Counter acts as a pointer to the next instruction. How processor increments program counter
depends on the nature of the instruction; for one byte instruction it increments program counter by one,
for two byte instruction it increments program counter by two and for three byte instruction it increments
program counter by three such that program counter always points to the address of the next instruction.
e) Stack Pointer (SP): The stack is a reserved area of the memory in the RAM where temporary
information may be stored. A 16-bit stack pointer is used to hold the address of the most recent stack
entry.
Arithmetic Logic Unit (ALU)
The 8085's ALU performs arithmetic and logical functions on eight bit variables. The arithmetic unit
performs bitwise fundamental arithmetic operations such as addition and subtraction. The logic unit
performs logical operations such as complement, AND, OR and EX-OR, as well as rotate and clear. The
ALU also looks after the branching
iv) CLK OUT (Output): This signal is used as a system clock for other devices. Its frequency is half the
oscillator frequency.
b) Data bus and address bus
A) AD0, to AD7, (Input/Output): The 8-bit data bus (Do - D7) is multiplexed with the lower half (Ao
– A7) of the 16-bit address bus. During first part of the machine cycle (T1), lower 8 bits of memory
address or I/O address appear on the bus. During remaining part of the machine cycle (T2 and T3)
these lines are used as a bi-directional data bus.
B) A8 to A15 (Output) : The upper half of the 16-bit address appears on the address lines A8 to A 15.
These lines are exclusively used for the most significant 8 bits of the 16-bit 8 address lines.
c) Control And status signal
A) ALE (Address Latch Enable) (Output): We know that ADo to AD7, lines are multiplexed and the
lower half of address (Ao - A7) is available only during T1 of the machine cycle. This lower half of
address is also necessary during T2 and T3 of machine cycle to access specific location in memory or I/O
port. This means that the lower half of an address must be latched in T1 of the machine cycle, so that it is
available throughout the machine cycle. The latching of lower half of an address bus is done by using
external latch and ALE signal from 8085.
B) RD and WR (Output): A low on RD indicates that the data must be read from the selected memory
location or I/O port via data bus. A low on WR indicates that the data must be written into the selected
memory location or I/O port via data bus.
C) IO / M, So and S1 (Output) : IO/M indicates whether I/O operation or memory operation is being
carried out. S1 and So indicate the type of machine cycle in progress.
D) READY (Input): It is used by the microprocessor to sense whether a peripheral is ready or not for
data transfer. If not, the processor waits. It is thus used to synchronize slower peripherals to the
microprocessor.
e) Serial I/O signals:
A) SID (Serial I/P Data) (Input): This input signal is used to accept serial data bit by bit from the
external device.
B) SOD (Serial O/P Data) (Output): This is an output signal which enables the transmission of
serial data bit by bit to the external device.
g) Reset signals :-
synchronized to the processor clock and it can be used to reset other devices connected in the system .
Serial I/O Signals
A) SID (Serial I/P Data) (Input): This input signal is used to accept serial data bit by bit from the
external device.
B) SOD (Serial O/P Data) (Output): This is an output signal which enables the transmission of serial
data bit by bit to the external device.
DMA Signal
A) HOLD (Input): This signal indicates that another master is requesting for the use of address bus,
data bus and control bus.
B) HLDA (Output): This active high signal is used to acknowledge HOLD request.
Demultiplexing AD7-AD0
•This clock signal is driven by ALE signal from 8085. The ALE signal is activated only during T1, so
input is transferred to the output only during T1 i.e. address (Ao - A7) on the AD to AD, multiplexed
bus.
•In the remaining part of the machine cycle, ALE signal is disabled so output of the latch (Ao - A7)
remains unchanged. To latch lower half of an address, in each machine cycle, the 8085 gives ALE
signal high during T1 of every machine cycle. With this circuit, we can use output of latch as lower half
address bus and input of latch (AD♂-AD1) as data