How this calculation works
Use lower-inclusive uniform bins with a declared top-end convention. Decode shows a voltage interval and its center, not an exact recovered input. Exact decimal bin boundaries remain distinct even when a floating-point display would round them together.
Code width = (Vhigh − Vlow)/2^N; encode = clipped floor((Vin − Vlow)/width)A worked example
For 12 bits over 0–3.3 V, code width is 0.8056640625 mV. The declared floor-bin model maps 1.65 V to code 2048, whose bin-center representative is 1.65040283203125 V.
Good to know
An explicit ideal teaching quantizer, not a particular device transfer-function or accuracy promise. No noise, reference error, gain/offset, INL/DNL or sample-rate model. Real device transition conventions can differ.
Reference: Reference: model definitions and scope (opens in a new tab) ↗
There are more bins than differences between the end codes
A 12-bit unsigned code has 4,096 possible values, from 0 through 4,095. This declared uniform-bin model divides the full 0–3.3 V range into 4,096 widths, giving 0.8056640625 mV per bin. Dividing by 4,095 would describe a different endpoint-mapping convention.
The supplied 1.65 V lies on the lower boundary of code 2,048 in this model. Its bin center is 1.65040283203125 V, with an upper boundary of 1.6508056640625 V. Many analog values correspond to the same code; decoding cannot recover which one was originally present.
The loaded voltage divider calculator addresses one ideal resistive front end. This quantizer does not infer an actual converter input impedance or acquisition behavior.
Clipping and quantization error are different effects
Bins include their lower boundary and exclude their upper boundary, except the last accepts the upper range endpoint. An exact 3.3 V input therefore maps to the maximum code. An input above 3.3 V is explicitly labeled clipped, even though it produces that same code.
A bin-center representative differs from an in-range input by at most half the declared width under this convention. That bound does not apply to an out-of-range input that has been clipped. The center-minus-entered-voltage result retains the signed difference instead of pretending clipping is only a small quantization error.
Resolution and a defined code convention are not device accuracy
The voltage boundaries are retained as decimal values so high-resolution narrow-range bins can remain distinct. The bit count alone does not include reference accuracy, offset, gain error, noise, INL/DNL, conversion speed or an actual device’s transition convention.
The loaded voltage divider calculator addresses a separate ideal resistive front end. An ADC input can have dynamic loading and acquisition behavior that neither simplified page validates. Use this tool to explore its stated quantizer model, and identify the actual data-sheet convention before comparing it with a particular converter.
A few questions, answered
Why does code width use 2^N rather than 2^N−1?
This explicitly declared model has 2^N equal bins across the full range. The highest unsigned code is 2^N−1, which is a different count.
Is a decoded voltage exact?
No. Decode reports a bin and its center representative, not the unique original input.
What happens above or below the range?
The encoded result is clipped to an endpoint code and the range status says so.
Does this reproduce every ADC or DAC?
No. Real device transition, error and endpoint conventions can differ from this teaching model.