You are on page 1of 14

Forging new generations of engineers

Binary Addition &


Subtraction
Addition Rules

• 0 + 0 = 00 ( 0 with a 0 carry )

• 0 + 1 = 01 ( 1 with a 0 carry )

• 1 + 0 = 01 ( 1 with a 0 carry )

• 1 + 1 = 10 ( 0 with a 1 carry )
Addition Rules

0 1 0 1
+0 +0 +1 +1
0 0 0 1 0 1 1 0

4
Addition Rules w/Carries

• 0+0+0 = 00 (0 WITH 0 CARRY)

• 0+0+1 = 01 (1 WITH 0 CARRY)

• 0+1+1 = 10 (0 WITH 1 CARRY)

• 1+1+1 = 11 (1 WITH 1 CARRY)


Adding Binary Numbers

01 1 1 0 0 0
28  00011100
+ 43  + 00101011
71 01000111

6
1’S Complement

01010011

Invert All Bits 10101100

7
2’S Complement

01010011

Invert All Bits 10101100
+1
Add One 10101101

8
Add/Sub : 4 Combinations

9 (-9)
Positive / Positive Negative / Positive
Positive Answer + 5 Negative Answer + 5
14 -4

9 (-9)
Negative / Negative
Positive / Negative
Positive Answer
+ (-5) Negative Answer + (-5)
4 - 14
9
Positive / Positive Combination

9  00001001
Positive / Positive
Positive Answer + 5  + 00000101
14  00001110
Both Positive Numbers
Use Straight Binary Addition

10
Positive / Negative Combination

9  00001001
Positive / Negative
Positive Answer + (-5) + 11111011
4  1]00000100
1-Positive / 1-Negative
8th Bit = 0 : Answer is Positive
Take 2’s Complement Disregard 9th Bit
Of Negative Number (-5)
00000101
 2’s
11111010 Complement
Process
+1
11111011 11
Negative / Positive Combination

(-9) 11110111
Positive / Negative
+ 5  + 00000101
Negative Answer

- 4 11111100
1-Positive / 1-Negative
8th Bit = 1 : Answer is Negative
Take 2’s Complement Take 2’s Complement to Check Answer
Of Negative Number (-9)
11111100 00001001
2’s   2’s
Complement 00000011 11110110 Complement
Process Process
+1 +1
00000100 11110111 12
Negative / Negative Combination

(-9)  11110111 2’s Complement


Numbers, See
Conversion
Negative / Negative
+ (-5)  + 11111011 Process
Negative Answer In Previous Slides

- 14 1]11110010
2-Negative
Take 2’s Complement Of 8th Bit = 1 : Answer is Negative
Disregard 9th Bit
Both Negative Numbers Take 2’s Complement to Check Answer

11110010
2’s 
Complement 00001101
Process
+1
00001110 13
2’S Complement Quick Method

Example: 11101100
1) Start at the LSB and write down all zeros moving
to the left.

2) Write down the first “1” you come to.

3) Invert the rest of the bits moving to the left.

0 001 0 1 0 0
14

You might also like