next up previous
Next: Can you explain again Up: Content Questions Previous: In the 2's complement,

How do you figure out the result after adding 1 in the ``complement'' convention for a negative number?

To add 1 to a binary number, you first flip the least significant bit. If this changed a 0 to a 1, you're done. Otherwise, you ``carry'' the 1, and add it to the next significant bit; you then repeat this process from right to left until you reach the most significant bit.

For example, in binary, $1+1=10$, $1+10=11$, $1+11= 100$, etc. Today's examples were: 1100000+1 = 11000001, and 10111111+1 = 11000000.

(Try a few examples if you are uncomfortable with this.)



Kate Scholberg 2017-04-12