Electronic – A confusion regarding signed representation of binary numbers

adcbinarydigital-logic

Suppose I have an ADC that converts the analog input samples to 4-bit signed binary numbers. The resolution of the ADC is 0.5V. Since the binary o/p is of sign magnitude representation, the MSB has no magnitude and the i/p range of the ADC is from -3.5 to +3.5.

However there are two representations of 0 (i.e. if the i/p is 0V). One of them is 0000 and the other 1000. That means for 0V, I have two different encoding levels. How do I represent that on the voltage characteristics? Its pretty clear to me for positive values, how the characteristics is going to be like – enter image description here

Where do I put the level 1000? Obviously 0000 and 1000 cannot be present at the same place.

Also, if the i/p is 2.7V, the encoded o/p is 0101. Similarly for an i/p of -2.8V, going by the previous logic, shouldn't the o/p be 1101?

This is the question that got me thinking about it –

enter image description here

Best Answer

In 2's complement, 1000 does not represent 0, but rather -8. So, in your ADC (or DAC), you would use it to represent -4.0 V.

More precisely, in an ADC, each code would represent the center of its range:

Code     ADC input            DAC output
----  ----------------        ----------
0000: -0.25 to +0.25 V          0.00 V
0001: +0.25 to +0.75 V         +0.50 V
0010: +0.75 to +1.25 V         +1.00 V
0011: +1.25 to +1.75 V         +1.50 V
0100: +1.75 to +2.25 V         +2.00 V
0101: +2.25 to +2.75 V         +2.50 V
0110: +2.75 to +3.25 V         +3.00 V
0111: greater than +3.25 V     +3.50 V

Similarly, in the negative direction, you would have:

Code     ADC input            DAC output
----  ----------------        ----------
1111: -0.25 to -0.75 V         -0.50 V
1110: -0.75 to -1.25 V         -1.00 V
1101: -1.25 to -1.75 V         -1.50 V
1100: -1.75 to -2.25 V         -2.00 V
1011: -2.25 to -2.75 V         -2.50 V
1010: -2.75 to -3.25 V         -3.00 V
1001: -3.25 to -3.75 V         -3.50 V
1000: less than -3.75 V        -4.00 V

A sign-magnitude ADC would be slightly different. The positive direction would look the same:

Code     ADC input            DAC output
----  ----------------        ----------
0000: -0.25 to +0.25 V          0.00 V
0001: +0.25 to +0.75 V         +0.50 V
0010: +0.75 to +1.25 V         +1.00 V
0011: +1.25 to +1.75 V         +1.50 V
0100: +1.75 to +2.25 V         +2.00 V
0101: +2.25 to +2.75 V         +2.50 V
0110: +2.75 to +3.25 V         +3.00 V
0111: greater than +3.25 V     +3.50 V

But in the negative direction, you would have:

Code     ADC input            DAC output
----  ----------------        ----------
1001: -0.25 to -0.75 V         -0.50 V
1010: -0.75 to -1.25 V         -1.00 V
1011: -1.25 to -1.75 V         -1.50 V
1100: -1.75 to -2.25 V         -2.00 V
1101: -2.25 to -2.75 V         -2.50 V
1110: -2.75 to -3.25 V         -3.00 V
1111: less than -3.25 V        -3.50 V

It's possible that the range around zero might be split into two:

Code     ADC input            DAC output
----  ----------------        ----------
0000:  0.00 to +0.25 V          0.00 V
1000: -0.25 to  0.00 V          0.00 V