Confirming Pages
6.2 Digital Representations 199
6.2 DIGITAL REPRESENTATIONS
We grow up becoming proficient using the base 10 decimal number system. The
base of the number system indicates the number of different symbols that can
be used to represent a digit. In base 10, the symbols are 0, 1, 2, 3, 4, 5, 6, 7, 8,
and 9. Each digit in a decimal number is a placeholder for different powers of 10
according to
d
n 1–
. . .
d
3
d
2
d
1
d
0
d
n 1–
10
n 1–
⋅
. . .
d+
2
10
2
⋅ d++
1
10
1
⋅ d
0
10
0
⋅+=
(6.1)
where n is the number of digits and each digit d
i
is one of the ten symbols. Note that
the highest power of 10 is ( n 1), 1 less than the number of digits. As an example,
the decimal number 123 can be expanded as
123 = 1 × 10
2
+ 2 × 10
1
+ 3 × 10
0
(6.2)
Fractions may also be included if digits for negative powers of 10 are included
( d
1
, d
2
, . . .).
In order to represent and manipulate numbers with digital devices such as com-
puters, we use a base 2 number system called the binary number system. The rea-
son for this is that the operation of digital devices is based on transistors that switch
between two states: the ON or saturated state and the OFF or cutoff state. These
states are designated by the symbols 1 (ON) and 0 (OFF) in the base 2 system. The
digits in a binary number, as with the base 10 system, correspond to different powers
of the base. A binary number can be expanded as
(d
n 1–
. . .
d
3
d
2
d
1
d
0
)
2
d
n 1–
·2
n 1–
. . .
d+
2
·2
2
d++
1
·2
1
d
0
·2
0
+=
(6.3)
where each digit d
i
is one of the two symbols 0 and 1. The trailing subscript 2 is used
to indicate that the number is base 2 and not the normally assumed base 10. As an
example of Equation 6.3 , the binary number 1101 can be expanded as
1101
2
12
3
12
2
⋅+⋅ 02
1
⋅ 12
0
⋅++ 8
10
4
10
1
10
++ 13
10
===
(6.4)
The digits of a binary number are also called bits, and the first and last bits have
special names. The first, or leftmost, bit is known as the most significant bit (MSB)
because it represents the largest power of 2. The last, or rightmost, bit is known
as the least significant bit (LSB) because it represents the smallest power of 2.
A group of 8 bits is called a byte.
In general, the value of a number represented in any base can be expanded and
computed with
d
n 1–
. . .
d
3
d
2
d
1
d
0
()
d
n 1–
b
n 1–
⋅
. . .
d+
2
b
2
⋅ d
1
b
1
d
0
b
0
⋅+⋅++()=
(6.5)
where b is the base and n is the number of digits. Often it is necessary to convert from
one base system to another. Equation 6.5 provides a mechanism to convert from an
arbitrary base to base 10. To convert a number from base 10 to some other base, the
procedure is to successively divide the decimal number by the base and record the
alc80237_ch06_197-257.indd 199alc80237_ch06_197-257.indd 199 11/01/11 3:53 PM11/01/11 3:53 PM