DAC Resolution Calculator Formula
Understand the math behind the dac resolution calculator. Each variable explained with a worked example.
Formulas Used
Output Voltage
output_voltage = digital_code * step_sizeStep Size (1 LSB)
step_mv = step_size * 1000Total Output Levels
total_levels = pow(2, dac_bits)Maximum Output
max_output = max_code * step_sizeVariables
| Variable | Description | Default |
|---|---|---|
dac_bits | DAC Resolution (bits) | 10 |
v_ref | Reference Voltage(V) | 5 |
digital_code | Digital Input Code | 512 |
max_code | Derived value= pow(2, dac_bits) - 1 | calculated |
step_size | Derived value= v_ref / pow(2, dac_bits) | calculated |
How It Works
DAC Resolution and Output
A DAC converts a digital code to a proportional analog voltage. The resolution determines the smallest voltage step.
Formulas
Step Size = V_ref / 2^N
V_out = Digital Code x Step Size
Max Output = (2^N - 1) x Step Size
The output is always one step size less than V_ref because the code range is 0 to 2^N - 1.
Worked Example
10-bit DAC with 5.0 V reference, digital code 512.
dac_bits = 10v_ref = 5digital_code = 512
- 01Step size: 5.0 / 1024 = 4.883 mV
- 02Output: 512 x 0.004883 = 2.5000 V
- 03Max output: 1023 x 0.004883 = 4.9951 V
- 04Total levels: 1024
Ready to run the numbers?
Open DAC Resolution Calculator