Download presentation
Presentation is loading. Please wait.
Published byRalf Simon Modified over 8 years ago
1
Fuw-Yi Yang1 數位系統 Digital Systems Department of Computer Science and Information Engineering, Chaoyang University of Technology 朝陽科技大學資工系 Speaker: Fuw-Yi Yang 楊伏夷 伏夷非征番, 道德經 察政章 (Chapter 58) 伏 者潛藏也 道紀章 (Chapter 14) 道無形象, 視之不可見者曰 夷
2
Fuw-Yi Yang2 Text Book: Digital Design 5th ed. Chapter 1 Problems 1.9 Express the following numbers in decimal: (a) (11010.0101) 2 2 4 + 2 3 + 2 1 + 2 -2 + 2 -4 = 26.3125 (b) (A6.5) 16 10*16 1 + 6*16 0 + 5*16 -1 = 166.3125 (c) (276.24) 8 2*8 2 + 7*8 1 + 6*8 0 + 2*8 -1 + 4*8 -2 = … (d) (BABA.B) 16 11*16 3 + 10*16 2 + 11*16 1 + 10*16 0 + 11*16 -1 =… (e) (10110.1101) 2 2 4 + 2 2 + 2 1 + 2 -1 + 2 -2 + 2 -4 =…
3
Fuw-Yi Yang3 Text Book: Digital Design 5th ed. Chapter 1 Problems 1.13 Do the following conversion problems: (a) Convert decimal 35.125 to binary. (b) Calculate the binary equivalent of 1/3 out to eight places. Then convert from binary to decimal. How close is the result to 1/3? (c) Convert the binary result in (b) into hexadecimal. Then convert the result to decimal. Is the answer the same?
4
Fuw-Yi Yang4 Text Book: Digital Design 5th ed. Chapter 1 Problems Solution to 1.13 (a) Convert decimal 37.125 to binary. Ans: 100101.001 IntegerRemainder 37 181 90 41 20 10 01 FractionCoefficient 0.125 0.250 0.50 01
5
Fuw-Yi Yang5 Text Book: Digital Design 5th ed. Chapter 1 Problems FractionCoefficient 0.33333333 0.666666660 0.333333321 0.666666640 0.333333281 0.666666560 0.333333211 0.666666420 0.333332841
6
Fuw-Yi Yang6 Text Book: Digital Design 5th ed. Chapter 1 Problems Solution to 1.13 (b) Calculate the binary equivalent of 1/3 out to eight places. Then convert from binary to decimal. How close is the result to 1/3? Ans: (1/3) 10 = (0.01010101) 2 Ans: (0.01010101) 2 = 0.25 + 0.0625 + 0.015625 +.00390625 = (0.33203125) 10 Ans: ((0.33203125 - 0.3333333) / (0.33333333)) *100% = -0.39% How to make the result more close to the true value?
7
Fuw-Yi Yang7 Text Book: Digital Design 5th ed. Chapter 1 Problems Solution to 1.13 (c) Convert the binary result in (b) into hexadecimal. Then convert the result to decimal. Is the answer the same? Ans: (0.01010101) 2 = (0.55) 16 = 5 * 16 -1 + 5 * 16 -2 = 5 * 0.0625 + 5 * 0.00390625 = (0.33203125) 10 Ans:The result is the same.
8
Fuw-Yi Yang8 Text Book: Digital Design 5th ed. Chapter 1 Problems 1.19 The following decimal numbers are shown in sign-magnitude form: +9,081 and +954. Convert them to signed-10’s-complement form and perform the following operations (note that the sum is +10,035 and requires five digits and a sign). Definition and solution: next pages
9
Fuw-Yi Yang9 Text Book: Digital Design 5th ed. Chap 1 1.5 Complements Diminished Radix Complement Given a number N in base r having n digits, the (r - 1)’s complement of N is defined as (r n - 1) - N. N = 9286, r = 10, n = 5 The 9’s complement of N is (10 5 - 1) - 9286 = 90713 Radix Complement Given a number N in base r having n digits, the r’s complement of N is defined as r n - N for N 0 and as 0 for N = 0. The 10’s complement of N is 10 5 - 9286 = 90714
10
Fuw-Yi Yang10 Text Book: Digital Design 5th ed. Chapter 1 Problems Sol. 1-19 (a)(+9081) + (+ 801) = 009081 + 000801 = Signed bit = 0, answer = (+9881) (b) (9286) + (-954) = (009286) + (999046) = Signed bit = 0, answer = (+8332) (Discard the carry out of signed bit) 009081 + 000801 009881 009286 +999046 1008332 Signed bit
11
Fuw-Yi Yang11 Text Book: Digital Design 5th ed. Chapter 1 Problems Sol. 1-19 (c) (-9081) + (+ 801) = 990919 + 000801 = Signed bit = 1, answer is a negative Number represented in 10’s-complement form (991720), Or = -(100000 - 91720) = -8280 (d) (-9286) + (-954) = (990714) + (999046) = Signed bit = 1, answer is a negative number represented in 10 ’ s-complement form (989760), Or = -(100000 - 89760) = -10240 (Discard the carry out of signed bit) 990919 + 000801 991720 990714 +999046 1989760 Signed bit
12
Fuw-Yi Yang12 Text Book: Digital Design 5th ed. Chapter 1 Problems Next page shows an implementation of adder-subtractor using 2 ’ s complement form (1 sign bit and 3-bit magnitude). No overflow can occur in the cases: (+ number) + (- number) and (- number) + (+ number) Overflow may occur in the cases: (+ number) + (+ number) and (- number) + (- number) (+5) + (+6) = (-5) + (-6) = 0 1 0 1 + 0 1 1 0 1 0 1 1 Carry in the signed bit position, Carry out of signed bit position 1 0 1 1 + 1 0 1 0 1 0 1 0 1
13
Fuw-Yi Yang13 Text Book: Digital Design 4th Ed. Chap 4.5 Binary Adder-Subtractor Binary Adder Over flow occurs when either Carry in the signed bit position or Carry out of signed bit position but not both or none of them. Signed bit position
14
Fuw-Yi Yang14 Text Book: Digital Design 5th ed. Chapter 1 Problems 1.29 Decode the following ASCII code: 1000100 1101001 1100111 1101001 1110100 1100001 1101100 D i g i t a l 1010011 1111001 1110011 1110100 1100101 1101101 0101110. S y s t e m.
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.