Presentation is loading. Please wait.

Presentation is loading. Please wait.

How Computers Think: Binary, Decimal and Hexadecimal For NYSCPT Summer Institute, NYU 8-16-02 Andrew O’Neill Columbia University.

Similar presentations


Presentation on theme: "How Computers Think: Binary, Decimal and Hexadecimal For NYSCPT Summer Institute, NYU 8-16-02 Andrew O’Neill Columbia University."— Presentation transcript:

1 How Computers Think: Binary, Decimal and Hexadecimal For NYSCPT Summer Institute, NYU 8-16-02 Andrew O’Neill Columbia University

2 Introduction ● Why do people and computers think in different ways? ● How do people think about numbers? Where did these ideas come from? ● How do computers use numbers? ● How can we speak the computer's language? ● Two mysteries solved - you too can count to 1000 on two hands!

3 History of (human) numbers ● 1 st Mystery: The Mesopotamians used a base-60 number system, from which we still use minutes, seconds and degrees. ● Greeks/Romans use base-10, in a different form... 1 2 3 4 5 6 7 8 9 I II III IV V VI VII VIII IX X, L, C, D, M We have 10 fingers, so this makes sense, right?

4 ● Refined by introduction of zero and the place system - 'decimal' as we know it 0 1 2 3 4 5 6 7 8 9 10, 100, 1000... – Allows us to deal with very large numbers, and fractions. – Proven successful over time.

5 How Computers Count ● Computers are logical electronic devices – All data is just a combination of two states 'on' and 'off'. ● These states are called “Binary digITs” (BITS), which can only take a value of 1 or 0. ● Use the place system just like decimal 1 represents decimal 'one', 10 represents decimal 'two'...

6 Binary - Decimal Comparison

7 ● Maximum different values we can represent with n bits is 2 n. ● One BYTE = 8 BITS ● One BYTE holds 2 n = 256 different values. ● ASCII is a code for most characters between 0 & 255 ● Oh yeah, computers typically start counting at zero!

8 ASCII Codes in Decimal 000001002003004005006007 008009010011012013014015 016017018019020021022023 024025026027028029030031 032033 !034 "035 #036 $037 %038 &039 ' 040 (041 )042 *043 +044,045 -046.047 / 048 0049 1050 2051 3052 4053 5054 6055 7 056 8057 9058 :059 ;060 063 ? 064 @065 A066 B067 C068 D069 E070 F071 G 072 H073 I074 J075 K076 L077 M078 N079 O 080 P081 Q082 R083 S084 T085 U086 V087 W 088 X089 Y090 Z091 [092 \093 ]094 ^095 _ 096 `097 a098 b099 c100 d101 e102 f103 g 104 h105 i106 j107 k108 l109 m110 n111 o 112 p113 q114 r115 s116 t117 u118 v119 w 120 x121 y122 z123 {124 |125 }126 ~127...128 to 255 used for non-latin characters...

9 Hexadecimal ● Base 16 ● Need more symbols than 0,1,...,9 ● 1 2 3 4 5 6 7 8 9 A B C D E ● "Ox" notation Ox15 = 16 in decimal (1*16 + 5 = 21)

10 Bin - Hex – Dec Comparison

11 So Why Hex? ● Base 16, or 2 4 – Holds as much information as 4 bits – E.g. 0xE is equivalent to binary 1111 ● 1 byte can be represented by 2 hex characters ● Saves writing 8 bits! – Saves space on small screens ● Useful in displaying computer information

12 Communicating With Our Electronics ● Our electronics board has 4 inputs ● We need to tell it which ones to look for coincidences on

13 Calculator Demo Counting to 1000

14 So why base 60? ● Mesopotamians had cool numbers…

15 Theory #1 ● 60 is the smallest number divisible by 2, 3, 4, and 5. Theory #2 ● Mixing of two civilizations, one with base 5, one with base 12…

16 Theory #3 ● Three-parts to each finger on right hand = 12 ● Point to one of these 12 parts with one of 5 fingers on left hand ● 5x12 = 60 … Theory # … ● Astronomical, geometrical, yada yada

17 The Real Reason ● There are 0x3C reasons why the ancient civilizations used base-60!!!


Download ppt "How Computers Think: Binary, Decimal and Hexadecimal For NYSCPT Summer Institute, NYU 8-16-02 Andrew O’Neill Columbia University."

Similar presentations


Ads by Google