What is Missing code?

A defect in which an ADC never outputs a particular code no matter how the input varies. It occurs when DNL reaches −1 LSB.

Field: A/D and D/A conversion

Japanese name: ミッシングコード

How a code disappears

An ADC divides its input range into code bins separated by transition voltages. Ideally every bin is exactly 1 LSB wide. Differential nonlinearity (DNL) is each bin's actual width minus 1 LSB: a bin 1.5 LSB wide has DNL = +0.5 LSB. When DNL reaches −1 LSB the bin has zero width; its two transitions coincide and no input voltage produces it. That is a missing code. Because the bin widths must add up to the full range, a missing code is often accompanied by a neighboring code that is too wide.

Why it happens

Missing codes usually appear at major carry transitions, where many bits change at once, such as from 0111…1 to 1000…0. In a SAR (successive-approximation register) ADC, the internal capacitive DAC (digital-to-analog converter) sets the decision levels; if an upper-bit weight is slightly too small compared with the sum of the lower bits, the code just below that transition can vanish, while an oversized weight creates an extra-wide code instead. Pipeline and subranging ADCs are vulnerable to comparator offsets between stages, which is why they add redundancy and digital error correction to guarantee no missing codes.

Testing and datasheet specs

Missing codes are found with a histogram test: a slow ramp or a sine wave is applied, many samples are collected, and the number of hits per code is counted. With a ramp, each code's count is proportional to its width; with a sine the counts are corrected for the sine's amplitude distribution. A code with zero hits is missing. Datasheets state a resolution with guaranteed no missing codes, for example 16-bit output with no missing codes at 16 or perhaps 15 bits, which is equivalent to guaranteeing DNL greater than −1 LSB at that resolution.

Missing codes vs. INL and DAC monotonicity

Integral nonlinearity (INL) is the deviation of the transfer curve from an ideal straight line, which equals the DNL accumulated up to each code; an ADC can have several LSB of INL and still produce every code, so INL does not directly determine missing codes. In a DAC the analogous concern is monotonicity: if DNL stays above −1 LSB, the output never decreases when the code increases. Missing codes matter most in control loops, where a skipped code acts as a sudden jump in loop gain that can cause limit cycling, and in measurement systems that build histograms of codes.

Try it: questions about Missing code

Which correctly describes the differential nonlinearity (DNL) of an ADC?

  1. AError in the slope (gain) of the overall transfer characteristic
  2. BDeviation of the width (step size) between adjacent codes from the ideal 1 LSB
  3. CDeviation of the output when the input is 0
Show answer and explanation

Answer: B. Deviation of the width (step size) between adjacent codes from the ideal 1 LSB

DNL measures how far each code's input width (step width) deviates from the ideal 1 LSB; a width of 1.5 LSB means DNL = +0.5 LSB. At −1 LSB a code disappears (a missing code), and beyond +1 LSB the effective resolution degrades. Deviation of the whole transfer curve from the ideal line is integral nonlinearity (INL), and the output deviation at zero input is offset error.

What is the ADC defect called in which a certain output code never appears no matter how the input changes?

  1. AMissing code
  2. BAliasing
  3. CGlitch
Show answer and explanation

Answer: A. Missing code

A code whose DNL reaches −1 LSB has no input width and never appears at the output—a missing code. For example, if an upper-bit weight in a SAR ADC's internal DAC is too small, codes can be skipped. This is critical for control systems or histogram-based measurements, so datasheets state the resolution guaranteed to have "no missing codes."

FAQ

What does 'no missing codes' mean on an ADC datasheet?

It guarantees that every output code occurs for some input voltage at the stated resolution, which is equivalent to DNL staying greater than −1 LSB.

Can INL cause missing codes?

Not directly. INL is the deviation from a straight line (accumulated DNL), while missing codes come from a single code bin shrinking to zero width, which is a DNL condition.

How do you test an ADC for missing codes?

Apply a slow ramp or a sine wave, collect a large number of samples, and build a histogram of output codes; any code with zero occurrences is missing.

Questions that mention Missing code (1)

Missing code appears in 3 practice questions across 2 topics, including A/D and D/A conversion, How to read datasheets.

  1. Which condition is most closely related to the "no missing codes" guarantee in an A/D converter datasheet?

Books on A/D and D/A conversion Ad

Learn hands-on: parts and kits

Building real circuits is a good way to check what you learned in the questions.

As an Amazon Associate I earn from qualifying purchases.

This page was drafted with AI and fact-checked by a separate AI review before publication. Our Editorial policy explains how we write and check content. If you spot an error, please tell us on our Contact page.

Back to the glossary