Works on this device
DAC Resolution Calculator
The resolution of a digital-to-analog converter (DAC) is the size of its smallest output step, one LSB. This calculator works it out from the number of bits and the reference voltages, turns a code into the output voltage and a wanted voltage into a code, and finds the bits you need.
Enter your values
Check these values
Your values are worked out in this browser. They are not sent to a server.
Your result will show here
Fill in the values, then choose Calculate.
Your result
How it was worked out
How to use this calculator
- Choose what you want: the step size, the output for a code, the code for a voltage, or the bits you need.
- Enter the number of bits and the output range. For 0 to 5 V, the top is 5 and the bottom 0. For −10 V to +10 V, the top is 10 and the bottom −10.
- For a code, type a whole number (2048), a hexadecimal pattern (0x800) or a binary pattern (0b100000000000), and choose straight binary or two's complement.
- Under More options, choose the step size: range ÷ 2^N (the usual definition) or range ÷ (2^N − 1).
The formulas
- Step size: LSB = (top − bottom) ÷ 2^N. Some data sheets and texts use (top − bottom) ÷ (2^N − 1), so that the highest code gives the top of the range. The tool uses the same two rules as the Adc Resolution Calculator.
- Output for a code: V = bottom + k × LSB, where k is the step number from the bottom. For two's complement, k = code + 2^(N−1).
- Code for a voltage: k = (V − bottom) ÷ LSB, rounded to the nearest whole number, or rounded down so that the output never goes above the voltage you want.
- Bits needed: N = log2(range ÷ LSB), taken up to a whole number.
- Ideal SNR of a full-scale sine wave: 6.02 × N + 1.76 dB.
Worked examples
12 bits, 0 to 5 V: LSB = 5 ÷ 4096 = 1.2207 mV. The highest code, 4095, gives 4.99878 V, and code 2048 gives 2.5 V.
1.8 V from the same DAC: 1.8 ÷ 1.2207 mV = 1474.56, so the nearest code is 1475 (0x5C3). It gives 1.800537 V, which is 0.537 mV too high.
Bits for a 1 mV step over 5 V: log2(5 ÷ 0.001) = 12.29, so 13 bits.
Limits you should know
- The DAC is ideal: equal steps, no offset, gain error or nonlinearity, no noise and no settling time. A real DAC can be off by several LSB; its data sheet says by how much.
- If the DAC has an output amplifier, type the range at the output pin, for example a 2.048 V reference with a gain of 2 gives 0 to 4.096 V.
- For converters that go the other way, use the Adc Voltage Calculator.