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 FormatIn 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 FormatIn 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.