2's complement
-x = ~x + 1 (invert bits, then add 1).
Last updated
Was this helpful?
-x = ~x + 1 (invert bits, then add 1).
Last updated
Was this helpful?
⟩ ⟩ ⟩ ⟩ ⟩ ⟩ 2's complement
(inverts the bits, then add 1)
in signed integer addition, -x
(the 2's complement of x
) is defined to be ~x + 1
.
signed integer addition is a .
doesn't show 2's complement for negative integers
replit:
Cornell ⟩
Wikipedia ⟩ ,
- invert the bits.
- specify the radix.