# Formula for step size in Quantization

I've just started learning about Quantization and I'm a little confused. Currently my understanding of it is that we should use the formula (Vmax-Vmin)/2^n where n is the amount of bits used.

However, using the example of Vmax=5, Vmin=0 and n=3, we would get 625mV as my step size and this is where I'm confused. If 000=0V, then 001 would be 1*625mV=625mV, and so on. But at 111, it would be 7*625mV, which only be 4.375V. Shouldn't 111 be equals to approximately 5V in this case?

If I were to use the formula of (Vmax-Vmin)/2^n-1 instead, it feels like it makes more sense but information online is rather conflicting on this case.

## 1 Answer

Your example is correct. For a 3-bit DAC the maximum output voltage would be 4.375 V. For a simple ADC the output value changes from 110 to 111 when the input voltage exceeds 4.375 V.

This is just the way these converters work. For large values on $$\N\$$ (the number of bits) the difference between $$\2^N\$$ and $$\2^N-1\$$ does not limit the use of the converters in practice. Here is the formula provided in the datasheet for the Atmel ATMega 328, where $$\N = 10\$$:
{"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 1, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 4, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0}