Presentation on theme: "Microprocessors and Interfacing. Processor It is a device that perform an operation on data based on some pre-defined instructions for example Addition."— Presentation transcript:
Processor It is a device that perform an operation on data based on some pre-defined instructions for example Addition In starting the CPU were made on different boards and connected together, as technology improved, it became possible to bring whole CPU on a single chip named as microprocessor.
Microprocessor A Microprocessor is a multipurpose, programmable electronic device that reads binary instruction from memory; accepts binary data as Input and provides output after processing the data. Block Diagram of computer with Microprocessor as CPU (Microcomputer) Block Diagram of computer
Brain It gets input from eyes/ears and sends processed information to output devices such as face/Muscles. Example : Sit down as instruction.
Microprocessor (MPU) – Read instructions – Process binary data – Microprocessor includes ALU, Register arrays and control unit on a single chip
Input/Output Devices & Bus Input Devices – Keyboard and Switches – Provide binary information to the MPU Output devices – LEDs and LCDs – Receive binary information from the MPU Bus – Carries bits between the microprocessor and memory and I/O Devices
Microprocessor-Based System with Bus Architecture
Microcontroller A device that includes microprocessor, memory and I/O signal lines on a single chip.
Difference between Microcontroller and Microprocessor
10 Microprocessor CPU is stand-alone, RAM, ROM, I/O, timer are separate designer can decide on the amount of ROM, RAM and I/O ports. versatility, general-purpose High power consumption Microcontroller CPU, RAM, ROM, I/O and timer are all on a single chip fixed amount of on-chip ROM, RAM, I/O ports specific-purpose (control- oriented) Low power consumption
Advances in Semiconductor Technology SSI <10 Gates MSIBetween 10 to 1000 Gates LSI>1000 Gates VLSI>100000
Intel Microprocessors 4,8,16,32,64 Bit Processors ProcessorYear of Introduction Address Bus ( In Bits) Data Bus ( In Bits) Addressable Memory 40041971104640 Bytes 8080197416864 K Bytes 8085197616864 K Bytes 8086197820161 M Bytes 80386198532 4 G Bytes Pentium II onwards 1997366464 G Bytes
ALU The ALU performs the following arithmetic and logical operations. – Addition – Subtraction – Logical AND – Logical OR – Logical EXCLUSIVE OR – Complement (logical NOT) – Increment (add 1) – Decrement (subtract 1) – Left shift – Clear
Instruction Register and Decoder The instruction register and the decoder are considered as a part of the ALU The instruction register is a temporary storage for the current instruction of a program The decoder decodes the instruction and establishes the sequence of events to follow
General Registers The 8085 has six general-purpose registers to store 8-bit data; these are identified as B, C, D, E, H, and L They can be combined as register pairs - BC, DE, and HL - to perform some 16-bit operations The programmer can use these registers to store or copy data into the registers by using data copy instructions The HL register pair is also used to address memory locations In other words, HL register pair plays the role of memory address register
Accumulator Hold data for manipulation (arithmetic, logical). Whenever the operation combines two words, either arithmetically or logically, the accumulator contains one word (say A) and the other word(say B) may be contained in a register or in memory location. After the operation the result is placed in the Accumulator replacing the word A. Major working register. Microprocessor can directly work on Acc.
Program counter The function of the PC is to point to the memory address from which the next byte is to be fetched. For 8085 it is 16 bit long. PC automatically increments to point to the next memory during the execution of the present instruction. PC value can be changed by some instructions.
Stack pointer 16 bit register acts as memory pointer. Can save the value of the program counter for later use. points to a memory location in R/W memory which is called stack. follows LIFO algorithm. After every stack operation SP points to next available location of the stack. Usually decrements.
Flags The ALU includes five flip-flops, which are set or reset after an operation according to data conditions of the result in the accumulator and other registers They are called Zero (Z), Carry (CY), Sign (S), Parity (P), and Auxiliary Carry (AC) flags
Flag register SZACPCY 1.S : after the execution of an arithmetic operation, if bit 7 of the result is 1, then sign flag is set. 2.Z : bit is set if ALU operation results a zero in the Acc or registers. 3.AC: bit is set, when a carry is generated by bit 3 and passed on bit 4. 4.P: parity bit is set when the result has even number of 1s.For odd no of 1’s, the flag is reset 5.CY = carry is set when result generates a carry. Also a borrow flag.
Writing Assembly Language Program Define the problem clearly and make the problem statement. Analyze the problem thoroughly. In this step we divide the problem into smaller steps to examine the process of writing programs. Draw the flow chart. The steps listed in the problem analysis and the sequences are represented in a block diagram. Translate the blocks shown in the flowchart into 8085 operations and then subsequently into mnemonics.
Conversion and Execution Convert the mnemonics into Hex code; we need to look up the code in 8085 instruction set. Store the program in Read/Write memory of a single-board microcomputer. This may require the knowledge about memory addresses and the output port addresses. Finally execute the program.