Lecture 04: Analog/Digital Conversions

42
CENG 4480 Embedded System Development & Applications Lecture 04: Analog/Digital Conversions Bei Yu CSE Department, CUHK [email protected] (Latest update: October 6, 2021) Fall 2021

Transcript of Lecture 04: Analog/Digital Conversions

Page 1: Lecture 04: Analog/Digital Conversions

CENG 4480Embedded System Development & Applications

Lecture 04: Analog/Digital Conversions

Bei YuCSE Department, [email protected]

(Latest update: October 6, 2021)

Fall 2021

Page 2: Lecture 04: Analog/Digital Conversions

1 Preliminaries

2 Comparator

3 Digital to Analog Conversion (DAC)

4 Analog to Digital Conversion (ADC)

Overview

2/36

Page 3: Lecture 04: Analog/Digital Conversions

Preliminaries

Page 4: Lecture 04: Analog/Digital Conversions

Topics:• Digital to analog conversion

• Analog to digital conversion

• Sampling-speed limitation

• Frequency aliasing

• Practical ADCs of different speed

Analog/Digital Conversions

4/36

Page 5: Lecture 04: Analog/Digital Conversions

Block Diagrams

5/36

Page 6: Lecture 04: Analog/Digital Conversions

Comparator

Page 7: Lecture 04: Analog/Digital Conversions

Open-Loop Mode

vout = AV(v+ − v−)

• Extreme large gain

• Any small difference ε will cause large outputs.

Op-Amp Comparator

7/36

Page 8: Lecture 04: Analog/Digital Conversions

Op-amp output with voltage supply limit (V+S = V−

S = 15)

• Powered by external DC voltage supplies V+S & V−

S

• Amplifying signals only within the range of supply voltages

• In a practical op-amp, saturation would be reached at 1.5 V below the supply voltags.

Voltage Supply Limits

8/36

Page 9: Lecture 04: Analog/Digital Conversions

Switching waveforms of non-inverting comparator.

Since ε = Vcos(ωt), therefore

ε > 0⇒ vout = V+sat

ε < 0⇒ vout = V−sat

*Vsat: saturation voltage (e.g., ±15 V supplies is approximately ±13.5 V)

Switching waveforms by Comparator

9/36

Page 10: Lecture 04: Analog/Digital Conversions

-+vin vout

(a) Noninverting comparator

-+ vout

vin

(b) Inverting comparator

Noninverting & Inverting Comparator

10/36

Page 11: Lecture 04: Analog/Digital Conversions

• In the presence of noisy inputs

• Cross the reference voltage level repeatedly

• Cause multiple triggering

Limitation of Conventional Comparator

11/36

Page 12: Lecture 04: Analog/Digital Conversions

• Based on Inverting comparator

• Positive feedback

• (+) Increase the switching speed

• (+) Noise immunity

Schmitt Trigger

12/36

Page 13: Lecture 04: Analog/Digital Conversions

Question: prove two reference voltages of schmitt trigger.

13/36

Page 14: Lecture 04: Analog/Digital Conversions

Motivations:When a slow ADC is used to sample a fast changing signal only a short sampling pointcan be analyzed

• To resolve uncertainty during ADC

• “freeze” the value of analog waveform for a time sufficient for the ADC to completeits task

Sample-and-Hold Amplifier

14/36

Page 15: Lecture 04: Analog/Digital Conversions

• A MOSFET analog switch is used to “sample” analog waveform

• While MOSFET conducts, charge the “hold” capacitor

Sample-and-Hold Amplifier

15/36

Page 16: Lecture 04: Analog/Digital Conversions

• When sampling 6 times per cycle, close to the original.

• when sampling 3 times per cycle, less reliable but frequency is equal to original.

• When sampling 6 times per 5 cycles, frequency is different.

Good Sample, Bad Sample

16/36

Page 17: Lecture 04: Analog/Digital Conversions

Digital to Analog Conversion(DAC)

Page 18: Lecture 04: Analog/Digital Conversions

DAC

Input code(n bit Binary code)0110001010001001001000101011::

Output voltage = Vout(n) V+ref ( High Reference Voltage)

V-ref (Low Reference Voltage)

Vout = (b3b2b1b0)2

= (b3 · 23 + b2 · 22 + b1 · 21 + b0 · 20)10

= (8b3 + 4b2 + 2b1 + b0)∆v + V−ref

∆v: smallest step size by which voltage can increase

Digital-to-Analog Converter (DAC)

18/36

Page 19: Lecture 04: Analog/Digital Conversions

DAC

Input code(n bit Binary code)0110001010001001001000101011::

Output voltage = Vout(n) V+ref ( High Reference Voltage)

V-ref (Low Reference Voltage)

DV

V-ref

DAC output V+ref

Code (n)

∆v =V+ref − V−ref

2n ,

where n is the bit# of input digital signal.

How to Determine ∆v?

19/36

Page 20: Lecture 04: Analog/Digital Conversions

Glitch:A transient spike in the output of a DAC that occurs when more than one bit changes inthe input code.

• Use a low pass filter to reduce the glitch

• Use sample-and-hold circuit to reduce the glitch

Settling time:

Time for the output to settle to typically 1/4 LSB after a change in DA output.

DAC Characteristics

20/36

Page 21: Lecture 04: Analog/Digital Conversions

Similar to summing amplifier:

va = −∑

i

(RF

Ri· bi · vin)

If we select Ri =R0

2i :

va = −RF

R0(2n−1bn−1 + · · ·+ 21b1 + 20b0) · vin

Note here V−ref is 0 (ground)

Limitations:• Impossible to fabricate a wide range of resistor values in the same IC chip

