1 / 27

Data Manipulation

Data Manipulation. CSC 2001 TTU. Now what?. Program can be represented (and stored) like data. So, now what happens? The program needs to retrieved from memory and executed. Program execution. Need to “add” some special purpose registers to the CPU to help with this. Program counter

hoshi
Télécharger la présentation

Data Manipulation

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. Data Manipulation CSC 2001 TTU

  2. Now what? • Program can be represented (and stored) like data. So, now what happens? • The program needs to retrieved from memory and executed.

  3. Program execution • Need to “add” some special purpose registers to the CPU to help with this. • Program counter • Keeps up with location in program (address of next instruction). • Instruction register • Holds the instruction being executed.

  4. Program execution • Control unit’s basic algorithm • the machine cycle • fetch • decode • execute • repeat

  5. Program execution • Fetch • Retrieve the next instruction from memory and increment the program counter. • Decode • Decode the bit pattern in the instruction register. • Execute • Perform the action required by the decoded instruction.

  6. Example • Let’s say each memory cell is a byte. • Our memory addresses are 1 byte. • Program counter: 1 byte • Our instructions each take 2 bytes. • Instruction register: 2 bytes • Must increment program counter by 2 each time.

  7. Example (continued) 2141: A1 21 A2 41 3138: A3 31 A4 38 2142: A5 21 A6 42 3170: A7 31 A8 70 1138: A9 11 AA 39 1270: AB 12 AC 70 3170: AD 31 AE 70 3238: AF 32 B0 38 C000: B1 C0 B2 00 Program counter: A1 Instruction register: 2141 Program counter: A3 Decode 2141 Execute 2141 Instruction register: 3138 Program counter: A5 Decode 3138 Execute 3138 . . .

  8. Instruction set • We’ve seen addition, jump, load, store. • We haven’t looked at logical operations • AND, OR, XOR

  9. Logic instructions: AND 10011010 AND 11001001 10001000 00001111 AND 10101010 00001010

  10. Logic instructions: OR 10011010 OR 11001001 11011011 00001111 OR 10101010 10101111

  11. Logic instructions: XOR 10011010 XOR 11001001 01010011 00001111 XOR 10101010 10100101

  12. Bit maps and masking • Using a bit string to represent the presence (or absence) of something. • Meaning of bit string specific to use. • Examples: • attendance • keeping up with what users have seen within a computer application

  13. Masking with AND • Checking for the presence of a 1. 10011010 AND 10000000 10000000 10011010 AND 00000001 00000000

  14. Masking with OR • Setting a bit without disturbing other bits 10011010 OR 00000001 10011011 10011010 OR 10000000 10011010

  15. Masking with XOR • Complementing a bit map (or part of a bit map) 10011010 XOR 11111111 01100101 10011010 XOR 11110000 01101010

  16. Rotating/shifting 10011010 01001101 10011010 10110100 10110100 11011010 circular shift two’s complement representation doubling logical shifts halving

  17. Communicating with other devices • Controllers • mediates communication between computer and device • translates messages back and forth • has to speak both “languages” • plugs in system bus and can be found at a particular “port” on the bus

  18. Communicating with other devices • Computer typically doesn’t blindly flood a device with data. • Device might not be able to keep up. • Coordination occurs through a two-way communication (handshake) that lets the computer know about the device’s status

  19. Communication rates • Rate of bit transfer • bps (bits per second) • Kbps • Mbps • Gbps

  20. Communication types • parallel • multiple bits sent simultaneously down several lines • faster, but more complicated • serial • one bit at a time sent along same wire

  21. Exam 1 review • Try not to surprise on tests • However, these notes are not necessarily comprehensive • Aim for understanding over memorizing • But the two are not mutually exclusive

  22. Exam 1 review • Chapters 0 - 2 • 0.1 - 0.4 • 1.1 - 1.7 • 2.1 - 2.5 • Lectures

  23. Chapter 0 • What is an algorithm? • What is the process of abstraction? • Charles Babbage • Ada Byron, Countess of Lovelace • Grace Hopper • Will not ask much on history. • Will not ask dates.

  24. Data storage • Boolean operators • Gates • Evaluate inputs • Translate between Boolean logic and circuit • Convert between bases 10, 2, and 16 • Basic memory organization • Understand seek time, latency time, access time, transfer time

  25. Data storage • Representing text • Don’t memorize ASCII table • Basic difference between ASCII and UNICODE • Bitmap images • Representing sound

  26. Data storage • Numbers • Integers • Two’s complement • Conversion • Adding • Overflow problem • Floating point • Given rules regarding translation, perform translation

  27. Data manipulation • Basic architecture • Basic machine language • RISC vs. CISC • Understand and be able to work with sample machine language (Appendix will be provided here if needed.)

More Related