Description
For signed code limits -2^(bits - 1) through 2^(bits - 1) - 1, return distances from the lower and upper limits as negativeHeadroom and positiveHeadroom.
Ideal ADC and DAC models connect digital codes to a reference span and quantization step. Coding, endpoint conventions, and reference behavior determine the meaning of a code-domain term.
For signed code limits -2^(bits - 1) through 2^(bits - 1) - 1, return distances from the lower and upper limits as negativeHeadroom and positiveHeadroom.
When to use this tool
Use ADC Signed Differential Full Scale Gap when you need one explicit converter coding, resolution, or analog-model term.
How to use the tool and how it works
- Enter bits, code. Use the units and conventions below.
- Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
- Read negativeHeadroom, positiveHeadroom. Use the output convention below.
For signed code limits -2^(bits - 1) through 2^(bits - 1) - 1, return distances from the lower and upper limits as negativeHeadroom and positiveHeadroom.1
| Input field | Meaning and units | Accepted input |
|---|---|---|
| bits | Bits | Required. Safe integer; minimum 2; maximum 32. |
| code | Code | Required. Safe integer. |
| Output field | Interpretation | Returned shape |
|---|---|---|
| negativeHeadroom | Negative Headroom | Required. Finite number. |
| positiveHeadroom | Positive Headroom | Required. Finite number. |
{
"input": {
"bits": 8,
"code": -128
},
"output": {
"negativeHeadroom": 0,
"positiveHeadroom": 255
}
} Limitations and assumptions
- Headroom is measured in code steps, without conversion to voltage or analog overload assessment.
- Inputs must satisfy both the field types and the cross-field conditions above. Invalid input causes an error; a successful false flag or documented placeholder is a different result.
- Numeric calculations use binary floating point unless exact decimal-integer arithmetic is explicitly stated. No hidden measurement tolerance or decimal rounding is added; nonfinite or out-of-contract results are rejected. Numeric signed-zero results are exported as zero.
Alternative or Complementary methods
Compare the ideal term with device transfer curves, noise, calibration, and acquisition requirements.
References
Similar or alternative tools
- Microcontroller: ADC Differential Midcode Offset
Subtract 2^(bits - 1) from offsetBinaryCode for signedCode, with code bounded by the selected 1-24-bit width.
- Microcontroller: ADC Code Bin Midpoint
Use referenceVoltage / 2^bits for unipolar bin width or twice that value for twos-complement-bipolar.