SYEN 3330 Digital Systems Chapter 5 Part 2

  • Slides: 25
Download presentation
SYEN 3330 Digital Systems Chapter 5 – Part 2 SYEN 3330 Digital Systems Jung

SYEN 3330 Digital Systems Chapter 5 – Part 2 SYEN 3330 Digital Systems Jung H. Kim Chapter 5 -2 1

Complements • Subtraction of numbers requires a different algorithm than addition. • Adding a

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 • Subtraction will be accomplished by adding a complement. SYEN 3330 Digital Systems 2

Diminished Radix Complement SYEN 3330 Digital Systems 3

Diminished Radix Complement SYEN 3330 Digital Systems 3

Binary 1's Complement SYEN 3330 Digital Systems 4

Binary 1's Complement SYEN 3330 Digital Systems 4

Radix Complement SYEN 3330 Digital Systems 5

Radix Complement SYEN 3330 Digital Systems 5

Binary 2's Complement SYEN 3330 Digital Systems 6

Binary 2's Complement SYEN 3330 Digital Systems 6

Binary 2's Complement Examples SYEN 3330 Digital Systems 7

Binary 2's Complement Examples SYEN 3330 Digital Systems 7

Efficient 2’s Complement SYEN 3330 Digital Systems 8

Efficient 2’s Complement SYEN 3330 Digital Systems 8

Two's Complement Example SYEN 3330 Digital Systems 9

Two's Complement Example SYEN 3330 Digital Systems 9

Subtraction with Radix Complements SYEN 3330 Digital Systems 10

Subtraction with Radix Complements SYEN 3330 Digital Systems 10

Example: Find 543 SYEN 3330 Digital Systems 10 - 123 10 11

Example: Find 543 SYEN 3330 Digital Systems 10 - 123 10 11

Example: Find 123 SYEN 3330 Digital Systems 10 - 543 10 12

Example: Find 123 SYEN 3330 Digital Systems 10 - 543 10 12

Binary Example SYEN 3330 Digital Systems 13

Binary Example SYEN 3330 Digital Systems 13

Another Binary Example SYEN 3330 Digital Systems 14

Another Binary Example SYEN 3330 Digital Systems 14

Subtract: Add 1’s Complement SYEN 3330 Digital Systems 15

Subtract: Add 1’s Complement SYEN 3330 Digital Systems 15

1’s Complement Subtraction SYEN 3330 Digital Systems 16

1’s Complement Subtraction SYEN 3330 Digital Systems 16

1’s Complement Subtraction SYEN 3330 Digital Systems 17

1’s Complement Subtraction SYEN 3330 Digital Systems 17

Signed Integers SYEN 3330 Digital Systems 18

Signed Integers SYEN 3330 Digital Systems 18

Interpreting the Other Digits SYEN 3330 Digital Systems 19

Interpreting the Other Digits SYEN 3330 Digital Systems 19

Example: Given r=2, n=3 SYEN 3330 Digital Systems 20

Example: Given r=2, n=3 SYEN 3330 Digital Systems 20

Addition with Signed Numbers SYEN 3330 Digital Systems 21

Addition with Signed Numbers SYEN 3330 Digital Systems 21

Signed-Magnitude Arithmetic SYEN 3330 Digital Systems 22

Signed-Magnitude Arithmetic SYEN 3330 Digital Systems 22

Sign-Magnitude Examples SYEN 3330 Digital Systems 23

Sign-Magnitude Examples SYEN 3330 Digital Systems 23

Signed-Complement Arithmetic SYEN 3330 Digital Systems 24

Signed-Complement Arithmetic SYEN 3330 Digital Systems 24

Binary Adder/Subtractor A(3) B(3) C(4) x Co y FA S S(3) SYEN 3330 Digital

Binary Adder/Subtractor A(3) B(3) C(4) x Co y FA S S(3) SYEN 3330 Digital Systems Ci C(3) A(1) B(1) A(2) B(2) x Co y FA S S(2) Ci C(2) x Co y FA S S(1) Ci C(1) A(0) B(0) x Co y FA S S(0) 25 Ci C(0)