I've been stuck on this question for a while now:
Show mathematically that two integers that have a sum of zero have one’s complement representations that are bit-complementary.
Here is a simple proof and a counter example:
One's complement representation by definition represents negative values with bit-complement. In other words -n
is represented as ~n
. If any two integers have a sum of zero, either they are both zero or one is the opposite of the other.