Module I

The Microprocessor is the CPU of a computer. It is a device or a group of devices that can communicate with peripherals, provide timing and control signals, direct data flow and perform computing tasks as specified by the instructions in the memory. History • • • • • Abacus 500 B.C. First generation PMOS Technology Low cost and slow Not TTL compatible • Intel 4004, Intel 4040, Fairchild PPS 25, National IMP-4, Rockwell PPP-4 • Intel 8008, National IMP-8, Rockwell PPP-8 • National IMP-16 Second generation NMOS Technology so faster TTL compatible More powerful instruction set. Better interrupt handling. Intel 8080, Intel 8085, Fairchild F-8, Motorola M6800, National CMP-8 Intersil 6100 – 12 bit TI TMS 9900 -16 bit Third generation HMOS Technology so faster Easier to program Physical memory of 1 – 16 Mb. Flexible I/O port addressing. • Intel 8086, Intel 8088, Motorola M68000, Motorola M68010, National CMP-8 Fourth generation Intel 80386, Intel 80486, Motorola M68020, Motorola M68030. Advantages of µp based systems • • • • • Computation speeds are high. Flexibility by changing the s/w. Less components, compact in size, reliable and low cost. Easy operation and maintenance. Brings intelligent systems.

• • • • • • • • • • • • • • •

Disadvantages of µp based systems • • • • Limitations in data size. Analog signals need to be digitized. Applications are limited by the physical address. Do not support floating point operations. 1

It has three main sections (1) Arithmetic and Logic Unit (ALU) (2) Timing and Control Unit (3) Registers Pin Configuration of 8085 The pins of 8085 can be classified into 6 major sections. They are bidirectional. When it is high it indicates an I/O operation and when low it indicates a memory operation. 33 S1. Its clock cycle is of 320ns. It indicates that the memory D or I/O device has to be read and data is available on the data bus. It indicates that the data available on the data bus has to be written to the memory or I/O device. They R D include two control signals ( W and R ) and three status signals (S0.Intel 8085 Intel 8085 is an 8 bit. (Attach figure) (1) Address Bus (output) A8-A15. 32 R . 30 ALE. R  W (output). (2) Multiplexed Address Data Bus (input/output) AD0-AD7. 2 . S1 and S0(output) – They are used as below. S1 and R D IO/ M ) and one special signal ALE (Address Latch Enable). They are pin numbers 29 S0. (3) Control and Status Signals. It is used to latch the lower order address from the multiplexed bus and generate separate set of eight address lines. They carry the MSB’s of the 16-bit address. 34 IO/ M . The ALU can work with 8 bits and it has a 16-bit address. Pin numbers 21 to 28 are called the higher order address bus. 31 W . S1 0 0 1 1 S0 0 1 0 1 Operation HALT WRITE READ FETCH  (4) Power Supply and Frequency Signals (input).It is used to differentiate between a memory and I/O operation. It is a 40 pin IC with a single +5V DC supply and a 3MHz clock.  R (output).  IO/ M (output). Pin numbers 12 to 19 are called the Multiplexed Address Data Bus. The operation of each pin is as follows.Write: This is an active low signal. NMOS microprocessor. They carry the LSB’s of the 16-bit address during the first clock cycle of a machine cycle and data during the second and third clock cycles.Read: This is an active low signal.  ALE: It is a positive going pulse indicating the beginning of an operation. It indicates that bits on AD0-AD7 are address bits. They are unidirectional.

