250 likes | 265 Views
SYEN 3330 Digital Systems. Chapter 5 – Part 2. Complements. Subtraction of numbers requires a different algorithm than addition. Adding a complement of a number is equivalent to subtraction. We will discuss two complements: Diminished Radix Complement Radix Complement
E N D
SYEN 3330 Digital Systems Chapter 5 – Part 2 SYEN 3330 Digital Systems
Complements • Subtraction of numbers requires a different algorithm than addition. • Adding a complement of a number is equivalent to subtraction. • We will discuss two complements: • Diminished Radix Complement • Radix Complement • Subtraction will be accomplished by adding a complement. SYEN 3330 Digital Systems
Diminished Radix Complement SYEN 3330 Digital Systems
Binary 1's Complement SYEN 3330 Digital Systems
Radix Complement SYEN 3330 Digital Systems
Binary 2's Complement SYEN 3330 Digital Systems
Binary 2's Complement Examples SYEN 3330 Digital Systems
Efficient 2’s Complement SYEN 3330 Digital Systems
Two's Complement Example SYEN 3330 Digital Systems
Subtraction with Radix Complements SYEN 3330 Digital Systems
Example: Find 54310 - 12310 SYEN 3330 Digital Systems
Example: Find 12310 - 54310 SYEN 3330 Digital Systems
Binary Example SYEN 3330 Digital Systems
Another Binary Example SYEN 3330 Digital Systems
Subtract: Add 1’s Complement SYEN 3330 Digital Systems
1’s Complement Subtraction SYEN 3330 Digital Systems
1’s Complement Subtraction SYEN 3330 Digital Systems
Signed Integers SYEN 3330 Digital Systems
Interpreting the Other Digits SYEN 3330 Digital Systems
Example: Given r=2, n=3 SYEN 3330 Digital Systems
Addition with Signed Numbers SYEN 3330 Digital Systems
Signed-Magnitude Arithmetic SYEN 3330 Digital Systems
Sign-Magnitude Examples SYEN 3330 Digital Systems
Signed-Complement Arithmetic SYEN 3330 Digital Systems
A(1) A(3) A(2) A(0) B(1) B(0) B(3) B(2) C(0) C(4) C(3) C(2) C(1) x y x y x y x y Co Ci Co Ci Co Ci Co Ci FA FA FA FA S S S S S(3) S(2) S(1) S(0) Binary Adder/Subtractor SYEN 3330 Digital Systems