Speaker: Fuw-Yi Yang 楊伏夷 伏夷非征番, 道德經 察政章(Chapter 58) 伏者潛藏也 數位系統 Digital Systems Department of Computer Science and Information Engineering, Chaoyang University of Technology 朝陽科技大學資工系 Speaker: Fuw-Yi Yang 楊伏夷 伏夷非征番, 道德經 察政章(Chapter 58) 伏者潛藏也 道紀章(Chapter 14) 道無形象, 視之不可見者曰夷 Fuw-Yi Yang
Text Book: Digital Design 4th Ed. Chapter 1 Problems 1.19 The following decimal numbers are shown in sign-magnitude form: +9,286 and +801. Convert them to sign-10’s-complement form and perform the following operations (note that the sum is +10,627 and requires five digits and a sign). Definition and solution: next pages Fuw-Yi Yang
Text Book: Digital Design 4th 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 (rn - 1) - N. N = 9286, r = 10, n = 5 The 9’s complement of N is (105 - 1) - 9286 = 90713 Radix Complement Given a number N in base r having n digits, the r’s complement of N is defined as rn - N for N 0 and as 0 for N = 0 . The 10’s complement of N is 105 - 9286 = 90714 Fuw-Yi Yang
Text Book: Digital Design 4th Ed. Chapter 1 Problems Sol. 1-19 (+9286) + (+ 801) = 009286 + 000801 = Sign bit = 0 , answer = (+10087) (b) (-9286) + (801) = (990714) + (000801) = Sign bit = 1 , answer is a negative number represented in 10’s-complement form (991515), or= -(100000 - 991515) = -8485 009286 + 000801 010087 Sign bit 990714 +000801 991515 Fuw-Yi Yang
Text Book: Digital Design 4th 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 1 0 1 1 + 1 0 1 0 1 0 1 0 1 Carry in the sign bit position, Carry out of sign bit position Fuw-Yi Yang
Text Book: Digital Design 4th Ed. Chap 4.5 Binary Adder-Subtractor Sign bit position Over flow occurs when either Carry in the sign bit position or Carry out of sign bit position but not both or none of them. Fuw-Yi Yang