1 / 23

Microprocessors

Microprocessors. Typical microprocessor controlled devices: Camera, mobile phone, stereo, mp3 player, electronic toys…. High-level microprocessor controlled automation: DHL and FedEx, Park and Shop, …. What are the similarities ? Both types use computer control. What is the difference?

nevan
Télécharger la présentation

Microprocessors

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Microprocessors Typical microprocessor controlled devices: Camera, mobile phone, stereo, mp3 player, electronic toys… High-level microprocessor controlled automation: DHL and FedEx, Park and Shop, … What are the similarities ? Both types use computer control What is the difference? Real-time programmable

  2. Basic Architecture of a microprocessor A simplified computer

  3. (i) Break [complex] task  sequence of [very simple] sub-tasks each sub-task: dedicated circuit inside the CPU (ii) Perform each sub-task sequentially, in T units of time (or less) until all sub-tasks have been done CPU: Central Processing Unit

  4. CPU structure The Accumulator: main register of the ALU Each ALU operation: operand (data value)  accumulator operand  memory output  accumulator. The instruction register holds the binary code of the instruction that is being executed. The program counter contains the address of the memory location from which the next instruction code will be taken.

  5. Microprocessors: Control unit The control unit controller-sequencer and instruction decoder

  6. Microprocessor memory Memory: Microprocessor memory: on chip [WHY?] Other memory terms: - ROM - PROM (programmable ROM): - EPROM (erasable PROM: erased/reprogrammed by UV-light) - RAM

  7. Microprocessor: Input and Output I/O chips are connect the microprocessor to a variety of devices. EXAMPLES: memory disks, printers, data-links to other computers, instrumentation controlling equipment, etc. Common of I/O chips: Parallel Input/Output (PIO) Serial I/O (UART, Universal Asynchronous Receiver/Transmitter)

  8. Microprocessor: Machine language OPERANDS OPCODE 100011 00011 01000 0000000001000100 [in decimal: 35 3 8 68] 000000 00001 01000 00110 [in decimal: 0 1 8 6] Line 1. Operation-code 35 (load some data into a register): Look at the number stored in register 3 Go to the memory location = [value of register 3] + 68 Get the data from that cell Store it into register 8. Line 2. Operation code 0 (add two numbers). Add the contents of register 1 and register 8 store answer into register 6.

  9. Microprocessor: Assembly language Machine language: Difficult to write programs! Assembly language: English codes for each opcode and operand  Easier to program  Need a way to convert Assembly language  machine language

  10. Microprocessor: Assembly language [label] opcode [operands] [comment] CSEG AT 0000H LOOP: SETB P2.7 ; turn off the LED LOOP1: JNB P0.7,LIGHT AJMP LOOP LIGHT: CLR P2.7 ; turn on the LED AJMP LOOP1 END

  11. Microprocessor: Assembly language Run the program from memory location (Hexadecimal) 0000) CSEG AT 0000H LOOP: SETB P2.7 ; turn off the LED LOOP1: JNB P0.7,LIGHT AJMP LOOP LIGHT: CLR P2.7 ; turn on the LED AJMP LOOP1 END [label] opcode [operands] [comment]

  12. Microprocessor: Assembly language token (marks the line with a name) set bit: set the value of a bit = 1 which bit: port 2.7 (pin #7 of outputs) CSEG AT 0000H LOOP: SETB P2.7 ; turn off the LED LOOP1: JNB P0.7,LIGHT AJMP LOOP LIGHT: CLR P2.7 ; turn on the LED AJMP LOOP1 END [label] opcode [operands] [comment]

  13. Microprocessor: Assembly language token (marks the line with a name) JUMP if NOT: if the bit is not set, i.e. = 0. which bit: port 0.7 (pin #7 of inputs) CSEG AT 0000H LOOP: SETB P2.7; turn off the LED LOOP1: JNB P0.7, LIGHT AJMP LOOP LIGHT: CLR P2.7 ; turn on the LED AJMP LOOP1 END [label] opcode [operands] [comment]

  14. Microprocessor: Assembly language automatic jump (unconditional jump) where? to program counter located by LOOP CSEG AT 0000H LOOP: SETB P2.7 ; turn off the LED LOOP1: JNB P0.7,LIGHT AJMP LOOP LIGHT: CLR P2.7 ; turn on the LED AJMP LOOP1 END [label] opcode [operands] [comment]

  15. Microprocessor: Assembly language token (marks the line with a name) CLEAR: set bit = 0. which bit: port 2.7 (pin #7 of outputs) CSEG AT 0000H LOOP: SETB P2.7; turn off the LED LOOP1: JNB P0.7, LIGHT AJMP LOOP LIGHT: CLR P2.7 ; turn on the LED AJMP LOOP1 END [label] opcode [operands] [comment]

  16. Microprocessor: Assembly language automatic jump (unconditional jump) where? to program counter located by LOOP1 CSEG AT 0000H LOOP: SETB P2.7 ; turn off the LED LOOP1: JNB P0.7,LIGHT AJMP LOOP LIGHT: CLR P2.7 ; turn on the LED AJMP LOOP1 END [label] opcode [operands] [comment]

  17. Microprocessor: Assembly language terminate program (erase it from RAM) CSEG AT 0000H LOOP: SETB P2.7 ; turn off the LED LOOP1: JNB P0.7, LIGHT AJMP LOOP LIGHT: CLR P2.7 ; turn on the LED AJMP LOOP1 END [label] opcode [operands] [comment] Question: When will it END ?

  18. Microprocessor: Assemblers Assembly programming software What’s happening here ?

  19. Burning a PROM

  20. Hardwired Microprocessor control CSEG AT 0000H LOOP: SETB P2.7 ; turn off the LED LOOP1: JNB P0.7,LIGHT AJMP LOOP LIGHT: CLR P2.7 ; turn on the LED AJMP LOOP1 END

  21. plug it here How about Computer control ? Need a special board that can communicate with processor Need a program that can communicate with the board: (device driver) Connect output sockets on this board to outside actuators/sensors

  22. How about Computer control ?? Need a program that can communicate with the board: (device driver) How to use the device driver ? If device driver is written in C++: Write your program in C++ Link your program to device driver (library) Your program  device driver

  23. Computer basics Operating System Examples: What does it do ? Compiler(s) Examples: What do they do ? Application programs Examples: What do they do?

More Related