Number Systems There are 10 kinds of people those that understand binary, those that don t, and those that expected this joke to be in base 2
A Closer Look at the Numbers We Use What is the difference between 3004 and 34, if 0 doesn t mean anything? Our system of numbers (called decimal or base 10) uses the location of digits to describe values The number 3004 means we have: 4 units of 1 0 units of 10 0 units of 100 3 units of 1000 In total: 3 1000 + 0 100 + 0 10 + 4 1 The number 34 has only 4 units of 1 and 3 units of 10 In total: 3 10 + 4 1
A Closer Look at the Numbers We Use This position based number system makes sense to us, mostly because we re used to it We immediately recognize a 3 digit number as being larger than a 2 digit number, regardless of the digits themselves: 111 > 99 There were older systems that did not use positions to indicate value Roman numerals are a common example, where IV is larger than III Ancient Egyptians used hieroglyphics (that evolved over time) that would be incomprehensible to anyone that didn t know the symbols The Egyptian Powers of 10: 1 10 100 1,000 10,000 100,000 1,000,000 line, arch, spiral, lotus, bent finger, tadpole, the god Heh
A Closer Look at the Numbers We Use Our system includes 10 digits (hence the name base 10): 0 1 2 3 4 5 6 7 8 9 No tadpoles or anything creative! By combining these digits into a particular order, we create larger numbers The number of digits we need goes up each time we reach a power of our base, 10: 10 0 = 1 10 1 = 10 10 2 = 100 10 3 =1, 000 10 4 = 10, 000
A Closer Look at the Numbers We Use This isn t a new idea - position based number systems are older than Roman numerals The Sumerians and Babylonians used them, but they used a base 60 system This means they had 60 individual symbols to learn And they didn t reach a two-digit number until they reached 60 Each of their systems used different symbols, but both had a huge drawback: they didn t know about 0 This meant they could not distinguish, with certainty, between larger and smaller numbers. Some symbols were later adopted, but nothing that resembles the way we use 0 now.
A Closer Look at the Numbers We Use The Chinese number system is over 4500 years old, with little change (except for the adoption of a 0 character) They used 10 distinct characters, much like we do But instead of using position to write larger numbers, additional characters are used to describe which power of 10 is being used The system is closer to the way we say numbers out loud in English, rather than how we write them 七万 千 7 ten thousands and 8 thousands 78,000
It took a while to get here The modern numbers we use today are often referred to as Arabic numerals, though their origins can be traced back even further What may be surprising is that Europeans were still using Roman numerals until the 1200s Leonardo Fibonacci (the guy with the sequence) popularized the Arabic system, as it was much easier to work on complicated mathematics
So why base 10? Societies throughout history have experimented with different number systems - some positional, some not Even those that used positional systems (like we use now) didn t approach it the same way Some used base 10 (like we use now), others base 60, and others used entirely different bases, like 8, 12, or 16. How did we settle on base 10 for our current system?
So why base 10? Societies throughout history have experimented with different number systems - some positional, some not Even those that used positional systems (like we use now) didn t approach it the same way Some used base 10 (like we use now), others base 60, and others used entirely different bases, like 8, 12, or 16. How did we settle on base 10 for our current system? We re equipped with convenient calculators!
Would other bases make sense? Base 10 isn t all that great - 10 is only divisible by 2 and 5, it s not that big, and it doesn t represent much except for how many fingers we have We do use other bases all the time, without realizing it Base 60 is used for units of time (seconds, minutes) and in global coordinates (minutes and seconds of a degree) It s convenient, because of how easy it is to divide 60: by 2, 3, 4, 5, 6, 10, 12, 15, 20, and 30. There s even signs of base 60 left over in some languages. The French word for 70 is soixante-dix which translates to sixty plus 10
Would other bases make sense? Binary numbers, or base 2, is used frequently in computing. It uses only 2 digits: 0 and 1, which correspond to the states of a switch being off or on. Very few programmers actually write in binary. Programs are written in more familiar languages, but are ultimately converted to binary before being read by the computer itself. Base 16, or hexadecimal numbers, are also popular. Again, 16 is easy to divide and is a power of 2. It s also not too many digits to remember, but enough that numbers can get fairly large before getting too many digits. ANY base is possible, even bases that aren t whole numbers, though that gets a bit harder. We ll still to whole number bases here.
What about the digits? In modern uses, when we work in a system with base less than 10, we use the same digits base 10 uses, from 0 up to 1 less than the base Base 2 uses 0,1 Base 5 uses 0,1,2,3,4 Base 6 uses 0,1,2,3,4,5 We just need to add more digits to make larger numbers A few numbers in a few bases: BASE 10 BASE 2 BASE 4 BASE 5 BASE 7 BASE 8 1 1 1 1 1 1 2 10 2 2 2 2 4 100 10 4 4 4 6 110 12 11 6 6 10 1010 22 20 13 12 14 1110 32 24 20 16 18 10010 102 33 24 22 55 110111 313 210 106 67 100 1100100 1210 400 202 144
What about the digits? For a base greater than 10, we ll need some extra digits. We usually use the alphabet to fill in for us (which is what the ancient Greeks did too!) 10 = A, 11 = B, 12 = C, 13 = D, 14 = E, 15 = F, 16 = G, 17 = H, etc This works until we get up to 35 so we tend to stay under that these days. A few numbers in a few bases: BASE 10 BASE 2 BASE 4 BASE 12 BASE 16 1 1 1 1 1 2 10 2 2 2 4 100 10 4 4 6 110 12 6 6 10 1010 22 A A 14 1110 32 12 E 18 10010 102 16 12 55 110111 313 47 37 100 1100100 1210 84 64
Converting: Other bases to 10 This is the easier conversion (especially with a calculator) We ll call the base we re converting from b The position of the number tells us which power of the base we need To help keep things straight, we ll use a subscript to represent the base of each number So for example: 135 means 13 in base 5, which is 8 in base 10 First, an example in base 10: 20513 = 2 10 4 + 0 10 3 + 5 10 2 + 1 10 1 + 3 10 0 (Remember than any number to the power of 0 is 1)
Converting: Other bases to 10 This is the easier conversion (especially with a calculator) We ll call the base we re converting from b The position of the number tells us which power of the base we need To help keep things straight, we ll use a subscript to represent the base of each number So for example: 135 means 13 in base 5, which is 8 in base 10 Now, we ll convert 102310 in base 4 to base 10 1023104 = 1 4 5 + 0 4 4 + 2 4 3 + 3 4 2 + 1 4 1 + 0 4 0
Converting: Other bases to 10 This is the easier conversion (especially with a calculator) We ll call the base we re converting from b The position of the number tells us which power of the base we need To help keep things straight, we ll use a subscript to represent the base of each number So for example: 135 means 13 in base 5, which is 8 in base 10 Now, we ll convert 102310 in base 4 to base 10 1023104 = 1 4 5 + 0 4 4 + 2 4 3 + 3 4 2 + 1 4 1 + 0 4 0 = 1 1024 + 0 256 + 2 64 + 3 16 + 1 4 + 0 1
Converting: Other bases to 10 This is the easier conversion (especially with a calculator) We ll call the base we re converting from b The position of the number tells us which power of the base we need To help keep things straight, we ll use a subscript to represent the base of each number So for example: 135 means 13 in base 5, which is 8 in base 10 Now, we ll convert 102310 in base 4 to base 10 1023104 = 1 4 5 + 0 4 4 + 2 4 3 + 3 4 2 + 1 4 1 + 0 4 0 = 1 1024 + 0 256 + 2 64 + 3 16 + 1 4 + 0 1 = 1024 + 0 + 128 + 48 + 4 + 0 = 120410
Converting: Base 10 to 2 converting by 2, and find the Divide the quotient by 2, and find Divide the next quotient by 2, and find Write the remainders backwards to find the binary number.
Converting: Base 10 to 2 converting by 2, and find the Example: We ll convert 79 to base 2 Divide the quotient by 2, and find Divide the next quotient by 2, and find Write the remainders backwards to find the binary number.
Converting: Base 10 to 2 converting by 2, and find the Divide the quotient by 2, and find Example: We ll convert 79 to base 2 79 = 2 39 + 1 Divide the next quotient by 2, and find Write the remainders backwards to find the binary number.
Converting: Base 10 to 2 converting by 2, and find the Divide the quotient by 2, and find Example: We ll convert 79 to base 2 79 = 2 39 + 1 39 = 2 19 + 1 Divide the next quotient by 2, and find Write the remainders backwards to find the binary number.
Converting: Base 10 to 2 converting by 2, and find the Divide the quotient by 2, and find Divide the next quotient by 2, and find Example: We ll convert 79 to base 2 79 = 2 39 + 1 39 = 2 19 + 1 19 = 2 9 + 1 Write the remainders backwards to find the binary number.
Converting: Base 10 to 2 converting by 2, and find the Divide the quotient by 2, and find Divide the next quotient by 2, and find Example: We ll convert 79 to base 2 79 = 2 39 + 1 39 = 2 19 + 1 19 = 2 9 + 1 9 = 2 4 + 1 Write the remainders backwards to find the binary number.
Converting: Base 10 to 2 converting by 2, and find the Divide the quotient by 2, and find Divide the next quotient by 2, and find Example: We ll convert 79 to base 2 79 = 2 39 + 1 39 = 2 19 + 1 19 = 2 9 + 1 9 = 2 4 + 1 4 = 2 2 + 0 Write the remainders backwards to find the binary number.
Converting: Base 10 to 2 converting by 2, and find the Divide the quotient by 2, and find Divide the next quotient by 2, and find Example: We ll convert 79 to base 2 79 = 2 39 + 1 39 = 2 19 + 1 19 = 2 9 + 1 9 = 2 4 + 1 4 = 2 2 + 0 2 = 2 1 + 0 Write the remainders backwards to find the binary number.
Converting: Base 10 to 2 converting by 2, and find the Divide the quotient by 2, and find Divide the next quotient by 2, and find Write the remainders backwards to find the binary number. Example: We ll convert 79 to base 2 79 = 2 39 + 1 39 = 2 19 + 1 19 = 2 9 + 1 9 = 2 4 + 1 4 = 2 2 + 0 2 = 2 1 + 0 1 = 2 0 + 1
Converting: Base 10 to 2 converting by 2, and find the Example: We ll convert 79 to base 2 Divide the quotient by 2, and find Divide the next quotient by 2, and find Write the remainders backwards to find the binary number. 79 = 2 39 + 1 39 = 2 19 + 1 19 = 2 9 + 1 9 = 2 4 + 1 4 = 2 2 + 0 2 = 2 1 + 0 1 = 2 0 + 1 1 1 1 1 0 0 1
Converting: Base 10 to 2 converting by 2, and find the Example: We ll convert 79 to base 2 Divide the quotient by 2, and find Divide the next quotient by 2, and find Write the remainders backwards to find the binary number. 79 = 2 39 + 1 39 = 2 19 + 1 19 = 2 9 + 1 9 = 2 4 + 1 4 = 2 2 + 0 2 = 2 1 + 0 1 = 2 0 + 1 7910 = 10011112 1 1 1 1 0 0 1
Converting: Base 10 to 16 converting by 16, and find the Divide the quotient by 16, and find Divide the next quotient by 16, and find If any remainders are two digit numbers, convert them to a base 16 digit (A,B,C,D,E,F) Write the remainders backwards to find the base 16 number.
Converting: Base 10 to 16 converting by 16, and find the Example: We ll convert 83,710 to base 16 Divide the quotient by 16, and find Divide the next quotient by 16, and find If any remainders are two digit numbers, convert them to a base 16 digit (A,B,C,D,E,F) Write the remainders backwards to find the base 16 number.
Converting: Base 10 to 16 converting by 16, and find the Divide the quotient by 16, and find Example: We ll convert 83,710 to base 16 83710 = 16 5231 + 14 Divide the next quotient by 16, and find If any remainders are two digit numbers, convert them to a base 16 digit (A,B,C,D,E,F) Write the remainders backwards to find the base 16 number.
Converting: Base 10 to 16 converting by 16, and find the Divide the quotient by 16, and find Example: We ll convert 83,710 to base 16 83710 = 16 5231 + 14 5231 = 16 326 + 15 Divide the next quotient by 16, and find If any remainders are two digit numbers, convert them to a base 16 digit (A,B,C,D,E,F) Write the remainders backwards to find the base 16 number.
Converting: Base 10 to 16 converting by 16, and find the Divide the quotient by 16, and find Divide the next quotient by 16, and find Example: We ll convert 83,710 to base 16 83710 = 16 5231 + 14 5231 = 16 326 + 15 326 = 16 20 + 6 If any remainders are two digit numbers, convert them to a base 16 digit (A,B,C,D,E,F) Write the remainders backwards to find the base 16 number.
Converting: Base 10 to 16 converting by 16, and find the Divide the quotient by 16, and find Divide the next quotient by 16, and find Example: We ll convert 83,710 to base 16 83710 = 16 5231 + 14 5231 = 16 326 + 15 326 = 16 20 + 6 20 = 16 1 + 4 If any remainders are two digit numbers, convert them to a base 16 digit (A,B,C,D,E,F) Write the remainders backwards to find the base 16 number.
Converting: Base 10 to 16 converting by 16, and find the Divide the quotient by 16, and find Divide the next quotient by 16, and find Example: We ll convert 83,710 to base 16 83710 = 16 5231 + 14 5231 = 16 326 + 15 326 = 16 20 + 6 20 = 16 1 + 4 1 = 16 0 + 1 If any remainders are two digit numbers, convert them to a base 16 digit (A,B,C,D,E,F) Write the remainders backwards to find the base 16 number.
Converting: Base 10 to 16 converting by 16, and find the Divide the quotient by 16, and find Divide the next quotient by 16, and find Example: We ll convert 83,710 to base 16 83710 = 16 5231 + 14 E 5231 = 16 326 + 15 F 326 = 16 20 + 6 6 20 = 16 1 + 4 4 1 = 16 0 + 1 1 If any remainders are two digit numbers, convert them to a base 16 digit (A,B,C,D,E,F) Write the remainders backwards to find the base 16 number.
Converting: Base 10 to 16 converting by 16, and find the Divide the quotient by 16, and find Divide the next quotient by 16, and find If any remainders are two digit numbers, convert them to a base 16 digit (A,B,C,D,E,F) Example: We ll convert 83,710 to base 16 83710 = 16 5231 + 14 E 5231 = 16 326 + 15 F 326 = 16 20 + 6 6 20 = 16 1 + 4 4 1 = 16 0 + 1 1 8371010 = 146FE16 Write the remainders backwards to find the base 16 number.