The microprocessor is the CPU (Central Processing Unit) of a computer. It is the heart of the computer. Here, we will describe Intel 8085 as it is one of the most popular 8-bit microprocessor.
Intel 8085 is an 8-bit, NMOS microprocessor designed by Intel in 1977.
It has following configuration:
Intel 8085 is used in mobile phones, microwave ovens, washing machines etc.
The below diagram shows the block diagram of Intel 8085:
The Arithmetic and Logic Unit, ALU performs the arithmetic and logical operations:
Timing and Control Unit
The timing and control unit is the section of the CPU.
Thus we can see that the control unit of the CPU acts as the brain of the computer system.
Registers are used for temporary storage and manipulation of data and instructions by the microprocessor. Data remain in the registers till they are sent to the I/O devices or memory. Intel 8085 microprocessor has the following registers:
In addition to the above mentioned registers the 8085 microprocessor contains a set of five flip-flops which serve as flags (or status flags).
A flag is a flip-flop which indicates some conditions which arises after the execution of an arithmetic or logical instruction.
The five status flags of Intel 8085 are:
If a flip-flop for a particular flag is set, then it indicates 1. When it is reset, it indicates 0.
Data and Address Bus
Fig: Pin diagram of Intel 8085 microprocessor
The descriptions of various pins are as follows:
Address Bus and Data Bus
Control and Status Signals
Status codes for Intel 8085
Interrupts and Externally Initiated Signals
RST 7.5, RST 6.5 and RST 5.5 are the restart interrupts which cause an internal restart to be automatically inserted.
The TRAP has the highest priority among interrupts. The order of priority of interrupts is as follows:
Serial I/O Signals
Vcc : +5 Vlots supply
Vss : ground reference
An instruction of computer is a command given to the computer to perform a specified operation on given data. Some instructions of Intel 8085 microprocessor are: MOV, MVI, LDA, STA, ADD, SUB, RAL, INR, MVI, etc.
Opcode and Operands
Each instruction contains two parts: Opcode (Operation code) and Operand.
The 1st part of an instruction which specifies the task to be performed by the computer is called Opcode.
The 2nd part of the instruction is the data to be operated on, and it is called Operand. The Operand (or data) given in the instruction may be in various forms such as 8-bit or 16-bit data, 8-bit or 16-bit address, internal registers or a register or memory location.
Instruction Word Size
A digital computer understands instruction written in binary codes (machine codes). The binary codes of all instructions are not of the same length.
According to the word size, the Intel 8085 instructions are classified into the following three types:
1. One-byte instruction: Examples of one byte instructions are:
All the above two examples are only one byte long. All one-byte instructions contain information regarding operands in the opcode itself.
2. Two-byte instruction: In a two byte instruction the first byte of the instruction is its opcode and the second byte is either data or address.
MVI B, 05; 05 moved to register B.
06, 05; MVI B, 05 is in the code form.
The first byte 06 is the opcode for MVI B and second byte 05 is the data which is to be moved to register B.
3. Three-byte instruction: The first byte of the instruction is its opcode and the second and third bytes are either 16-bit data or 16-bit address.
LXI H, 2400H; Load H-L Pair with 2400H
21, 00, 24; LXI H, 2400H in the code form
The first byte 21 is the opcode for the instruction LXI H. The second 00 is 8 LSBs of the data (2400H), which is loaded into register L. The third byte 24 is 8 MSBs of the data (2400H), which is loaded into register H.
The time required to fetch an instruction and necessary data from memory and to execute it, is called an instruction cycle. Or the total time required to execute an instruction is given by:
IC = FC + EC
IC = Instruction Cycle FC = Fetch Cycle EC = Execute Cycle
Timing Diagram for Instruction Cycle
In the beginning of the fetch cycle, the content of the program counter (PC), which is the address of the memory location where opcode is available, is sent to the memory. The memory puts the opcode on the data bus so as to transfer it to the CPU.
The whole operation of fetching an opcode takes three clock cycles. A slow memory may take more time.
The opcode fetched from the memory goes to the data register, DR and then to instruction register, IR. From the IR it goes to the decoder circuitry which decodes the instruction. Decoder circuitry is within the microprocessor.
After the instruction is decoded, execution begins.
If the operand is reside the general purpose registers, execution is immediately performed. The time taken in decoding and execution of an instruction is one clock cycle.
In some situations, an execute cycle may involve one or more read or write cycles or both.
Read Cycle: If an instruction contains data or operand address which are in the memory, the CPU has to perform some read operations to get the desired data. In case of a read cycle the instruction received from the memory are data or operand address instead of an opcode.
Write Cycle: In write cycle data are sent from the CPU to the memory or an output device.
The necessary steps carried out to perform the operation of accessing either memory or input output device, constitute a machine cycle. In other words, necessary steps carried out to perform a fetch, a read or a write operation constitutes a machine cycle.
One sub-division of an operation performed in one clock cycle is called a state or T-state. In short, one clock cycle of the system clock is referred to as a state.
The necessary steps carried out in a machine cycle can be represented graphically. Such a graphical representation is called timing diagram. The timing diagram for opcode fetch, memory read, memory write, I/O read and I/O write will be discussed below:
In the above diagrams, the basic used parameters are:
ALE: ALE indicates the availability of a valid address on the multiplexed address/data lines. When it is high or 1, then it acts as an address bus and when low or 0, then it acts as a data bus.
RD (low active): If it is high or 1, then no data is read by the microprocessor. If signal is low or 0, then data is read by the microprocessor.
WR (low active): If it is high or 1, then no data is written by the microprocessor. If signal is low or 0, then data is written by the microprocessor.
IO/M (low active): A high or 1 on this signal indicates I/O operation while a low or 0 indicates memory operation.
S0, S1: S0 and S1 Indicate the type of machine cycle in progress.
The below table, shows the status of different control signal for different operation: