Ratiometric ADC

adc

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.

Best Answer

My problem was that I didn't realize that the value of the 1024 level is 1023 because it is all ones.