Presentation is loading. Please wait.

Presentation is loading. Please wait.

Microprocessors CSE 341 Lecture Md. Omar Faruqe UB 1228

Similar presentations


Presentation on theme: "Microprocessors CSE 341 Lecture Md. Omar Faruqe UB 1228"— Presentation transcript:

1 Microprocessors CSE 341 Lecture Md. Omar Faruqe faruqe@bracu.ac.bd http://faculty.bracu.ac.bd/~faruqe UB 1228 faruqe@bracu.ac.bd http://faculty.bracu.ac.bd/~faruqe 1 Lecture -2 CSE 341-Microprocessors

2 2 Notice  Books to buy: O/S Concepts - Core book Microprocessors & Interfacing (Hall)  The other books are reference books: You may need to read certain topics from them The books may have better explanations of some topics. Don’t buy just go into the library and have a look.  CSE 321 Labs have been shifted to AH610 (Linux Lab)  Please get your user id/passwords for next week.  I have been asked to supervise Thesis from comms. If any of you are interested I have some new topics which you guys haven’t done before. Lecture -2 CSE 341-Microprocessors

3 3 Course Contents  Common Aspects of microprocessors.  Review of computing/electronic concepts as background study.  Microcontrollers - 8051  Microprocessors - 8086  Microprocessors – Motorola MC68000  Microprocessors –80386 and MC68020  Microprocessors – Intel Pentium Lecture -2 CSE 341-Microprocessors

4 4 Review of Concepts...  Decimal, Binary and Hexadecimal numbering systems.  BCD Codes  ASCII Codes  Binary Arithmetic Addition, Subtraction, Multiplication and Division 1’s Complement 2’s Complement Lecture -2 CSE 341-Microprocessors

5 5 Calculator..... Lecture -2 CSE 341-Microprocessors

6 6 Simple Adder Input AB 00 01 10 11 Output CS 00 01 01 10 Adder A B S C Lecture -2 CSE 341-Microprocessors

7 7 8 bit Adder........  Additions : 5 + 4  Subtraction: 5 - 4 5 + (- 4 ) Lecture -2 CSE 341-Microprocessors

8 8 8 bit Adder......  Shifting to the right 12 6 Dividing by 2  Shifting to the Left 12 24 Multiplying by 2 Lecture -2 CSE 341-Microprocessors

9 9 ALU (Simple Calculator) We have just designed a Simple Calculator that can:  Add  Subtract  Divide by 2  Multiply by 2 Programmable Rather then Fixed Lecture -2 CSE 341-Microprocessors

10 10 8 bit Registers store both A and B. Consider Adding 5 and 4. We need a Control Unit which will perform the above steps. Lecture -2 CSE 341-Microprocessors

11 11 We also need the following :  General Purpose Registers  A special register called PSW “Processor Status Word”  Carry Flag – To hold carry from operations  Zero Flag – Which will indicate arithmetic overflow  Instruction Register –Where all the instructions for the unit is provided.  Clock – To control the rate of operations that are performed. This IR has 8 bits and thus can understand 2 8 =256 Instructions Lecture -2 CSE 341-Microprocessors

12 12 A B Lecture -2 CSE 341-Microprocessors

13 13 Lecture -2 CSE 341-Microprocessors

14 14 Lecture -2 CSE 341-Microprocessors

15 15 Address Lines Data Lines Control Lines (Active Low) RAM (Random Access Memory) will have both RD and WR – Volatile Static – Retains contents unless overwritten or power removed Dynamic – Needs to be refreshed at intervals. ROM(Read Only Memory) will only have RD – Non-Volatile EPROM (Erasable Programmable ROM) - Ultra Violet Light EEPROM (Electronically Erasable Programmable ROM) Lecture -2 CSE 341-Microprocessors

16 16 MOV A,05 MOV B,04 ADD A,B MOV 06,A Lecture -2 CSE 341-Microprocessors

