Presentation is loading. Please wait.

Presentation is loading. Please wait.

CSCI N201 Programming Concepts and Database 3 – Essence of Computing Lingma Acheson Department of Computer and Information Science, IUPUI.

Similar presentations


Presentation on theme: "CSCI N201 Programming Concepts and Database 3 – Essence of Computing Lingma Acheson Department of Computer and Information Science, IUPUI."— Presentation transcript:

1 CSCI N201 Programming Concepts and Database 3 – Essence of Computing Lingma Acheson linglu@iupui.edu Department of Computer and Information Science, IUPUI

2 Definition of Computer Universal Information Manipulator

3 Definition of Computer Universal –Works with all kinds of information Words, maths, images, videos –Performs different tasks Games, create a document read books, long distance calls, modify images… –Very few limitations Do anything with any kind of information

4 Definition of Computer Information –Seems to be able to work with anything –Actually very limited All translated into 1s and 0s –Tiny pieces of data combined into complex information

5 Definition of Computer Manipulator –Seem able to do anything with data –Actually very limited Come down to a few basic operations –Simple commands combined into complex instructions

6 Computer and Information Information limited to on/off impulses, like a light switch Light switch demo –http://wally.cs.iupui.edu/n100/update/binLights.htmlhttp://wally.cs.iupui.edu/n100/update/binLights.html –One light switch 1 – on, 0 – off Two messages – Have a lecture class today? (on: yes; off: no) –Two light switches Switch one – Have a lecture class today? (on: yes; off: no) Switch two – Have a lab class today? (on: yes; off: no) How many messages can two switches send?

7 Computer and Information –Three light switches Switch one – Have a lecture class today? (on: yes; off: no) Switch two – Have a lab class today? (on: yes; off: no) Switch three – Have a quiz today? (on: yes; off: no) How many messages can two switches send? –Adding each extra switch will double the number of messages –2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, ….

8 Computer and Information Related to how computers store information –Brick counter demo –http://wally.cs.iupui.edu/n100/update/legoMover.htmlhttp://wally.cs.iupui.edu/n100/update/legoMover.html –Represent 1, 2, 4, 8 –How to represent other numbers? (0 – 15) –How to represent more numbers?

9 Binary Conversion Converting from binary to base 10 –Use a spreadsheet –E.g. 1: 101 Brick Demo

10 Binary Conversion –E.g. 2: 1101 –E.g. 3: 1010 –Try it yourself!

11 Binary Conversion How are binary numbers related to base 10 numbers? E.g., 367

12 Binary Conversion Binary numbers, base 2. Able to deal with any number with the power of 2 Binary 101 = 1*2^2 + 0*2^1 + 1*2^0 = 5 Decimal 101 = 1*10^2 + 0*10^1 + 1*10^0 = 101

13 Binary Conversion Base 10, 0 – 9 digits, add more digits as numbers grow Base 2, 0 – 1, add more switches as numbers grow

14 Binary Conversion Converting from base 10 to binary –Use a spreadsheet –Try it yourself!

15 Binary Conversion Converting from base 10 to binary –Large numbers E.g., 34 What is the result from using spreadsheet? 34/2 = 17 with a remainder of 0 17/2 = 8 with a remainder of 1 8/2 = 4 with a remainder of 0 4/2 = 2 with a remainder of 0 2/2 = 1 with a remainder of 0 1/2 = 0 with a remainder of 1 Result: 100010 (get the remainder backwards) E.g. 157

16 Computer Definition Revisit Information –Only deal with 1s and 0s Binary conversion readings: http://www.cs.iupui.edu/~n241/readings/binconv.html

17 Computer Definition Revisit Operation –Very limited –Only three logical operations AND, OR, NOT

18 Basic Logic Gates True or False conditions –E.g.I have a football. – True, False? –Why True or False ? – 1 or 0 Add logic operations –E.g. I have a football and a baseball. I have a football or a baseball. I do not have a football. –E.g. A hardware device example

19 Basic Logic Gates Truth tables –Logical AND AB Result FFF FTF TFF TTT

20 Basic Logic Gates Truth tables –Logical OR AB Result FFF FTT TFT TTT

21 Basic Logic Gates Truth tables –Logical NOT ANOT A FT TF

22 Basic Logic Gates These devices are called gates Turning them into electronic devices, we can put them together to build electronic circuit boards and components, and make computers do different jobs, such as adding or subtracting binary numbers Everything comes down to the operations of the three logic gates

23 Basic Logic Gates Practice: –If you are a student of computer science, or if you are a freshman, you can access the computers in this lab. Can I access the computers in this lab if I am a first year computer science student? –If ((midterm>80) and (final>90)) then grade=“A” Will Sam get an “A” if his midterm score is 85 and final is 89? –If (count <3) then let the user try again. Mary has tried logging to the account three times, will she be allowed to try again? –If you are taller than 4ft, or you are over 16 years old, then you can ride the roller coaster. Peter is 15 years old, can he ride the roller coaster?


Download ppt "CSCI N201 Programming Concepts and Database 3 – Essence of Computing Lingma Acheson Department of Computer and Information Science, IUPUI."

Similar presentations


Ads by Google