E  R SET IN : When this pin goes low the Program Counter is set to zero and the microprocessor restarts. (2) Timing and Control Unit This section provides the status. INTR (input): Interrupt Request. RST 6. 37 clock out and 20 VSS.5 (inputs): Restart Interrupts. to be attached) The 8085 has three main sections (1) Arithmetic and Logic Unit (ALU) The ALU performs the computing functions and the logical operations such as addition.  READY (input): It is used to delay the read and write operations when communicating with slow peripherals.  RESET OUT: It indicates that the microprocessor is being reset. increment. complement.  RST 7.5.5. RST 5. It is used to reset other devices The interrupts have their priorities as follows TRAP. SOD (output): It is the data line for serial output. (5) Externally Initiated Signals. subtraction. clear logical AND and OR. Clock: A crystal clock is connected to the pins. When they are recognized the next instructions are executed from fixed memory locations. 8085 has five interrupt signals TRAP. T  HOLD (input): This indicates that a peripheral controller is requesting the use of address and data bus. SID (input): It is the data line for serial input. decrement. rotate right and let.5. 40 VCC. READY and HOLD accept the externally initiated signals. RST 6. CLK OUT (output): This is used as the system clock for other devices.5. It controls the µP and all peripherals connected to it. It is a general purpose interrupt. It has two external signal acknowledgements HLDA and IN A . RST 7.  HLDA (output): Acknowledgement to the hold request. RST 6.    The power and frequency signals are pin numbers 1 & 2 clock. RST 7. 3      . RST 5. IN A (output): Interrupt Acknowledge.5. They consist of 2 pins SID and SOD. timing and control signals necessary for the execution of instructions and the operation of the memory and I/O devices.5 and INTR. RST 5. shift left. (6) Serial I/O Ports.5. VSS: Ground Reference. In addition to these T three pins RESET.5 and INTR. It is a general purpose interrupt. TRAP (input): Interrupt Request. VCC: +5V DC supply. It is referred to as the control unit of the processor. Architecture of 8085 (Fig.

The stack is defined and the SP is initialized by the programmer. Since it works on LIFO it is faster. The result of an operation is stored in the accumulator except for some instructions (e. VII. Some logical instructions work with one operand only. I. The flags of 8085 are a) Carry Flag: After the execution of an arithmetic instruction if a carry is produced then the carry flag is set to 1. Instruction register It holds the opcode of the instruction which is being decoded and executed. It holds the address of the top element of the data stored in the stack. DAD instruction). It cannot be programmed by the user. PC or flags during a program execution. III. needed for some other operations in the subsequent steps. It is an 8-bit register used by the ALU to store data during an operation. IV. The combination of 2. D-E pair and H-L pair. II. they can be used by the programmer. 8085 has the following registers. It is an 8-bit register and it holds one of the operands of an operation. H and L. Only these combinations are permitted). The microprocessor increments the contents of the PC after the execution of each instruction. eight bit registers can be used to hold 16-bit data and are called register pairs (e. These data are stored in the stack. D. VI. Temporary register.g. The SP controls the stack addressing. Then the result is held in the accumulator. The other operands may be in the general purpose register or in the memory. Flags 8085 has 5 flip-flops which serve as status flags and they are set or reset depending upon the conditions arising during an arithmetic or logic operation. They can store 8 bits.(3) Registers Registers are used for temporary storage and manipulation of data and instructions. Sometimes it becomes necessary to save the contents of the registers. V. The general purpose registers are programmable i. They are also called the general purpose registers. E. Program Counter – 16-bit It holds the memory address of the next instruction to be executed. Accumulator or register A This is the most important of all registers and it is associated with the ALU. C. B-C pair. The contents of the stack will be brought back to the registers when the registers become free.e. Registers B.g. Stack Pointer (SP) – 16-bit The stack is a sequence of memory locations set aside by the programmer to store/retrieve contents of the registers. It occurs during 4 .

d) Zero Flag: If the result of an operation is zero.addition and subtraction. PSW and accumulator are treated as 16 bit registers for stack operation. 5 . The combinations of these three bits are called the PSW. c) Auxiliary Carry Flag: It holds the carry from the third bit to the fourth bit. e) Sign Flag: It is set to one if the result of an arithmetic operation of signed numbers results in a negative number. b) Parity Flag: If the result of an operation has even number of ones the parity flag is set to one. Program Status Word (PSW) 7 S 6 Z 5 X 4 AC 3 X 2 P 1 X 0 CS Figure shows that the five bits indicate the flags of 8085 and three bits are undefined. It holds the MSB resulting from the execution of an operation. It is normally used in BCD operations. the zero flag is set to one.