33.1.7.1 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. Equation 33-3 can be used to calculate the full-scale range of ADC result values in sign/magnitude format:
Equation 33-3. ADC Range in Sign/Magnitude Result Format
n b i t r a n g e i n s i g n / m a g n i t u d e f o r m a t = ± 2 n 1 1 w h e r e : n = A D C r e s o l u t i o n E x a m p l e s : 12 b i t A D C = ± 2 12 1 1 = ± 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. Equation 33-4 can be used to calculate the full-scale range of ADC result values in two’s complement format:
Equation 33-4. ADC Range in Two’s Complement Result Format
n b i t r a n g e i n t w o s c o m p l e m e n t f o r m a t = ( 2 n 1 1 ) , ( 2 n 1 2 ) w h e r e : n = A D C r e s o l u t i o n E x a m p l e : 12 b i t A D C = ( 2 12 1 1 ) = 2047 ( l o w r a n g e ) = ( 2 12 1 2 ) = 2046 ( h i g h r a n g e )
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