Two's Complement Notation Integers

Example of conversion to signed binary of a decimal integer:

Let's convert to signed binary the following integer: -200

-200 = -256 + 32 + 16 + 8 = = -1×28 + 0×27 + 0×26 + 1×25 + 1×24 + 1×23 + 0×22 + 0×21 + 0×20 = 1001110002.

Example of sign extension of numbers in two's complement representation

Let's store the 8 bit number 11100100 on 6 bits:

We remove the first two 1's and the result is 100100. Note that to store a 8 bit number in 6 bits you can simply truncate the upper 2 bits as long as they are all the same as the left-most bit in the resulting 6 bit number - i.e., the sign doesn't change.

Signed Binary to Decimal Quiz

Question 1: What is the largest positive number that can be represented on 12 bits in two's complement representation?








Question 2: What is the largest negative number that can be represented on 12 bits in two's complement representation?








Question 3: Convert -199 from decimal to binary using two's complement notation.








Question 4: Convert -66 from decimal to binary using two's complement notation.








Question 5: What is the signed binary number 11001, stored in 8 bits?








Press the Submit button to see the results.