Presentation is loading. Please wait.

Presentation is loading. Please wait.

Microprocessors and Interfacing

Similar presentations


Presentation on theme: "Microprocessors and Interfacing"— Presentation transcript:

1 Microprocessors and Interfacing

2 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.

3 Block Diagram of computer
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 Block Diagram of computer with Microprocessor as CPU (Microcomputer)

4 Brain It gets input from eyes/ears and sends processed information to output devices such as face/Muscles. Example : Sit down as instruction.

5 Microprocessor (MPU) Read instructions Process binary data
Microprocessor includes ALU, Register arrays and control unit on a single chip

6 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

7 Microprocessor-Based System with Bus Architecture

8 Microcontroller A device that includes microprocessor, memory and I/O signal lines on a single chip.

9 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

11 Microprocessor Evolution and Types

12 Advances in Semiconductor Technology
SSI <10 Gates MSI Between 10 to 1000 Gates LSI >1000 Gates VLSI >100000

13 Intel Microprocessors 4,8,16,32,64 Bit Processors
Year of Introduction Address Bus ( In Bits) Data Bus ( In Bits) Addressable Memory 4004 1971 10 4 640 Bytes 8080 1974 16 8 64 K Bytes 8085 1976 8086 1978 20 1 M Bytes 80386 1985 32 4 G Bytes Pentium II onwards 1997 36 64 64 G Bytes

14 8085 Hardware Model

15 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

16 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

17 8085 Programming Model

18 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

19 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.

20 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.

21 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.

22 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

23 Flag register S : after the execution of an arithmetic operation, if bit 7 of the result is 1, then sign flag is set. Z : bit is set if ALU operation results a zero in the Acc or registers. AC: bit is set, when a carry is generated by bit 3 and passed on bit 4. P: parity bit is set when the result has even number of 1s.For odd no of 1’s , the flag is reset CY = carry is set when result generates a carry. Also a borrow flag. S Z AC P CY

24 The 8085 Instruction Set

25 Data Transfer (Copy) Operations

26 Arithmetic Operations
ADD B – [A] <----- [A]+[B] ADD M - [A] <----- [A]+[[HL]] SUB C – [A] <----- [A]-[C] SUI 76H – [A] <---- [A]-76H

27 Logical Operations ANA B – [A] <----- [A] AND [B]
ANI 85H – [A] <----- [A] AND 85H ORA M – [A] <----- [A] OR [[HL]] XRA B – [A] < [A] XOR [B] Rotate Compare Complement

28 Branching Operations JMP 2050H – [PC] <----- 2050H
JZ 3100H – [PC] < H if Z=1, otherwise [PC] <----- [PC]+1 JNC 4250H – [PC] < H if C=0, otherwise [PC] <----- [PC]+1 Call, Return

29 Machine Control Operations
Halt Interrupt

30 Instruction Word Size In terms of bytes: One Byte Instructions
Two Byte Instructions Three Byte Instruction

31 One Byte Instructions

32 Two Byte Instructions

33 Three Byte Instruction
JMP 2085H LDA 2050H

34 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.

35 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.


Download ppt "Microprocessors and Interfacing"

Similar presentations


Ads by Google