Two's complement

🏷️ Computer science

To get the two’s complement negative notation of an integer:

If the leftmost bit of a two’s complement number is 1, the number is negative.

If the leftmost bit is 0, the number is 0 or **positive **

Convert from two’s complement number:

Arithmetic with two’s complement


https://www.cs.cornell.edu/~tomf/notes/cps104/twoscomp.html