We can write the integer 7965841 as That we can write it this way is a consequence of the fact that our usual number system is base 10, meaning we have 10 digits. Each digit represents a multiple of a power of 10, based on its position. To make this clearer we could write
Why do we count the way we do, following the number 9 with a new number consisting of a 1 and a 0? Having used 10 digits (0 through 9) to count to 9, we make a new “tens place,” and assume that the digit in that position is the number of tens. For example, 57 is 5 tens and 7 ones. This saves us from needing a new digit for each number; we can stick to our original ten digits. When we get up to 99, we need to add another place, making the next position represent the number of hundreds.
Humans use 10 digits because we have ten fingers. However, what if we were cartoon characters, with only 8 fingers? Then we might only use the eight digits 0, 1, , 7. To go higher than 7, we would create an “eights place,” so that 25 in our new number system would represent two 8’s and five 1’s, or in the base ten system. Higher positions would correspond to higher powers of 8; for example, 6543 means . To get rid of the confusion of going back and forth between the two bases, we use the notation that means the base 10 number 47 and means the base 8 number 47. (What is this in base 10?) This notation carries over into other bases as well.
What is the base 7 number in base 10?
Solution for Example 5-1: All we have to do is write □
Write the base 10 number 216 in base 4.
Solution for Example 5-2: The first few powers of 4 are 1, 4, 16, 64, 256, Clearly we can’t use 256 or any greater power. The highest power which is less than 216 is . The multiples of 64 are 64, 128, and 192; since is still less than 216, the first digit is 3. Why don’t we just use 2 64’s? If so we would need more than 3 16’s, but we are only allowed 3 nonzero digits to represent the number of 16’s. Try it and see! To find the second digit, we look at what is left once we have taken out three 64’s, or .
In general, to find how many times one number goes into another, we can divide the first by the second and throw out the remainder. Doing this with 24 and 16, the quotient is 1.5, so only one 16 is needed (two 16’s are too many), and the second digit is 1. We subtract this 16 from what is left, to get . Dividing this by , the quotient is 2, so the third digit is 2. Subtracting , we get zero, so the remaining digit is zero since we don’t need any 1’s. The number in base 4 is . □
Find the base 10 representations of , , and .
Find the base 8, 9, and 16 representations of .
The presence of base 16 in the previous exercises raises a new question: what if we want to use a base greater than 10? We will need more digits than the usual 10, so all we do is use some other symbols. The most common such case is base 16, or hexadecimal (six-plus-ten-imal). Here we use the digits Thus and . If we had a high enough base we might have to start using smiley faces and triangles for digits, but there would be little use for such a system.
Find the base 10 equivalents of , , and .
At the opposite extreme from all these digits is the lowly base 2, or binary. Here the only two digits are 0 and 1, and counting looks like 1, 10, 11, 100, 101, 110,
How do you multiply a number by 2 in base 2?
Do some conversions into and out of binary.
Perform the addition without converting the two numbers to decimal. Check your answer by converting to decimal, adding, and converting back.
Solution for Example 5-3: We can do the addition just like ordinary base 10 addition, writing the numbers one above the other like so: If two 0’s are in a column, a zero goes in the result in the same column. If a 1 and a 0 are in a column, a 1 goes below. If two 1’s are together, the sum is 2, which in binary is . Thus we must carry the 1, and put a 0 below. The ‘carrying’ process works in base 2 just like in base 10. (Compare this process to adding 56 and 65 in base 10.) This carried 1 will add to the numbers in the next column, making 1 if both are 0, 2 (or ) with a 1 and a 0, and 3 (or ) with two 1’s. For the latter two we will have to carry another 1, and so on. Using these rules we can fill in the digits of the result from right to left, as usual: We’ve placed the carried digits above the columns they’re carried to. The result is To confirm this we convert the original numbers to decimal, getting and and note that , as desired. □
We have seen that the operation of carrying works in binary. This procedure works in any base. Say we are adding the base 7 numbers and . When we add the two rightmost digits we get , so we place a 2 below the line and carry the 1.