------------------------------------------------------------------------------
MC logo
Decimal to Two's Complement Conversion
[^] Two's Complement Operation   [^^][^^] Binary/Boolean Main Index
------------------------------------------------------------------------------
[Decimal to Two's Complement Conversion] [Two's Complement to Decimal Conversion] [Two's Complement Binary Addition Examples]
These examples show conversion of a decimal number to 8-bit twos complement. The bit size is always important with twos complement, since you must be able to tell where the sign bit is.

The steps are simple. First, you convert the magnitude of the number to binary, and pad to the word size (8 bits). If the original number was positive, you are done. Otherwise, you must negate the binary number by inverting the bits and adding 1.