DAC Type 1: Weighted Adder DAC

21/36

Page 22: Lecture 04: Analog/Digital Conversions

Similar to summing amplifier:

va = −∑

i

(RF

Ri· bi · vin)

If we select Ri =R0

2i :

va = −RF

R0(2n−1bn−1 + · · ·+ 21b1 + 20b0) · vin

Note here V−ref is 0 (ground)

Limitations:• Impossible to fabricate a wide range of resistor values in the same IC chip

DAC Type 1: Weighted Adder DAC

21/36

Page 23: Lecture 04: Analog/Digital Conversions

Similar to summing amplifier:

va = −∑

i

(RF

Ri· bi · vin)

If we select Ri =R0

2i :

va = −RF

R0(2n−1bn−1 + · · ·+ 21b1 + 20b0) · vin

Note here V−ref is 0 (ground)

Limitations:• Impossible to fabricate a wide range of resistor values in the same IC chip

DAC Type 1: Weighted Adder DAC

21/36

Page 24: Lecture 04: Analog/Digital Conversions

Question: 4-bit DACFor given (b3b2b1b0) = {(1111), (0000), (1010)}, calculate va.

22/36

Page 25: Lecture 04: Analog/Digital Conversions

Data Bit Ideal R Real R0 (LSB) 256K 270K1 128K 130K2 64K 62K3 32K 33K4 16K 16K5 8K 8.2K6 4K 3.9K7 (MSB) 2K 2K

• Not perfect, but okay.

Practical Resistor Network DAC and Audio Amplifier

23/36

Page 26: Lecture 04: Analog/Digital Conversions

_V0

R

+

V-ref

Motivations:• Use only two values of resistors which make for easy and accurate fabrication and

integration

• At each node, current is split into 2 equal parts

• The most popular DAC

DAC Type 2: R-2R DAC

24/36

Page 27: Lecture 04: Analog/Digital Conversions

_V0

R

+

V-ref

Reference:http://www.tek.com/blog/tutorial-digital-analog-conversion—r-2r-dac

DAC Type 2: R-2R DAC

25/36

Page 28: Lecture 04: Analog/Digital Conversions

_V0

R

+

V-ref

Given I as input value (n bit):

Vo3 =Vb0

16+

Vb1

8+

Vb2

4+

Vb3

2

DAC Type 2: R-2R DAC

26/36

Page 29: Lecture 04: Analog/Digital Conversions

_V0

R

+

V-ref

Question: R-2R DACFor given (b3b2b1b0) = {(1111), (0000), (1010)}, calculate vo3.

27/36

Page 30: Lecture 04: Analog/Digital Conversions

Analog to Digital Conversion(ADC)

Page 31: Lecture 04: Analog/Digital Conversions

ADC

output code = n0110001010001001001000101011:::

Input voltage = V

V+ref

V-ref

Analog-to-Digital Converter (ADC)

29/36

Page 32: Lecture 04: Analog/Digital Conversions

• Convert an analog level to digital output

• Employ 2n − 1 intervals (n: bit#)

• va: analog voltage

• vd: output digital voltage

Quantization

30/36

Page 33: Lecture 04: Analog/Digital Conversions

• Accumulate the input current on a capacitor for a fixed time

• Then measure time (T) to discharge the capacitor

• When cap is discharged to 0 V, comparator will stop the counter

Limination: Slow

ADC Type 1: Integrating ADC

31/36

Page 34: Lecture 04: Analog/Digital Conversions

• Accumulate the input current on a capacitor for a fixed time

• Then measure time (T) to discharge the capacitor

• When cap is discharged to 0 V, comparator will stop the counter

Limination: Slow

ADC Type 1: Integrating ADC

31/36

Page 35: Lecture 04: Analog/Digital Conversions

• ADC repeatedly compares its input with DACoutputs

• Up/down count depends on input/DAC outputcomparison

Limination: Slow

ADC Type 2: Tracking ADC

32/36

Page 36: Lecture 04: Analog/Digital Conversions

• ADC repeatedly compares its input with DACoutputs

• Up/down count depends on input/DAC outputcomparison

Limination: Slow

ADC Type 2: Tracking ADC

32/36

Page 37: Lecture 04: Analog/Digital Conversions

• Replace “Up-down counter” by “control logic”

• Binary search to determine the output bits

• still slow although faster than types 1 & 2

ADC Type 3: Successive Approximation

33/36

Page 38: Lecture 04: Analog/Digital Conversions

Flow chart of Successive-approximation ADC

34/36

Page 39: Lecture 04: Analog/Digital Conversions

• Divide the voltage range into 2n − 1 levels

• Use 2n − 1 comparators to determine what the voltage level is

• Fully parallel

Pros:

• Very fast for high quality audio and video

• Sample and hold circuit NOT required

Cons:• Very expensive for wide bits conversion

ADC Type 4: Flash ADC

35/36

Page 40: Lecture 04: Analog/Digital Conversions

• Divide the voltage range into 2n − 1 levels

• Use 2n − 1 comparators to determine what the voltage level is

• Fully parallel

Pros:• Very fast for high quality audio and video

• Sample and hold circuit NOT required

Cons:

• Very expensive for wide bits conversion

ADC Type 4: Flash ADC

35/36

Page 41: Lecture 04: Analog/Digital Conversions

• Divide the voltage range into 2n − 1 levels

• Use 2n − 1 comparators to determine what the voltage level is

• Fully parallel

Pros:• Very fast for high quality audio and video

• Sample and hold circuit NOT required

Cons:• Very expensive for wide bits conversion

ADC Type 4: Flash ADC

35/36

Page 42: Lecture 04: Analog/Digital Conversions

Thanks You