ADC home pageIntroductionGoalsWhy digitize?Number RepresentationDigital to AnalogAnalog to DigitalApplicationsLiterature Citations

2's Complement Binary Numbers

Choose Subtopic

Integers not only have magnitude. They also have a sign. How do we deal with that in binary?

Straight Binary

The first option is to ignore sign and just use all the available numbers, running from 0 to 2N-1 where N is the number of bits in the number. That's what we already discussed.

Sign Plus Magnitude Binary

A second approach is to use one bit of the number (usually the left-most bit, what was originally the most significant bit with value 2N-1) to represent sign. This leaves N-1 bits to represent value. This is only rarely seen in the instrumentation world. Why?

  • Both +0 and -0 have separate representations. This gives two representations of a number where, in practice, there is only one meaning (most of the time -- consult a number theorist to learn when +0 and -0 are different).

  • It turns out to be less efficient to design hardware subtraction hardware for this representation than for Two's Complement coding.

  • It is less efficient to design data converters that use this design than those that use Two's Complement coding.

People who think of positive and negative numbers as funadmentally disjoint are comfortable with Sign Plus Magnitude Binary coding. Those who see the integer number line as describing a single, uniform set of numbers that happens to have 0 as its midpoint may find Sign Plus Magnitude Binary awkward.

Examples: for 4 bit numbers, 0110 = +6, 1110 = -6 since 0 in the lead bit = +, 1 in the lead bit = -.



University of Illinois Homepage The Camille & Henry Dreyfus Foundation Homepage Home Creative Commons License System Homepage Scheeline Group Home Page Univ. of Illinois at Urbana-Champaign Home Page Department of Chemistry Home Page