数字电路课后习题答案第二章
2.8
(a)
(b)
2.9
(a)
(b)
2.10 (a)
(b)
(c)
2.11 decimal signed-magnitude two’s-magnitude one’s-complement 2.12 (a)
11010100 (b) 101110011 (c) 01011101 (d) 00100110 + 10101011 + 11010110 + 00100001 + 01011010 ------------------------------------------------------------------------------------------------------------------------01111111 10001111 01111101 10000000 yes no no yes
2.6
(a) (c) (e) (g) (i)
125 10 = 1111101 2 209 10 = 11010001 2 132 10 = 1000100 2 727 10 = 10402 5 1435 10 = 2633 8 1100010 110101 + 11001 ------------------------1001110 110000 110101 - 11001 -----------------------011100 1372 + 4631 ------------------6223 1372 + 4631 ------------------59A3 (b)
2.7
(a)
111111110 (d) 11000000 1011000 (c) 11011101 101110 1110010 + 1100011 + 100101 + 1101101 ------------------------------------------------------------------------------------101000000 1010011 11011111 0011010 000010 (c) 11000100 (d) 1110010 11011101 101110 - 1101101 - 1100011 - 100101 ------------------------------------------------------------------------------------0000101 01111010 001001 47135 + 5125 ------------------54262 4F1A5 + B8D5 ---------------------5AA7A + 18 00010010 00010010 00010010 (c) 175214 (d) 110321 + 152405 + 56573 ---------------------------------------------347621 167114 F35B + 27E6 -------------------11B41 + 115 01110011 01110011 01110011 (d) 1B90F + C44E --------------------27D5D +79 01001111 01001111 01001111 –49 10110001 11001111 11001110 –3 10000011 11111101 11111100 –100 11100100 10011100 10011011
2.13 d – 1 2.14 The number of parity bits is minimized by making the array as close as possible to square, so the number of parity bits is on the order of 2 n + 1 . The exact answer depends on the value of n , and will be either 2 n (e.g., for 10 ≤ n ≤ 12 or 2 n + 1 (e.g., for 13 ≤ n ≤ 16 ). 2.15 F00D 2.16 (a) any b > 6 (b) b = 7
9E36.7A 16 = 1001111000110110.0111 2 = 117066.364 8 (f) DEAD.BEEF 16 = 1101111010101101.1011111011101111 2 = 157255.575674 8 123456701238 = 001010011 10010111 01110000 010100112 = (001 010 011) (010 010 111) (001 110 000) (001 010 011)2 = (123) (227) (160) (123)8
i=0
∑ b4 j + i ⋅ 2 ∑
3
j
Therefore,
4n – 1 n–1
B =
bi ⋅ 2i =
4n – 1
i–0
i=0
∑ hi ⋅ 16i
n–1 i=0
–B = 24 n –
i=0
∑
b i ⋅ 2 i = 16 n –
∑ h i ⋅ 16 i
Suppose a 3n-bit number B is represented by an n-digit octal number Q . Then the two’s-complement of B is represented by the 8’s-complement of Q. 2.19 The result follows directly from Tables 2–1 and 2–3. For any 4-bit string B and corresponding hex digit H, the ones’ complement of B is represented by the 15s’ complement of H. Since the ones’ complement is obtained by complementing individual bits, we can complement them in groups of four to arrive at the result. 2.20 Cases 1 and 2 assume no overflow. Case 1 ( x, y ≥ 0 ) : [x + y ] = x + y = [x ] + [ y ] [ x + y] = 2n – ( x + y ) Case 2 ( x, y < 0 ) : = 2 n + 2 n – ( x + y ) modulo 2 n = ( 2n – x ) + ( 2n – y ) = [x] + [y ] Case 3 ( x < 0, y ≥ 0 ) : [x + y] = 0 subcase 3a: x = y , so x + y = 0 = 2 n modulo 2 n = ( 2n – x ) + y = [x] + [y ] [ x + y ] = 2 n – ( x – y ) (using signed-magnitude rules) subcase 3b: x > y , so x + y < 0 = ( 2n – x ) + y = [x] + [y ] Case 4 ( x ≥ 0, y < 0 ) : x ≥ y , so x + y ≥ 0 2.21 If x < 0 , then [ x ] = 2 n – 1 – x . We want to show that [ x + y ] = [ x ] + [ y ] modulo2 n – 1 . Cases 1 and 2 assume no overflow.
10100.1101 2 = 20.8125 10 (f) F3A5 16 = 62373 10 (h) AB3D 16 = 43837 10 (j) (b) (d) (f) (h) (j) 15C.38 16 = 348.21875 10 3489 10 = 6641 8 9714 10 = 22762 8 23851 10 = 5D2B 16 57190 10 = DF66 16 65113 10 = FE59 16
1101011 2 = 6B 16 10110111 2 = B7 16 10100.1101 2 = 14.D 16 11011001 2 = 331 8 101111.0111 2 = 57.34 8
1023 8 = 1000010011 2 = 213 16 761302 8 = 111110001011000010 2 = 3E2C2 16 163417 8 = 1110011100001111 2 = 3E70F 16 552273 8 = 101101010010111011 2 = 2D4BB 5436.15 8 = 101100011110.001101 2 = B1E.34 16 13075.207 8 = 1011111000101.0100001 2 = 17C5.438 16 1023 16 = 1000000100011 2 = 10043 8 7E6A 16 = 111111001101010 2 = 77152 8 ABCD 16 = 1010101111001101 2 = 125715 8 C350 16 = 1100001101010000 2 = 141520 8