------------------------------------------------------------------------------
MC logo
Decimal to Two's Compliment Conversion
[^] Two's Compliment Operation   [^^][^^] Binary/Boolean Main Index
------------------------------------------------------------------------------
[Decimal to Two's Compliment Conversion] [Two's Compliment to Decimal Conversion] [Two's Compliment Binary Addition Examples]
These examples show conversion of a decimal number to 8-bit twos compliment. The bit size is always important with twos compliment, 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.