N-1
bits and the sign is represented in the MSB, where
N
is the number of bits used to represent the entire number.
+13 binary representation: 0000 0000 0000 1101 -13 binary representation: 1000 0000 0000 1101
+0 binary representation: 0000 0000 0000 0000 -0 binary representation: 1000 0000 0000 0000
+13 binary representation: 0000 0000 0000 1101 -13 binary representation: 1111 1111 1111 0010
+0 binary representation: 0000 0000 0000 0000 -0 binary representation: 1111 1111 1111 1111
13 binary representation: 0000 0000 0000 1101
-13 1's Complement: 1111 1111 1111 0010
-13 1's Complement: 1111 1111 1111 0010 + 1 ------------------- -13 2's Complement: 1111 1111 1111 0011
12 binary representation: 0000 0000 0000 1100
-12 1's Complement: 1111 1111 1111 0011
-12 1's Complement: 1111 1111 1111 0011 + 1 ------------------- -12 2's Complement: 1111 1111 1111 0100