Professional Documents
Culture Documents
1
1's Complement Representation
• Positive numbers are represented using normal binary
equivalent while negative numbers are represented by
the 1's complement (complement) of the normal binary
representation of the magnitude.
+9 is represented as 01001
4
3-Digit Decimal Number System
A bicycle odometer with only 999
forward (+)
three digits is an example of a 998
fixed-length decimal number 997
system.
001
The problem is that without a
000
negative sign, you cannot tell
999
a +998 from a -2 (also a 998).
998
Did you ride forward for 998
miles or backward for 2 miles?
002
backward (-)
001
5
Negative Decimal
+499 499
How do we represent pos(+)
negative numbers in this 3- +498 498
Example #2
-13 = 11110011
Complement Digits
00001100
+1
Add 1
14
13 = 00001101
Using The 2’s Compliment Process
Use the 2’s complement process to add together
the following numbers.
9 00001001
+ 5 + 00000101
14 00001110
16
POS + NEG → POS Answer
Take the 2’s complement of the negative number and
use regular binary addition.
9 00001001
+ (-5) + 11111011
4 1]00000100
8th Bit = 0: Answer is Positive
Disregard 9th Bit
00000101
2’s
11111010 Complement
Process
+1
11111011 17
NEG + POS → NEG Answer
Take the 2’s complement of the negative number and
use regular binary addition.
(-9) 11110111
+ 5 + 00000101
-4 11111100
8th Bit = 1: Answer is Negative
11111100 00001001
To Check: 2’s
Perform 2’s Complement
Complement 00000011 11110110
Process
On Answer +1 +1
00000100 11110111 18
NEG + NEG → NEG Answer
Take the 2’s complement of both negative numbers and
use regular binary addition.
2’s Complement
(-9) 11110111 Numbers, See
Conversion Process
-14 1]11110010
8th Bit = 1: Answer is Negative
Disregard 9th Bit
11110010
To Check:
Perform 2’s
Complement 00001101
On Answer +1
00001110 19