Introduction to the World of Analogue-to-Digital Conversion

ADC

Shraga Kraus

Analogue and Mixed Signal Haifa Research Laboratory Contents

• Introduction to A/D Conversion • Building Blocks • Basic Architectures • More Advanced Architectures • The ΔΣ Architecture

©2016 Copyright Shraga Kraus «2» Contents

• Introduction to A/D Conversion • Building Blocks • Basic Architectures • More Advanced Architectures • The ΔΣ Architecture

©2016 Copyright Shraga Kraus «3» Introduction to A/D Conversion

©2016 Copyright Shraga Kraus «4» Types of Signals

• Analogue signal: – Continuous in time – Continuous in value (within its range of existence)

• Digital signal: – Discrete in time – Discrete in value

©2016 Copyright Shraga Kraus «5» The Two Conversions

• Conversion 1: Sampling – Continuous time  discrete time – Creates aliasing

• Conversion 2: Quantisation – Continuous value  discrete value – Creates quantisation

©2016 Copyright Shraga Kraus «6» Sampling

• Sampling = multiplication by an impulse train • Y(t) = X(t) · S(t)

• Ts = sampling interval

• fs = 1/Ts = sampling frequency

Ts

t

©2016 Copyright Shraga Kraus «7» Sampling in the Frequency Domain

• In the frequency domain: • Y(f) = X(f) * S(f)

• “Aliasing” is evident

©2016 Copyright Shraga Kraus «8» Over/Under Sampling

• Nyquist sampling:

• Over- sampling:

• Under- sampling:

©2016 Copyright Shraga Kraus «9» Information at the Output

• Nyquist sampling:

–fs –fs/2 0 fs/2 fs • Over- sampling:

–fs –fs/2 0 fs/2 fs • Under- sampling:

–fs –fs/2 0 fs/2 fs

©2016 Copyright Shraga Kraus «10» “Folding” the Frequency Axis

©2016 Copyright Shraga Kraus «11» Finding the Final Frequency

©2016 Copyright Shraga Kraus «12» Example 1: f = 13 MHz

• fs = 20 MHz • ADC’s output contains information up to 10 MHz • 13 MHz folds to 7 MHz

©2016 Copyright Shraga Kraus «13» Example 2: f = 23 MHz

• fs = 20 MHz • ADC’s output contains information up to 10 MHz • 23 MHz folds to 3 MHz

©2016 Copyright Shraga Kraus «14» Anti-Aliasing Filter

• Never use your ADC at full Nyquist

• A rule of These interferers can thumb: be removed digitally over sampling ratio (OSR) of 2 is minimal

©2016 Copyright Shraga Kraus «15» Quantisation

• Δ = LSB • m = number of bits 7 • Full scale 6 A amplitude: 5 4 2m 0 3 A  2 2 1 Δ 0

©2016 Copyright Shraga Kraus «16» Quantisation Error

• If the input signal is not synchronised with the sampling clock, the error is uniformly distributed between –Δ/2 and +Δ/2

t

©2016 Copyright Shraga Kraus «17» ADC model

• In this case, the ADC is modelled as a linear system with noise • The noise comes from the quantisation process

• If we refer the noise to the input: • At every sampling moment a small noise is added to the input signal, bringing it to the centre of the quantisation range

©2016 Copyright Shraga Kraus «18» A Test Case: Continuous-Wave

• The input signal a sinusoidal wave not synchronised with the sampling clock, with a full-scale amplitude • Quantisation error distribution is:

Fqn 1/Δ

x –Δ/2 0 +Δ/2

©2016 Copyright Shraga Kraus «19» Signal and Noise Power

• Signal power:

m 2 12 1 2 2 2m 3 PAsig      2 2 2 2

• Quantisation noise power:

  221 1 1 32 P F x x22 dx  x dx     qn qn     3 4 12 22

©2016 Copyright Shraga Kraus «20» Signal and Noise Power

• SNR: P 223 2m 3 SNR sig   22m P 2 2 qn 12

SNRdB 10log10  SNR  6.02 m  1.76

(ENOB):

SNR 1.76 ENOB  dB 6.02

