Skip to main content
Logo image

Section 11.2 Binary Representation

Before we move on to presenting numbers with arbitrary base b where b is a natural number greater than 1, we consider one more special case. One of the most common bases other than base 10 is base 2. While base 10 numbers are written with the ten symbols 0, 1, 2, 3, 4, 5, 6, 7, 8, and 9 numbers in base 2 are written using the two symbols
0 and 1.
Base 2 representation is particular of interest because digital devices (such as computers) work with the two states on and off, which are represented by 0 and 1. To distinguish numbers in base 2 representation from numbers in base 10 representation we add a subscript 2 to the number in base 2 representation. For example, we write
10012=9
where we interpret 10012 as a number in base 2 representation and 9 as a number in base 10 representation. Numbers in base 2 representation are also called binary numbers.

Subsection Base 2 Expansion

The values of the places of base 10 numbers are the powers of 10. As before we write these from right to left because (by convention) the least significant digit of numbers in decimal representation is on the right. For an n digit decimal (that is, bas 10) number we have the place values:
10n1, 10n2, , 104=10000, 103=1000, 102=100, 101=10, 100=1.
Similarly the place values of base 2 numbers are the powers of two. For an n digit base 2 (or binary) number we have the place values:
2n1, 2n2, , 24=16, 23=8, 22=4, 21=2, 20=1.
For a binary number
a=(rn1r2r1r0)2
where for ri{0,1} we have i{0,,n1} the binary (base 2) expansion
a=rn12n1+rn22n2++r12+r0.
This immediately yields a method for converting base 2 numbers to base 10.
In the video in Figure 11.5 we recap the material covered above and present examples.
Figure 11.5. Binary Numbers by Matt Farmer and Stephen Steward
For the remainder of the section we continue considering the conversion of base 2 to base 10 and also count in base 2.

Example 11.6. Conversion from binary to decimal.

We convert the binary number 1001012 to base 10. We have
1001012=125+024+023+122+021+120=32+4+1=37.
We have found that the decimal representation of the base 2 number 1001012 is 37.
In Figure 11.7 we give more examples of numbers in base 2, their base 2 expansion, and the number in decimal representation.
n in base 2 digits of n base 2 expansion of n n in
base 2 23 22 21 20 base 10
02 0 01 0
12 1 11 1
102 1 0 12+01 2
112 1 1 12+11 3
1002 1 0 0 122+02+01 4
1012 1 0 1 122+02+11 5
1102 1 1 0 122+12+01 6
1112 1 1 1 122+12+11 7
10002 1 0 0 0 123+022+02+00 8
10012 1 0 0 1 123+022+02+11 9
10102 1 0 1 0 123+022+12+01 10
Figure 11.7. Binary (base 2) numbers, their base 2 digits, their base 2 expansion, and in base 10. The two symbols used in binary numbers are 0 and 1. Recall that 20=1 and that 21=2.
So to convert a number in base 2 representation
  • write down the base 2 expansion, which consists of the digits of the base 2 representation converted to decimal and the place values, which are the powers of 2
  • evaluate this expression to obtain the base 10 representation.
Try yourself.

Checkpoint 11.8. Convert from binary to decimal.

Give the expanded base 2 form of 1110112.
26+ 25+ 24+ 23+ 22+ 2+ 1
Give 1110112 in decimal representation.

Subsection Counting in Base 2

For a better understanding of binary (or base 2) numbers, we consider counting in that representation.
When we start counting using only the two symbols 0 and 1. As in the case of decimal numbers we start with zero.
02,
Still with one digit we can also write the number one:
So with one digit we were able to count zero and one. As in the case of decimal numbers we add one more digit and obtain:
102, 112
With two digits we have counted to three. As we cannot go further with those two digits, we continue with:
1002, 1012, 1102, 1112
With three digits we have counted to seven. Adding one more digit we continue with:
10002, 10012, 10102, 10112, 11002, 11012, 11102, 11112
With 4 digits we have counted from zero to fifteen. By now the pattern is clear and we can keep counting like this indefinitely, adding one more digit when we have exhausted all combinations with the current number of digits.
Considering the numbers above we see that 102 is two, 1002 is four, and 10002 is eight.
In Checkpoint 11.9 apply the pattern described above to count in base 2.

Checkpoint 11.9. Count in base 2.

Count in base 2
In the first column enter the numbers in base 2. Recall that the characters used to represent base 2 numbers are:
In the other columns enter the values for the digits of the base 2 expansions.
For your convenience the last number in each row is the corresponding decimal number.
2=
24+
23+
22+
21+
20=0
2=
24+
23+
22+
21+
20=1
2=
24+
23+
22+
21+
20=2
2=
24+
23+
22+
21+
20=3
2=
24+
23+
22+
21+
20=4
2=
24+
23+
22+
21+
20=5
2=
24+
23+
22+
21+
20=6
2=
24+
23+
22+
21+
20=7
2=
24+
23+
22+
21+
20=8
2=
24+
23+
22+
21+
20=9
2=
24+
23+
22+
21+
20=10
2=
24+
23+
22+
21+
20=11
2=
24+
23+
22+
21+
20=12
2=
24+
23+
22+
21+
20=13
2=
24+
23+
22+
21+
20=14
2=
24+
23+
22+
21+
20=15
2=
24+
23+
22+
21+
20=16
2=
24+
23+
22+
21+
20=17
2=
24+
23+
22+
21+
20=18
2=
24+
23+
22+
21+
20=19
2=
24+
23+
22+
21+
20=20
2=
24+
23+
22+
21+
20=21
2=
24+
23+
22+
21+
20=22
2=
24+
23+
22+
21+
20=23
2=
24+
23+
22+
21+
20=24
described in detail following the image
A square divided into 2x2 squares, the top-right one has an 1 in it, the bottom-right one has a 0, the two left ones are empty.
Label: Binary Su Doku
Title text: This one is from the Red Belt collection, of ’medium’ difficulty.
This one is from the Red Belt collection of ’medium’ difficulty
Figure 11.10. Su Doku by Randall Munroe (https://xkcd.com/74).