Coa Sem 5
Coa Sem 5
2.1 Introduction:
The 8085 microprocessor is an 8-bit microprocessor that was introduced by Intel Corporation in the year
1976.
The 8085 microprocessor is designed to execute a set of instructions to perform various tasks in a
computer system.
The 8085 microprocessor operates at a clock speed of 3 MHz which is known as frequency.
The frequency is inversely proportional to time, so time to execute one operation T = 1/3MHz = 1/(3*106)
= 0.33*10-6 = 0.33 micro second.
To understand the basic concepts microprocessor device, it is easier to learn from a simple 8-bit processor
than from a 64-bit processor.
Following diagram shows microprocessor as CPU. A computer with a microprocessor is known as
microcomputer.
System bus: The system bus is a communication path between the microprocessor and peripheral.
There are three types of system bus in 8085 microprocessor: Address Bus, Data Bus and Control Bus.
Address Bus: It is a unidirectional bus which carries address of memory or I/O devices from where data is to
be read or write according to control signal provided b microprocessor. Size of address bus is 16-bits.So,
addressable memory of 8085 is 64 Kbytes (216 =26*210 = 64*1024=64K).
Data Bus: It is a bi-directional bus which is used to transfer 8-bit data between the microprocessor and
memory or IO devices. The flow of data is depends on control signal.
Control Bus: It consists of various single lines carry synchronization signals between the microprocessor
and memory or IO device. There are four lines which are used to generate memory read, memory write, I/O
read, I/O write signals using control bus.
To communicate with a memory or I/O device, the microprocessor needs to perform the following steps:
Step 1: Identify the memory location or peripheral device (Using Address Bus)
Step 2: Provide timing and synchronization signals. (Using Control Bus)
Step 3: Transfer binary information to or from memory or peripheral device. (Using Data Bus)
This group consists 2 control signals (RD and WR), 3 status signals (IO/M, S1 and S0) to identify
the control signals, and one special signal (ALE) which is used to demultiplexed address and data
bus. These signals are as follows:
Address Latch Enable (ALE) signal: When signal on ALE pin becomes high (1), then multiplexed
address/data bus contains lower order address and when it becomes low (0) then the bits on AD7 to
AD0 are considered as data bits. At every machine cycle, Signal on ALE become positive going pulse
at first T-state and after that it becomes low.
Read (RD): This signal is enable when low (0). This signal indicates that the selected I/O or memory
device is to be read and data are available on the data bus.
Write (WR): This signal is enable when low (0).. This signal indicates that the data on the data bus
are to be written into a selected memory or I/O location.
IO /M: This is a status signal used to differentiate between I/O and memory operations. When it is
high, it indicates an I/O operation.When it is low, it indicates a memory operation. This signal is
combined with RD (Read) and WR (Write) to generate I/O and memory control signals.
S1, and S0: These status signals can identify various operations like opcode fetch, memory read/write,
I/O read, write, Interrupt acknowledgment etc.,
The READY input signal is used to synchronize the operations with the slower peripheral devices.
It is used by peripheral devices to inform the microprocessor that it in ready to send or receive data.
When it is low, the microprocessor goes into wait state and then waits for response from device.
When a device is ready to transfer the data, it sends READY signal high to microprocessor
RESETIN, RESET OUT: The signal can be used to reset other devices. RESETIN is active low
input signal. When it is low, microprocessor reset itself, the content of program counter is set to zero,
and control buses are tri-stated. RESET OUT is active high output signal. The microprocessor can
send the reset signal to other peripheral devices by RESET OUT pin to indicate that is being reset.
Serial I/O signals: Two signals are used two implement the serial transmission: SID (Serial Input
Data) and SOD(Serial Output Data). SID is input signal while SOD is output signal. In serial
transmission, data bits are sent over a single line, one bit at a time, such as the transmission over
telephone lines ,serial printer etc.
Arithmetic and Logic Unit (ALU): It is used to perform mathematical operations like addition, multiplication,
subtraction, division, decrement, increment, etc. Different operations are carried out in ALU: Logical
operations, Bit-Shifting Operations, and Arithmetic Operations.
Instruction register : It is an 8-bit register that contains the current instruction being executed. The instruction
register is used by the microprocessor to decode and execute instructions.
Instruction Decoder and Machine Cycle Encoding: The content of instruction register is transferred to the
instruction decoder and it is decoded to find the meaning of opcode. After decoding the instruction, Decoder
directs the timing and control section to perform the sequence of events in order to complete the execution of
current instruction.
instructions.There are Five flags used by 8085 microprocessor, Sign flag (5), Zero flag (Z).
Auxiliary carry flag (AC). Parity flag (P), and Carry flag (CY)
Interrupt control: Whenever a microprocessor is executing the main program and if suddenly an interrupt
occurs, the microprocessor shifts the control from the main program to process the incoming request. After the
request is completed, the control goes back to the main program. There are 5 interrupt signals in 8085
microprocessors: INTR, TRAP, RST 7.5, RST 6.5, and RST 5.5.
Priorities of Interrupts: TRAP > RST 7.5 > RST 6.5 > RST 5.5 > INTR
Serial Input/output control: It controls the serial data communication by using Serial input data and Serial
output data. The 8085 has a serial I/O port (SID/SOD) for serial communication .Serial Input/output control in
the 8085 microprocessor refers to the communication of data between the microprocessor and external devices
in a serial manner.
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 addressbus 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: The data bus is bidirectional and carries the data which is to be stored. The address
bus is unidirectional and carries the location where data is to be stored.In the 8085 microprocessor, the address
bus and data bus are two separate buses that are used for communication between the microprocessor and
external devices.
2.4 Register Organization of 8085
Registers are used by the microprocessor for temporary storage and manipulation of data and
instructions.
Total number of registers available is depending on the microprocessor.
The 8085 has 8-bit and 16-bit registers used for storing data temporarily in program execution.
Registers in 8085 can be classified in two categories:
General Purpose Registers
Special Purpose Registers
Program Counter (PC): It is a 16-bit register used by microprocessor to store address of next instruction
fetch from memory.
Program is a sequence of instructions. While executing the program, microprocessor fetches the
current instruction from the memory whose address is stored in PC and executes it.
After fetching the instruction, content of PC is auto-increment by one, two or three depends on
the size of 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.
In case of JUMP and CALL instructions, address followed by JUMP and CALL instructions is
placed in the program counter.
Stack Pointer (SP): The stack pointer is a 16-bit register used as a memory pointer.
It points to a memory location in R/W memory, called the stack.
A stack is a portion of RAM.
Stack is temporary storage used by microprocessor to store return address while jump to the
service routine/ stored procedure.
Flag Register:
The flag register is a special purpose register and it is different from other registers in
Microprocessor.
It consists of 8 bits and only 5 of them are useful.
The other three are left vacant and are used in the future Intel versions.
Sign flag(SF): The sign flag indicates whether result generated is positive or negative. The sign
flag is set to 1 whenever the result generated is negative. If the sign flag is set to 0 than the result
generated is positive.
Zero Flag(ZF): The zero flag indicates the result generated is zero or non-zero. If the result
generated is zero than the Zero Flag is set to 1. If the result is non-zero than the ZF=0.
Auxiliary Carry Flag (AC): The Auxiliary Carry flag is set to 1 whenever there is a carry or
borrow at nibble in the data. If the carry generated from 4th bit to 5th bit or borrow is taken from
5th bit to 4th bit than the Auxiliary Carry Flag is set to 1.
Parity Flag(PF): The Parity Flag is set to 1 when even parity of 1s into the result. The Parity
Flag is reset to 0 when odd parity of 1s into the result.
If the number of 1s into the result is ODD than the parity flag is reset to 0.
If the number of 1s into the result is EVEN than the parity flag is set to 1.
Carry Flag(CF): The Carry flag is set to 1 whenever there is a carry from MSB or borrow to
MSB.
Example:
T-state:
Each operation is performed in synchronization with the internal clock.
One clock pulse is called a T-state.
The timing diagram is a graphical representation of the process in steps with respect to time.
Following Fig. shows the Instruction cycle and machine cycle.The fetch cycle takes 4 T-states and the
execution cycle takes 3 T-states.