数字电路课后习题答案第二章
合集下载
相关主题
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
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.
EXERCISE SOLUTIONS
2–3
Βιβλιοθήκη Baidu
(c) (e)
any b > 3 b = 4
(d) (f)
b = 5 b = 6
2.17 Assuming that the solution x = 8 is correct in some base b > 8 , we can write the following equation using base-10 arithmetic: 5 ⋅ 82 + ( 5 ⋅ b + 0 ) ⋅ 8 + 1 ⋅ b2 + 2 ⋅ b + 5 = 0 Solving the quadratic, we get b = 13 or b = 25 . Next, we try the x = 5 solution for both possible bases, and find that it works only for b = 13 ; the Martians had 13 fingers. 2.18 hj =
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
2–4
DIGITAL CIRCUITS
Case 1 ( x, y ≥ 0 ) : x+y = x+y = x + y [x + y] = x + y Case 2 ( x, y < 0 ) : = ( 2 n – 1 + 2 n – 1 – ( x + y ) mod ulo 2 n – 1 ) = ( (2n – 1 – x ) + ( 2n – 1 – y ) ) = x+y Case 3 ( x < 0, y ≥ 0 ) : [x] + y = 0 = 2 n – 1 modulo 2 n – 1 subcase 3a: x = y , so x + y = 0 = 2n – 1 – x + x = ( 2n – 1 – x ) + y = [x ] + [y] [ x + y ] = 2 n – 1 – ( x – y ) (using signed-magnitude rules) subcase 3b: x = y , so x + y < 0 = ( 2n – 1 – x ) + y = x+y Case 4 ( x ≥ 0, y < 0 ) : x ≥ y , so x + y ≥ 0 [ x + y ] = x – y (using signed-magnitude rules) = x + 2 n – 1 – y modulo 2 n – 1 = [x] + [y ] 2.22 Starting with the arrow pointing at any number, adding a positive number causes overflow if the arrow is advanced through the +7 to – 8 transition. Adding a negative number to any number causes overflow if the arrow is not advanced through the +7 to –8 transition. 2.23 Case 1 ( X ≥ 0 ) trivial Case 2 X < 0 Let x be the positive magnitude of X . X ( m-bit ) = 2 m – x
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
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
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.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
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)
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
2
NUMBER SYSTEMS AND CODES
E X E R C I S E 2.1 (a) (c) (e) (g) (i) 2.2 (a) (b) (c) (d) (e) (f) 2.3 (a) (b) (c) (d) (e) 2.4
S O L U T I O N S (b) (d) (f) (h) (j) 174003 8 = 111100000000011 2 67.24 8 = 110111.0101 2 F3A5 16 = 1111001110100101 2 AB3D 16 = 1010101100111101 2 15C.38 16 = 101011100.00111 2
2–1
2–2
DIGITAL CIRCUITS
2.5
(a) (c) (e) (g) (i)
1101011 2 = 107 10 10110111 2 = 183 10 12010 3 = 138 10 7156 8 = 3694 10
(b) (d)
174003 8 = 63491 10 67.24 8 = 55.3125 10