Skip to main content

Section 11.4 Base \(b\) Numbers

Instead of using base \(10\) or base \(2\text{,}\) we can use any other natural number \(b>1\) as a base. To represent any number in base \(b\text{,}\) we must specify \(b\) unique symbols that represent the \(b\) values from \(0\) to \(b-1\text{.}\) Those symbols are the first \(b\) symbols from the list

\begin{equation*} 0,1,2,3,4,5,6,7,8,9,\mathrm{A},\mathrm{B},\mathrm{C},\dots\text{.} \end{equation*}

When considering bases \(b\) with \(b\le10\text{,}\) we use the numbers \(0,1,2,3,\dots,b-1\) as our \(b\) unique symbols. However, if \(b>10\text{,}\) we use all of the numbers \(0, 1, 2, \dots, 8, 9\) as well as enough capital letters to complete the list of \(b\) unique symbols. The value of \(\mathrm{A}\) is the decimal number \(10\text{,}\) the value of \(\mathrm{B}\) is the decimal number \(11\text{,}\) the value of \(\mathrm{C}\) is the decimal number \(12\text{,}\) and so on. We do not consider bases greater than \(36\) where we have \(Z_{36}=35\text{,}\) so we do not need further symbols. There are many applications of numbers in other bases. In particular, computer related fields frequently use base \(2\text{,}\) \(8\text{,}\) and \(16\text{.}\)

In the video in Figure 11.4.1 introduce numbers represented in bases other than \(2\) and \(10\text{.}\) Further details are give below.

Figure 11.4.1. Base \(b\) Numbers by Matt Farmer and Stephen Steward

Table 11.4.2 provides various numbers written in base \(2\text{,}\) \(3\text{,}\) \(8\text{,}\) \(10\text{,}\) \(12\text{,}\) and \(16\) as well as in English and French. When counting in some languages, there are some irregularities of words that represent numbers, and many of those irregularities originate in the traditional use of other number systems. In English, the numbers \(11\) and \(12\) do not follow the pattern of the other numbers between \(10\) and \(20\text{.}\) In French, the numbers \(11\) to \(16\) follow a different pattern than the numbers \(17\) to \(19\text{,}\) and the numbers \(30\) to \(79\) follow a different pattern than the numbers \(80\) to \(99\text{.}\)

