Professional Documents
Culture Documents
Digital Design Digital Design Digital Design Digital Design: Third Edition Third Edition
Digital Design Digital Design Digital Design Digital Design: Third Edition Third Edition
THIRD EDITION
M. MORRIS MANO
CHAPTER 1 : BINARY
SYSTEMS PROBLEMS
1.1-) List the octal and the hexadecimal numbers
from 16 to 32
32.. Using A and B for the last two
digits, list the numbers from 10 to 26 in base 12 .
Octal :
16 = 8¹ x 2 + 8º x 0 => (16)10 = (20)8
32 = 8¹ x 4 + 8º x 0 => (32)10 = (40)8
20, 21, 22, 23, 24, 25, 26, 27, 30, 31, 32, 33, 34, 35, 36, 37, 40
Hexadecimal :
16 = 16¹ x 1 + 16º x 0 => (16)10 = (10)16
32 = 16¹ x 2 + 16º x 0 => (32)10 = (20)8
10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 1A, 1B , 1C, 1D, 1E, 1F, 20
Base-12 :
10 = 12º x A => (10)10 = (A)12
26 = 12¹ x 2 + 12º x 2 => (26)10 = (22)12
A, B, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 1A, 1B, 20, 21, 22
1.2-) What is the exact number of bytes in a
system that contains (a) 32
32K
K byte, (b)64
(b)64M
M bytes,
and (c)6
(c)6.4G byte ?
Binary:
(111111111111)2
Decimal:
(111111111111)2 = 1x 2º+ 1 x 2¹ + 1 x 2² +…..+ 1 x 2¹¹ + 1 x 2¹²
(111111111111)2 = 4,095
Hexadecimal:
(1111 1111 1111)2 = (FFF)16
F F F
1.4-) Convert the following numbers with the
indicated bases to decimal : (4310
(4310))5 , and (198
(198))12
.
(4310)5 = 0 x 5º + 1 x 5¹ + 3 x 5² + 4 x 5³ = 0 + 5 + 75 + 500
(4310)5 = 580
x² - 11x + 22 = (x – 3) . (x – 6)
x² - 11x + 22 = x² - (6 + 3)x + (6.3)
⇒ (11)a = (6)a + (3)a
⇒1+a=6+3
⇒a=8
1.7-) Express the following numbers in decimal :
(10110
10110..0101
0101))2 , ((16
16..5)16 , ((26
26..24
24))8 .
(16.5)16 = 6 + 16 + (5/16)
(16.5)16 = 22.3125
( 2 6 . 2 4 )8 = 6 x 8º + 2 x 8¹ + 2 x (8^-1) + 4 x (8^-2)
1 0 -1 -2
(68BE) 16
Binary form:
(0110 1000 1011 1110)2=(0110100010111110)2
6 8 B E
Octal form:
(0 110 100 010 111 110)2
0 6 4 2 7 6 =(064276)8
(a) 1.10
10--) Convert the decimal number 345 to
binary in two ways :
Convert directly to binary;
Convert first to hexadecimal, then from
hexadecimal to binary. Which method is
faster ?
Method 1:
Number Divided by 2 Remainder
(345)10 345 345/
345/2=172 1
172 172/
172/2=86 0
86 86/
86/2=43 0
43 43/
43/2=21 1
21 21/
21/2=10 1
10 10/
10/2=5 0
5 5/2=2 1
2 2/2=1 1
Method 2:
345 345/
345/16=
16=21 9
21 21/
21/16=
16=1 5
34 0.4375
34
34..4375=(
4375=(100010
100010..01110)
01110)2
(b) 1/3=0.3333…
0.33333*2=0.66666 r=0
0.66666*2=1.33332 r=1
0.33332*2=0.66664 r=0
0.66664*2=1.33328 r=1
.
.
.
0.3333…=(0.010101….)= 0+ ¼ + 0 +
1/8 + 0 + 1/32 +… =~0.33333…
(c)
0.010101010…=0.0101 0101
0101
9’s comlements :
(a) 99999999-98127634=01872365
(b) 99999999-72049900=27950099
(c) 99999999-10000000=89999999
(d) 99999999-0000000=99999999
10’s complements
(a)16
(a)16^
^5-AF
AF33B=
B=50
50C
C5
(b)(AF
(b) (AF3
3B)
B)16
16=
=1010 1111 0011 1011
(c)1010111100111011
(c)1010111100111011
0101000011000101
(d)0101
(d) 0101 0000 1100 0101
0101=
= 50
50C
C5
1.16
16--) Obtain the 1’s and 2’S complements of the
following binary numbers :
(a)11101010
(a)11101010 (b)01111110
(b)01111110 (c)00000001
(c)00000001
(d)10000000
(d)10000000 (e)00000000
(e)00000000
1’s complements:
(a) 00010101 (b)
(b)10000001
10000001 (c)11111110
(c)11111110 (d)
(d)01111111
01111111
(e)11111111
(e)11111111
2’s complement :
(a) 00010110 (b)10000010
(b)10000010 (c)11111111
(c)11111111 (d)10000000
(d)10000000
(e)00000000
(e)00000000
1.17
17--) Perform subtraction on the following
unsigned numbers using the 2’s
’s--complement of
the subtrahend. Where the result shoud be
negative, 10
10’s
’s complement it and affix a minus
sign. Verify your answers .
(a) 7188-
7188-3049 (b)150
(b)150--2100 (c)2997
(c)2997--7992
(d)1321
(d)1321--375
(a)7188+
(a)7188+6951
6951= =4139 One carry out so
answer is correct.
(b)150
(b)150+
+7900=
7900=8050 correct answer=-
answer=-1950
(c)2997
(c)2997+
+2008=
2008=5005 correct answer=-
answer=-4995
(d)1321+
(d)1321+9625
9625= =0946 One carry out so
answer is correct.
1.18
18--) Perform subtraction on the following
unsigned binary numbers using the 2’s
’s--
complement of the subtrahend. Where the result
should be negative, 2’s complement it and affix a
minus sign .
(a)11011
(a)11011--11001 (b)110100
(b)110100--10101 (c)1011
(c)1011--
110000 (d)
(d)101010
101010--101011
(a)11011
(a)11011+
+00111
00111=
=00010
00010((27
27--25
25=
=2)
(b)110100
(b) 110100+
+01011=
01011=011111
011111((52
52--21
21=
=31
31))
(c)1011
(c)1011+
+010000=
010000=011011 -100101
100101((11
11--48
48=
=-37
37))
(d)101010
(d) 101010+
+010101=
010101=111111
111111-000001
000001((42
42--43
43=
=-1)
1.19
19--) The following decimal numbers are shown
in sign-
sign- magnitude form : +
+9826
9826 and +801
+801..
Convert them to signed 10
10’s
’s--complement form
and perform the following operations : (Note that
the sum is +10627
+10627 and requires six digits).
(a) (+9826
(+9826)+(+
)+(+801
801)) (b)(+9826
(b)(+9826)+(
)+(--801
801))
(c)(--9826
(c)( 9826)+(+
)+(+801
801)) (d)(-
(d)(-9826)+(
9826)+(--801
801))
(a)009826
(a)009826++00801
00801==010627
(b)009826
(b) 009826+
+999199
999199=
=09025
(c)990174
(c) 990174+
+000801
000801=
=990975
990975
-09025
(d)990174
(d) 990174+
+999199
999199=
=989373
989373
-10627
1.20
20--) Convert decimal +61
+61 and +27
+27 to binary
using the signed-
signed-2’s complement representation
and enough digits to accomodate the numbers.
Then perform the binary equivalent of (+27
(+27)) + (-
(-
61
61)) , (-
(- 27
27)) + (+61
(+61)) and (-
(-27
27)) + (-
(- 61
61)) .
Convert the answers back to ecimal and verify that
they are correct .
+61=0111101 -61=1000011
+27=0011011 -27=1100101
(a)27+(-61)=0011011+1000011=1011110
(b)-27+(+61)=1100101+0111101=0100010
(c)-27+(-61)=
1100101+1000011=0101000(overflow)
11100101+11000011=10101000
1.21
21--) Convert decimal 9126 to both BCD and
ASCII codes. For ASCII, an odd parity bit is to be
appended at the left .
(a)6027
(a)6027
BCD : 0110 0000 0010 0111
(b)excess
(b) excess3
3: 1001 0011 0101 1010
(c)(c)
(c)(c)0110
0110 0000 0010 1101
1.25
25--) Find the 9’s complement of 6027 and
express it in 2421 code. Show that the result is
the 1’s complement of the answer to (c) in
Problem 1.24 . This demonstrates that the 2421
code is self-
self-complementing .
2^4 =16
2^5 =32
G . B O O L E
(01000111
01000111)(
)(00101110
00101110)) ((01000010
01000010)) ((01101111
01101111)) ((01101111
01101111)) ((01101100
01101100)) ((01100101
01100101))
1.28
28--) Decode the following ASCII code : 1001010
1100001
1101110 1100101 0100000 1000100 1101111
1100101 .
Jane
Doe
1.29
29--) The following is a string of ASCII
characters whose bit patterns have benn
converted into hexadecimal for compactness : 4A
EF 68 6E
6E 20 C4 EF E5
E5 . Of the 8 bits in each
pair of digits, the leftmost is a parity bit. The
remaining bits are the ASCII code.
J O H N (space) D O E
1.30
30--) How many printing characters are there in
ASCII ?
How many of them are special characters (not
letters or numerals) ?
94 characters
(8-3) (9
(9-3) (7
(7-3)
Binary Code:
100010010111 2^11
11+
+2^7+2^4+2^2+2+1=2199
1.33
33--) List the ASCII code for the 10 decimal
digits with an even parity bit in the leftmos
position.
00110000
10110001
10110010
00110011
10110100
00110101
00110110
10110111
10111000
00111001
1.34
34--) Assume a 3-input AND gate with output F
and a 3-input OR gate with output G. Inputs are
A, B, and C . Show the signals (by means of a
timing diagram) of the outputs F and G as
functions of three inputs ABC. Use all possible
combinations of ABC.
F: A ,B ,C
F: A , BX , CX
AX ,B , CX
AX , BX ,C