©2016 Copyright Shraga Kraus «21» Practical ENOB

• In practice, another noise mechanisms exist in the ADC • Thermal / • Nonlinearity (not strictly a noise, but contributes to non-signal power) • To get the practical resolution of an ADC, the signal to noise-and- ratio (SNDR) should be derived

©2016 Copyright Shraga Kraus «22» Derivation of ENOB

• For a given SNDR of an ADC, the effective resolution is:

푆푁퐷푅 − 1.76 퐸푁푂퐵 = 푑퐵 6.02 • The above is valid for a full-scale sinusoidal continuous wave input • This test setup is feasible using standard lab equipment

©2016 Copyright Shraga Kraus «23» Simulation Example

• Simulation of an ideal 7-bit ADC

Quantisation noise is approximately Quantisation noise white is

(as expected 2 ∆ from a unifor- 12 mly distributed 푓푠 noise) 2

• SNR = 43.8 dB  ENOB = 7

©2016 Copyright Shraga Kraus «24» Simulation Example - Oversampling

• Out-of-band noise is filtered out digitally

푆푁퐷푅 − 1.76 퐸푁푂퐵 = 푑퐵 6.02

• OSR = 2  SNR x2 (+3dB)  ENOB += ½

©2016 Copyright Shraga Kraus «25» What is ½ Bit?

• 6½ decimal digits = 106.5 levels

• 7½ bits (binary digits) = 27.5 levels

©2016 Copyright Shraga Kraus «26» Integral Nonlinearity

INL is the horizontal distance between the actual and ideal curves. output code Usually expressed in units of Δ. 7 6 5 4 3 2 1

0 Vin 0 Vref

©2016 Copyright Shraga Kraus «27» Differential Nonlinearity

DNL is the difference between the actual and ideal step widths. output code Usually expressed in units of Δ. 7 6 5 4 3 2 1

0 Vin 0 Vref

©2016 Copyright Shraga Kraus «28» Nonlinearity Information

• INL and DNL provide a lot of information on what’s going on inside the ADC

• Analysis of the data depends on the structure of the specific ADC being tested

©2016 Copyright Shraga Kraus «29» Clock

• Jitter = the time domain equivalent of • Clock jitter = changes in clock period • Deterministic / random jitter

©2016 Copyright Shraga Kraus «30» Sampling With Clock Jitter

• Clock jitter results in sampling the wrong value

The higher the slope of the signal, the larger the error

©2016 Copyright Shraga Kraus «31» Effect of Clock Jitter

• fsig = input signal frequency

• Tj,RMS = random clock jitter RMS (in unit time)

• SNRj = SNR of an ADC as if clock jitter was the only noise source

1 푆푁푅푗 = 2휋 ∙ 푓푠푖푔 ∙ 푇푗,푅푀푆

©2016 Copyright Shraga Kraus «32» Meaning of Clock Jitter

• Clock jitter is painful in SNRj depends only on the input signal sampling of high frequency frequency, NOT sampling frequency! signals • No solution was found to date

1 푆푁푅푗 = 2휋 ∙ 푓푠푖푔 ∙ 푇푗,푅푀푆

©2016 Copyright Shraga Kraus «33» Lab Characterisation - SNR

Pure Sine

Signal Generator ADC

Signal Generator

©2016 Copyright Shraga Kraus «34» Lab Characterisation - SNDR

Dual Tone

Signal Generator ADC

Signal Generator SFDR

©2016 Copyright Shraga Kraus «35» Contents

• Introduction to A/D Conversion • Building Blocks • Basic Architectures • More Advanced Architectures • The ΔΣ Architecture

©2016 Copyright Shraga Kraus «36» Building Blocks

©2016 Copyright Shraga Kraus «37» Latched Comparator

• Differential pair – When CLK = ‘1’ the input difference is amplified

• Regenerative load (positive feedback) – When CLK = ‘0’ the amplified difference if further enhanced to the rails One of many topologies, from Wikipedia – Regardless of the inputs

©2016 Copyright Shraga Kraus «38» Comparator’s Nonidealities

• Offset – Originates from mismatch in the differential pair

• Noise – Like in every active circuit – The input-referred noise may result in incorrect decision for small input difference

