UNIT-1 INTRODUCTION The microprocessor is a programmable integrated device that has computing and decision-making capability similar to that of the Central Processing Unit (CPU) of the computer. The microprocessor communicates and operates in the binary numbers 0 and 1, called bits. Each microprocessor has a fixed set of instructions in the form of binary patterns called a machine language. The binary instructions are given abbreviated names, called mnemonics, which form the assembly language for a given microprocessor. Because an assembly language is specific to a given machine, programs written in assembly language are not transferable from one machine to another. Machine independent languages are called high-level languages. Microprocessor Definition A microprocessor is a multipurpose, multiprogrammable, clock driven, register based electronic device that reads binary instructions from a memory, accepts binary data as input, and processes data according to those instructions, and provides results as output. Microprocessor Based System A microprocessor is a microprocessor-based system that includes mainly three components as shown below. Microprocessor I/O Memory (RAM and ROM) Diagram:
These components are organized around a common communication path called bus.
Microprocessor: It is a clock driven semiconductor device consisting of electronic logic circuits. It can be further divided into three segments as arithmetic logic unit, register array and control unit. Arithmetic Logic Unit performs computing functions such as addition, subtraction, and logical operations such as AND,OR, and EXOR. Register array consists of various registers B, C, D, E, H and L. These are used to store data temporarily during the execution of a program. These are accessible to the user through instructions. Control unit provides necessary timing and control signals to all the operations in a microcomputer. Also, it controls the flow of data the various units. Memory: Store binary information as instructions, data, and provides the same to the microprocessor when necessary. Memory has two sections Read/Write memory and Read Only Memory. ROM is used to store programs that do not need alterations such as monitor programs. Programs stored in ROM can be only read. Read/Write memory (R/WM) also called user memory stores user programs and data. Programs can be read and altered
Input/Output: Helps to communicate with the outside world. Also called peripherals. Input devices such as keyboard, switches and analog to digital converters transfer binary information form user to microprocessor. Output devices transfer data from the microprocessor to the outside world. They include CRT, LEDs, a printer, a X-Y plotter, a magnetic tape and digital to analog converters. System bus: This is a communication path between the microprocessor and peripherals. They are a group of wires to carry bits. Microprocessor communicates with only one peripheral at a time though all the peripherals share the same bus. The timing is provided by the control unit.
Advantages of microprocessor based systems: Simplifies system design Reduces development time Reduces cost and size Flexible in operation. Differences Between Microprocessor & Micro controller: Microprocessors contain no RAM, no ROM and no I/O ports on the chip itself. The addition of the external RAM, ROM, I/O ports and timers make these systems bulkier and more expensive. But they have the advantage of versatility. Where as a microcontroller has a microprocessor (which functions as a CPU), RAM, ROM, I.O ports and timers are on a single chip.
Microprocessor Working: The process of program execution is as follows. The instructions are stored sequentially in memory. The microprocessor fetches the first instruction from the memory, decodes and executes it. The sequence of fetch, decode, and execute is continued until the microprocessor comes across an instruction stop. During the entire process, microprocessor uses the system bus to fetch binary instructions, uses registers to store data temporarily, and performs computing functions in ALU. Microprocessor Operations: The functions performed by the microprocessor can be classified into three categories. _ Microprocessor initiated operation _ Internal operations _ Peripheral operations. (i) Microprocessor Initiated Operations: The MPU performs four functions mainly _ Memory read _ Memory write _ I/O read _ I/O write To communicate with a peripheral or memory, MPU has to do the following steps. Step1: Identify the peripheral or memory (using address) Step2: Transfer binary information (data and instructions) Step3: Provide timing and synchronization signals. ii) Internal Data Operations: These operations include Store 8 bit data, Perform arithmetic and logical functions, Test for conditions, Sequence the execution of instructions, Store data temporarily in the defined R/WM during execution called stack, These are performed using registers, an ALU and control logic and internal buses. (iii) Peripheral Or Externally Initiated Operations:
External devices can initiate the pins on the microprocessor: Reset, Interrupt, Hold, and Ready. Reset pin is activated when all the internal operations are suspended and the PC is cleared. Interrupt signal can interrupt a microprocessor to execute other instructions called service routine. The microprocessor resume itself after completing the routine. Ready pin when low makes a microprocessor to enter a wait state to synchronize slow peripherals. Hold pin when activated by an external signal, the microprocessor relinquishes control of all the buses and allows a external peripheral to use them. THE 8085 MPU The MPU as a device or a group of devices Can communicate with peripherals Provide timing signals Direct data flow Perform computing tasks The 8085A is an 8- bit general-purpose microprocessor capable of addressing 64K of memory. The device has 40 pins, requires +5v single-phase supply, and can operate with a 3-MHz single phase clock.
ARCHITECTURE Definition: The internal logic design of a microprocessor is called its architecture. Limitations of 8085 over MPU: A microprocessor can almost qualify a MPU but has two limitations. _ The lower order address bus of 8085 microprocessor is multiplexed with the data bus. These buses need to be de-multiplexed _ Appropriate control signals need to be generated to interface memory and I/O with 8085. 8085 Pin Configuration: 8085 Pin out diagram
_ The 8085 is a microprocessor with 8-bit word length and is an improved version of the earlier processor 8080A. _ The 8085 includes on its chip most of the logic circuitry for performing computing tasks and for communicating with peripherals. _ Eight of its bus lines are multiplexed; that is, they are time-shared by the lower-order address and data. The 8085 MPU: The MPU as a device or a group of devices _ Can communicate with peripherals _ Provide timing signals _ Direct data flow _ Perform computing tasks The 8085A is an 8- bit general-purpose microprocessor capable of addressing 64K of memory. The device has 40 pins, requires +5v single phase supply, and can operate with a 3-MHz single phase clock. The internal architecture of the 8085 includes
1. Arithmetic/Logic Unit (ALU) 2. Timing and Control Unit 3. Instruction Register and Decoder 4. Register Array 5. Interrupt Control 6. Serial I/O Control The ALU: _ It includes the accumulator, the temporary registers, the arithmetic & logic circuits, and five flags. _ The result is stored in the accumulator, and the flags are set or reset according to the result of operation Flags: There are five flip-flops that act as flags for testing data conditions Affected by Arithmetic and logical Operations The flags are S-Sign flag: Set - Bit D7 of the result (accumulator) is 1 Reset - Bit D7 of the result (accumulator) is 0 Z-Zero flag: Set - Result of operation is 0 Reset - Result is nonzero AC-Auxiliary Carry flag: Set -A carry from bit D3 to bit D4 Reset- No carry from bit D3 to bit D4 P-Parity flag: Set - Result has even number of ones Reset - Result has odd number of ones CY-Carry flag: Set - Final carry from the MSB Reset -No carry out of MSB
Timing and Control Unit: _ Synchronizes all the microprocessor operations _ Generates necessary signals for communication between peripherals and p. Instruction Register and Decoder: _ Loads the instructions from the memory _ The decoder decodes & a sequence is established. Register Architecture: The 8085 has six general purpose registers namely B, C, D, E, H and L. These registers are programmable. Used to load or copy data by writing instructions Accumulator (Register A): 8-bit register Used for performing Arithmetic & Logic Operations I/O data transfers between 8085 & I/O devices. Program Counter: 16-bit register, memory pointer Used for sequencing the execution of instructions Address up to 16K of memory Stack Pointer: 16-bit register, memory pointer Contains the address of the last data byte written into the stack
Two additional registers called temporary registers (8-bit) W and Z, are included in the register array.
Pin Configuration: The 8085 is housed in a 40-pin dual in-line package (DIP). All the signals can be classified into six groups: 1. Address Bus 2. Data Bus 3. Control and Status signals 4. Power supply and frequency signals 5. Externally initiated signals 6. Serial I/O ports
Address Bus: The 8085 has eight signal lines, A15-A8, which are unidirectional and used as the Higher order address bus. 8085 bus structure block diagram
8085 bus structure block diagram System Buses: Address bus: These are a group of 16 lines identified ad Ao to A15. The address bus is unidirectional from MPU to peripheral devices. This is used to perform the first function identifying a peripheral or a memory locati