CHAPTER
1
INTRODUCTION
1.1 EXERCISES
Section 1.2: The World of Digital Systems
1.1. What is a digital signal and how does it differ from an analog signal? Give two
everyday examples of digital phenomena (e.g., a window can be open or closed) and
two everyday examples of analog phenomena.
A digital signal at any time takes on one of a finite number of possible values,
whereas an analog signal can take on one of infinite possible values. Examples of
digital phenomena include a traffic light that is either be red, yellow, or green; a tele-
vision that is on channel 1, 2, 3, ..., or 99; a book that is open to page 1, 2, ..., or 200;
or a clothes hangar that either has something hanging from it or doesn’t. Examples
of analog phenomena include the temperature of a room, the speed of a car, the dis-
tance separating two objects, or the volume of a television set (of course, each ana-
log phenomena could be digitized into a finite number of possible values, with some
accompanying loss of information).
1.2 Suppose an analog audio signal comes in over a wire, and the voltage on the wire can
range from 0 Volts (V) to 3 V. You want to convert the analog signal to a digital sig-
nal. You decide to encode each sample using two bits, such that 0 V would be
encoded as 00, 1 V as 01, 2 V as 10, and 3 V as 11. You sample the signal every 1
millisecond and detect the following sequence of voltages: 0V 0V 1V 2V 3V 2V 1V.
Show the signal converted to digital as a stream of 0s and 1s.
00 00 01 10 11 10 01
1.3 Assume that 0 V is encoded as 00, 1 V as 01, 2 V as 10, and 3 V as 11. You are
given a digital encoding of an audio signal as follows: 1111101001010000. Plot
1
,2 c 1 Introduction
the re-created signal with time on the x-axis and voltage on the y-axis. Assume that
each encoding’s corresponding voltage should be output for 1 millisecond.
3
2
1
0
V
1 2 3 4 5 6 7 8 ms
1.4 Assume that a signal is encoded using 12 bits. Assume that many of the encodings
turn out to be either 000000000000, 000000000001, or 111111111111. We
thus decide to create compressed encodings by representing 000000000000 as
00, 000000000001 as 01, and 111111111111 as 10. 11 means that an
uncompressed encoding follows. Using this encoding scheme, decompress the fol-
lowing encoded stream:
00 00 01 10 11 010101010101 00 00 10 10
000000000000 000000000000 000000000001 111111111111 010101010101
000000000000 000000000000 111111111111 111111111111
1.5 Using the same encoding scheme as in Exercise 1.4, compress the following unen-
coded stream:
000000000000 000000000001 100000000000 111111111111
00 01 11 100000000000 10
1.6 Encode the following words into bits using the ASCII encoding table in Figure 1.9.
a. LET
b. RESET!
c. HELLO $1
a) 1001100 1000101 1010100
b) 1010010 1000101 1010011 1000101 1010100 0100001
c) 1001000 1000101 1001100 1001100 1001111 0100000 0100100 0110001 (don’t
forget the encoding 0100000 for the space between the O and the $).
1.7 Suppose your are building a keybad that has the buttons A through G. A three-bit
output should indicate which button is currently being pressed. 000 represents no
button being pressed. Decide on a 3-bit encoding to represent each button being
pressed.
One possible set of encodings is: A=001, B=010, C=011, D=100, E=101, F=110,
and G=111. Another possible set is: A=001, B=010, C=100, D=101, E=110, F=111,
G=011. Many other sets of encodings are possible; any set of encodings is fine as
long as each encoding is unique.
1.8 Convert the following binary numbers to decimal numbers:
a. 100
, 1.1 Exercises b 3
b. 1011
c. 0000000000001
d. 111111
e. 101010
a) 4
b) 11
c) 1
d) 63
e) 42
1.9 Convert the following binary numbers to decimal numbers:
a. 1010
b. 1000000
c. 11001100
d. 11111
e. 10111011001
a) 10
b) 64
c) 204
d) 31
e) 1497
1.10 Convert the following binary numbers to decimal numbers:
a. 000011
b. 1111
c. 11110
d. 111100
e. 0011010
a) 3
b) 15
c) 30
d) 60
e) 26
1.11 Convert the following decimal numbers to binary numbers using the addition
method:
a. 9
b. 15
c. 32
d. 140
a) 1001
b) 1111
c) 100000
d) 10001100
, 4 c 1 Introduction
1.12 Convert the following decimal numbers to binary numbers using the addition
method:
a. 19
b. 30
c. 64
d. 128
a) 10011
b) 11110
c) 1000000
d) 10000000
1.13 Convert the following decimal numbers to binary numbers using the addition
method:
a. 3
b. 65
c. 90
d. 100
a) 11
b) 1000001
c) 1011010
d) 1100100
1.14 Convert the following decimal numbers to binary numbers using the divide-by-2
method:
a. 9
b. 15
c. 32
d. 140
a) 1001
b) 1111
c) 100000
d) 10001100
1.15 Convert the following decimal numbers to binary numbers using the divide-by-2
method:
a. 19
b. 30
c. 64
d. 128
a) 10011
b) 11110
c) 1000000
d) 10000000
1
INTRODUCTION
1.1 EXERCISES
Section 1.2: The World of Digital Systems
1.1. What is a digital signal and how does it differ from an analog signal? Give two
everyday examples of digital phenomena (e.g., a window can be open or closed) and
two everyday examples of analog phenomena.
A digital signal at any time takes on one of a finite number of possible values,
whereas an analog signal can take on one of infinite possible values. Examples of
digital phenomena include a traffic light that is either be red, yellow, or green; a tele-
vision that is on channel 1, 2, 3, ..., or 99; a book that is open to page 1, 2, ..., or 200;
or a clothes hangar that either has something hanging from it or doesn’t. Examples
of analog phenomena include the temperature of a room, the speed of a car, the dis-
tance separating two objects, or the volume of a television set (of course, each ana-
log phenomena could be digitized into a finite number of possible values, with some
accompanying loss of information).
1.2 Suppose an analog audio signal comes in over a wire, and the voltage on the wire can
range from 0 Volts (V) to 3 V. You want to convert the analog signal to a digital sig-
nal. You decide to encode each sample using two bits, such that 0 V would be
encoded as 00, 1 V as 01, 2 V as 10, and 3 V as 11. You sample the signal every 1
millisecond and detect the following sequence of voltages: 0V 0V 1V 2V 3V 2V 1V.
Show the signal converted to digital as a stream of 0s and 1s.
00 00 01 10 11 10 01
1.3 Assume that 0 V is encoded as 00, 1 V as 01, 2 V as 10, and 3 V as 11. You are
given a digital encoding of an audio signal as follows: 1111101001010000. Plot
1
,2 c 1 Introduction
the re-created signal with time on the x-axis and voltage on the y-axis. Assume that
each encoding’s corresponding voltage should be output for 1 millisecond.
3
2
1
0
V
1 2 3 4 5 6 7 8 ms
1.4 Assume that a signal is encoded using 12 bits. Assume that many of the encodings
turn out to be either 000000000000, 000000000001, or 111111111111. We
thus decide to create compressed encodings by representing 000000000000 as
00, 000000000001 as 01, and 111111111111 as 10. 11 means that an
uncompressed encoding follows. Using this encoding scheme, decompress the fol-
lowing encoded stream:
00 00 01 10 11 010101010101 00 00 10 10
000000000000 000000000000 000000000001 111111111111 010101010101
000000000000 000000000000 111111111111 111111111111
1.5 Using the same encoding scheme as in Exercise 1.4, compress the following unen-
coded stream:
000000000000 000000000001 100000000000 111111111111
00 01 11 100000000000 10
1.6 Encode the following words into bits using the ASCII encoding table in Figure 1.9.
a. LET
b. RESET!
c. HELLO $1
a) 1001100 1000101 1010100
b) 1010010 1000101 1010011 1000101 1010100 0100001
c) 1001000 1000101 1001100 1001100 1001111 0100000 0100100 0110001 (don’t
forget the encoding 0100000 for the space between the O and the $).
1.7 Suppose your are building a keybad that has the buttons A through G. A three-bit
output should indicate which button is currently being pressed. 000 represents no
button being pressed. Decide on a 3-bit encoding to represent each button being
pressed.
One possible set of encodings is: A=001, B=010, C=011, D=100, E=101, F=110,
and G=111. Another possible set is: A=001, B=010, C=100, D=101, E=110, F=111,
G=011. Many other sets of encodings are possible; any set of encodings is fine as
long as each encoding is unique.
1.8 Convert the following binary numbers to decimal numbers:
a. 100
, 1.1 Exercises b 3
b. 1011
c. 0000000000001
d. 111111
e. 101010
a) 4
b) 11
c) 1
d) 63
e) 42
1.9 Convert the following binary numbers to decimal numbers:
a. 1010
b. 1000000
c. 11001100
d. 11111
e. 10111011001
a) 10
b) 64
c) 204
d) 31
e) 1497
1.10 Convert the following binary numbers to decimal numbers:
a. 000011
b. 1111
c. 11110
d. 111100
e. 0011010
a) 3
b) 15
c) 30
d) 60
e) 26
1.11 Convert the following decimal numbers to binary numbers using the addition
method:
a. 9
b. 15
c. 32
d. 140
a) 1001
b) 1111
c) 100000
d) 10001100
, 4 c 1 Introduction
1.12 Convert the following decimal numbers to binary numbers using the addition
method:
a. 19
b. 30
c. 64
d. 128
a) 10011
b) 11110
c) 1000000
d) 10000000
1.13 Convert the following decimal numbers to binary numbers using the addition
method:
a. 3
b. 65
c. 90
d. 100
a) 11
b) 1000001
c) 1011010
d) 1100100
1.14 Convert the following decimal numbers to binary numbers using the divide-by-2
method:
a. 9
b. 15
c. 32
d. 140
a) 1001
b) 1111
c) 100000
d) 10001100
1.15 Convert the following decimal numbers to binary numbers using the divide-by-2
method:
a. 19
b. 30
c. 64
d. 128
a) 10011
b) 11110
c) 1000000
d) 10000000