Table 11.4.2. Selected numbers in English, French, and bases \(2\text{,}\) \(3\text{,}\) \(8\text{,}\) \(10\text{,}\) \(12\text{,}\) \(16\)
English French binary ternary octal decimal dozenal hexadecimal
(base 2) (base 3) (base 8) (base 10) (base 12) (base 16)
zero zéro \(\mathrm{0}_2\) \(\mathrm{0}_3\) \(\mathrm{0}_8\) \(\mathrm{0}\) \(\mathrm{0}_{12}\) \(\mathrm{0}_{16}\)
one un \(\mathrm{1}_2\) \(\mathrm{1}_3\) \(\mathrm{1}_8\) \(\mathrm{1}\) \(\mathrm{1}_{12}\) \(\mathrm{1}_{16}\)
two deux \(\mathrm{10}_2\) \(\mathrm{2}_3\) \(\mathrm{2}_8\) \(\mathrm{2}\) \(\mathrm{2}_{12}\) \(\mathrm{2}_{16}\)
three trois \(\mathrm{11}_2\) \(\mathrm{10}_3\) \(\mathrm{3}_8\) \(\mathrm{3}\) \(\mathrm{3}_{12}\) \(\mathrm{3}_{16}\)
four quatre \(\mathrm{100}_2\) \(\mathrm{11}_3\) \(\mathrm{4}_8\) \(\mathrm{4}\) \(\mathrm{4}_{12}\) \(\mathrm{4}_{16}\)
five cinq \(\mathrm{101}_2\) \(\mathrm{12}_3\) \(\mathrm{5}_8\) \(\mathrm{5}\) \(\mathrm{5}_{12}\) \(\mathrm{5}_{16}\)
six six \(\mathrm{110}_2\) \(\mathrm{20}_3\) \(\mathrm{6}_8\) \(\mathrm{6}\) \(\mathrm{6}_{12}\) \(\mathrm{6}_{16}\)
seven sept \(\mathrm{111}_2\) \(\mathrm{21}_3\) \(\mathrm{7}_8\) \(\mathrm{7}\) \(\mathrm{7}_{12}\) \(\mathrm{7}_{16}\)
eight huit \(\mathrm{1000}_2\) \(\mathrm{22}_3\) \(\mathrm{10}_8\) \(\mathrm{8}\) \(\mathrm{8}_{12}\) \(\mathrm{8}_{16}\)
nine neuf \(\mathrm{1001}_2\) \(\mathrm{100}_3\) \(\mathrm{11}_8\) \(\mathrm{9}\) \(\mathrm{9}_{12}\) \(\mathrm{9}_{16}\)
ten dix \(\mathrm{1010}_2\) \(\mathrm{101}_3\) \(\mathrm{12}_8\) \(\mathrm{10}\) \(\mathrm{A}_{12}\) \(\mathrm{A}_{16}\)
eleven onze \(\mathrm{1011}_2\) \(\mathrm{102}_3\) \(\mathrm{13}_8\) \(\mathrm{11}\) \(\mathrm{B}_{12}\) \(\mathrm{B}_{16}\)
twelve douze \(\mathrm{1100}_2\) \(\mathrm{110}_3\) \(\mathrm{14}_8\) \(\mathrm{12}\) \(\mathrm{10}_{12}\) \(\mathrm{C}_{16}\)
thirteen treize \(\mathrm{1101}_2\) \(\mathrm{111}_3\) \(\mathrm{15}_8\) \(\mathrm{13}\) \(\mathrm{11}_{12}\) \(\mathrm{D}_{16}\)
fourteen quatorze \(\mathrm{1110}_2\) \(\mathrm{112}_3\) \(\mathrm{16}_8\) \(\mathrm{14}\) \(\mathrm{12}_{12}\) \(\mathrm{E}_{16}\)
fifteen quinze \(\mathrm{1111}_2\) \(\mathrm{120}_3\) \(\mathrm{17}_8\) \(\mathrm{15}\) \(\mathrm{13}_{12}\) \(\mathrm{F}_{16}\)
sixteen seize \(\mathrm{10000}_2\) \(\mathrm{121}_3\) \(\mathrm{20}_8\) \(\mathrm{16}\) \(\mathrm{14}_{12}\) \(\mathrm{10}_{16}\)
seventeen dixsept \(\mathrm{10001}_2\) \(\mathrm{122}_3\) \(\mathrm{21}_8\) \(\mathrm{17}\) \(\mathrm{15}_{12}\) \(\mathrm{11}_{16}\)
twenty vingt \(\mathrm{10100}_2\) \(\mathrm{202}_3\) \(\mathrm{24}_8\) \(\mathrm{20}\) \(\mathrm{18}_{12}\) \(\mathrm{14}_{16}\)
sixty soixante \(\mathrm{111100}_2\) \(\mathrm{2020}_3\) \(\mathrm{74}_8\) \(\mathrm{60}\) \(\mathrm{50}_{12}\) \(\mathrm{3C}_{16}\)
eighty quatrevingt \(\mathrm{1010000}_2\) \(\mathrm{2222}_3\) \(\mathrm{120}_8\) \(\mathrm{80}\) \(\mathrm{68}_{12}\) \(\mathrm{50}_{16}\)
ninety quatrevingt-dix \(\mathrm{1011010}_2\) \(\mathrm{10100}_3\) \(\mathrm{132}_8\) \(\mathrm{90}\) \(\mathrm{76}_{12}\) \(\mathrm{5A}_{16}\)
hundred cent \(\mathrm{1100100}_2\) \(\mathrm{10201}_3\) \(\mathrm{144}_8\) \(\mathrm{100}\) \(\mathrm{84}_{12}\) \(\mathrm{64}_{16}\)

We generalize the decimal (base 10) expansion to other bases in the following way. Let \(b\in \N\) with \(b>1\text{.}\) We can write any number \(a\in\N\) with \(a\lt b^n\) in the form

\begin{equation*} a=r_{n-1}b^{n-1}+r_{n-2}b^{n-2}+\dots+r_1 b+r_0\text{,} \end{equation*}

where \(n\) is the number of digits in the base \(b\) representation of \(a\) and \(0\le r_i\lt b\) for \(i\in\{0,\dots,n-1\}\text{.}\)

To write the number \(a\) in base \(b\text{,}\) we extract the coefficients \(r_0\) to \(r_{n-1}\) from the expanded notation. To distinguish numbers in different bases, we add a subscript \(b\) to the number in base \(b\) if \(b\ne 10\text{.}\) So, the number \(a\) from above would be written as

