Sign/Magnitude and Two’s Complement Result

When performing differential measurements, the conversion results can be presented in either a sign/magnitude or two’s complement format.

In sign/magnitude format, the conversion result is a binary representation of the input, with a sign bit determining the polarity. Figure 1 can be used to calculate the full-scale range of ADC result values in sign/magnitude format:
Figure 1. ADC Range in Sign/Magnitude Result Format
nbitrangeinsign/magnitudeformat=±2n11where:n=ADCresolutionExamples:12bitADC=±21211=±2047
In 12-Bit Sign/Magnitude Result Format, the right justified ADRES value is 0x8020. The 11-bit sign/magnitude formatted result shows an absolute value of ‘2’ (decimal), with bit 7 of the ADRESH register representing the sign bit. When the sign bit = ‘0’, the result is positive, and when the sign bit = ‘1’, the result is negative. For this example, the sign bit = ‘1’, so the sign/magnitude formatted decimal result value is ‘-2’.

12-Bit Sign/Magnitude Result Format

In two’s complement format, the MSb of the conversion result determines the polarity. Figure 2 can be used to calculate the full-scale range of ADC result values in two’s complement format:
Figure 2. ADC Range in Two’s Complement Result Format
nbitrangeintwoscomplementformat=(2n11),(2n12)where:n=ADCresolutionExample:12bitADC=(21211)=2047(lowrange)=(21212)=2046(highrange)
In 12-Bit Two’s Complement Result Format, the right justified ADRES result is 0x8020, which matches the ADRES result in 12-Bit Sign/Magnitude Result Format. The 12-bit two’s complement result shows a value of -2046 (decimal), with bit 7 of the ADRESH register representing the MSb of the conversion result.

12-Bit Two’s Complement Result Format