Digital Electronics / Converters

Analog to Digital and Digital to Analog Converters

Learn how real-world analog signals enter digital systems through ADCs and how digital codes return to physical voltages or currents through DACs.

Introduction

An ADC converts a continuous analog signal into a digital number. A DAC converts a digital number into an analog voltage or current.

These converters are the bridge between the physical world and digital processing. Without them, microphones, sensors, medical instruments, motor drives, communication receivers, and embedded systems cannot interact meaningfully with real signals.

Why This Topic Matters

  • Industry relevance: converters are used in smartphones, oscilloscopes, audio systems, radar, IoT sensors, PLCs, and software-defined radios.
  • Signal relevance: ADCs decide how accurately amplitude and time information are captured; DACs decide how cleanly digital data becomes an analog waveform.
  • Exam relevance: GATE and university exams frequently ask resolution, step size, quantization error, conversion time, and ADC/DAC architecture comparison.
  • Interview relevance: good answers explain sampling, quantization, reference voltage, and trade-offs between speed, accuracy, and complexity.

Prerequisites

  • Binary numbers and weighted bits
  • Operational amplifier basics
  • Comparators and reference voltage
  • Sampling theorem and aliasing idea
  • RC charging and settling time
  • Basic error and percentage calculation

Basic Intuition

Imagine measuring water level with a ruler. The actual water level is continuous, but the ruler gives the nearest mark. ADCs do the same with voltage: they divide the input range into small levels and report the nearest digital code.

A DAC works in the reverse direction. It takes binary bits and uses them as weighted contributions. The most significant bit contributes the largest voltage or current; the least significant bit contributes the smallest step.

ADC: voltage to number. DAC: number to voltage. Resolution decides how fine the steps are.

Core Theory Explanation

1. Sampling

Sampling captures the value of an analog signal at discrete time instants. If the signal changes too fast compared with sampling frequency, different signals may appear identical after sampling. This is aliasing.

2. Quantization

Quantization maps a sampled voltage to one among a finite number of allowed levels. More bits mean more levels, smaller step size, and smaller quantization error.

3. Encoding

After quantization, the selected level is represented as a binary code. For an n-bit ADC, there are $$ 2^n $$ possible codes.

4. DAC Reconstruction

A DAC uses weighted resistors, current sources, or an R-2R ladder to generate an analog value proportional to the digital input code. The output is usually a staircase approximation and may be filtered for smoothness.

Step-by-Step Mathematical Derivation

1. Number of Levels

An n-bit converter has n binary decisions. Therefore total available codes are:

$$ L=2^n $$

Each extra bit doubles the number of representable amplitude levels.

2. Resolution or Step Size

For an ideal unipolar converter from 0 to $$ V_{ref} $$:

$$ \Delta = \frac{V_{ref}}{2^n} $$

Here $$ \Delta $$ is the smallest output change of a DAC or the voltage width represented by one ADC code.

3. Quantization Error

Because ADC output must choose the nearest level, maximum ideal quantization error is:

$$ e_q = \pm \frac{\Delta}{2} $$

This means the digital value can be off by at most half a step for ideal rounding.

4. DAC Output

For a unipolar n-bit DAC with decimal input code D:

$$ V_o = \frac{D}{2^n}V_{ref} $$

The digital code behaves like a fraction of full-scale reference voltage.

Working Principle

  1. ADC input signal is first sampled and held so the voltage stays stable during conversion.
  2. The converter compares the held voltage with internally generated reference levels.
  3. The closest level is selected and represented by an n-bit binary code.
  4. In a DAC, each input bit controls a weighted resistor, switch, or current source.
  5. The weighted contributions add together to produce an analog output proportional to the code.
  6. A reconstruction filter may smooth DAC staircase output when a continuous waveform is required.

Diagram Explanation

Animated working: analog signal, ADC code, DAC reconstructionSampling captures voltage; quantization assigns a code; DAC converts weighted bits back into a staircase voltage.Analog inputADCsample + quantizeDigital code101DACstaircase output
ADC Block Diagram Here
R-2R Ladder DAC Circuit Diagram Here
Sampling and Quantization Waveform Here
SAR ADC Signal Flow Diagram Here

Important Formulas

Number of levels

$$ L=2^n $$

An n-bit converter divides the input or output range into $$ 2^n $$ digital codes.

Resolution

$$ \Delta=\frac{V_{ref}}{2^n} $$

Smallest ideal voltage step for a unipolar converter. Higher n means finer voltage distinction.

