110 likes | 117 Views
Learn how to perform addition and subtraction in a fixed-length system using 2's complement notation. Explore the rules of binary addition and understand how it can be used to effect subtraction.
E N D
2’s Complement Arithmetic (remember it’s a fixed length system)
Arithmetic in 2’s Complement(remember it’s a fixed length system) 00 + 00 = 00 00 + 01 = 01 01 + 00 = 01 01 + 01 = 10
Arithmetic in 2’s Complement The ability to represent negative values in Binary means that the Addition operation can be used to effect subtraction. The expression 7 – 3 can be alternatively represented as (+7) + (-3). With the 4 “Rules of Binary Addition” and 2’s Complement Notation, addition becomes subtraction.
Arithmetic in 2’s Complement (+7) - (+3)
Arithmetic in 2’s Complement (+7) 00000111 - (+3)
Arithmetic in 2’s Complement (+7) 00000111 - (+3) 00000011
Arithmetic in 2’s Complement (+7) 00000111 - (+3) 00000011 11111100
Arithmetic in 2’s Complement (+7) 00000111 - (+3) 00000011 11111100 +1
Arithmetic in 2’s Complement (+7) 00000111 00000011 + 11111101 11111100 +1 + (-3) 11111101
Arithmetic in 2’s Complement(remember it’s a fixed length system) (+7) 00000111 + (-3) 00000011+ 11111101 111111001 00000100 +1discard the carry bit 11111101
Arithmetic in 2’s Complement(remember it’s a fixed length system) (+7) 00000111 + (-3) 00000011 11111101 11111100 1 00000100 +1discard the carry bit 11111101