17 17 Assembly programming is the fastest way of executing programs. Code written is Processor-dependent. Code for 80386 will not work on Motorola 68000. Lecture -2 CSE 341-Microprocessors

18 18 Lecture -2 CSE 341-Microprocessors

19 19 Lecture -2 CSE 341-Microprocessors

20 20 External Access Lecture -2 CSE 341-Microprocessors

21 21 Lecture -2 CSE 341-Microprocessors

22 22 Lecture -2 CSE 341-Microprocessors

23 23 Lecture -2 CSE 341-Microprocessors

24 24 Memory 8051 has 256 bytes of internal memory Lecture -2 CSE 341-Microprocessors

25 25 Memory Lecture -2 CSE 341-Microprocessors

26 26 Memory Lecture -2 CSE 341-Microprocessors

27 27 Memory Lecture -2 CSE 341-Microprocessors

28 28 Memory Typical SRAM Lecture -2 CSE 341-Microprocessors

29 29 Memory What memory is used to store BIOS of a PC ? What type of ROM is used do you think ? How could the CIH virus destroy BIOS in a ROM ? Lecture -2 CSE 341-Microprocessors

30 30 Move MOV R0,#05 Stores 0x05 in Register R0 MOV 00,#05Stores 0x05 in memory location 00 Same as Register R0 MOV 20, #06H Stores 0x06 in memory location 20 SETB 07 Sets bit with address 07 to 1 CLR 07 Sets bit with address 07 to 0 Lecture -2 CSE 341-Microprocessors

31 31 PSW EP: Even Parity OV: Arithmetic Overflow Register Bank Select: Bank Selection Auxiliary Flag [AUX]: BCD Operations. Carry Flag: Holds carry bits during Addition / Subtraction MOV C, Lecture -2 CSE 341-Microprocessors

32 32 A + B Lecture -2 CSE 341-Microprocessors

33 33 Sum of 0 + 1 + 2 + 3 + 4 + 5… Int a =0; Int I = 1; While (i <11){ a = a +i; I = I +1; } ORG 0 CLR A MOV R0,#01H LOOP: ADD A,R0 INC R0 CJNE R0,#0AH,LOOP MOV R1,A END CJNE : Compare Jump if Not Equals Lecture -2 CSE 341-Microprocessors

34 34 Sum of 0 + 1 + 2 + 3 + 4 + 5… Int a =0; Int I = 1; While (i <11){ a = a +i; I = I +1; } ORG 0 CLR A MOV R0,#01H LOOP: ADD A,R0 INC R0 CJNE R0,#0AH,LOOP MOV R1,A END CJNE : Compare Jump if Not Equals Lecture -2 CSE 341-Microprocessors

35 35 Find Largest Number and store in 22H ORG 0 MOV A,20H MOV B,21H CJNE A,B,L1 L1: JC L2 MOV 22H,A SJMP FINISH L2: MOV 22H, B FINISH: NOP The carry flag =1 if A<B The carry flag=0 if A>B Lecture -2 CSE 341-Microprocessors

36 36 Addressing Modes MOV R0, #20HMOV R0, R1 MOV A, 35H Immediate NumberingDirect Addressing MOV @R0, R1 MOV @R1, 35H Indirect Addressing MOV @A, 35HNot Valid Only R0 and R1 can be used for Indirect Addressing Lecture -2 CSE 341-Microprocessors

37 37 What does this do ? CLR A MOV R0,#20H LOOP: MOV @R0,A INC R0 CJNE R0,#30H,LOOP END Lecture -2 CSE 341-Microprocessors

38 38 Enough ? I think it is for today ! Lecture -2 CSE 341-Microprocessors

39 39 Discussion / Questions ? Lecture -2 CSE 341-Microprocessors


Download ppt "Microprocessors CSE 341 Lecture Md. Omar Faruqe UB 1228"

Similar presentations


Ads by Google