Presentation is loading. Please wait.

Presentation is loading. Please wait.

CSE115: Introduction to Computer Science I Dr. Carl Alphonce 219 Bell Hall 1.

Similar presentations


Presentation on theme: "CSE115: Introduction to Computer Science I Dr. Carl Alphonce 219 Bell Hall 1."— Presentation transcript:

1 CSE115: Introduction to Computer Science I Dr. Carl Alphonce 219 Bell Hall alphonce@buffalo.edu 1

2 Announcements First class? Print a syllabus from web site. Turn in syllabus signature sheet if you haven’t already done so. Recitations begin this week. 2

3 cell phones off laptops away 3

4 Today Representing things –information encoding –symbol interpretation But first… 4

5 Put your name signs out! And the winner is: Taz 5

6 Morse Code Dots, dashes and spaces used to represent letters/digits http://www.planetofnoise.com/midi /morse2mid.phphttp://www.planetofnoise.com/midi /morse2mid.php Two features: –variable length encodings –not a prefix code 6

7 7 Spaces of different lengths is needed to decode unambiguously. Without spaces, how many ways can six dots in a row be decoded? (Image in public domain: http://commons.wikimedia.org/wiki/F ile:Intcode.png)

8 8 5 five cinq

9 Counting Decimal (base 10) 0 1 2 3 4 5 6 7 8 9 10 11 12 13 etc. Binary (base 2) 0 1 10 11 100 101 110 111 1000 1001 1010 1011 1100 1101 etc. 9

10 Number systems Decimal (base 10) Each position is weighted by a power of 10. E.g. 734 = –7*100 + 3*10 + 4*1 –7*10 2 + 3*10 1 + 4*10 0 E.g. 1101 = –1*1000 + 1*100 + 0*10 + 1*1 –1*10 3 + 1*10 2 + 0*10 1 + 1*10 0 Binary (base 2) Each position is weighted by a power of 2. E.g. 111 = –1*4 + 1*2 + 1*1 = “seven” –1*2 2 + 1*2 1 + 1*2 0 E.g. 1101 = –1*8 + 1*4 + 0*2 + 1*1 = “thirteen” –1*2 3 + 1*2 2 + 0*2 1 + 1*2 0 10

11 Same information Different encoding Color (RGB & CMYK) Quantity (Decimal & Binary) 11

12 Bit string A ‘0’ or ‘1’ is a binary digit, or a bit. A sequence of bits is called a bit string. For example: –1101 is a bit string 12

13 Interpretation QUESTION: –What does 1101 represent? 13

14 Interpretation QUESTION: –What does the bit string 1101 represent? ANSWER: –Whatever we want it to represent! 14

15 Bit-string representations (used in computers) Binary (non-negative numbers) Two’s complement (integers) IEEE 754 (approx. floating point numbers) ASCII / EBCDIC / Unicode (characters) etc. 15

16 Questions? 16


Download ppt "CSE115: Introduction to Computer Science I Dr. Carl Alphonce 219 Bell Hall 1."

Similar presentations


Ads by Google