©2016 Copyright Shraga Kraus «39» Comparator’s Nonidealities

• Regeneration Time – The smaller the input signal, the longer the regeneration is

• Metastability – Occurs when the regeneration is too long – Adding digital buffers at the output can reduce the probability of metastability

©2016 Copyright Shraga Kraus «40» Comparator’s Nonidealities

• Hysteresis – A result of residual charge somewhere in the load network – Some circuit techniques alleviate this effect

©2016 Copyright Shraga Kraus «41» Master-Slave Comparator

• Consists of two cascaded latched comparators • Reduces the probability of metastability • Has constant input-to-output delay • But – the delay is long (½ clock cycle)

inp outp inp outp

CK CK inn outn inn outn

©2016 Copyright Shraga Kraus «42» More Information

©2016 Copyright Shraga Kraus «43» Op Amp

• Serves in almost every type of ADC • Based on a differential pair at the input – except of low voltage technologies, but this makes no difference for our discussion

©2016 Copyright Shraga Kraus «44» Op Amp’s Nonidealities

• Offset – Originates from mismatch in the differential pair

• Noise – Like in every active circuit

• Finite Gain and Bandwidth – Feedback is imperfect, results in gain error

©2016 Copyright Shraga Kraus «45» Op Amp’s Nonidealities

• Inaccurate Gain – Due to either gain error or mismatch between the feedback devices

• Settling Time – May set a limit in several architectures

©2016 Copyright Shraga Kraus «46» More Information

©2016 Copyright Shraga Kraus «47» MOS Switch

NMOS

PMOS Both

• Switch resistance (“ON”) RSW depends on Vin

Vctrl = VDD ; Vctrl = 0 Both VGS = Vctrl – Vin Vin

©2016 Copyright Shraga Kraus «48» What’s the Problem With That?

• Nonlinear RSW results in a nonlinear voltage divider • Signal is distorted

©2016 Copyright Shraga Kraus «49» Parasitic Capacitances

• The gate overlaps with the areas of source and drain • In addition, the gate capacitance exists

COL G COL

S CG D

B

©2016 Copyright Shraga Kraus «50» Charge Injection

• When φ goes down, the charge in the channel is drained to both sides φ The path of the The voltage on charge depends CL changes! on the values of

VOL, CG, and tfall of the clock The exact amount of C charge is input Vin L dependent

©2016 Copyright Shraga Kraus «51» Bootstrapped Switch

• Keeps VGS constant • Usually incorporates a charge pump • May also include a sub circuit for alleviating charge injection effect

From P.E. Allen’s lecture notes, 2010 http://www.aicdesign.org/SC NOTES/2010notes/Lect2UP1 40_%28100325%29.pdf

©2016 Copyright Shraga Kraus «52» More Information

©2016 Copyright Shraga Kraus «53» Sample & Hold / Track & Hold

• Tracks the input signal when clock is low • Freezes (“holds”) the input value upon clock rising • Uses a capacitor to store the analogue φ information (voltage)

©2016 Copyright Shraga Kraus «54» S&H Nonidealities

• Charge injection by the switch • Leaky capacitor • Buffer’s nonidealities (including noise) • Total noise of the capacitor itself is 퐾푇 φ 푉2 퐶

©2016 Copyright Shraga Kraus «55» More Information

©2016 Copyright Shraga Kraus «56» Contents

• Introduction to A/D Conversion • Building Blocks • Basic Architectures • More Advanced Architectures • The ΔΣ Architecture

©2016 Copyright Shraga Kraus «57» Basic Architectures

©2016 Copyright Shraga Kraus «58» Flash ADC

Vin

VREF • Nº of comparators = 2m – 1 • Thermometer code output Thermo- meter Dout to <2:0> • Converted to binary by Binary a simple logic • Fastest topology

©2016 Copyright Shraga Kraus «59» Thermometer Code

• Like a bar graph indicator • The represented decimal number is the number of ‘1’s. 01 01 01 01 01 01 012345678 01 01

©2016 Copyright Shraga Kraus «60» Limitations of the Flash ADC

Vin

