Summary

This document provides information on microprocessor word length and the evolution of microprocessor technology. It also covers the Intel 8085 microprocessor, its architecture, and functions. The document discusses various microprocessor components like ALU, registers, and flags.

Full Transcript

WORD LENGTH OF MICROPROCESSOR Word length of microprocessor is given by n-bit, where n may be 8,16,32,64. A binary digit 0 and 1 is called a bit. A 8-bit microprocessor can process 8-bit data at a time. If data size is more than 8-bit than 8-bit microprocessor process...

WORD LENGTH OF MICROPROCESSOR Word length of microprocessor is given by n-bit, where n may be 8,16,32,64. A binary digit 0 and 1 is called a bit. A 8-bit microprocessor can process 8-bit data at a time. If data size is more than 8-bit than 8-bit microprocessor process the data in more than one times. For example:-A 8-bit microprocessor process the 16-bit data in two times, 24- bit data in three times and so on. A 8-bit processor handle 8-bit of data at a time, it’s ALU processes 8-bit data and general purpose register hold 8-bit data. Similarly ,a 16-bit processor handle 16-bit of data at a time, it’s ALU process 16-bit data and general purpose register hold 16-bit data. The same concept is used for 32-bit 64-bit microprocessor. A processor of longer words length is more powerful and can process data at faster, speed compare to short word length microprocessor. EVOLUTION OF MICROPROCESSOR MICROPROCESSO YEAR OF WORD MEMORY PIN CLOCK (FREQUENCY) R INTRODUCED LENGTH ADDRESSING CAPACITY 4004 1971 4-bit 1 kB 16 750kHz 8085 1976 8-bit 64 KB 40 3-6 MHz 8086 1978 16-bit 1MB 40 5-10MHz 80486 1989 32-bit 4 GB 17×17 VGA 25-100 MHz Pentium 1993 32-bit 4 GB 237 PGA 60-200 MHz Pentium Pro 1995 32-bit 64-bit 387 PGA 150-200MHz Celeron 1998 32-bit ---------- ------------- 2 GB Pentium-4 2000 32-bit 64 GB 423 PGA 1.3-1.3 GHz Core 2 Duo 2006 64-bit ------------ ------------ 1.2-1.3 GHz i3,i5,i7 2007,2008,2009 64-bit ------------- ------------- 2.4GHz,3.6GHz, 2.93GHz-3.33GHz UNIT – I MICROPROCESSOR 8085 INTRODUCTION Intel 8085 is an 8-bit, NMOS microprocessor. It is a 40 pin IC package fabricated on a single LSI chip. The Intel 8085 uses a single +5 Vdc supply for its operation. Its clock speed is about 3 MHz or 3MHz-6MHz. The clock cycle is of 320 ns. The time for the clock cycle of the Intel 8085 AH-2 version is 200 ns. It has 80 basic instructions and 246 up codes. It consists of three main sections :-an arithmetic and logic unit, a timing and control unit and set of registers. 1.ALU(Arithmetic & Logic Unit) The arithmetic and logic unit(ALU) performs the following arithmetic and logical operations: i. Addition ii. Subtraction iii. Logical AND iv. Logical OR v. Logical EXCLUSIVE OR vi. Complement (logical NOT) vii. Increment(add 1) viii. Decrement(subtract 1) ix. Left shift, Rotate left, Rotate right x. Clear etc. 2.Timing and Control Unit It control the entire operation of the microprocessor and peripherals connected to it. It generates timing and control signals which are necessary for the execution of instructions. It controls data flow between CPU and peripherals(including memory). It provides status ,control and timing signals which are required for the operation of memory and I/O devices. Thus the control unit of the CPU acts as the brain of the computer system. 2.Registers Register is the memory element of microprocessor. Registers are used by microprocessor for temporary storage. Data are remain in the register till they are sent to the memory or I/O devices. In a large computer the number of register is more and hence the program requires less transfer of data to/from the memory. In a small computer the number of registers is small due to limited size of the chip. Intel 8085 microprocessor has the following register i. One 8-bit accumulator(ACC) i.e register A ii. Six 8-bit general purpose registers. These are B,C,D,E,H and L. iii. One 16-bit stack pointer, PC iv. One 16-bit program counter, PC v. Instruction register vi. Temporary register Accumulator(ACC) The accumulator is an 8-bit register associated with the ALU. Accumulator is also known as register A. It is used to hold one of the operands of an arithmetic or logical operation. Accumulator also hold the resultant data of ALU. General-Purpose Registers The 8085 microprocessor contains six 8-bit general purpose registers. They are: B, C, D, E, H and L register. To hold 16-bit data a combination of two 8-bit registers can be employed. The combination of two 8-bit registers is known as a register-pair. The valid register pairs in the 8085 are: B-C, D-E, and H-L. The H-L pair is used to act as memory pointer and for this purpose it holds the 16-bit address of a memory location. The general-purpose register and the accumulator are accessible to programmer. Program Counter(pc) It is a 16-bit special-purpose register. It is use to hold the memory address of the next instruction to be executed. It keeps the track of memory address of the instruction in a program whil they are being executed. Stack Pointer(SP) It is a 16-bit special-function register. The stack pointer(SP) controls addressing of the stack. The SP holds the address of the top element of data stored in the stack. Explanation The stack is a sequence of memory locations set aside by a programmer to store/retrieve the contents of accumulator, flags, program counter and general purpose register during the execution of a program. Any portion of memory used as stack. Since/ the stack works on LIFO(last-in-first-out) principle, its operation is faster compare normal store/retrieve of memory location. During the execution of a program sometimes it becomes necessary to save the contents of some registers which are needed for other operation in the subsequent steps of the program. The contents of such registers are saved in the stack. Then the registers used for some other operations. After completing the needed operations the contents which were saved in the stack are brought back to the register. Instruction Register The instruction register holds the opcode(operation code or instruction code) of the instruction which is being decoded and executed. Temporary Register It is an 8-bit register associated with the ALU. It hold data during an arithmetic/logical operation. It is use by microprocessor. It is not accessible by programmer. FLAGS The Intel 8085 microprocessor contains five flip-flop to serve as status flags. Flag maintains the status of ALU The flip-flop are set or reset according to the conditions which arise during an arithmetic or logical operation. The five status flags of Intel 8085 are 1. Carry flag(CS) 2. Parity flag(P) 3. Auxiliary flag(AC) 4. Zero flag(Z) 5. Sign flag(S) 7 6 5 4 3 2 1 0 0 S Z X AC X P X CS 1.Carry Flag(CS) After the execution of an arithmetic instruction if a carry is produced, the carry flag cs is set to 1, otherwise it is zero.. The carry flag is set or reset in case of addition as well as subtraction. After the addition of two 8-bit numbers , if the sum is larger than 8-bits , a carry is produced; and the carry flag is set to 1. In case of subtraction , if borrow occurs, the carry flag is set to 1. 2.Parity Flag The parity status flag p is set to 1, if the result of an arithmetic or logical operation contains even number of 1s. It is reset that is it is zero, if the result contains odd number of 1s. 3.Auxiliary Carry Flag(AC) The auxiliary carry flag AC hold carry out of the bit number 3 to the bit number 4 resulting from the execution of an arithmetic operation. The counting of bits starts from zero, and hence, the bit number 3 is actually the 4th bit from the least significant bit. 4. Zero Flag(Z) The zero status flag Z is set to 1, if the result of an arithmetic or logical operation is zero. If the result is not zero, the flag is set to zero. 5.Sign Flag(S) The sign flag S is set to one, if the result of an arithmetic or logical operation is negative. If the result is positive, the sign flag is set to zero. Pin Diagram 𝑨𝑫𝟎 − 𝑨𝑫𝟕 𝑉𝑠𝑠 𝑽𝒄𝒄 𝑨𝟖 − 𝑨𝟏𝟓 𝑋1 CLK ( OUT ) 𝑿𝟐 HOLD RESETIN HLDA RESET OUT TRAP 10Τ𝑀ഥ 𝒔𝟎 Intel RST 7-5 RST 6-5 𝒔𝟏 8085A RST 5-5 𝑹𝑫 𝑾𝑹 INTR ALE SID 𝑰𝑵𝑻𝑨 SOD READY Schematic Diagram of Intel 8085 Pin Diagram The description of various pins are as follows: A8-A15(output): These are address bus and are used for the most significant bits(MSB) of memory address or 8 bits of I/O address. AD0-AD7(input/output): These are time multiplexed address/data bus i.e they serve dual purpose. They are used for the least significant 8 bits of the memory address or I/O address during the first clock cycle of a machine cycle. Again they are used for the data during second and third clock cycles. ALE(output): It is an address latch enable signal. It goes high during first clock of a machine cycle and enables the lower 8 bits of the address to be latched either into the memory or external latch. IO/M(output): It is a status signal which distinguishes whether the address is of memory or I/O. When it goes high, the address on the address bus is for an I/O device. When it goes low, address on the address bus is for a memory location. SO,S1(output): These are status signals sent by the microprocessor to distinguish the various types of operation given in table 𝒔𝟏 𝒔𝟎 Operations 0 0 HALT 0 1 WRITE 1 0 READ 1 1 FETCH RD(output): When microprocessor reads data or codes from memory location or an input device, it is called READ operation. RD is a signal sent by the microprocessor to the memory/input device to control READ operation. When it goes low, the selected memory or input device is read. 329 WR(output): When microprocessor sends data to a memory location or an output device, it is caller WRITE operation. WR is a signal sent by the microprocessor to the memory/output device to control write operation. When it goes low, the data which is on the data bus, is written into the selected memory or sent to the output device. READY(input): It is s signal sent by an input or output device to the microprocessor. This signal indicates that the input and output device is ready to send or receive data. HOLD(input): When another device of the computer system, requires address and data buses for the data transfer, it sends HOLD signal to the microprocessor. After receiving the HOLD request, the microprocessor sends out a HLDA(HOLD Aknowledge) signal to the device. HLDA(output): It is a HOLD acknowledge signal sent out by the microprocessor after receiving the HOLD signal. It is sent to the device which has issued the HOLD signal. After the removal of the HLDA goes low, and thereafter the microprocessor takes overs the buses. INTR(input): It is an interrupt signal sent by an external device to the microprocessor. Through this line an external device informs microprocessor that it is ready to transfer data or to initiate certain operation. The 8085 microprocessor have five interrupt lines. The INTR is one of them. INTRA(output): it is an interrupt acknowledge signal issued by the microprocessor after receiving an interrupt request from an external device. It is a low active signal. RRT 5.5, 6.5.7.5 and TRAP(inputs): These are interrupts. RST 7.5, RST 6.5and RST 5.5 are the restart interrupts. Each of them has a programmable mask. The TRAP has the highest priority among interrupts. It is a non-maskable interrupt. RESET IN (input): It resets the program counter to zero. It also resets interrupt enable and HLDA flip flop. It does not affect any other flag or register except the instruction register. RESET OUT(output): It indicates that the CPU is being reset. X1,X2(input): These are terminals to be connected to an external crystal oscillator which drives an internal circuitry of the microprocessor to produce a suitable clock for the operation of microprocessor. CLK(output): It is a clock output for user, which can be used for other digital ICs. Its frequency is same at which processor operates. SID(input): It is data line for serial input. The data on this line is loaded into the 7th bits of the accumulator when RIM instruction is executed. SOD (output): It is a data line for serial output. The 7th bit of the accumulator is output on SOD line when SIM instruction is executed. Vcc: +5 V supply. Vss: Ground reference. Opcode And Operands Each instruction contains two parts: operation code(opcode) and operand. The first part of an instruction which specifies the task to be performed by the microprocessor is called opcode. The second part of the instruction is the data to be operated on, and it is called operand. The operand(data) given in the instruction may be in various forms such as 8-bit or 16-bit address, internal registers or a register or memory location. In some instruction the operand is implicit. Instruction Word Size A digital computer understands instruction written in binary codes(machine codes). The machine 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) 1-Byte Instruction- The instruction whose word size is of 1-byte is known as 1-byte instruction. Example- a) MOV A,B -Move the content of register B to register A. 78H is the opcode for MOV A,B. b) ADD B – Add the content of register B to the content of the accumulator. 80H is the opcode for the instruction ADD B. c) RAL – Rotate the content of the accumulator left by one bit. 17H is the opcode of RAL. 2) 2- Byte Instruction In a two- byte instruction the 1st byte of the instruction is its opcode and the 2nd byte is either data or address. Example are: a) MVI B,O5; Move 05 to register B. 06,05; MVI B,O5 in the code form. b) IN 01; Read data at port B. DB,01; IN 01 in the code form. 3) 3-Byte Instruction. In a three byte instruction the 1st byte of the instruction is its opcode and the 2nd and 3rd bytes are either 16-bit data or 16-address. Example are: a) LXI H,2400H ; Load H-L pair with 2400H. 21,00,24 ; are the opcodes of LXI H,2400. b) LDA 2500H ; Load accumulator from memory 2500 3A,00,25 ; is the opcode of LDA 2500. ADDRESSING MODES. There are various techniques to specify data for instruction, is known as addressing modes.. Intel 8085 uses the following addressing modes 1. Direct addressing 2. Register addressing 3. Register indirect addressing 4. Immediate addressing. 1. Direct addressing In this mode of addressing the address of the operand(data) is given in instruction itself. Examples are: (a) STA 2400H Store the content of the accumulator in the memory location 2400. (b) IN 02 Read data from the port C. 2. Register Addressing In register addressing mode the operand is in one of the general purpose registers. Or operands address by register name. Example are: (a) MOV A,B ; Move the content of register B to register A. (b) ADD B ; Add the content of register B to the content of register A. 3. Register Indirect Addressing In this mode of addressing the address of the operand is specified by a register pair. Examples are: (a) LXI H, 2500H ;Load H-L pair with 2500 H. MOV A,M ; Move the content of the memory location , whose address is in H-L pair to the accumulator HLT ; Halt In the above program the instruction MOV A,M is an example of register indirect addressing. (b) LXI H, 2500 H ADD M HLT In the above program the instruction ADD M is an example of register indirect addressing. 4.Immediate Addressing In immediate addressing mode the operand is specified within the instruction itself. Example are: (a) MVI A,05 Move 05 in register A (b) ADI 06 Add 06 to the content of the accumulator. (c) LXI H,2500 Load immediate H-L pair by 2500. 5. Implicit Addressing There are certain instruction which operate on the content of the accumulator. Such instruction do not required the address of the operand. Examples are: CMA, RAL, RAR etc.

Use Quizgecko on...
Browser
Browser