\begin{equation*} a=(r_{n-1}\dots r_2 r_1 r_0)_b \end{equation*}

in base \(b\text{.}\) In Table 11.4.3 and Table 11.4.4 we give examples of numbers in base \(7\) and base \(16\) with their digits, expansions, and the numbers in base \(10\text{.}\)

Table 11.4.3. Numbers in base \(7\text{,}\) their base \(7\) digits, their base \(7\) expansion, and in base \(10\text{.}\) The \(7\) digits used in base \(7\) numbers are \(0\text{,}\) \(1\text{,}\) \(2\text{,}\) \(3\text{,}\) \(4\text{,}\) \(5\text{,}\) and \(6\text{.}\)
\(a\) in base \(7\) digits of \(a\) base \(7\) expansion of \(a\) \(a\) in
base \(7\) \(7^3\) \(7^2\) \(7^1\) \(7^0\) base 10
\(1_7\) \(1\) \(1\cdot 1\) \(1\)
\(10_7\) \(1\) \(0\) \(1\cdot 7+0\cdot 1\) \(7\)
\(100_7\) \(1\) \(0\) \(0\) \(1\cdot 7^2+0\cdot 7+0\cdot 1\) \(49\)
\(200_7\) \(2\) \(0\) \(0\) \(2\cdot 7^2+0\cdot 7+0\cdot 1\) \(98\)
\(6200_7\) \(6\) \(2\) \(0\) \(0\) \(6\cdot 7^3+2\cdot 7^2+0\cdot 7+0\cdot 1\) \(341\)
Table 11.4.4. Hexadecimal (base \(16\)) numbers, their base \(16\) digits, their base \(16\) expansion, and in base \(10\text{.}\) The \(16\) symbols used in hexadecimal numbers are \(0\text{,}\) \(1\text{,}\) \(2\text{,}\) \(3\text{,}\) \(4\text{,}\) \(5\text{,}\) \(6\text{,}\) \(7\text{,}\) \(8\text{,}\) \(9\text{,}\) \(\mathrm{A}\text{,}\) \(\mathrm{B}\text{,}\) \(\mathrm{C}\text{,}\) \(\mathrm{D}\text{,}\) \(\mathrm{E}\text{,}\) and \(\mathrm{F}\text{.}\) We have \(\mathrm{A}_{16}=10\text{,}\) \(\mathrm{B}_{16}=11\text{,}\) \(\mathrm{C}_{16}=12\text{,}\) \(\mathrm{E}_{16}=13\text{,}\) \(\mathrm{E}_{16}=14\text{,}\) and \(\mathrm{F}_{16}=15\text{.}\)
\(a\) in base 16 digits of \(a\) base \(16\) expansion of \(a\) \(a\) in
base \(16\) \(16^3\) \(16^2\) \(16^1\) \(16^0\) base 10
\(1_{16}\) \(1\) \(1\cdot 1\) \(1\)
\(\mathrm{C}_{16}\) \(\mathrm{C}\) \(12\cdot 1\) \(12\)
\(10_{16}\) \(1\) \(0\) \(1\cdot 16+0\cdot 1\) \(16\)
\(\mathrm{A}0_{16}\) \(\mathrm{A}\) \(0\) \(10\cdot 16+0\cdot 1\) \(160\)
\(\mathrm{FF}_{16}\) \(\mathrm{F}\) \(\mathrm{F}\) \(15\cdot 16+15\cdot 1\) \(255\)
\(100_{16}\) \(1\) \(0\) \(0\) \(1\cdot 16^2+0\cdot 16+0\cdot 1\) \(256\)
\(200_{16}\) \(2\) \(0\) \(0\) \(2\cdot 16^2+0\cdot 16+0\cdot 1\) \(512\)
\(6\mathrm{B}00_{16}\) \(6\) \(\mathrm{B}\) \(0\) \(0\) \(6\cdot 16^3+11\cdot 16^2+0\cdot 16+0\cdot 1\) \(27392\)

We compute the decimal representation of a base \(b\) number by evaluating its base \(b\) expansion.

