Math1003 1.15 - Integers and 2's Complement
-
Upload
gcmath1003 -
Category
Education
-
view
366 -
download
2
Transcript of Math1003 1.15 - Integers and 2's Complement
![Page 1: Math1003 1.15 - Integers and 2's Complement](https://reader030.fdocuments.net/reader030/viewer/2022020218/55703ce6d8b42a611e8b508b/html5/thumbnails/1.jpg)
MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001
1.15Integers and2’s Complement
![Page 2: Math1003 1.15 - Integers and 2's Complement](https://reader030.fdocuments.net/reader030/viewer/2022020218/55703ce6d8b42a611e8b508b/html5/thumbnails/2.jpg)
MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001
Goal
To be able to specify how integers are stored by the computer in 2’s complement format.
![Page 3: Math1003 1.15 - Integers and 2's Complement](https://reader030.fdocuments.net/reader030/viewer/2022020218/55703ce6d8b42a611e8b508b/html5/thumbnails/3.jpg)
MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001
Integers
![Page 4: Math1003 1.15 - Integers and 2's Complement](https://reader030.fdocuments.net/reader030/viewer/2022020218/55703ce6d8b42a611e8b508b/html5/thumbnails/4.jpg)
MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001
Integers
Integers and Real Numbers are stored in different ways inside the computer.
![Page 5: Math1003 1.15 - Integers and 2's Complement](https://reader030.fdocuments.net/reader030/viewer/2022020218/55703ce6d8b42a611e8b508b/html5/thumbnails/5.jpg)
MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001
Integers
Integers and Real Numbers are stored in different ways inside the computer.
35 and 35.0 to human beings represent the same value.
![Page 6: Math1003 1.15 - Integers and 2's Complement](https://reader030.fdocuments.net/reader030/viewer/2022020218/55703ce6d8b42a611e8b508b/html5/thumbnails/6.jpg)
MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001
Integers
Integers and Real Numbers are stored in different ways inside the computer.
35 and 35.0 to human beings represent the same value.
35 35.0
![Page 7: Math1003 1.15 - Integers and 2's Complement](https://reader030.fdocuments.net/reader030/viewer/2022020218/55703ce6d8b42a611e8b508b/html5/thumbnails/7.jpg)
MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001
Integers
Integers and Real Numbers are stored in different ways inside the computer.
35 and 35.0 to human beings represent the same value.
However, the computer “handles” these numbers with different mechanisms.
35 35.0
![Page 8: Math1003 1.15 - Integers and 2's Complement](https://reader030.fdocuments.net/reader030/viewer/2022020218/55703ce6d8b42a611e8b508b/html5/thumbnails/8.jpg)
MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001
35
Integers
![Page 9: Math1003 1.15 - Integers and 2's Complement](https://reader030.fdocuments.net/reader030/viewer/2022020218/55703ce6d8b42a611e8b508b/html5/thumbnails/9.jpg)
MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001
Today’s computers store integers usually in 32 bits.
35
Integers
![Page 10: Math1003 1.15 - Integers and 2's Complement](https://reader030.fdocuments.net/reader030/viewer/2022020218/55703ce6d8b42a611e8b508b/html5/thumbnails/10.jpg)
MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001
Today’s computers store integers usually in 32 bits.
For the purpose of our discussions, we will imagine that we are working with an older computer that stores
integers in 8 bits. Concepts that we will discuss are valid whether the integers are in 32 bits or 8 bits.
35
Integers
![Page 11: Math1003 1.15 - Integers and 2's Complement](https://reader030.fdocuments.net/reader030/viewer/2022020218/55703ce6d8b42a611e8b508b/html5/thumbnails/11.jpg)
MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001
35
Integers
![Page 12: Math1003 1.15 - Integers and 2's Complement](https://reader030.fdocuments.net/reader030/viewer/2022020218/55703ce6d8b42a611e8b508b/html5/thumbnails/12.jpg)
MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001
3510, as an 8 bit binary number, is 001000112
35
Integers
![Page 13: Math1003 1.15 - Integers and 2's Complement](https://reader030.fdocuments.net/reader030/viewer/2022020218/55703ce6d8b42a611e8b508b/html5/thumbnails/13.jpg)
MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001
3510, as an 8 bit binary number, is 001000112
That’s how the computer will store 3510
35
Integers
![Page 14: Math1003 1.15 - Integers and 2's Complement](https://reader030.fdocuments.net/reader030/viewer/2022020218/55703ce6d8b42a611e8b508b/html5/thumbnails/14.jpg)
MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001
3510, as an 8 bit binary number, is 001000112
That’s how the computer will store 3510
But we know that integers include both positive and negative whole numbers.
35
Integers
![Page 15: Math1003 1.15 - Integers and 2's Complement](https://reader030.fdocuments.net/reader030/viewer/2022020218/55703ce6d8b42a611e8b508b/html5/thumbnails/15.jpg)
MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001
Sign and Magnitude
001000112signbit
![Page 16: Math1003 1.15 - Integers and 2's Complement](https://reader030.fdocuments.net/reader030/viewer/2022020218/55703ce6d8b42a611e8b508b/html5/thumbnails/16.jpg)
MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001
Sign and Magnitude
How does the computer store negative numbers? (Remember: bits are only 0 or 1)
001000112signbit
![Page 17: Math1003 1.15 - Integers and 2's Complement](https://reader030.fdocuments.net/reader030/viewer/2022020218/55703ce6d8b42a611e8b508b/html5/thumbnails/17.jpg)
MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001
Sign and Magnitude
How does the computer store negative numbers? (Remember: bits are only 0 or 1)
One option would be to use the leftmost bit as a sign bit (0 for positive numbers and 1 for negative numbers).
001000112signbit
![Page 18: Math1003 1.15 - Integers and 2's Complement](https://reader030.fdocuments.net/reader030/viewer/2022020218/55703ce6d8b42a611e8b508b/html5/thumbnails/18.jpg)
MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001
Sign and Magnitude
How does the computer store negative numbers? (Remember: bits are only 0 or 1)
One option would be to use the leftmost bit as a sign bit (0 for positive numbers and 1 for negative numbers).
001000112signbit
![Page 19: Math1003 1.15 - Integers and 2's Complement](https://reader030.fdocuments.net/reader030/viewer/2022020218/55703ce6d8b42a611e8b508b/html5/thumbnails/19.jpg)
MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001
How does the computer store negative numbers? (Remember: bits are only 0 or 1)
One option would be to use the leftmost bit as a sign bit (0 for positive numbers and 1 for negative numbers).
001000112signbit
Sign and Magnitude
![Page 20: Math1003 1.15 - Integers and 2's Complement](https://reader030.fdocuments.net/reader030/viewer/2022020218/55703ce6d8b42a611e8b508b/html5/thumbnails/20.jpg)
MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001
We’ll use the other 7 bits for the value (or magnitude) of the number.
001000112signbit
Sign and Magnitude
![Page 21: Math1003 1.15 - Integers and 2's Complement](https://reader030.fdocuments.net/reader030/viewer/2022020218/55703ce6d8b42a611e8b508b/html5/thumbnails/21.jpg)
MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001
We’ll use the other 7 bits for the value (or magnitude) of the number.
001000112magnitude
Sign and Magnitude
![Page 22: Math1003 1.15 - Integers and 2's Complement](https://reader030.fdocuments.net/reader030/viewer/2022020218/55703ce6d8b42a611e8b508b/html5/thumbnails/22.jpg)
MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001
We’ll use the other 7 bits for the value (or magnitude) of the number.
001000112magnitude
Sign and Magnitude
![Page 23: Math1003 1.15 - Integers and 2's Complement](https://reader030.fdocuments.net/reader030/viewer/2022020218/55703ce6d8b42a611e8b508b/html5/thumbnails/23.jpg)
MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001
Using this scheme, we can represent -3510 as 101000112
3510 as a 7 bit number is 01000112
The sign bit will be a 1 to represent the minus sign
101000112signbit magnitude
Sign and Magnitude
![Page 24: Math1003 1.15 - Integers and 2's Complement](https://reader030.fdocuments.net/reader030/viewer/2022020218/55703ce6d8b42a611e8b508b/html5/thumbnails/24.jpg)
MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001
Problems
![Page 25: Math1003 1.15 - Integers and 2's Complement](https://reader030.fdocuments.net/reader030/viewer/2022020218/55703ce6d8b42a611e8b508b/html5/thumbnails/25.jpg)
MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001
Problems
In this scheme, what is 000000002 and 100000002?
![Page 26: Math1003 1.15 - Integers and 2's Complement](https://reader030.fdocuments.net/reader030/viewer/2022020218/55703ce6d8b42a611e8b508b/html5/thumbnails/26.jpg)
MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001
Problems
In this scheme, what is 000000002 and 100000002?
000000002 is positive 0
![Page 27: Math1003 1.15 - Integers and 2's Complement](https://reader030.fdocuments.net/reader030/viewer/2022020218/55703ce6d8b42a611e8b508b/html5/thumbnails/27.jpg)
MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001
Problems
In this scheme, what is 000000002 and 100000002?
000000002 is positive 0
+0
![Page 28: Math1003 1.15 - Integers and 2's Complement](https://reader030.fdocuments.net/reader030/viewer/2022020218/55703ce6d8b42a611e8b508b/html5/thumbnails/28.jpg)
MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001
Problems
In this scheme, what is 000000002 and 100000002?
000000002 is positive 0
100000002 is negative 0
+0
![Page 29: Math1003 1.15 - Integers and 2's Complement](https://reader030.fdocuments.net/reader030/viewer/2022020218/55703ce6d8b42a611e8b508b/html5/thumbnails/29.jpg)
MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001
Problems
In this scheme, what is 000000002 and 100000002?
000000002 is positive 0
100000002 is negative 0
+0 -0
![Page 30: Math1003 1.15 - Integers and 2's Complement](https://reader030.fdocuments.net/reader030/viewer/2022020218/55703ce6d8b42a611e8b508b/html5/thumbnails/30.jpg)
MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001
Problems
In this scheme, what is 000000002 and 100000002?
000000002 is positive 0
100000002 is negative 0
Believe or not, having two ways to represent 0 causes big problems.
+0 -0
![Page 31: Math1003 1.15 - Integers and 2's Complement](https://reader030.fdocuments.net/reader030/viewer/2022020218/55703ce6d8b42a611e8b508b/html5/thumbnails/31.jpg)
MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001
Problems
+0 -0
![Page 32: Math1003 1.15 - Integers and 2's Complement](https://reader030.fdocuments.net/reader030/viewer/2022020218/55703ce6d8b42a611e8b508b/html5/thumbnails/32.jpg)
MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001
Problems
Depending on the arithmetic operation, we can get a result of 000000002 or 100000002.
+0 -0
![Page 33: Math1003 1.15 - Integers and 2's Complement](https://reader030.fdocuments.net/reader030/viewer/2022020218/55703ce6d8b42a611e8b508b/html5/thumbnails/33.jpg)
MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001
Problems
Depending on the arithmetic operation, we can get a result of 000000002 or 100000002.
If we had this situation, there would have to be special circuitry to test for positive 0 and negative 0 - this adds
complexity to the computer.
+0 -0
![Page 34: Math1003 1.15 - Integers and 2's Complement](https://reader030.fdocuments.net/reader030/viewer/2022020218/55703ce6d8b42a611e8b508b/html5/thumbnails/34.jpg)
MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001
Problems
![Page 35: Math1003 1.15 - Integers and 2's Complement](https://reader030.fdocuments.net/reader030/viewer/2022020218/55703ce6d8b42a611e8b508b/html5/thumbnails/35.jpg)
MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001
Problems
Another problem that arises has to do with the addition of a positive and a negative number.
![Page 36: Math1003 1.15 - Integers and 2's Complement](https://reader030.fdocuments.net/reader030/viewer/2022020218/55703ce6d8b42a611e8b508b/html5/thumbnails/36.jpg)
MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001
Problems
Another problem that arises has to do with the addition of a positive and a negative number.
The computer would have to deal with the sign bit (which does not represent value).
![Page 37: Math1003 1.15 - Integers and 2's Complement](https://reader030.fdocuments.net/reader030/viewer/2022020218/55703ce6d8b42a611e8b508b/html5/thumbnails/37.jpg)
MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001
2’s Complement
So a scheme was invented to address these issues.
It is called 2’s complement.
![Page 38: Math1003 1.15 - Integers and 2's Complement](https://reader030.fdocuments.net/reader030/viewer/2022020218/55703ce6d8b42a611e8b508b/html5/thumbnails/38.jpg)
MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001
In 2’s complement, positive numbers are represented in their normal binary equivalent.
2’s Complement
![Page 39: Math1003 1.15 - Integers and 2's Complement](https://reader030.fdocuments.net/reader030/viewer/2022020218/55703ce6d8b42a611e8b508b/html5/thumbnails/39.jpg)
MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001
2’s Complement
![Page 40: Math1003 1.15 - Integers and 2's Complement](https://reader030.fdocuments.net/reader030/viewer/2022020218/55703ce6d8b42a611e8b508b/html5/thumbnails/40.jpg)
MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001
Negative number representation is found in the following manner:
2’s Complement
![Page 41: Math1003 1.15 - Integers and 2's Complement](https://reader030.fdocuments.net/reader030/viewer/2022020218/55703ce6d8b42a611e8b508b/html5/thumbnails/41.jpg)
MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001
Negative number representation is found in the following manner:
1. calculate the magnitude of the number
2’s Complement
![Page 42: Math1003 1.15 - Integers and 2's Complement](https://reader030.fdocuments.net/reader030/viewer/2022020218/55703ce6d8b42a611e8b508b/html5/thumbnails/42.jpg)
MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001
Negative number representation is found in the following manner:
1. calculate the magnitude of the number
2. subtract the number from 111111112
2’s Complement
![Page 43: Math1003 1.15 - Integers and 2's Complement](https://reader030.fdocuments.net/reader030/viewer/2022020218/55703ce6d8b42a611e8b508b/html5/thumbnails/43.jpg)
MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001
Negative number representation is found in the following manner:
1. calculate the magnitude of the number
2. subtract the number from 111111112
3. add 1 to the result
2’s Complement
![Page 44: Math1003 1.15 - Integers and 2's Complement](https://reader030.fdocuments.net/reader030/viewer/2022020218/55703ce6d8b42a611e8b508b/html5/thumbnails/44.jpg)
MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001
2’s complement
1. calculate the magnitude of the number
2. subtract the number from 111111112
3. add 1 to the result
2’s Complement
![Page 45: Math1003 1.15 - Integers and 2's Complement](https://reader030.fdocuments.net/reader030/viewer/2022020218/55703ce6d8b42a611e8b508b/html5/thumbnails/45.jpg)
MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001
2’s complement
1. calculate the magnitude of the number
2. subtract the number from 111111112
3. add 1 to the result
Calculate the 2’s complementform of -10410
2’s Complement
![Page 46: Math1003 1.15 - Integers and 2's Complement](https://reader030.fdocuments.net/reader030/viewer/2022020218/55703ce6d8b42a611e8b508b/html5/thumbnails/46.jpg)
MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001
2’s complement
1. calculate the magnitude of the number
2. subtract the number from 111111112
3. add 1 to the result
Calculate the 2’s complementform of -10410
1. 10410 = 011010002
2’s Complement
![Page 47: Math1003 1.15 - Integers and 2's Complement](https://reader030.fdocuments.net/reader030/viewer/2022020218/55703ce6d8b42a611e8b508b/html5/thumbnails/47.jpg)
MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001
2’s complement
1. calculate the magnitude of the number
2. subtract the number from 111111112
3. add 1 to the result
Calculate the 2’s complementform of -10410
1. 10410 = 011010002
2. 111111112 - 011010002 = 100101112
2’s Complement
![Page 48: Math1003 1.15 - Integers and 2's Complement](https://reader030.fdocuments.net/reader030/viewer/2022020218/55703ce6d8b42a611e8b508b/html5/thumbnails/48.jpg)
MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001
2’s complement
1. calculate the magnitude of the number
2. subtract the number from 111111112
3. add 1 to the result
Calculate the 2’s complementform of -10410
1. 10410 = 011010002
2. 111111112 - 011010002 = 100101112
3. 100101112 + 12 = 100110002
2’s Complement
![Page 49: Math1003 1.15 - Integers and 2's Complement](https://reader030.fdocuments.net/reader030/viewer/2022020218/55703ce6d8b42a611e8b508b/html5/thumbnails/49.jpg)
MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001
2’s complement
1. calculate the magnitude of the number
2. subtract the number from 111111112
3. add 1 to the result
Calculate the 2’s complementform of -10410
1. 10410 = 011010002
2. 111111112 - 011010002 = 100101112
3. 100101112 + 12 = 100110002
Therefore, -10410 = 100110002
2’s Complement
![Page 50: Math1003 1.15 - Integers and 2's Complement](https://reader030.fdocuments.net/reader030/viewer/2022020218/55703ce6d8b42a611e8b508b/html5/thumbnails/50.jpg)
MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001
2’s Complement
![Page 51: Math1003 1.15 - Integers and 2's Complement](https://reader030.fdocuments.net/reader030/viewer/2022020218/55703ce6d8b42a611e8b508b/html5/thumbnails/51.jpg)
MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001
Now, let us explore a less complicated way of calculating the 2’s complement form of a negative number:
2’s Complement
![Page 52: Math1003 1.15 - Integers and 2's Complement](https://reader030.fdocuments.net/reader030/viewer/2022020218/55703ce6d8b42a611e8b508b/html5/thumbnails/52.jpg)
MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001
Now, let us explore a less complicated way of calculating the 2’s complement form of a negative number:
1. calculate the magnitude of the number
2’s Complement
![Page 53: Math1003 1.15 - Integers and 2's Complement](https://reader030.fdocuments.net/reader030/viewer/2022020218/55703ce6d8b42a611e8b508b/html5/thumbnails/53.jpg)
MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001
Now, let us explore a less complicated way of calculating the 2’s complement form of a negative number:
1. calculate the magnitude of the number
2. starting from the rightmost bit, look for the first bit that is a 1
2’s Complement
![Page 54: Math1003 1.15 - Integers and 2's Complement](https://reader030.fdocuments.net/reader030/viewer/2022020218/55703ce6d8b42a611e8b508b/html5/thumbnails/54.jpg)
MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001
Now, let us explore a less complicated way of calculating the 2’s complement form of a negative number:
1. calculate the magnitude of the number
2. starting from the rightmost bit, look for the first bit that is a 1
3. “invert” all bits to the left of the 1
2’s Complement
![Page 55: Math1003 1.15 - Integers and 2's Complement](https://reader030.fdocuments.net/reader030/viewer/2022020218/55703ce6d8b42a611e8b508b/html5/thumbnails/55.jpg)
MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001
2’s complement (a better way)
1. calculate the magnitude of the number
2. starting from the rightmost bit, look for the first bit that is a 1
3. “invert” all bits to the left of the 1
Calculate the 2’s complementform of -10410
2’s Complement
![Page 56: Math1003 1.15 - Integers and 2's Complement](https://reader030.fdocuments.net/reader030/viewer/2022020218/55703ce6d8b42a611e8b508b/html5/thumbnails/56.jpg)
MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001
2’s complement (a better way)
1. calculate the magnitude of the number
2. starting from the rightmost bit, look for the first bit that is a 1
3. “invert” all bits to the left of the 1
Calculate the 2’s complementform of -10410
10410 = 011010002
2’s Complement
![Page 57: Math1003 1.15 - Integers and 2's Complement](https://reader030.fdocuments.net/reader030/viewer/2022020218/55703ce6d8b42a611e8b508b/html5/thumbnails/57.jpg)
MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001
Calculate the 2’s complementform of -10410
10410 = 011010002
2’s Complement2’s complement (a better way)
1. calculate the magnitude of the number
2. starting from the rightmost bit, look for the first bit that is a 1
3. “invert” all bits to the left of the 1
![Page 58: Math1003 1.15 - Integers and 2's Complement](https://reader030.fdocuments.net/reader030/viewer/2022020218/55703ce6d8b42a611e8b508b/html5/thumbnails/58.jpg)
MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001
Calculate the 2’s complementform of -10410
10410 = 011010002
2’s Complement2’s complement (a better way)
1. calculate the magnitude of the number
2. starting from the rightmost bit, look for the first bit that is a 1
3. “invert” all bits to the left of the 1
![Page 59: Math1003 1.15 - Integers and 2's Complement](https://reader030.fdocuments.net/reader030/viewer/2022020218/55703ce6d8b42a611e8b508b/html5/thumbnails/59.jpg)
MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001
Calculate the 2’s complementform of -10410
10410 = 011010002
2’s Complement2’s complement (a better way)
1. calculate the magnitude of the number
2. starting from the rightmost bit, look for the first bit that is a 1
3. “invert” all bits to the left of the 1
![Page 60: Math1003 1.15 - Integers and 2's Complement](https://reader030.fdocuments.net/reader030/viewer/2022020218/55703ce6d8b42a611e8b508b/html5/thumbnails/60.jpg)
MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001
Calculate the 2’s complementform of -10410
10410 = 011010002
2’s Complement2’s complement (a better way)
1. calculate the magnitude of the number
2. starting from the rightmost bit, look for the first bit that is a 1
3. “invert” all bits to the left of the 1
![Page 61: Math1003 1.15 - Integers and 2's Complement](https://reader030.fdocuments.net/reader030/viewer/2022020218/55703ce6d8b42a611e8b508b/html5/thumbnails/61.jpg)
MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001
Calculate the 2’s complementform of -10410
10410 = 011010002
2’s Complement2’s complement (a better way)
1. calculate the magnitude of the number
2. starting from the rightmost bit, look for the first bit that is a 1
3. “invert” all bits to the left of the 1
![Page 62: Math1003 1.15 - Integers and 2's Complement](https://reader030.fdocuments.net/reader030/viewer/2022020218/55703ce6d8b42a611e8b508b/html5/thumbnails/62.jpg)
MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001
Calculate the 2’s complementform of -10410
10410 = 011010002
2’s Complement2’s complement (a better way)
1. calculate the magnitude of the number
2. starting from the rightmost bit, look for the first bit that is a 1
3. “invert” all bits to the left of the 1
![Page 63: Math1003 1.15 - Integers and 2's Complement](https://reader030.fdocuments.net/reader030/viewer/2022020218/55703ce6d8b42a611e8b508b/html5/thumbnails/63.jpg)
MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001
Calculate the 2’s complementform of -10410
10410 = 0110100021
2’s Complement2’s complement (a better way)
1. calculate the magnitude of the number
2. starting from the rightmost bit, look for the first bit that is a 1
3. “invert” all bits to the left of the 1
![Page 64: Math1003 1.15 - Integers and 2's Complement](https://reader030.fdocuments.net/reader030/viewer/2022020218/55703ce6d8b42a611e8b508b/html5/thumbnails/64.jpg)
MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001
Calculate the 2’s complementform of -10410
10410 = 01101000210
2’s Complement2’s complement (a better way)
1. calculate the magnitude of the number
2. starting from the rightmost bit, look for the first bit that is a 1
3. “invert” all bits to the left of the 1
![Page 65: Math1003 1.15 - Integers and 2's Complement](https://reader030.fdocuments.net/reader030/viewer/2022020218/55703ce6d8b42a611e8b508b/html5/thumbnails/65.jpg)
MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001
Calculate the 2’s complementform of -10410
10410 = 011010002100
2’s Complement2’s complement (a better way)
1. calculate the magnitude of the number
2. starting from the rightmost bit, look for the first bit that is a 1
3. “invert” all bits to the left of the 1
![Page 66: Math1003 1.15 - Integers and 2's Complement](https://reader030.fdocuments.net/reader030/viewer/2022020218/55703ce6d8b42a611e8b508b/html5/thumbnails/66.jpg)
MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001
Calculate the 2’s complementform of -10410
10410 = 0110100021001
2’s Complement2’s complement (a better way)
1. calculate the magnitude of the number
2. starting from the rightmost bit, look for the first bit that is a 1
3. “invert” all bits to the left of the 1
![Page 67: Math1003 1.15 - Integers and 2's Complement](https://reader030.fdocuments.net/reader030/viewer/2022020218/55703ce6d8b42a611e8b508b/html5/thumbnails/67.jpg)
MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001
Calculate the 2’s complementform of -10410
-10410 = 100110002
2’s Complement2’s complement (a better way)
1. calculate the magnitude of the number
2. starting from the rightmost bit, look for the first bit that is a 1
3. “invert” all bits to the left of the 1
![Page 68: Math1003 1.15 - Integers and 2's Complement](https://reader030.fdocuments.net/reader030/viewer/2022020218/55703ce6d8b42a611e8b508b/html5/thumbnails/68.jpg)
MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001
Calculate the 2’s complementform of -110
2’s Complement2’s complement (a better way)
1. calculate the magnitude of the number
2. starting from the rightmost bit, look for the first bit that is a 1
3. “invert” all bits to the left of the 1
![Page 69: Math1003 1.15 - Integers and 2's Complement](https://reader030.fdocuments.net/reader030/viewer/2022020218/55703ce6d8b42a611e8b508b/html5/thumbnails/69.jpg)
MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001
Calculate the 2’s complementform of -110
110 = 000000012
2’s Complement2’s complement (a better way)
1. calculate the magnitude of the number
2. starting from the rightmost bit, look for the first bit that is a 1
3. “invert” all bits to the left of the 1
![Page 70: Math1003 1.15 - Integers and 2's Complement](https://reader030.fdocuments.net/reader030/viewer/2022020218/55703ce6d8b42a611e8b508b/html5/thumbnails/70.jpg)
MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001
Calculate the 2’s complementform of -110
110 = 000000012
2’s Complement2’s complement (a better way)
1. calculate the magnitude of the number
2. starting from the rightmost bit, look for the first bit that is a 1
3. “invert” all bits to the left of the 1
![Page 71: Math1003 1.15 - Integers and 2's Complement](https://reader030.fdocuments.net/reader030/viewer/2022020218/55703ce6d8b42a611e8b508b/html5/thumbnails/71.jpg)
MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001
Calculate the 2’s complementform of -110
110 = 000000012
2’s Complement2’s complement (a better way)
1. calculate the magnitude of the number
2. starting from the rightmost bit, look for the first bit that is a 1
3. “invert” all bits to the left of the 1
![Page 72: Math1003 1.15 - Integers and 2's Complement](https://reader030.fdocuments.net/reader030/viewer/2022020218/55703ce6d8b42a611e8b508b/html5/thumbnails/72.jpg)
MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001
Calculate the 2’s complementform of -110
110 = 0000000121
2’s Complement2’s complement (a better way)
1. calculate the magnitude of the number
2. starting from the rightmost bit, look for the first bit that is a 1
3. “invert” all bits to the left of the 1
![Page 73: Math1003 1.15 - Integers and 2's Complement](https://reader030.fdocuments.net/reader030/viewer/2022020218/55703ce6d8b42a611e8b508b/html5/thumbnails/73.jpg)
MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001
Calculate the 2’s complementform of -110
110 = 00000001211
2’s Complement2’s complement (a better way)
1. calculate the magnitude of the number
2. starting from the rightmost bit, look for the first bit that is a 1
3. “invert” all bits to the left of the 1
![Page 74: Math1003 1.15 - Integers and 2's Complement](https://reader030.fdocuments.net/reader030/viewer/2022020218/55703ce6d8b42a611e8b508b/html5/thumbnails/74.jpg)
MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001
Calculate the 2’s complementform of -110
110 = 000000012111
2’s Complement2’s complement (a better way)
1. calculate the magnitude of the number
2. starting from the rightmost bit, look for the first bit that is a 1
3. “invert” all bits to the left of the 1
![Page 75: Math1003 1.15 - Integers and 2's Complement](https://reader030.fdocuments.net/reader030/viewer/2022020218/55703ce6d8b42a611e8b508b/html5/thumbnails/75.jpg)
MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001
Calculate the 2’s complementform of -110
110 = 0000000121111
2’s Complement2’s complement (a better way)
1. calculate the magnitude of the number
2. starting from the rightmost bit, look for the first bit that is a 1
3. “invert” all bits to the left of the 1
![Page 76: Math1003 1.15 - Integers and 2's Complement](https://reader030.fdocuments.net/reader030/viewer/2022020218/55703ce6d8b42a611e8b508b/html5/thumbnails/76.jpg)
MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001
Calculate the 2’s complementform of -110
110 = 00000001211111
2’s Complement2’s complement (a better way)
1. calculate the magnitude of the number
2. starting from the rightmost bit, look for the first bit that is a 1
3. “invert” all bits to the left of the 1
![Page 77: Math1003 1.15 - Integers and 2's Complement](https://reader030.fdocuments.net/reader030/viewer/2022020218/55703ce6d8b42a611e8b508b/html5/thumbnails/77.jpg)
MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001
Calculate the 2’s complementform of -110
110 = 000000012111111
2’s Complement2’s complement (a better way)
1. calculate the magnitude of the number
2. starting from the rightmost bit, look for the first bit that is a 1
3. “invert” all bits to the left of the 1
![Page 78: Math1003 1.15 - Integers and 2's Complement](https://reader030.fdocuments.net/reader030/viewer/2022020218/55703ce6d8b42a611e8b508b/html5/thumbnails/78.jpg)
MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001
Calculate the 2’s complementform of -110
110 = 0000000121111111
2’s Complement2’s complement (a better way)
1. calculate the magnitude of the number
2. starting from the rightmost bit, look for the first bit that is a 1
3. “invert” all bits to the left of the 1
![Page 79: Math1003 1.15 - Integers and 2's Complement](https://reader030.fdocuments.net/reader030/viewer/2022020218/55703ce6d8b42a611e8b508b/html5/thumbnails/79.jpg)
MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001
Calculate the 2’s complementform of -110
-110 = 111111112
2’s Complement2’s complement (a better way)
1. calculate the magnitude of the number
2. starting from the rightmost bit, look for the first bit that is a 1
3. “invert” all bits to the left of the 1
![Page 80: Math1003 1.15 - Integers and 2's Complement](https://reader030.fdocuments.net/reader030/viewer/2022020218/55703ce6d8b42a611e8b508b/html5/thumbnails/80.jpg)
MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001
Calculate the 2’s complementform of -4210
2’s Complement2’s complement (a better way)
1. calculate the magnitude of the number
2. starting from the rightmost bit, look for the first bit that is a 1
3. “invert” all bits to the left of the 1
![Page 81: Math1003 1.15 - Integers and 2's Complement](https://reader030.fdocuments.net/reader030/viewer/2022020218/55703ce6d8b42a611e8b508b/html5/thumbnails/81.jpg)
MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001
Calculate the 2’s complementform of -4210
4210 = 001010102
2’s Complement2’s complement (a better way)
1. calculate the magnitude of the number
2. starting from the rightmost bit, look for the first bit that is a 1
3. “invert” all bits to the left of the 1
![Page 82: Math1003 1.15 - Integers and 2's Complement](https://reader030.fdocuments.net/reader030/viewer/2022020218/55703ce6d8b42a611e8b508b/html5/thumbnails/82.jpg)
MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001
Calculate the 2’s complementform of -4210
110 = 001010102
2’s Complement2’s complement (a better way)
1. calculate the magnitude of the number
2. starting from the rightmost bit, look for the first bit that is a 1
3. “invert” all bits to the left of the 1
![Page 83: Math1003 1.15 - Integers and 2's Complement](https://reader030.fdocuments.net/reader030/viewer/2022020218/55703ce6d8b42a611e8b508b/html5/thumbnails/83.jpg)
MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001
Calculate the 2’s complementform of -4210
110 = 0010101021
2’s Complement2’s complement (a better way)
1. calculate the magnitude of the number
2. starting from the rightmost bit, look for the first bit that is a 1
3. “invert” all bits to the left of the 1
![Page 84: Math1003 1.15 - Integers and 2's Complement](https://reader030.fdocuments.net/reader030/viewer/2022020218/55703ce6d8b42a611e8b508b/html5/thumbnails/84.jpg)
MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001
Calculate the 2’s complementform of -4210
110 = 00101010210
2’s Complement2’s complement (a better way)
1. calculate the magnitude of the number
2. starting from the rightmost bit, look for the first bit that is a 1
3. “invert” all bits to the left of the 1
![Page 85: Math1003 1.15 - Integers and 2's Complement](https://reader030.fdocuments.net/reader030/viewer/2022020218/55703ce6d8b42a611e8b508b/html5/thumbnails/85.jpg)
MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001
Calculate the 2’s complementform of -4210
110 = 001010102101
2’s Complement2’s complement (a better way)
1. calculate the magnitude of the number
2. starting from the rightmost bit, look for the first bit that is a 1
3. “invert” all bits to the left of the 1
![Page 86: Math1003 1.15 - Integers and 2's Complement](https://reader030.fdocuments.net/reader030/viewer/2022020218/55703ce6d8b42a611e8b508b/html5/thumbnails/86.jpg)
MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001
Calculate the 2’s complementform of -4210
110 = 0010101021010
2’s Complement2’s complement (a better way)
1. calculate the magnitude of the number
2. starting from the rightmost bit, look for the first bit that is a 1
3. “invert” all bits to the left of the 1
![Page 87: Math1003 1.15 - Integers and 2's Complement](https://reader030.fdocuments.net/reader030/viewer/2022020218/55703ce6d8b42a611e8b508b/html5/thumbnails/87.jpg)
MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001
Calculate the 2’s complementform of -4210
110 = 00101010210101
2’s Complement2’s complement (a better way)
1. calculate the magnitude of the number
2. starting from the rightmost bit, look for the first bit that is a 1
3. “invert” all bits to the left of the 1
![Page 88: Math1003 1.15 - Integers and 2's Complement](https://reader030.fdocuments.net/reader030/viewer/2022020218/55703ce6d8b42a611e8b508b/html5/thumbnails/88.jpg)
MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001
Calculate the 2’s complementform of -4210
110 = 001010102101011
2’s Complement2’s complement (a better way)
1. calculate the magnitude of the number
2. starting from the rightmost bit, look for the first bit that is a 1
3. “invert” all bits to the left of the 1
![Page 89: Math1003 1.15 - Integers and 2's Complement](https://reader030.fdocuments.net/reader030/viewer/2022020218/55703ce6d8b42a611e8b508b/html5/thumbnails/89.jpg)
MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001
Calculate the 2’s complementform of -4210
-4210 = 110101102
2’s Complement2’s complement (a better way)
1. calculate the magnitude of the number
2. starting from the rightmost bit, look for the first bit that is a 1
3. “invert” all bits to the left of the 1
![Page 90: Math1003 1.15 - Integers and 2's Complement](https://reader030.fdocuments.net/reader030/viewer/2022020218/55703ce6d8b42a611e8b508b/html5/thumbnails/90.jpg)
MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001
2’s complement(calculating the decimal equivalent)
1. starting from the rightmost bit, look for the first bit that is a 1
2. “invert” all bits to the left of the 1
3. calculate the magnitude of the number
Calculate the decimal value of111101112
2’s Complement
![Page 91: Math1003 1.15 - Integers and 2's Complement](https://reader030.fdocuments.net/reader030/viewer/2022020218/55703ce6d8b42a611e8b508b/html5/thumbnails/91.jpg)
MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001
2’s complement(calculating the decimal equivalent)
1. starting from the rightmost bit, look for the first bit that is a 1
2. “invert” all bits to the left of the 1
3. calculate the magnitude of the number
Calculate the decimal value of111101112
111101112
2’s Complement
![Page 92: Math1003 1.15 - Integers and 2's Complement](https://reader030.fdocuments.net/reader030/viewer/2022020218/55703ce6d8b42a611e8b508b/html5/thumbnails/92.jpg)
MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001
2’s complement(calculating the decimal equivalent)
1. starting from the rightmost bit, look for the first bit that is a 1
2. “invert” all bits to the left of the 1
3. calculate the magnitude of the number
Calculate the decimal value of111101112
111101112
2’s Complement
![Page 93: Math1003 1.15 - Integers and 2's Complement](https://reader030.fdocuments.net/reader030/viewer/2022020218/55703ce6d8b42a611e8b508b/html5/thumbnails/93.jpg)
MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001
2’s complement(calculating the decimal equivalent)
1. starting from the rightmost bit, look for the first bit that is a 1
2. “invert” all bits to the left of the 1
3. calculate the magnitude of the number
Calculate the decimal value of111101112
1111011120
2’s Complement
![Page 94: Math1003 1.15 - Integers and 2's Complement](https://reader030.fdocuments.net/reader030/viewer/2022020218/55703ce6d8b42a611e8b508b/html5/thumbnails/94.jpg)
MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001
2’s complement(calculating the decimal equivalent)
1. starting from the rightmost bit, look for the first bit that is a 1
2. “invert” all bits to the left of the 1
3. calculate the magnitude of the number
Calculate the decimal value of111101112
11110111200
2’s Complement
![Page 95: Math1003 1.15 - Integers and 2's Complement](https://reader030.fdocuments.net/reader030/viewer/2022020218/55703ce6d8b42a611e8b508b/html5/thumbnails/95.jpg)
MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001
2’s complement(calculating the decimal equivalent)
1. starting from the rightmost bit, look for the first bit that is a 1
2. “invert” all bits to the left of the 1
3. calculate the magnitude of the number
Calculate the decimal value of111101112
111101112001
2’s Complement
![Page 96: Math1003 1.15 - Integers and 2's Complement](https://reader030.fdocuments.net/reader030/viewer/2022020218/55703ce6d8b42a611e8b508b/html5/thumbnails/96.jpg)
MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001
2’s complement(calculating the decimal equivalent)
1. starting from the rightmost bit, look for the first bit that is a 1
2. “invert” all bits to the left of the 1
3. calculate the magnitude of the number
Calculate the decimal value of111101112
1111011120010
2’s Complement
![Page 97: Math1003 1.15 - Integers and 2's Complement](https://reader030.fdocuments.net/reader030/viewer/2022020218/55703ce6d8b42a611e8b508b/html5/thumbnails/97.jpg)
MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001
2’s complement(calculating the decimal equivalent)
1. starting from the rightmost bit, look for the first bit that is a 1
2. “invert” all bits to the left of the 1
3. calculate the magnitude of the number
Calculate the decimal value of111101112
11110111200100
2’s Complement
![Page 98: Math1003 1.15 - Integers and 2's Complement](https://reader030.fdocuments.net/reader030/viewer/2022020218/55703ce6d8b42a611e8b508b/html5/thumbnails/98.jpg)
MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001
2’s complement(calculating the decimal equivalent)
1. starting from the rightmost bit, look for the first bit that is a 1
2. “invert” all bits to the left of the 1
3. calculate the magnitude of the number
Calculate the decimal value of111101112
111101112001000
2’s Complement
![Page 99: Math1003 1.15 - Integers and 2's Complement](https://reader030.fdocuments.net/reader030/viewer/2022020218/55703ce6d8b42a611e8b508b/html5/thumbnails/99.jpg)
MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001
2’s complement(calculating the decimal equivalent)
1. starting from the rightmost bit, look for the first bit that is a 1
2. “invert” all bits to the left of the 1
3. calculate the magnitude of the number
Calculate the decimal value of111101112
1111011120010000
2’s Complement
![Page 100: Math1003 1.15 - Integers and 2's Complement](https://reader030.fdocuments.net/reader030/viewer/2022020218/55703ce6d8b42a611e8b508b/html5/thumbnails/100.jpg)
MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001
2’s complement(calculating the decimal equivalent)
1. starting from the rightmost bit, look for the first bit that is a 1
2. “invert” all bits to the left of the 1
3. calculate the magnitude of the number
Calculate the decimal value of111101112
1111011120010000
2’s Complement this method is for negative numbers
only
![Page 101: Math1003 1.15 - Integers and 2's Complement](https://reader030.fdocuments.net/reader030/viewer/2022020218/55703ce6d8b42a611e8b508b/html5/thumbnails/101.jpg)
MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001
2’s complement(calculating the decimal equivalent)
1. starting from the rightmost bit, look for the first bit that is a 1
2. “invert” all bits to the left of the 1
3. calculate the magnitude of the number
Calculate the decimal value of111101112
1111011120010000 = -910
2’s Complement this method is for negative numbers
only
![Page 102: Math1003 1.15 - Integers and 2's Complement](https://reader030.fdocuments.net/reader030/viewer/2022020218/55703ce6d8b42a611e8b508b/html5/thumbnails/102.jpg)
MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001
Calculate the decimal value of111010002
2’s Complement2’s complement
(calculating the decimal equivalent)
1. starting from the rightmost bit, look for the first bit that is a 1
2. “invert” all bits to the left of the 1
3. calculate the magnitude of the number
![Page 103: Math1003 1.15 - Integers and 2's Complement](https://reader030.fdocuments.net/reader030/viewer/2022020218/55703ce6d8b42a611e8b508b/html5/thumbnails/103.jpg)
MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001
Calculate the decimal value of111010002
111010002
2’s Complement2’s complement
(calculating the decimal equivalent)
1. starting from the rightmost bit, look for the first bit that is a 1
2. “invert” all bits to the left of the 1
3. calculate the magnitude of the number
![Page 104: Math1003 1.15 - Integers and 2's Complement](https://reader030.fdocuments.net/reader030/viewer/2022020218/55703ce6d8b42a611e8b508b/html5/thumbnails/104.jpg)
MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001
Calculate the decimal value of111010002
111010002
2’s Complement2’s complement
(calculating the decimal equivalent)
1. starting from the rightmost bit, look for the first bit that is a 1
2. “invert” all bits to the left of the 1
3. calculate the magnitude of the number
![Page 105: Math1003 1.15 - Integers and 2's Complement](https://reader030.fdocuments.net/reader030/viewer/2022020218/55703ce6d8b42a611e8b508b/html5/thumbnails/105.jpg)
MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001
Calculate the decimal value of111010002
1110100021
2’s Complement2’s complement
(calculating the decimal equivalent)
1. starting from the rightmost bit, look for the first bit that is a 1
2. “invert” all bits to the left of the 1
3. calculate the magnitude of the number
![Page 106: Math1003 1.15 - Integers and 2's Complement](https://reader030.fdocuments.net/reader030/viewer/2022020218/55703ce6d8b42a611e8b508b/html5/thumbnails/106.jpg)
MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001
Calculate the decimal value of111010002
11101000210
2’s Complement2’s complement
(calculating the decimal equivalent)
1. starting from the rightmost bit, look for the first bit that is a 1
2. “invert” all bits to the left of the 1
3. calculate the magnitude of the number
![Page 107: Math1003 1.15 - Integers and 2's Complement](https://reader030.fdocuments.net/reader030/viewer/2022020218/55703ce6d8b42a611e8b508b/html5/thumbnails/107.jpg)
MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001
Calculate the decimal value of111010002
111010002100
2’s Complement2’s complement
(calculating the decimal equivalent)
1. starting from the rightmost bit, look for the first bit that is a 1
2. “invert” all bits to the left of the 1
3. calculate the magnitude of the number
![Page 108: Math1003 1.15 - Integers and 2's Complement](https://reader030.fdocuments.net/reader030/viewer/2022020218/55703ce6d8b42a611e8b508b/html5/thumbnails/108.jpg)
MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001
Calculate the decimal value of111010002
1110100021000
2’s Complement2’s complement
(calculating the decimal equivalent)
1. starting from the rightmost bit, look for the first bit that is a 1
2. “invert” all bits to the left of the 1
3. calculate the magnitude of the number
![Page 109: Math1003 1.15 - Integers and 2's Complement](https://reader030.fdocuments.net/reader030/viewer/2022020218/55703ce6d8b42a611e8b508b/html5/thumbnails/109.jpg)
MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001
Calculate the decimal value of111010002
1110100021000 = -2410
2’s Complement2’s complement
(calculating the decimal equivalent)
1. starting from the rightmost bit, look for the first bit that is a 1
2. “invert” all bits to the left of the 1
3. calculate the magnitude of the number
![Page 110: Math1003 1.15 - Integers and 2's Complement](https://reader030.fdocuments.net/reader030/viewer/2022020218/55703ce6d8b42a611e8b508b/html5/thumbnails/110.jpg)
MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001
2’s Complement and Addition
01011001
![Page 111: Math1003 1.15 - Integers and 2's Complement](https://reader030.fdocuments.net/reader030/viewer/2022020218/55703ce6d8b42a611e8b508b/html5/thumbnails/111.jpg)
MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001
2’s Complement and Addition
Calculate 7210 + 1710
Since these are both positive, this is straightforward
01011001
![Page 112: Math1003 1.15 - Integers and 2's Complement](https://reader030.fdocuments.net/reader030/viewer/2022020218/55703ce6d8b42a611e8b508b/html5/thumbnails/112.jpg)
MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001
2’s Complement and Addition
Calculate 7210 + 1710
Since these are both positive, this is straightforward
01011001
7210
+1710
![Page 113: Math1003 1.15 - Integers and 2's Complement](https://reader030.fdocuments.net/reader030/viewer/2022020218/55703ce6d8b42a611e8b508b/html5/thumbnails/113.jpg)
MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001
2’s Complement and Addition
Calculate 7210 + 1710
Since these are both positive, this is straightforward
010010002
+000100012
01011001
7210
+1710
![Page 114: Math1003 1.15 - Integers and 2's Complement](https://reader030.fdocuments.net/reader030/viewer/2022020218/55703ce6d8b42a611e8b508b/html5/thumbnails/114.jpg)
MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001
2’s Complement and Addition
Calculate 7210 + 1710
Since these are both positive, this is straightforward
010010002
+000100012
01011001
7210
+1710
![Page 115: Math1003 1.15 - Integers and 2's Complement](https://reader030.fdocuments.net/reader030/viewer/2022020218/55703ce6d8b42a611e8b508b/html5/thumbnails/115.jpg)
MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001
2’s Complement and Addition
Calculate 7210 + 1710
Since these are both positive, this is straightforward
010010002
+000100012
01011001
7210
+1710
![Page 116: Math1003 1.15 - Integers and 2's Complement](https://reader030.fdocuments.net/reader030/viewer/2022020218/55703ce6d8b42a611e8b508b/html5/thumbnails/116.jpg)
MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001
2’s Complement and Addition
Calculate 7210 + 1710
Since these are both positive, this is straightforward
010010002
+000100012
01011001
7210
+1710
![Page 117: Math1003 1.15 - Integers and 2's Complement](https://reader030.fdocuments.net/reader030/viewer/2022020218/55703ce6d8b42a611e8b508b/html5/thumbnails/117.jpg)
MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001
2’s Complement and Addition
Calculate 7210 + 1710
Since these are both positive, this is straightforward
010010002
+000100012
01011001
7210
+1710
![Page 118: Math1003 1.15 - Integers and 2's Complement](https://reader030.fdocuments.net/reader030/viewer/2022020218/55703ce6d8b42a611e8b508b/html5/thumbnails/118.jpg)
MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001
2’s Complement and Addition
Calculate 7210 + 1710
Since these are both positive, this is straightforward
010010002
+000100012
01011001
7210
+1710
![Page 119: Math1003 1.15 - Integers and 2's Complement](https://reader030.fdocuments.net/reader030/viewer/2022020218/55703ce6d8b42a611e8b508b/html5/thumbnails/119.jpg)
MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001
2’s Complement and Addition
Calculate 7210 + 1710
Since these are both positive, this is straightforward
010010002
+000100012
01011001
7210
+1710
![Page 120: Math1003 1.15 - Integers and 2's Complement](https://reader030.fdocuments.net/reader030/viewer/2022020218/55703ce6d8b42a611e8b508b/html5/thumbnails/120.jpg)
MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001
2’s Complement and Addition
Calculate 7210 + 1710
Since these are both positive, this is straightforward
010010002
+000100012
01011001
7210
+1710
![Page 121: Math1003 1.15 - Integers and 2's Complement](https://reader030.fdocuments.net/reader030/viewer/2022020218/55703ce6d8b42a611e8b508b/html5/thumbnails/121.jpg)
MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001
2’s Complement and Addition
Calculate 7210 + 1710
Since these are both positive, this is straightforward
010010002
+000100012
01011001
7210
+1710
![Page 122: Math1003 1.15 - Integers and 2's Complement](https://reader030.fdocuments.net/reader030/viewer/2022020218/55703ce6d8b42a611e8b508b/html5/thumbnails/122.jpg)
MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001
2’s Complement and Addition
Calculate 7210 + 1710
Since these are both positive, this is straightforward
010010002
+000100012
010110012
7210
+1710
![Page 123: Math1003 1.15 - Integers and 2's Complement](https://reader030.fdocuments.net/reader030/viewer/2022020218/55703ce6d8b42a611e8b508b/html5/thumbnails/123.jpg)
MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001
2’s Complement and Addition
Calculate 7210 + 1710
Since these are both positive, this is straightforward
010010002
+000100012
010110012
7210
+1710
sign
bit
![Page 124: Math1003 1.15 - Integers and 2's Complement](https://reader030.fdocuments.net/reader030/viewer/2022020218/55703ce6d8b42a611e8b508b/html5/thumbnails/124.jpg)
MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001
Calculate 10410 + (-4210)
Here we add a negative number to a positive number
2’s Complement and Addition
![Page 125: Math1003 1.15 - Integers and 2's Complement](https://reader030.fdocuments.net/reader030/viewer/2022020218/55703ce6d8b42a611e8b508b/html5/thumbnails/125.jpg)
MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001
Calculate 10410 + (-4210)
Here we add a negative number to a positive number
10410 + -4210
2’s Complement and Addition
![Page 126: Math1003 1.15 - Integers and 2's Complement](https://reader030.fdocuments.net/reader030/viewer/2022020218/55703ce6d8b42a611e8b508b/html5/thumbnails/126.jpg)
MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001
Calculate 10410 + (-4210)
Here we add a negative number to a positive number
011010002
+110101102
10410 + -4210
2’s Complement and Addition
![Page 127: Math1003 1.15 - Integers and 2's Complement](https://reader030.fdocuments.net/reader030/viewer/2022020218/55703ce6d8b42a611e8b508b/html5/thumbnails/127.jpg)
MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001
Calculate 10410 + (-4210)
Here we add a negative number to a positive number
011010002
+110101102
10410 + -4210
2’s Complement and Addition
-4210 in 2’s complement?
![Page 128: Math1003 1.15 - Integers and 2's Complement](https://reader030.fdocuments.net/reader030/viewer/2022020218/55703ce6d8b42a611e8b508b/html5/thumbnails/128.jpg)
MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001
Calculate 10410 + (-4210)
Here we add a negative number to a positive number
011010002
+110101102
10410 + -4210
2’s Complement and Addition
![Page 129: Math1003 1.15 - Integers and 2's Complement](https://reader030.fdocuments.net/reader030/viewer/2022020218/55703ce6d8b42a611e8b508b/html5/thumbnails/129.jpg)
MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001
Calculate 10410 + (-4210)
Here we add a negative number to a positive number
011010002
+110101102
1001111102
10410 + -4210
2’s Complement and Addition
![Page 130: Math1003 1.15 - Integers and 2's Complement](https://reader030.fdocuments.net/reader030/viewer/2022020218/55703ce6d8b42a611e8b508b/html5/thumbnails/130.jpg)
MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001
Calculate 10410 + (-4210)
Here we add a negative number to a positive number
011010002
+110101102
1001111102
10410 + -4210
since we are only using 8 bit numbers,
the ninth bit is simply dropped
2’s Complement and Addition
![Page 131: Math1003 1.15 - Integers and 2's Complement](https://reader030.fdocuments.net/reader030/viewer/2022020218/55703ce6d8b42a611e8b508b/html5/thumbnails/131.jpg)
MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001
Calculate 10410 + (-4210)
Here we add a negative number to a positive number
011010002
+110101102
1001111102
10410 + -4210
2’s Complement and Addition
![Page 132: Math1003 1.15 - Integers and 2's Complement](https://reader030.fdocuments.net/reader030/viewer/2022020218/55703ce6d8b42a611e8b508b/html5/thumbnails/132.jpg)
MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001
Calculate 10410 + (-4210)
Here we add a negative number to a positive number
011010002
+110101102
1001111102
10410 + -4210
sign
bit
2’s Complement and Addition
![Page 133: Math1003 1.15 - Integers and 2's Complement](https://reader030.fdocuments.net/reader030/viewer/2022020218/55703ce6d8b42a611e8b508b/html5/thumbnails/133.jpg)
MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001
Calculate 2710 + (-3510)
Here we add a negative number to a positive number
2’s Complement and Addition
![Page 134: Math1003 1.15 - Integers and 2's Complement](https://reader030.fdocuments.net/reader030/viewer/2022020218/55703ce6d8b42a611e8b508b/html5/thumbnails/134.jpg)
MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001
Calculate 2710 + (-3510)
Here we add a negative number to a positive number
2710 + -3510
2’s Complement and Addition
![Page 135: Math1003 1.15 - Integers and 2's Complement](https://reader030.fdocuments.net/reader030/viewer/2022020218/55703ce6d8b42a611e8b508b/html5/thumbnails/135.jpg)
MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001
Calculate 2710 + (-3510)
Here we add a negative number to a positive number
000110112
+110111012
2710 + -3510
2’s Complement and Addition
![Page 136: Math1003 1.15 - Integers and 2's Complement](https://reader030.fdocuments.net/reader030/viewer/2022020218/55703ce6d8b42a611e8b508b/html5/thumbnails/136.jpg)
MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001
Calculate 2710 + (-3510)
Here we add a negative number to a positive number
000110112
+110111012
2710 + -3510
-3510 in 2’s complement?
2’s Complement and Addition
![Page 137: Math1003 1.15 - Integers and 2's Complement](https://reader030.fdocuments.net/reader030/viewer/2022020218/55703ce6d8b42a611e8b508b/html5/thumbnails/137.jpg)
MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001
Calculate 2710 + (-3510)
Here we add a negative number to a positive number
000110112
+110111012
2710 + -3510
2’s Complement and Addition
![Page 138: Math1003 1.15 - Integers and 2's Complement](https://reader030.fdocuments.net/reader030/viewer/2022020218/55703ce6d8b42a611e8b508b/html5/thumbnails/138.jpg)
MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001
Calculate 2710 + (-3510)
Here we add a negative number to a positive number
000110112
+110111012
1111110002
2710 + -3510
2’s Complement and Addition
![Page 139: Math1003 1.15 - Integers and 2's Complement](https://reader030.fdocuments.net/reader030/viewer/2022020218/55703ce6d8b42a611e8b508b/html5/thumbnails/139.jpg)
MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001
Calculate 2710 + (-3510)
Here we add a negative number to a positive number
000110112
+110111012
1111110002
2710 + -3510
sign
bit
2’s Complement and Addition
![Page 140: Math1003 1.15 - Integers and 2's Complement](https://reader030.fdocuments.net/reader030/viewer/2022020218/55703ce6d8b42a611e8b508b/html5/thumbnails/140.jpg)
MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001
Calculate 2710 + (-3510)
Here we add a negative number to a positive number
000110112
+110111012
1111110002
2710 + -3510
sign
bit
can you verify that this is -810 in 2’s
complement?
2’s Complement and Addition
![Page 141: Math1003 1.15 - Integers and 2's Complement](https://reader030.fdocuments.net/reader030/viewer/2022020218/55703ce6d8b42a611e8b508b/html5/thumbnails/141.jpg)
MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001
Calculate -4210 + (-110)
Here we add a negative number to a negative number
2’s Complement and Addition
![Page 142: Math1003 1.15 - Integers and 2's Complement](https://reader030.fdocuments.net/reader030/viewer/2022020218/55703ce6d8b42a611e8b508b/html5/thumbnails/142.jpg)
MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001
Calculate -4210 + (-110)
Here we add a negative number to a negative number
-4210 + -110
2’s Complement and Addition
![Page 143: Math1003 1.15 - Integers and 2's Complement](https://reader030.fdocuments.net/reader030/viewer/2022020218/55703ce6d8b42a611e8b508b/html5/thumbnails/143.jpg)
MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001
Calculate -4210 + (-110)
Here we add a negative number to a negative number
110101102
+111111112
-4210 + -110
2’s Complement and Addition
![Page 144: Math1003 1.15 - Integers and 2's Complement](https://reader030.fdocuments.net/reader030/viewer/2022020218/55703ce6d8b42a611e8b508b/html5/thumbnails/144.jpg)
MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001
Calculate -4210 + (-110)
Here we add a negative number to a negative number
110101102
+111111112
111010101
-4210 + -110
2’s Complement and Addition
![Page 145: Math1003 1.15 - Integers and 2's Complement](https://reader030.fdocuments.net/reader030/viewer/2022020218/55703ce6d8b42a611e8b508b/html5/thumbnails/145.jpg)
MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001
Calculate -4210 + (-110)
Here we add a negative number to a negative number
110101102
+111111112
1110101012
-4210 + -110
2’s Complement and Addition
![Page 146: Math1003 1.15 - Integers and 2's Complement](https://reader030.fdocuments.net/reader030/viewer/2022020218/55703ce6d8b42a611e8b508b/html5/thumbnails/146.jpg)
MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001
Calculate -4210 + (-110)
Here we add a negative number to a negative number
110101102
+111111112
1110101012
-4210 + -110
2’s Complement and Addition
since we are only using 8 bit numbers,
the ninth bit is simply dropped
![Page 147: Math1003 1.15 - Integers and 2's Complement](https://reader030.fdocuments.net/reader030/viewer/2022020218/55703ce6d8b42a611e8b508b/html5/thumbnails/147.jpg)
MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001
Calculate -4210 + (-110)
Here we add a negative number to a negative number
110101102
+111111112
1110101012
-4210 + -110
2’s Complement and Addition
![Page 148: Math1003 1.15 - Integers and 2's Complement](https://reader030.fdocuments.net/reader030/viewer/2022020218/55703ce6d8b42a611e8b508b/html5/thumbnails/148.jpg)
MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001
Calculate -4210 + (-110)
Here we add a negative number to a negative number
110101102
+111111112
1110101012
-4210 + -110
sign
bit
2’s Complement and Addition
![Page 149: Math1003 1.15 - Integers and 2's Complement](https://reader030.fdocuments.net/reader030/viewer/2022020218/55703ce6d8b42a611e8b508b/html5/thumbnails/149.jpg)
MATH1003
10110100101011010100101010111010101111011011101111011101110111101110111011110111111010110100101011110110110101111011010100111111011010100110101001
Calculate -4210 + (-110)
Here we add a negative number to a negative number
110101102
+111111112
1110101012
-4210 + -110
sign
bit
can you verify that this is -4310 in 2’s complement?
2’s Complement and Addition