Fuw-Yi Yang1 數位系統 Digital Systems Department of Computer Science and Information Engineering, Chaoyang University of Technology 朝陽科技大學資工系 Speaker: Fuw-Yi Yang 楊伏夷 伏夷非征番, 道德經 察政章 (Chapter 58) 伏 者潛藏也 道紀章 (Chapter 14) 道無形象, 視之不可見者曰 夷
Fuw-Yi Yang2 Text Book: Digital Design 5th ed. Chapter 1 Problems 1.9 Express the following numbers in decimal: (a) ( ) = (b) (A6.5) 16 10* * *16 -1 = (c) (276.24) 8 2* * * * *8 -2 = … (d) (BABA.B) 16 11* * * * *16 -1 =… (e) ( ) =…
Fuw-Yi Yang3 Text Book: Digital Design 5th ed. Chapter 1 Problems 1.13 Do the following conversion problems: (a) Convert decimal 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?
Fuw-Yi Yang4 Text Book: Digital Design 5th ed. Chapter 1 Problems Solution to 1.13 (a) Convert decimal to binary. Ans: IntegerRemainder FractionCoefficient
Fuw-Yi Yang5 Text Book: Digital Design 5th ed. Chapter 1 Problems FractionCoefficient
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 = ( ) 2 Ans: ( ) 2 = = ( ) 10 Ans: (( ) / ( )) *100% = -0.39% How to make the result more close to the true value?
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: ( ) 2 = (0.55) 16 = 5 * * = 5 * * = ( ) 10 Ans:The result is the same.
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 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
Fuw-Yi Yang9 Text Book: Digital Design 5th ed. Chap 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 ( ) = 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 = 90714
Fuw-Yi Yang10 Text Book: Digital Design 5th ed. Chapter 1 Problems Sol (a)(+9081) + (+ 801) = = Signed bit = 0, answer = (+9881) (b) (9286) + (-954) = (009286) + (999046) = Signed bit = 0, answer = (+8332) (Discard the carry out of signed bit) Signed bit
Fuw-Yi Yang11 Text Book: Digital Design 5th ed. Chapter 1 Problems Sol (c) (-9081) + (+ 801) = = Signed bit = 1, answer is a negative Number represented in 10’s-complement form (991720), Or = -( ) = (d) (-9286) + (-954) = (990714) + (999046) = Signed bit = 1, answer is a negative number represented in 10 ’ s-complement form (989760), Or = -( ) = (Discard the carry out of signed bit) Signed bit
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) = Carry in the signed bit position, Carry out of signed bit position
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
Fuw-Yi Yang14 Text Book: Digital Design 5th ed. Chapter 1 Problems 1.29 Decode the following ASCII code: D i g i t a l S y s t e m.