Skip to main content

View the sign bit representation, one's complement, and two's complement representation of an integer with a specified word length.

Preview and results

After processing is complete, the results will be displayed here.

Instructions for use

  1. Select a word length and enter an integer that can fit in that word length.
  2. Click "View Binary Representation" to view the original code, inverse code and complement code respectively.
  3. The smallest negative number may only be represented by its complement; unrepresentable results are clearly marked and can be copied and viewed.

Input and output examples

Example input
-5 / 8 bit
Example output
10000101 / 11111010 / 11111011

These are demo inputs and sample results, and do not mean that your data has been processed.

Calculation basis and reference materials

The smallest negative number in two's complement code has no original code/reverse code representation with the same word length, and it will be clearly shown that it cannot be represented.

Content check: · About this site and content description

Related tools