Given numbers in various bases \(b\text{,}\) we convert these numbers to their decimal representations by writing out their base \(b\) expansions and then evaluating them.

  1. \(\displaystyle 1101_2=1\cdot2^3+1\cdot 2^2+0\cdot 2+1 \cdot 1=13\)

  2. \(\displaystyle 1101_3=1\cdot3^3+1\cdot 3^2+0\cdot 3+1 \cdot 1=37\)

  3. \(\displaystyle 201_3=2\cdot 3^2+0\cdot 3+1 \cdot 1=19\)

  4. \(\displaystyle 201_5=2\cdot 5^2+0\cdot 5+1 \cdot 1=51\)

  5. \(\displaystyle 201_{16}=2\cdot 16^2+0\cdot 16+1 \cdot 1=513\)

  6. \(\displaystyle \mathrm{A}3\mathrm{B}_{16}=10\cdot16^2+3\cdot 16+11 \cdot 1=2619\)

Give the base \(18\) expansion of \(99GD872_{18}\) and covert \(99GD872_{18}\) to decimal representation.

Solution.

In base {18} we use the characters \(0\text{,}\)\(1\text{,}\)\(2\text{,}\)\(3\text{,}\)\(4\text{,}\)\(5\text{,}\)\(6\text{,}\)\(7\text{,}\)\(8\text{,}\)\(9\text{,}\)\(A\text{,}\)\(B\text{,}\)\(C\text{,}\)\(D\text{,}\)\(E\text{,}\)\(F\text{,}\)\(G\text{,}\)\(H\) for the digits. The values of these are

\(0_{18} = 0\) \(1_{18} = 1\) \(2_{18} = 2\) \(3_{18} = 3\) \(4_{18} = 4\) \(5_{18} = 5\)
\(6_{18} = 6\) \(7_{18} = 7\) \(8_{18} = 8\) \(9_{18} = 9\) \(A_{18} = 10\) \(B_{18} = 11\)
\(C_{18} = 12\) \(D_{18} = 13\) \(E_{18} = 14\) \(F_{18} = 15\) \(G_{18} = 16\) \(H_{18} = 17\)

So as the base 18 expansion of \(99GD872{18}\) we get

\(99GD872_{18}\)\(= 9\cdot{18}^6 + 9\cdot{18}^5 + 16\cdot {18}^4 + 13\cdot{18}^3 + 8\cdot{18}^2 + 7\cdot{18} + 2\cdot 1 \text{.}\)

Evaluating the expression on the right yields the decimal representation of \(99GD872_{18}\text{:}\)

\(99GD872_{18}\) \(= 9\cdot{18}^6 + 9\cdot{18}^5 + 16\cdot {18}^4 + 13\cdot{18}^3 + 8\cdot{18}^2 + 7\cdot{18} + 2\cdot 1\)\(= 324874280\)

So to convert a number in base \(b\) representation, where \(b\) to base \(10\) representation we

  • write down the base \(b\) expansion, which consists of the digits of the base \(b\) representation converted to decimal and the place values, which are the powers of \(b\)

  • evaluate this expression to obtain the base \(10\) representation.

Try yourself.

0 0 0 0 1 0
0 1 0 0 1 0
0 1 1 0 1 0
0 0 0 1 0 1
1 0 0 1 0 0
1 0 1 0 0 1

Represent each row of the bitmap by a decimal number. When converting to decimal let the most significant binary digit be on the left.

Answer 1.

\(2\)

Answer 2.

\(18\)

Answer 3.

\(26\)

Answer 4.

\(5\)

Answer 5.

\(36\)

Answer 6.

\(41\)

In Checkpoint 11.4.8 do the same for a base greater than \(10\text{.}\) Recall that \(\mathrm{A}\) in the base \(b\) representation is a \(10\) in the base \(b\) expansion, \(\mathrm{B}\) in the base \(b\) representation is a \(11\) in the base \(b\) expansion, \(\mathrm{C}\) in the base \(b\) representation is a \(12\) in the base \(b\) expansion, and so on.

An image showing a letter is encoded into numbers.

In the encoding a 0 corresponds to a white and a 1 to a black pixel. When converting to decimal the most significant binary digit was on the left.

2

3

2

2

\text{}

What is the letter ?

Answer.

t

Solution.

The image is:

\(\square\)\(\blacksquare\)\(\square\)

\(\square\)\(\blacksquare\)\(\blacksquare\)

\(\square\)\(\blacksquare\)\(\square\)

\(\square\)\(\blacksquare\)\(\square\)

\(\square\)\(\square\)\(\square\)

Thus the letter is `t'.