5.3: Calculating in Other Bases
Introduction and Basics
During the previous discussions, we have been referring to positional base systems. In this section of the chapter, we will explore exactly what a base system is and what it means if a system is “positional.” We will do so by first looking at our own familiar, base-ten system and then deepen our exploration by looking at other possible base systems. In the next part of this section, we will journey back to Mayan civilization and look at their unique base system, which is based on the number 20 rather than the number 10.
A base system is a structure within which we count. The easiest way to describe a base system is to think about our own base-ten system. The base-ten system, which we call the “decimal” system, requires a total of ten different symbols/digits to write any number. They are, of course, 0, 1, 2, ….. 9.
The decimal system is also an example of a positional base system, which simply means that the position of a digit gives its place value. Not all civilizations had a positional system even though they did have a base with which they worked.
Below is the number line for Base 10 . Notice how it is broken up into rows. When you get to the last digit - in this case 9 - you have to add one to the next place value to the left.
There are an infinite amount of different bases and an infinite amount of corresponding number lines. Below are three different examples, written like we have Base 10 above.
Base 2 Number Line (reads from left to right, then top to bottom). The fifth number in the number line is \(101_{\text {two}}\).
|
0 |
1 |
|
10 |
11 |
|
100 |
101 |
|
110 |
111 |
|
1000 |
1001 |
|
1010 |
1011 |
|
1100 |
1101 |
|
1110 |
1111 |
|
10000 |
10001 |
Base 8 Number Line (reads from left to right, then top to bottom). The \(10^{\text {th}}\) number is \(12_{\text {eight}}\).
|
0 |
1 |
2 |
3 |
4 |
5 |
6 |
7 |
|
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
|
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
Base 12 Number Line (reads from left to right, then top to bottom). The \(15^{\text {th}}\) number is \(13_{\text {twelve}}\).
|
0 |
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
A |
B |
|
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
1A |
1B |
|
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
2A |
2B |
Where are different bases used?
Base 2 : (Binary) Computers use Base 2, just zeros and ones for all of their programming. Your phone operates in only zeros (OFF) and ones (ON).
Base 5: (Quinary) This was one of the very first systems of counting, since we have five fingers.
Base 8: (Octal) Think of Base 8 as the mathematics for the Cartoon Universe. Many Cartoons have only eight fingers. We have 10 fingers and live in a Base 10 universe. Cartoon have eight fingers and live in a Base 8 universe. The Cartoon character does not have a character for eight or nine items, as we do in our universe.
Base 12: (Duodecimal) Base 12 is rare to find within history. However, we currently have 12 hours on the clock and 12 months in the year. There were a few tribes in Africa and India which used the duodecimal (base 12) system.
Base 16: (Hexadecimal) Base 16 is used in computers to represent long binary values. It allows you to store more information using less space.
Base 20: (Vigesimal) The Mayans used a Base 20 system, and invented the concept of zero.
Base 60: (Sexagesimal) An extreme example is base 60, which was used by the Babylonians (about 4000 years ago) which is now current day Iraq. They had characters for 1 – 59 items. (The concept of “zero” was not discovered yet.) However, this is where our current concept of 60 minutes and 60 seconds come from.
Converting From Other Bases To Base 10
In our base-ten system, a number like 5,783,216 has meaning to us because we are familiar with the system and its places. As we know, there are six ones, since there is a 6 in the ones place. Likewise, there are seven “hundred thousands,” since the 7 resides in that place. Each digit has a value that is explicitly determined by its position within the number. We make a distinction between digit, which is just a symbol such as 5, and a number, which is made up of one or more digits. We can take this number and assign each of its digits a value. One way to do this is with a table, which follows:
\(\begin{array}{|l|l|l|l|}
\hline 5,000,000 & =5 \times 1,000,000 & =5 \times 10^{6} & \text { Five million } \\
\hline+700,000 & =7 \times 100,000 & =7 \times 10^{5} & \text { Seven hundred thousand } \\
\hline+80,000 & =8 \times 10,000 & =8 \times 10^{4} & \text { Eighty thousand } \\
\hline+3,000 & =3 \times 1000 & =3 \times 10^{3} & \text { Three thousand } \\
\hline+200 & =2 \times 100 & =2 \times 10^{2} & \text { Two hundred } \\
\hline+10 & =1 \times 10 & =1 \times 10^{1} & \text { Ten } \\
\hline+6 & =6 \times 1 & =6 \times 10^{0} & \text { Six } \\
\hline 5,783,216 & \text { Five million, seven hundred eighty-three thousand, two hundred sixteen } \\
\hline
\end{array}\)
From the third column in the table we can see that each place is simply a multiple of ten. Of course, this makes sense given that our base is ten. The digits that are multiplying each place simply tell us how many of that place we have. We are restricted to having at most 9 in any one place before we have to “carry” over to the next place. We cannot, for example, have 11 in the hundreds place. Instead, we would carry 1 to the thousands place and retain 1 in the hundreds place. This comes as no surprise to us since we readily see that 11 hundreds is the same as one thousand, one hundred. Carrying is a pretty typical occurrence in a base system.
However, base-ten is not the only option we have. Practically any positive integer greater than or equal to 2 can be used as a base for a number system. Such systems can work just like the decimal system except the number of symbols will be different and each position will depend on the base itself.
For example, let’s suppose we adopt a base-five system. The only modern digits we would need for this system are 0,1,2,3 and 4. What are the place values in such a system? To answer that, we start with the ones place, as most base systems do. However, if we were to count in this system, we could only get to four (4) before we had to jump up to the next place. Our base is 5, after all! What is that next place that we would jump to? It would not be tens, since we are no longer in base-ten. We’re in a different numerical world. As the base-ten system progresses from 10 0 to10 1 , so the base-five system moves from 5 0 to 5 1 = 5. Thus, we move from the ones to the fives.
After the fives, we would move to the 5 2 place, or the twenty fives. Note that in base-ten, we would have gone from the tens to the hundreds, which is, of course, 10 2 .
Let’s take an example and build a table. Consider the number 30412 in base five. We will write this as 30412 5 , where the subscript 5 is not part of the number but indicates the base we’re using. First off, note that this is NOT the number “thirty thousand, four hundred twelve.” We must be careful not to impose the base-ten system on this number. Here’s what our table might look like. We will use it to convert this number to our more familiar base-ten system.
\(\begin{array}{|l|l|l|l|}
\hline & \text { Base 5 } & \text { This column coverts to base-ten } & \text { In Base-Ten } \\
\hline & 3 \times 5^{4} & =3 \times 625 & =1875 \\
\hline+ & 0 \times 5^{3} & =0 \times 125 & =0 \\
\hline+ & 4 \times 5^{2} & =4 \times 25 & =100 \\
\hline+ & 1 \times 5^{1} & =1 \times 5 & =5 \\
\hline+ & 2 \times 5^{0} & =2 \times 1 & =2 \\
\hline & & \text { Total } & 1982 \\
\hline
\end{array}\)
As you can see, the number 30412 5 is equivalent to 1,982 in base-ten. We will say \(30412_{5}=1982_{10}\). All of this may seem strange to you, but that’s only because you are so used to the only system that you’ve ever seen.
Convert \(6234_{7}\) to a base 10 number.
Solution
We first note that we are given a base-7 number that we are to convert. Thus, our places will start at the ones ( \(7^{0}\) ), and then move up to the \(7^{\prime} s, 49^{\prime} s\left(7^{2}\right),\) etc. Here's the breakdown:
\(\begin{array}{|l|l|l|l|}
\hline & \text { Base 7 } & \text { Convert } & \text { Base 10 } \\
\hline & =6 \times 7^{3} & =6 \times 343 & =2058 \\
\hline+ & =2 \times 7^{2} & =2 \times 49 & =98 \\
\hline+ & =3 \times 7 & =3 \times 7 & =21 \\
\hline+ & =4 \times 1 & =4 \times 1 & =4 \\
\hline & & \text { Total } & 2181 \\
\hline
\end{array}\)
\( \text { Thus } 6234_{7}=2181_{10} \)
Convert \(41065_7\) to a base 10 number.
- Answer
-
\(41065_{7}=9994_{10}\)
Converting From Base 10 To Other Bases
Converting from an unfamiliar base to the familiar decimal system is not that difficult once you get the hang of it. It’s only a matter of identifying each place and then multiplying each digit by the appropriate power. However, going the other direction can be a little trickier. Suppose you have a base-ten number and you want to convert to base-five. When converting from base-ten to some other base, it is helpful to determine the highest power of the base that will divide into the given number at least once.
- Find the highest power of the base b that will divide into the given number at least once and then divide.
- Write down the whole number part, then use the remainder from division in the next step.
- Repeat step two, dividing by the next highest power of the base b, writing down the whole number part (including 0), and using the remainder in the next step.
- Continue until the remainder is smaller than the base. This last remainder will be in the “ones” place.
- Collect all your whole number parts to get your number in base \(b\) notation.
Convert the base-ten number 348 to base-five.
Solution
The powers of five are:
\(\begin{array}{l}
5^{0}=1 \\
5^{1}=5 \\
5^{2}=25 \\
5^{3}=125 \\
5^{4}=625
\end{array}\)
Etc..
since \(348\) is smaller than \(625,\) but bigger than \(125,\) we see that \(5^{3}=125\) is the highest power of five present in \(348 .\) So we divide 125 into 348 to see how many of them there are:
\(348 \div 125=2\) with remainder 98
We write down the whole part, 2, and continue with the remainder. There are 98 left over, so we see how many 25’s (the next smallest power of five) there are in the remainder:
\(98 \div 25=3\) with remainder 23
We write down the whole part, 2, and continue with the remainder. There are 23 left over, so we look at the next place, the 5’s:
\(23 \div 5=4\) with remainder 3
This leaves us with 3, which is less than our base, so this number will be in the “ones” place. We are ready to assemble our base-five number:
\( 348=\left(2 \times 5^{3}\right)+\left(3 \times 5^{2}\right)+\left(4 \times 5^{1}\right)+(3 \times 1) \)
Hence, our base-five number is \(2343 .\) We'll say that \(348_{10}=2343_{5}\)
Convert the base-ten number 4509 to base-seven.
Solution
The powers of 7 are:
\(\begin{array}{l}
7^{0}=1 \\
7^{1}=7 \\
7^{2}=49 \\
7^{3}=343 \\
7^{4}=2401 \\
7^{5}=16807
\end{array}\)
Etc…
The highest power of 7 that will divide into 4509 is \(7^{4}=2401\)
With division, we see that it will go in 1 time with a remainder of \(2108 .\) So we have 1 in the \(7^{4}\) place.
The next power down is \(7^{3}=343,\) which goes into 2108 six times with a new remainder of \(50 .\) So we have 6 in the \(7^{3}\) place.
The next power down is \(7^{2}=49\), which goes into 50 once with a new remainder of \(1 .\) So there is a 1 in the \(7^{2}\) place.
The next power down is \(7^{1}\) but there was only a remainder of \(1,\) so that means there is a 0 in the 7 's place and we still have 1 as a remainder.
That, of course, means that we have 1 in the ones place.
\(\begin{array}{ll}
4509 \div 7^{4}= & 1 \quad \mathrm{R} \quad 2108 \\
2108 \div 7^{3}= & 6 \quad \mathrm{R} \quad 50 \\
50 \div 7^{2}= & 1 \quad \mathrm{R} \quad 1 \\
1 \div 7^{1}= & 0 \quad \mathrm{R} \quad 1 \\
1 \div 7^{0}= & 1 \\
4509_{10}=16101_7
\end{array}\)
Putting all of this together means that \(4509_{10}=16101_{7}\)
Convert \(657_{10}\) to a base 4 number.
- Answer
-
\(657_{10}=22101_{4}\)
Convert \(8377_{10}\) to a base 8 number.
- Answer
-
\(8377_{10}=20271_{8} \)
Operations In Other Bases
- Rewrite the problem vertically (line up the place values).
- Add the rightmost digits first (the ones place).
- Represent the sum in the base you are working with and "carry" as if you are adding in Base 10.
- Repeat steps 2 and 3 with the next place value higher until you get to the leftmost digit.
\[\begin{aligned}
5415_{6}+3042_{6} \\
\\
5415_{6} \\
+3042_{6} \\
\hline
12501_{6}
\end{aligned} \nonumber \]
To help us through this addition, here is a table of all possible sums of single-digits in base 6:
\(\begin{array}{|l|l|l|l|l|}
\hline + & 0 & 1 & 2 & 3 & 4 & 5 \\
\hline 0 & 0 & 1 & 2 & 3 & 4 & 5 \\
\hline 1 & 1 & 2 & 3 & 4 & 5 & 10 \\
\hline 2 & 2 & 3 & 4 & 5 & 10 & 11 \\ \hline 3 & 3 & 4 & 5 & 10 & 11 & 12 \\ \hline 4 & 4 & 5 & 10 & 11 & 12 & 13\\ \hline 5 & 5 & 10 & 11 & 12 & 13 & 14 \\
\hline
\end{array}\)
\(5+2=7\) which is \(11_{6}\) so we "carry" the left 1 and put the right 1 in the ones place in the sum.
\(1+1+4=6\) which is \(10_{6}\) so we "carry" the 1 and put the 0 in the sixes place in the sum.
\(1+4+0=5\) which is \(5_{6}\) so we put the 5 in the thirty-sixes place in the sum.
\(5+3=8\) which is \(12_{6}\) and it's the last step, so we put the 2 in the two-hundred-sixteens place and the 1 in the one-thousand-two-hundred-ninety-sixes place in the sum.
\[\begin{aligned}
1202_{3}+1022_{3} \\
\\
1202_{3} \\
+1022_{3} \\
\hline
10001_{3}
\end{aligned} \nonumber \]
\(2+2=4\) which is \(11_{3}\) so we "carry" the left 1 and put the right 1 in the ones place.
\(1+0+2=3\) which is \(10_{3}\) so we "carry" the 1 and put the 0 in the threes place.
\(1+2+0=3\) which again is \(10_{3}\) so we again "carry" the 1 and put the 0 in the nines place.
\(1+1+1=3\) which again is \(10_{3}\) and it's the last step, so we put the 0 in the twenty-sevens place and the 1 in the eighty-ones place.
Add \(7452_{9}+3288_{9}\)
- Answer
-
\(11751_{9}\)
- Rewrite the problem vertically (line up the place values).
-
Subtract the rightmost digits first (the
ones
place).
-
If you cannot get a positive value, you need to "borrow" from the next column over, exchanging 1 from the b column to get b in the ones column.
- (For example in base 5: take 1 five and exchange it for 5 ones ).
-
If you cannot get a positive value, you need to "borrow" from the next column over, exchanging 1 from the b column to get b in the ones column.
- Repeat step 2 with the next place value higher until you get to the leftmost digit.
\[\begin{aligned}
4310_{7} - 1234_{7} \\
\\
4310_{7} \\
-1234_{7} \\
\hline
3043_{7}
\end{aligned} \nonumber \]
We cannot take 4 from 0 so we take one from the sevens place and exchange it for 7 ones. \(7-4=3\) so we put the 3 in the ones place in the difference.
We cannot take 3 from 0 (because we took 1) so we take one from the forty-nines place and exchange it for 7 sevens . \(7-3=4\) so we put the 4 in the sevens place in the difference.
\(2-2=0\) so we put the 0 in the forty-nines place in the difference.
\(4-1=3\) so we put the 3 in the three-hundred-forty-threes place in the difference.
\[\begin{aligned}
3741_{8}- 1465_{8} \\
\\
3741_{8} \\
-1465_{8} \\
\hline
2254_{8}
\end{aligned} \nonumber \]
We cannot take 5 from 1 so we take one from the eights place and exchange it for 8 ones and add it to the 1 already there. \(9-5=4\) so we put the 3 in the ones place in the difference.
We cannot take 6 from 3 (because we took 1) so we take one from the sixty-fours place and exchange it for 8 eights and add it to the 3 already there. \(11-6=5\) so we put the 5 in the eights place in the difference.
\(6-4=2\) so we put the 2 in the sixty-fours place in the difference.
\(3-1=2\) so we put the 2 in the five-hundred-twelves place in the difference.
- Rewrite the problem vertically.
- Multiply the bottom number's ones digit by the top number's ones digit.
- Represent the product in the base you are working with and "carry" as if you are multiplying in Base 10.
- Repeat steps 2 and 3 remembering to add the value of the "carry" until you have multiplies the bottom number's ones digit with every digit of the top number.
- Now repeat steps 2 and 3 with the bottom number's next digit over. You need to place a 0 in the ones digit because the next digit is not a ones digit.
- Repeat until you have use all digits of the bottom number.
\[\begin{aligned}
323_{4} \times 12_{4} \\
\\
323_{4} \\
\times 12_{4} \\
\hline
1312_{4} \\ + 3230_{4} \\ \hline 11202_{4}
\end{aligned} \nonumber \]
To help us through this multiplication, here is a table of all possible products of single-digits in base 4:
\(\begin{array}{|l|l|l|l|l|}
\hline \times & 0 & 1 & 2 & 3 \\
\hline 0 & 0 & 0 & 0 & 0 \\
\hline 1 & 0 & 1 & 2 & 3 \\
\hline 2 & 0 & 2 & 10 & 12 \\ \hline 3 & 0 & 3 & 12 & 21 \\
\hline
\end{array}\)
\(2 \times 3 = 6\) which is \(12_{4}\) so we "carry" the 1 and put the 2 in the ones place in the product.
\(2 \times 2 + 1 = 5\) which is \(11_{4}\) so we "carry" the left 1 and put the right 1 in the fours place in the product.
\(2 \times 3 + 1 = 7\) which is \(13_{4}\) so we put the 3 in the sixteens place in the product and the 1 in the sixty-fours place in the product.
Now on the next line we put a 0 in ones place. Then we multiply by the 1 in \(12_{4}\).
\(1 \times 3 = 3\) so we put the 3 in the fours place.
\(1 \times 2 =2\) so we put the 2 in the sixteens place.
\(1 \times 3 = 3\) so we put the 3 in the sixty-fours place.
Now we add to get our final answer.