Presentation is loading. Please wait.

Presentation is loading. Please wait.

2's Complement Arithmetic

Similar presentations


Presentation on theme: "2's Complement Arithmetic"— Presentation transcript:

1 2's Complement Arithmetic
Digital Electronics  Lesson 2.4 – Specific Comb Circuit & Misc Topics 2’s Complement Arithmetic Digital Electronics © 2014 Project Lead The Way, Inc. Project Lead The Way, Inc. Copyright 2009

2 2’s Complement Arithmetic
Digital Electronics  Lesson 2.4 – Specific Comb Circuit & Misc Topics This presentation will demonstrate The 2’s Complement Process. How the 2’s complement process can be used to add (and subtract) binary numbers. That subtracting one number from another is the same as making one number negative and adding. How to create negative numbers in the binary number system. Introductory Slide / Overview of Presentation Project Lead The Way, Inc. Copyright 2009

3 Binary Addition Single Bit Addition: Multiple Bit Addition: Carry Cout
XOR, XNOR, & Adders Digital Electronics Lesson 2.4 – Specific Comb Circuit & Misc Topics Single Bit Addition: Carry Multiple Bit Addition: Cin Cout A B Sum This slide shows the four possible combinations of adding together two single bit binary numbers and how these single bits can be cascaded into the addition of two 4-bit binary numbers. The 4-bit is just an example; we could have used 8-bits, 12-bits, etc. Project Lead The Way, Inc. Copyright 2009

4 2’s Complement Examples
2's Complement Arithmetic Digital Electronics  Lesson 2.4 – Specific Comb Circuit & Misc Topics Example #1 5 = Complement Digits  Add 1 +1 -5 = Example #2 Examples of the 2’s Complement Process. -13 = Complement Digits  Add 1 +1 13 = Project Lead The Way, Inc. Copyright 2009

5 2's Complement Arithmetic
POS + POS → POS Answer Digital Electronics  Lesson 2.4 – Specific Comb Circuit & Misc Topics If no 2’s complement is needed, use regular binary addition. 9 + 5 14  +   Addition of two Positive numbers. Project Lead The Way, Inc. Copyright 2009

6 2's Complement Arithmetic
POS + NEG → POS Answer Digital Electronics  Lesson 2.4 – Specific Comb Circuit & Misc Topics Take the 2’s complement of the negative number and use regular binary addition. 9 + (-5) 4  +  1] 8th Bit = 0: Answer is Positive Disregard 9th Bit This example shows the addition of one positive and one negative numbers. Note that this is done in the same way as subtracting a positive number from a positive number. In this case, the answer is positive.  +1 2’s Complement Process Project Lead The Way, Inc. Copyright 2009

7 2's Complement Arithmetic
POS + NEG → NEG Answer 2's Complement Arithmetic Digital Electronics  Lesson 2.4 – Specific Comb Circuit & Misc Topics Take the 2’s complement of the negative number and use regular binary addition. (-9) + 5 -4  +  8th Bit = 1: Answer is Negative This slide demonstrates the addition of one positive and one negative number. Again, this is is the same a subtracting a positive number from a positive number. In this case the answer happens to be negative.  +1 To Check: Perform 2’s Complement On Answer  +1 2’s Complement Process Project Lead The Way, Inc. Copyright 2009

8 2's Complement Arithmetic
NEG + NEG → NEG Answer 2's Complement Arithmetic Digital Electronics  Lesson 2.4 – Specific Comb Circuit & Misc Topics Take the 2’s complement of both negative numbers and use regular binary addition. (-9) + (-5) -14  2’s Complement Numbers, See Conversion Process In Previous Slides  +  1] 8th Bit = 1: Answer is Negative Disregard 9th Bit This slide demonstrates the addition of two negative numbers.  +1 To Check: Perform 2’s Complement On Answer Project Lead The Way, Inc. Copyright 2009


Download ppt "2's Complement Arithmetic"

Similar presentations


Ads by Google