I know that mathematically the k-V analog input on an A to D converter could be converted to the digital code of $\dfrac{k(2^n-1)}{VDD}$. But I really don't understand where it comes from and the logic behind it. Any help would be appreciated.

• The values of a n-bit number range from 0 to 2**n-1. Sep 30 '15 at 11:54
• yes but how we get to that formula in the question?
– Jack
Sep 30 '15 at 11:56
• The minimum value is represented by 0V and the maximum value is represented by Vdd. The rest is just linear interpolation. Sep 30 '15 at 11:57
• I think my problem was that I didn't realize that the value of the 1024 level is 1023 because it is all ones. I think I get it now. Let me know if I am right.
– Jack
Sep 30 '15 at 12:55
• You are correct. Sep 30 '15 at 13:40