VREF • Many comparators – area, power • Resistor matching – area Thermo- meter Dout to <2:0> • Input capacitance Binary – requires a buffer • Comparators’ offset – Can generate bubbles

©2016 Copyright Shraga Kraus «61» Nonlinearity of the Flash ADC

Vin

VREF • Input buffer • Resistor mismatch • Comparators’ offset Thermo- • Clock/Vin skew meter Dout to <2:0> or Binary input S&H

©2016 Copyright Shraga Kraus «62» Folding ADC

• Nº of comparators = 2m/2 + 1 – 2 • Reduces area and power significantly – Compared to flash vout

• In the blue zones, VREF zeros should be counted rather than ones (in ) vin VREF

©2016 Copyright Shraga Kraus «63» Numerical Example

• Consider an 8-bit ADC:

• A flash ADC requires 28 – 1 = 255 comparators

• A folding ADC, with 4-4 structure, requires 2 · (24 – 1) = 30 comparators

©2016 Copyright Shraga Kraus «64» Limitations of the Folding ADC

• Same as flash: the MSB flash, , must be as accurate as the LSB (Δ) – Resistor matching – Comparators’ offset • The folding amplifier, , must be as accurate as the LSB (Δ) – Transistor matching

©2016 Copyright Shraga Kraus «65» Limitations of the Folding ADC

• The folding amplifier introduces a delay and results in skew between the two flash ADCs – Significant at high frequencies – Requires introduction of a S&H at the input

©2016 Copyright Shraga Kraus «66» Nonlinearity of the Folding ADC

• Nonlinearity of the flash ADCs – In particular • Nonlinearity of the folding amplifier • Clock/Vin skew between the two flashes or input S&H

©2016 Copyright Shraga Kraus «67» Single Slope ADC

S&H

vslope Stop!Start! VREF v • Comparator’s• Counter resetoutput to flips0 in • Counterand starts stops counting t • Slope initiates

©2016 Copyright Shraga Kraus «68» Limitations of the Single Slope ADC

• The slope must be calibrated – Its exact slope is unknown

• The comparator makes a decision around Vin, not around a constant voltage

– If the comparator’s offset is constant for every Vin, this only shifts the range of voltages being quantised

– If the comparator’s offset changes with Vin, this results in nonlinearity

©2016 Copyright Shraga Kraus «69» Limitations of the Single Slope ADC

• The S&H has its own nonidealities • The slope can be nonlinear • Incomplete capacitor discharge (“memory effect”) • It’s Slooooooooooow – 2m clock cycles / conversion

©2016 Copyright Shraga Kraus «70» Single Slope ADC in Digital Cameras

• A line of ADCs samples a line of pixels simultaneously • To implement the line: – One slope for the entire line – One counter for the entire line or a counter for each ADC – A S&H, a comparator and a register for each ADC – Most CCDs do not require a S&H, though.

©2016 Copyright Shraga Kraus «71» More Information

©2016 Copyright Shraga Kraus «72» Contents

• Introduction to A/D Conversion • Building Blocks • Basic Architectures • More Advanced Architectures • The ΔΣ Architecture

©2016 Copyright Shraga Kraus «73» More Advanced Architectures

©2016 Copyright Shraga Kraus «74» The Pipeline ADC

• Starts from the MSB • Then moves on to the next stage – to extract the next bit • Meanwhile, the first stage treats the next sample

©2016 Copyright Shraga Kraus «75» Principle of Operation

1. Decide about the MSB 2. According to the decision – magnify the appropriate range (2x, shift to centre) 3. Decide about the next bit; go to 2

©2016 Copyright Shraga Kraus «76» Example

–VREF/2 then C C x2 C 2 x2 1 0

‘1’ ‘0’ ‘1’

©2016 Copyright Shraga Kraus «77» Implementation

• Implemented in switched-capacitor technique • A single-stage DAC + 2x amplifier (MDAC):

Value of VREF is set according to the decision of the previous Josh comparatorCarnes and Un-Ku Moon, “The effect of switch resistance on pipelined ADC MDAC settling time”, Proc. ISCAS 2006

©2016 Copyright Shraga Kraus «78» How a Multiplying-DAC Works

