Taking One's and Two's Complement
Learn how to represent negative numbers by taking the one's and two's complements.
We'll cover the following
One’s complement
An approach to representing negative numbers that will address the problem we saw earlier—where we tried to add a positive and a negative value—is the use of something called one’s complement. It also uses the most significant bit (the leftmost bit in our illustrations) as the sign bit, but stores negative numbers differently compared to SMR. If we have a positive value, we can use 3 again as an example, and if we store it in a byte, we get 0000 0011, as shown below:
Get hands-on with 1400+ tech skills courses.