exam review module 6 Flashcards Preview

CS100 > exam review module 6 > Flashcards

Flashcards in exam review module 6 Deck (17)
Loading flashcards...
1
Q

discrete information

A

digital

2
Q

continuous information

A

analog

3
Q

Continuous (analog)

A

¥ Old-school mercury thermometer
¥ Temperature is a continuous phenomenon (constantly fluctuates in decimals).
¥ There is an infinite precision we can use to describe temperature
¥ Continuous phenomenon:
¥ Our number system. (Infinite amount of numbers in between any 2 given numbers.
¥ We live in a world where most things are continuous (ex: light, soundwaves, time, distances

4
Q

Discreet (digital)

A

¥ Digital Thermometer (rounds off numbers higher or lower)
¥ There are only certain values that the thermometer can display (not continuous).
¥ Digital =/= electronic or a computer. IT means it measures discreet phenomenon
¥ Anything that can be counted on your fingers is digital/discrete information
¥ Digital clock
¥ Digitization is the simplification (discretization) of continuous phenomenons. We do this out of convenience, do use with computers (they don’t have infinite precision)
¥ Computers have a natural tendency to discretize everything
¥ Computers only deal with fixed numbers, not infinite numbers

5
Q

assassin analogy with light

A

¥ Discreet way to communicate between 2 spies: A light in the window that if turned on, presents a certain message, versus it being turned off.
¥ (2 possible values: assassinate, or don’t assassinate).
¥ Problem with this is you can only communicate one message: yes or no
¥ Solution: connect lightbulb to dimmer -> varying degress of same light to indicate different messages. -> noisy signal, hard to discern between variations
¥ Put 2 lightbulbs -> 4 messages.
¥ Put 8 lightbulbs -> 256 messages.
¥ You could have a “code book” that discerns between each variation to come up with a complex message.

6
Q

binary numbers

A

¥ The decimal number system.
¥ Deci=10 (we have 10 fingers on our fingers)
¥ Decimal digits: 0,1,2,3,4,5,6,7,8,9
¥ Counting in decimal: 7,8,9,10,11,12,13,14, etc. (we add a new column).
¥ Deconstruct 207: 2 “hundreds” + 0 “tens” + 7 “ones” -> base 10 decimal system
¥ 7 x 102 + 0 x 101 + 2 x 102
¥ Any number with exponent 0 will turn into “1”

7
Q

counting in octal

A

0,1,2,3,4,5,6,7,10,11,12,13,14,15,16,17,20,21,23,24,25,26,27,30
2 = 2x82 + 0 x 81 + 2 x 82 = 135. -> 64x2+7
Counting in binary: 0,1,10,11,100,101,110,111,1000,1001,1010,1011,1100,1101 (when you run out of digits, add to the next column).
207 (Decimal) = 11001111 (binary)

8
Q

Breaking down 11001111 (207) (BINARY TO DECIMAL)

A

1 1 0 0 1 1 1 1

27 26 25 24 23 22 21 20

128 64 32 16 8 4 2 1

IGNORE THE COLUMNS WITH 0’S AT THE TOP, THEN CALCULATE FROM THE BOTTOM ROW. -> 128+64+8+4+2+1 = 207

9
Q

¥ Breaking down 11001111 (207) (Decimal to Binary)

A

¥ Look for the biggest power of 2 that can fit into 207 -> 27 -> 128
¥ 207-128=79
¥ Look for biggest power of 2 that can fit into 79 -> 26 -> 64
¥ 79-64=15
¥ Look for biggest power of 2 that can fit into 15 -> 25 -> 32
¥ Numbers greater than 15 deserve 0’s.

10
Q

hexadecimal base (base 16)

A

0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F,10,11,12

A=10 B=11 C=12 D=13 E=14 F=15

11
Q

3aE - hex

A

3 A E
s
162 161 160

256 16 1

3x256 + 10x16 + 14 = 942

12
Q

1 hex digit

A

4 binary digits

13
Q

3AE - hex to binary

A
3= 0011
A= 1010
E= 1110
14
Q

hey to identify hex numbers

A

“42” could either be a base 10 number, or a HEX number.
¥ To identify: Put a “0x” before the number -> 0x42
¥ What’s used in web development -> #42

15
Q

ASCII

A

American Standard Code for Information Interchange
Committee sat down and developed a numbering system to go back and forth between characters and numbers
Beyond numbers…
¥ Computers are made of billions of switches, and those switches can be seen as 1’s and 0’s. We can then use any combination to explain any number.
¥ Numbers missing on the chart (numbers lesser than 32) were used in teletype machines. They were called “control characters”. Those characters are all now obsolete.
¥ The “!” is the first alphabetical character above all others. And so you can throw this into a contact name to show up at the top of the list.
¥ 1 Byte per character

16
Q

Unicode

A

¥ Multiple bytes per characters
¥ Supports characters from around the world e.g (asian characters).
¥ Started late 80’s, early 90’s
¥ Modern used code
¥ Emojis are made up of unicode
¥ Pile of shit emoji = U+1F4A9 -> Unicode + (HEX number)
¥ Not all software handles it well. ex: Emoji or character represented by a [] box

17
Q

UTF-8

A

¥ Used by many websites

¥ Mixes ASCII & Unicode