Presentation is loading. Please wait.

Presentation is loading. Please wait.

CS 177 Programming with Multimedia Objects Recitation.

Similar presentations


Presentation on theme: "CS 177 Programming with Multimedia Objects Recitation."— Presentation transcript:

1 CS 177 Programming with Multimedia Objects Recitation

2 Course Policy On Course Website

3 How Computer Works

4 What Computers Understand? Computers can only understand Encoding of numbers. So what is the meaning of Encoding ?

5 Figure 3 (pag. 8) of the textbook The reasoning is: hardware produces (patterns of) voltages (variations of electric current). It’s enough to distinguish btw the presence of a current and its absence. 1 represents the presence of a current, o its absence. So, a bit (or binary digit) can represent the presence or the absence of the current.

6 Example 1: Emoticons What if you want to tell a friend your emotion by texting them on your mobile phone (without texting a long message)? You can use emoticons… Emoticons are an encoding of emotions: :) I’m happy, I like it :( I’m unhappy, I dislike it :’( You are using a combination of symbols (parenthesis, punctuation symbols), that you normally you use in writing, to represent your emotions.

7 Example 1 ct’ed Now suppose that you want to encode the previous 3 symbols : ( ) using numbers… You may use the ASCII code …

8 ASCII Table

9 Question 1.2 Write down the sequence of numbers whose ASCII values make up your name.

10 Question Can you guess what is: 67 111 109 112 117 116 101 114

11 Example 2: Traffic Light Traffic light are used to say the car drivers what actions they can/can not do…. What is the Encoding of the following traffic lights?

12 Quiz What actions is encoded by the RED light? What action is encoded by the YELLOW light? What actions is encoded by the GREEN light? Now, let’s try to encode RED, YELLOW, and GREEN with 0’s and 1’s… RED  ? YELLOW  ? GREEN  ?

13 So, Encoding is the activity of converting data or information into some symbol. Computer understand just two symbols, 0 and 1. 0 and 1 are also numbers (in the binary number system). A binary number system gets its name from having just two digits, O and 1.

14 Definitions Bit: is the smallest unit of data in a computer that has a single binary value either 0 or 1. Byte: is a unit of data that is eight binary digits long. How many bits are there in 5 bytes?

15 Question 1.5 How many combinations can be represented in one bit? Two bits? What about three bits and four bits?

16 So, Decoding is the activity of converting code into plain text.

17 Recipes Computer science is the study of recipes. Computer Scientists study how recipes are written. How a recipe works is called algorithms.

18 One Egg Omelet How to make one egg omelet: 1. Put oil in pan 2. Pre-heat pan 3.Crack egg into bowl 4.Add Salt 5. Wisk the contents of bowl 6. Pour contents of bowl into pan 7. Wait for 3 minutes

19 ANY QUESTIONS???

20 THANK Y U


Download ppt "CS 177 Programming with Multimedia Objects Recitation."

Similar presentations


Ads by Google