• During φ12: 푉표푢푡 = 2푉푖푛 − 푉푅퐸퐹

©2016 Copyright Shraga Kraus «79» Offset in the First Comparator

–VREF/2 then C C x2 C 2 x2 1 0

Should be ‘0’!

‘1’ ‘0’ ‘0’

©2016 Copyright Shraga Kraus «80» Limitations of the Pipeline ADC

• Sensitive to comparator’s offset – Solved by redundancy (next slide) • Sensitive to op amp’s offset – Solved by correlated double sampling (CDS) • Charge injection from the switches – Solved by bottom plate sampling • Gain must be exactly 2x – Limited by capacitor mismatch & op amp’s gain • Op amp’s DC gain must be high – To reduce gain error

©2016 Copyright Shraga Kraus «81» Redundancy – 1½ Bits Per Stage

–VREF/2 then C2B x2 C1B –VREF/4 then C0 C2A C1A x2

We’re in the lower part ‘11’ of the 3 upper values ‘01’ ‘0’  D<2:0> = ‘101

MSB = ‘1’ B1 = ? Now we have all for sure We’ll decide the information later on for making a decision

©2016 Copyright Shraga Kraus «82» If a Comparator Has Offset

–VREF/2 then C2B x2 C1B C C0 C 1A 2A x2

‘10’ ‘00’ ‘1’

MSB = ‘1’ B1 = ‘0’ LSB = ‘1’ for sure for sure for sure

©2016 Copyright Shraga Kraus «83» Limitations of the Pipeline ADC

• Sensitive to comparator’s offset – Solved by redundancy • Sensitive to op amp’s offset – Solved by correlated double sampling (CDS) • Charge injection from the switches – Solved by bottom plate sampling • Gain must be exactly 2x – Limited by capacitor mismatch & op amp’s gain • Op amp’s DC gain must be high – To reduce gain error

©2016 Copyright Shraga Kraus «84» Nonlinerity of the Pipeline ADC

• Gain is not exactly 2x – Capacitor mismatch – Low DC gain of the op amp (gain error) – Changes the slope of the transfer function

• Long settling time – Op amp should settle during a clock period

©2016 Copyright Shraga Kraus «85» Notes on the Pipeline ADC

• Nº of comparators = 2m (due to redundancy) • Nº of MDACs = m – 1 • 1 clock cycle / conversion • Propagation delay = m clock cycles • Requires descent op amps – Not trivial in contemporary CMOS technologies

©2016 Copyright Shraga Kraus «86» More Information

©2016 Copyright Shraga Kraus «87» The SAR ADC

• Based upon binary search (Successive Approximation Register) • SAR = ‘10000

• DAC > Vin ? • SAR = ‘C1000

• DAC > Vin ? • SAR = ‘CC100 • And so on…

From Wikipedia ©2016 Copyright Shraga Kraus «88» Capacitive SAR ADC

• Capacitors are charged to Vin • Charge is distributed 푆퐴푅 so that 푉 = 푉 ∙ − 푉 = 퐷퐴퐶 − 푉 − 푅퐸퐹 2푚 − 1 푖푛 푖푛

©2016 Copyright Shraga Kraus «89» Limitations of the SAR ADC

• Comparator’s offset – Solved by redundancy • Charge injection from the switches – The larger the capacitors, the smaller the effect but the slower the ADC is • Capacitor mismatch

• Low impedance sources of Vin end Vref are required

©2016 Copyright Shraga Kraus «90» Notes on the SAR ADC

• Only one comparator • m clock cycles / conversion – Quite slow • Exponentially scaled capacitors – A lot of area • No op amp (!!!) – Attractive for contemporary CMOS technologies – Low power

©2016 Copyright Shraga Kraus «91» More Information

©2016 Copyright Shraga Kraus «92» Contents

• Introduction to A/D Conversion • Building Blocks • Basic Architectures • More Advanced Architectures • The ΔΣ Architecture

©2016 Copyright Shraga Kraus «93» The ΔΣ Architecture

©2016 Copyright Shraga Kraus «94» The Concept of ΔΣ ADC

• Over sampling – Relatively high OSR • – Quantisation noise is attenuated at the frequencies of interest – It is amplified, on the other hand, at other frequencies • Feedback structure

