Science & engineering

ADC uniform code and quantization calculator

Explore an explicit unsigned uniform-bin model, clipping and the voltage interval represented by a code.

Your numbers

Calculated on your device. Your inputs aren’t sent to us.

Your result

Ready when you are

Enter your numbers and select Calculate.

Try it, understand it

Explore the result

Inspect the declared uniform-bin convention, including clipping and bin-center decoding.

Worked example comparison
ExampleOutputWhat to notice
Encode half the declared voltage rangeEncoded unsigned code2,0481.65 V maps to unsigned code 2,048 in the 12-bit 0–3.3 V model.
Inspect code 2,048Bin-center representative voltage1.65040283203125 VThe code represents a voltage interval whose center is 1.65040283203125 V, rather than a unique recovered input.
Enter a voltage above the declared rangeEncoded unsigned code4,0955 V clips to the maximum unsigned code and is flagged above range.

Check your understanding

Are there 4,095 or 4,096 bins at 12 bits?

There are 4,096 codes/bins in this declared model; 4,095 is the highest unsigned code.

Does the half-bin representative error bound cover clipped inputs?

No. An out-of-range input can be much farther from the endpoint-bin center.

Behind the numbers

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.

THE FORMULACode 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.

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.

Find your calculator

Start typing to explore the library.