Presentation is loading. Please wait.

Presentation is loading. Please wait.

Data Manipulation CSC 2001 TTU CSC 2001 TTU. Now what?  Program can be represented (and stored) like data. So, now what happens?  The program needs.

Similar presentations


Presentation on theme: "Data Manipulation CSC 2001 TTU CSC 2001 TTU. Now what?  Program can be represented (and stored) like data. So, now what happens?  The program needs."— Presentation transcript:

1 Data Manipulation CSC 2001 TTU 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.  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.  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  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.  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.  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:A121A241 3138:A331A438 2142:A521A642 3170:A731A870 1138:A911AA39 1270:AB12AC70 3170:AD31AE70 3238:AF32B038 C000:B1C0B200 2141:A121A241 3138:A331A438 2142:A521A642 3170:A731A870 1138:A911AA39 1270:AB12AC70 3170:AD31AE70 3238:AF32B038 C000:B1C0B200 1.Program counter: A1 2.Instruction register: 2141 Program counter: A3 3.Decode 2141 4.Execute 2141 5.Instruction register: 3138 Program counter: A5 6.Decode 3138 7.Execute 3138.

8 Instruction set  We’ve seen addition, jump, load, store.  We haven’t looked at logical operations  AND, OR, XOR  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 10011010 AND 11001001 10001000 00001111 AND 10101010 00001010

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

11 Logic instructions: XOR 10011010 XOR 11001001 01010011 00001111 XOR 10101010 10100101 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  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  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  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  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 10011010 01001101 10011010 10110100 10110100 11011010 circular shift logical shifts doubling halving two’s complement representation

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  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  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  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  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  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  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.  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  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  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  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.)  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.)


Download ppt "Data Manipulation CSC 2001 TTU CSC 2001 TTU. Now what?  Program can be represented (and stored) like data. So, now what happens?  The program needs."

Similar presentations


Ads by Google