©2016 Copyright Shraga Kraus «95» The 1st Order ΔΣ Modulator

• N = loop resolution [bits] • M = final resolution [bits] “Quantiser”

For the sake of clarity we will discuss

Loop Filter low pass ΔΣ ADC only

©2016 Copyright Shraga Kraus «96» Linear Model

Loop filter of a Quantisation • Linear Model: low pass ΔΣ noise of the quantiser

• Loop equation: 푌 = 푋푧−1 + 퐸 1 − 푧−1

©2016 Copyright Shraga Kraus «97» Linear Model

• Signal Transfer Function (STF): 푌 Delay 푆푇퐹 = = 푧−1 푋 퐸=0 • Noise Transfer Function (NTF): 푌 푁푇퐹 = = 1 − 푧−1 High pass filter 퐸 푋=0 • Substituting z = ej·2πf in NTF we get:

푁푇퐹 푓 2 = 2sin 휋푓 2 Indeed, a high pass filter f is normalized:

f / fs ©2016 Copyright Shraga Kraus «98» Noise Transfer Function

Quantisation noise is amplified at high frequencies

Quantisation noise is Quantisation attenuated at low noise of high frequencies frequencies can be filtered out digitally

©2016 Copyright Shraga Kraus «99» Example: Ideal 1st Order ΔΣ ADC

OSR = 16 The grey noise is filtered out digitally (decimation filter)

Here, where our signal resides, the quantisation noise is significantly attenuated

©2016 Copyright Shraga Kraus «100» Example: Discussion

• In a “standard” Nyquist ADC: – OSR = 16  ENOB += 2

• A 1-bit ADC with OSR = 16: – ENOB = 3

• A 1-bit 1st order ΔΣ ADC with OSR = 16: – ENOB = 6.4

©2016 Copyright Shraga Kraus «101» How Does It Work?

• Recall the scheme of a feedback system:

A

B • The closed loop gain is approximately 1/B – Every pole in B becomes a zero – Every zero in B becomes a pole

©2016 Copyright Shraga Kraus «102» How Does It Work?

• In the signal path, the loop filter serves as the amplifier, and there is unity feedback:

• The signal passes as is, with the integrator limiting its bandwidth

©2016 Copyright Shraga Kraus «103» How Does It Work?

• In the error path, the loop filter serves as the feedback, and there is a unity amplifier:

• The closed loop gain is a high pass filter

©2016 Copyright Shraga Kraus «104» The 2nd Order ΔΣ Modulator

• N = loop resolution [bits] • M = final resolution [bits]

Two feedback loops

©2016 Copyright Shraga Kraus «105» Linear Model

• Linear Model:

• Loop equation: 푌 = 푋푧−1 + 퐸 1 − 푧−1 2

©2016 Copyright Shraga Kraus «106» Linear Model

• Signal Transfer Function (STF): 푌 푆푇퐹 = = 푧−1 푋 퐸=0 • Noise Transfer Function (NTF): 푌 푁푇퐹 = = 1 − 푧−1 2 퐸 푋=0 • Substituting z = ej·2πf in NTF we get: 푁푇퐹 푓 2 = 2sin 휋푓 4

©2016 Copyright Shraga Kraus «107» Noise Transfer Function

Quantisation noise is OSR x 2  attenuated st stronger + 1.3 bit (1 order) + 1.7 bit (2nd order) + 1.9 bit (3rd order) + 2.1 bit (4th order)

©2016 Copyright Shraga Kraus «108» Higher Loop Orders

• Higher loop orders are possible. However: • Up to 2nd order the modulator is unconditionally stable – If the linear model shows that the modulator is stable, it will be stable for every input signal • From 3rd order and above the modulator is conditionally stable – Even if the linear model shows that the modulator is stable, it might become unstable for certain input signals

©2016 Copyright Shraga Kraus «109» More Information

©2016 Copyright Shraga Kraus «110» The Mother of All Rules of Thumb

Never do anything not understanding what you’re doing

©2016 Copyright Shraga Kraus «111» Thank You!

©2016 Copyright Shraga Kraus «112»