Quantization error

$$ e_q=\pm\frac{\Delta}{2} $$

Maximum rounding error for an ideal ADC using nearest-level quantization.

DAC output

$$ V_o=\frac{D}{2^n}V_{ref} $$

D is the decimal value of the binary input. Output is proportional to D.

Sampling condition

$$ f_s\ge 2f_m $$

Sampling frequency must be at least twice the highest signal frequency to avoid aliasing for bandlimited signals.

SAR conversion time

$$ T_c=nT_{clk} $$

A SAR ADC makes one binary decision per bit, so conversion time scales with number of bits.

Real-World Applications

  • Microcontroller sensor measurement
  • Digital audio recording and playback
  • Oscilloscopes and data acquisition systems
  • Software-defined radio and communication receivers
  • Motor control and industrial automation
  • Medical instruments such as ECG and ultrasound systems
  • Digital power supplies and feedback control
  • Image sensors and instrumentation systems

Solved Examples

Beginner Example

Find the number of levels for an 8-bit ADC.

$$ L=2^8=256 $$ levels.

Intermediate Numerical

A 10-bit ADC has $$ V_{ref}=5V $$. Find resolution.

$$ \Delta=\frac{5}{2^{10}}=\frac{5}{1024}=4.88mV $$

The ADC cannot distinguish ideal voltage changes smaller than one step.

Advanced Problem

A 12-bit DAC has $$ V_{ref}=3.3V $$ and input code $$ D=2048 $$. Find ideal output.

$$ V_o=\frac{2048}{4096}\times3.3=1.65V $$

Half-scale code gives half of the reference voltage in an ideal unipolar DAC.

Common Mistakes

  • Using $$ 2^n-1 $$ in every resolution formula without checking the convention used in the question.
  • Confusing sampling with quantization. Sampling is time discretization; quantization is amplitude discretization.
  • Ignoring anti-aliasing filters before ADC input.
  • Thinking higher resolution automatically means faster conversion. Usually speed and accuracy trade off.
  • Forgetting that DAC output needs settling time before it reaches final accuracy.
  • Mixing LSB size with full-scale output voltage.

Comparison Tables

ConverterSpeedAccuracyTypical Use
Flash ADCVery highLow to mediumHigh-speed instruments
SAR ADCMedium to highGoodMicrocontrollers and data acquisition
Dual-slope ADCSlowExcellent noise rejectionDigital multimeters
R-2R DACFastDepends on resistor matchingGeneral-purpose analog output

Interview Questions

  • What is the difference between sampling and quantization?
  • Why is a sample-and-hold circuit required in many ADCs?
  • Why is flash ADC fastest but hardware-heavy?
  • How does a SAR ADC search for the digital code?
  • Why is R-2R ladder preferred over binary weighted resistor DAC for larger bit counts?
  • What is quantization noise?
  • What decides DAC settling time?

Exam-Oriented Notes

  • Flash ADC needs $$ 2^n-1 $$ comparators.
  • SAR ADC conversion time is approximately proportional to number of bits.
  • Dual-slope ADC is slow but has strong noise rejection, especially for power-line interference.
  • Resolution improves by a factor of 2 for every extra bit.
  • Always identify whether the problem uses full-scale divided by $$ 2^n $$ or $$ 2^n-1 $$ convention.

Revision Summary

  • ADC converts analog voltage into digital code; DAC converts digital code into analog voltage or current.
  • Sampling discretizes time; quantization discretizes amplitude.
  • More bits mean more levels and smaller LSB size.
  • SAR ADC balances speed, area, and accuracy; flash ADC is fastest; dual-slope ADC is precise but slow.
  • Key formulas: $$ L=2^n $$, $$ \Delta=V_{ref}/2^n $$, $$ e_q=\pm\Delta/2 $$.

Practice Questions

Conceptual

  • Explain ADC operation using sampling, quantization, and encoding.
  • Why does an R-2R ladder DAC use only two resistor values?
  • Why is anti-aliasing filtering needed before ADC input?

Numerical

  • Find resolution of an 8-bit ADC with $$ V_{ref}=2.56V $$.
  • Find ideal DAC output for $$ D=128 $$, 8-bit DAC, and $$ V_{ref}=5V $$.
  • How many comparators are needed for a 6-bit flash ADC?

MCQs

  • Which ADC is fastest: flash, SAR, or dual-slope?
  • Quantization error is approximately bounded by LSB, half LSB, or two LSB?
  • Which converter changes binary code into analog voltage?