Tuition increases on November 15th - Enroll soon to lock in current pricing!

Chapter 5: Using the Integers
5.2 Number Bases
C
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
5.2 Number Bases

We can write the integer 7965841 as \[ 7000000 + 900000 + 60000 + 5000 + 800 + 40 + 1. \]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 \begin{align*} &7\times10^6+9\times10^5+6\times10^4+5\times10^3\\&+8\times10^2+4\times10^1+1\times10^0. \end{align*}

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, $\ldots$, 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 $2(8)+5=21$ in the base ten system. Higher positions would correspond to higher powers of 8; for example, 6543 means $6\times8^3+5\times8^2+4\times8+3$. To get rid of the confusion of going back and forth between the two bases, we use the notation that $47_{10}$ means the base 10 number 47 and $47_{8}$ means the base 8 number 47. (What is this in base 10?) This notation carries over into other bases as well.

Example 5-1
t
V

What is the base 7 number $\color[rgb]{1,1,1}3456_7$ in base 10?

Solution for Example 5-1: All we have to do is write \begin{align*} 3\times7^3+4\times7^2&+5\times7^1+6\times7^0\\&=3(343)+4(49)+5(7)+6(1) \\&= {\bf 1266}. \end{align*}

Example 5-2
t
V

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, $\ldots$ Clearly we can’t use 256 or any greater power. The highest power which is less than 216 is $64=4^3$. The multiples of 64 are 64, 128, and 192; since $192=64\times3$ 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 $216-192=24$.

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 $24-16=8$. Dividing this by $4^1=4$, the quotient is 2, so the third digit is 2. Subtracting $8-2\cdot4$, we get zero, so the remaining digit is zero since we don’t need any 1’s. The number in base 4 is ${\bf 3120_4}$.

Exercise 5-4:
t
V

Find the base 10 representations of $\color[rgb]{0.35,0.35,0.35}47_{8}$, $\color[rgb]{0.35,0.35,0.35}47_9$, and $\color[rgb]{0.35,0.35,0.35}47_{16}$.

Show Solution
Exercise 5-5:
t
V

Find the base 8, 9, and 16 representations of $\color[rgb]{0.35,0.35,0.35}47_{10}$.

Show Solution

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 \[ 0,\ 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F. \]Thus $A_{16} = 10_{10}$ and $F_{16}=15_{10}$. 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.

Exercise 5-6:
t
V

Find the base 10 equivalents of $\color[rgb]{0.35,0.35,0.35}BEE_{16}$, $\color[rgb]{0.35,0.35,0.35}DEF_{16}$, and $\color[rgb]{0.35,0.35,0.35}A1_{16}$.

Show Solution

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, $\ldots$

Exercise 5-7:
t
V

How do you multiply a number by 2 in base 2?

Show Solution
Exercise 5-8:
t
V

Do some conversions into and out of binary.

Show Solution
Example 5-3
t
V

Perform the addition $\color[rgb]{1,1,1}1001110_{2}+11001101_{2}$ 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: \[ \begin{tabular}{cccccccc} &1&0&0&1&1&1&0 \\ 1&1&0&0&1&1&0&1\\ \hline \end{tabular} \]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 $10_2$. 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 $10_2$) with a 1 and a 0, and 3 (or $11_2$) 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: \[ \begin{tabular}{ccccccccc} 1&1& & &1&1& & & \\ & &1&0&0&1&1&1&0 \\ &1&1&0&0&1&1&0&1\\ \hline 1&0&0&0&1&1&0&1&1 \end{tabular} \]We’ve placed the carried digits above the columns they’re carried to. The result is \[ 100011011_{2}=256+16+8+2+1=283_{10}. \]To confirm this we convert the original numbers to decimal, getting \[ 1001110_2=64+8+4+2=78_{10} \]and \[ 11001101_{2}=128+64+8+4+1=205_{10}, \]and note that $205_{10}+78_{10}=283_{10}$, 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 $235_7$ and $114_7$. When we add the two rightmost digits we get $9=12_7$, so we place a 2 below the line and carry the 1.

a