Presentation is loading. Please wait.

Presentation is loading. Please wait.

Week 3 - Monday.  What did we talk about last time?  Video games  Lab 2.

Similar presentations


Presentation on theme: "Week 3 - Monday.  What did we talk about last time?  Video games  Lab 2."— Presentation transcript:

1 Week 3 - Monday

2  What did we talk about last time?  Video games  Lab 2

3

4

5

6  What is Tanya Rider's story?  How did bits (digital information) save her life?  Why wasn't she saved earlier?  Should she have been saved earlier?

7  Rhymes with "go on"  A koan is a puzzling or paradoxical statement  If you think about it literally, you'll get nowhere, but if you think about it in just the right way…  Insight!  They are associated with the Zen school of Buddhism

8 One day Tokusan told his student Ganto, "I have two monks who have been here for many years. Go and examine them." Ganto picked up an ax and went to the hut where the two monks were meditating. He raised the ax, saying, "If you say a word I will cut off your heads; and if you do not say a word, I will also cut off your heads." Both monks continued their meditation as if he had not spoken. Ganto dropped the ax and said, "You are true Zen students." He returned to Tokusan and related the incident. "I see your side well," Tokusan agreed, "but tell me, how is their side?" "Tozan may admit them," replied Ganto, "but they should not be admitted under Tokusan."

9 1. It's all just bits 2. Perfection is normal 3. There is want in the midst of plenty 4. Processing is power 5. More of the same can be a whole new thing 6. Nothing goes away 7. Bits move faster than thought

10

11  Storage for all the data and instructions on your computer  Modern computers store everything as binary digits (bits) which have a value of 0 or 1.

12 MemoryWhat Can be StoredMemoryWhat Can be Stored 1 byteOne character, like Q 4 gigabytesA regular movie on DVD 1 kilobyteA poem8 gigabytesAn action movie on DVD 100 kilobytes A short story50 gigabytesA movie on Blu-Ray A low resolution photo 1 terabyte Two years of MP3 music 1 megabyte A novel350,000 copies of War and Peace A medium resolution photo250 DVD quality movies A minute of MP3 music85,000 high resolution photos 1 gigabyte Two CD quality albums 24 albums of MP3 music

13

14  What if you want to write a program that can…  Edit music files  Stream video from the Internet  Organize your photo album  Each of these tasks manipulates a lot of data  MP3’s, streaming video, and jpegs are complicated kinds of data  These kinds of data out of much simpler building blocks  We'll start with representing numbers

15  You have heard people (me, probably) talking about all the 1’s and 0’s inside of a computer  What does that all really mean?  Using semiconductor physics, we can make a tiny little piece of a microchip be in one of two states, say, OFF and ON, like a switch  If we say that OFF is 0 and ON is 1, then, by using a lot of these switches, we can represent a lot of 1’s and 0’s

16  What do we do with those 1’s and 0’s?  To begin with, we represent numbers  How many of you have heard of base 10?  How many of you have heard of base 2?  What’s the definition of a number system with a given base?

17  A number is a concept  Three hedgehogs, three complaints, and three notes of music all share threeness  No matter how you represent a number, the number is the same  The name for a number is called a numeral  The following represent the concept of three: 33  III  11 2

18  Our normal number system is base 10  This means that our digits are: 0, 1, 2, 3, 4, 5, 6, 7, 8, and 9  Base 10 means that you need 2 digits to represent ten, namely 1 and 0  Each place in the numeral as you move left corresponds to an increase by a factor of 10

19 3,482,9313,482,931 OnesMillions Hundreds Thousands Tens Hundred thousands Ten thousands

20  The binary number system is base 2  This means that its digits are: 0 and 1  Base 2 means that you need 2 digits to represent two, namely 1 and 0  Each place in the numeral as you move left corresponds to an increase by a factor of 2 instead of 10

21 1111110000011111100000 Ones1024’s Sixteens Thirty twos Eights Sixty fours Twos Fours 256’s 128’s 512’s

22 11111100000 = 1∙2 10 + 1∙2 9 + 1∙2 8 + 1∙2 7 + 1∙2 6 + + 1∙2 5 + 0∙2 4 + 0∙2 3 + 0∙2 2 + 0∙2 1 + 0∙2 0 = 1024 + 512 + 256 + 128 + 64 + 32 = 2016

23  Each 1 in a base 2 numeral represents a power of 2  Add up all those values

24  Find the largest power of 2 that is less than or equal to the number  Subtract that power of 2 from the number  Repeat the process until you have zero  Every time you used a power of 2, write a 1 in the representation of the number in base 2  Otherwise, write a 0

25  Which base we use to represent numbers is arbitrary  We use base 10 almost certainly because we have 10 fingers  The Duodecimal Society thinks we should use base 12  Is there a base 1?  When do we use it?

26  In case you were wondering, there are bases bigger (sometimes much bigger) than 10  Computer scientists like base 16 (hexadecimal) because it is easy between base 2 and base 16, but base 16 takes less space to write  The digits in base 16 are 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, and F  1A2 in base 16 is 418 in base 10  It is possible to write ridiculous numbers like DEADBEEF

27  Using a series of 1s and 0s we can represent integers  Representing fractional numbers is similar, but messier  As you know, we can represent colors as three numbers: red, green, and blue values  What about words?

28  Each character has a number associated with it  These numbers can be listed in tables  The ASCII table only covers 7 bits of information (0-127)  Unicode is a standard that lets us represent characters from all the world's languages

29  You can think of sound as a wave  On a computer, we cannot record a wave form directly  As usual, we have to figure out a way to store a wave as a series of numbers  We are going to use these numbers to approximate the heights of the wave at various points

30  Recall that Hertz (Hz) is a unit that means a number of times per second  Equivalent to Hz is s -1  We are going to break down the wave into lots of slices  We are going to have 44,100 slices in a second  Thus, we are slicing at 44,100 Hz

31  We slice up a wave and record the height of the wave  Each height value is called a sample  By getting 44,100 samples per second, we get a pretty accurate picture of the wave

32

33  We will talk about abstraction and variables  Read Chapter 1 of Python Programming

34  Keep working on Project 1  Read Chapter 1 of Python Programming


Download ppt "Week 3 - Monday.  What did we talk about last time?  Video games  Lab 2."

Similar presentations


Ads by Google