lemonfrostt
- 7
- 3
In binary, the two's complement representation of a negative number is found by
I found this conceptually straightforward but hard to satisfactorily prove. Try it yourself.
NOT b + 1, with the leading bit being a sign bit. In general, prove that applying the operation NOT b + 1 twice to some n-bit binary number yields the original number b.I found this conceptually straightforward but hard to satisfactorily prove. Try it yourself.
The set of n-bit binary numbers under (+) form a cyclic group (g = 1) of order 2n.
b + NOT b = 1-1 (Ones' complement).
Therefore 1 + NOT b = b-1. (b-1)-1 = b.
(b-1 denotes additive inverse.)
b + NOT b = 1-1 (Ones' complement).
Therefore 1 + NOT b = b-1. (b-1)-1 = b.
(b-1 denotes additive inverse.)