# 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
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’.
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.