Professional Documents
Culture Documents
4 Analog
4 Analog
Lecture 10
Digital-to-Analog Conversion
Objectives
Digital-to-Analog Conversion
We want to convert a binary number into a voltage
proportional to its value:
X3 V3 R3=1/G3 VOUT
1
X2
1
V2 R2
V3 VOUT G3 V0 VOUT G0 0
R1 V3G3 V2 G2 V1G1 V0G0
X1
1
V1
VOUT
G3 G2 G1 G0
X0 V0 R0
1 1
RThevenin
G3 G2 G1 G0
Output Op-Amp
X3 V3 R3=1/G3 RF
1
X2 V2 R2
1
– VOUT
X1 V1 R1 +
1
X0 V0 R0
1
RF
VOUT VThévenin RF V3G3 V2 G2 V1G1 V0 G0
RThévenin
Adding an op-amp:
– The voltage at the junction of all the resistors is now
held constant by the feedback
• Hence current drawn from V3 is independent of the other
voltages V2, …, V0
• Hence any gate non-linearity has no effect more
accurate.
– Lower output impedance
p p slew rate 1 V/µs.
– Much slower: op-amp µ
DAC Jargon
V
nge
1 LSB
0 1 2 3 4 5 6 7
X0:2
Accuracy=1.8@X=3 Linearity=–0.7@X=4
Non-monotonic@34 Diff Linearity=–1
Linearity=–1.2@2@ 34
(all in units of LSB)
R-2R Ladder
We want to generate currents I0, 2I0, 4I0, …
2I0 2R I0
V0
– Two 2R resistors in parallel means
2R I0
that the 2I0 current will split equally.
2R I0
ANALOG.PPT(01/10/2009) 4.6
Current-Switched DAC
RF
16I0 8I0 1
VIN X3
3
0
4-bit R/2R ladder
4I0 1
X2 X3:0 × I0
0 –
2I0 VOUT
1
X1 +
0
I0 1
X0
0
I0
– Total
ota current
cu e t into
to summing
su g junction
ju ct o is 3:0 × I0
s X3:0
Hence Vout = X3:0 × Vin /16R × –Rf
– We switch currents rather than voltages so that all
nodes in the circuit remain at a constant voltage
no need to charge/discharge
g g node capacitances
p
faster.
– Use CMOS transmission gates as switches: adjust
ladder resistors to account for switch resistance.
• Each 2-wayy switch needs four transistors
Digital Attenuator
C b
Can be used
d as a di
digital
it l attenuator:
tt t
VIN
Bipolar DAC
A bipolar DAC is one that can give out both positive and
negative voltages according to the sign of its input. There
are two aspects of the circuit that we need to change:
Number Representation
Normally we represent numbers using 2’s complement
notation (because we can then use the same
addition/subtraction circuits).
For converters it is more convenient to use offset-binary
notation.
t ti
Signed Numbers
Value (v) 2’s complement (y) Offset Binary (x) (u=v+8)
–8 1000 0000 0
–7 1001 0001 1
–6 1010 0010 2
–5 1011 0011 3
... ... ...
–11 1111 0111 7
0 0000 1000 8
1 0001 1001 9
... ... ...
6 0110 1110 14
7 0111 1111 15
16I0 8I0 1
VIN X3 X3:0 × I0
0
4-bit R/2R ladder
4I0 1
X2 2(X3:0–8) × I0
0
2I0 1
X1
0
I0 1
X0
0 (16–X3:0) × I0
I0
Current
Mirror
(16–X3:0) × I0
Current Mirror
A RF
A
A–B
R – VOUT
+
B
B
– VX R
Thus VOUT = – (A – B) RF
Quiz
– Why y is a weighted-resistor
g DAC impractical
p for a 16-
bit converter?
– What is a multiplying DAC ?
– Why is a current mirror circuit so-called?
– What is the value of the bit pattern 1001 in the
following notations: (a) unsigned binary, (b) two’s
complement binary, (c) offset binary ?
– How do you convert a number from offset binary to
two’s complement notation ?
ANALOG.PPT(01/10/2009) 4.13
Lecture 11
Objectives
VREF
VIN XN–1:0
N 10
ADC
VIN
X round
1 LSB
E
Example:
l
If 1 LSB = 0.5 V, then VIN = 2.8 V will be converted to:
2.8
X round round 5.6 6
0.5
Sampling
To process a continuous signal in a computer or other
digital system, you must first sample it:
Time Quantisation
• Samples taken (almost always) at regular intervals:
sample frequency of fsamp.
1.11
Quantisation Noise
VREF VREF
VIN, VOUT
VOUT – VIN
If all error values are equally likely, the RMS value of the
quantisation noise is ½
1
x dx 0.3 LSB
2
½ 12
Signal-to-Noise Ratio (SNR) for an n-bit converter
Ratio of the maximum sine wave level to the noise level:
– Maximum sine wave has an amplitude of ±2n–1 which
equals an RMS value of 0.71 × 2n–1 = 0.35 × 2n.
– SNR is:
0.35 2 n
20 log10 20 log10 (1.2 2 n ) 1.8 6n dB
0.3
ANALOG.PPT(01/10/2009) 4.17
Threshold Voltages
VREF
VIN XN–1:0
N 10
ADC
Threshold Voltages
–4 –3 –2 –1 0 1 2 3
– G6
Resistor chain used to R +
generate threshold – G5
voltages. R + Priority Encoder Logic
X2
ust dete
must determine
e tthe
e R +
X0
highest Gn input that – G3
equals 1. R +
– G2
12-bit converter needs
R +
4095 comparators on a
single chip! VLO = –1.75 V
– G1
+
VIN
ANALOG.PPT(01/10/2009) 4.19
Priority Encoder
G7:1 can have 27 possible values but only 8 will occur:
G4 G2
1.11
0.5
-0.5
-1
0 0.2 0.4 0.6 0.8 1
Time
-0.5
0 0.2 0.4 0.6 0.8 1
Time
-0.5
-1
0 2 4 6 8
Triangle wave amplitude (+- LSB)
ANALOG.PPT(01/10/2009) 4.21
1.11
Dither
VREF VREF
VIN W XNN–1:0
1:0 VOUT
+ ADC DAC
D
0.8
Prob Density (W) or P
0.6
0.4
0.2
0
05
0.5 1 15
1.5 2 25
2.5 3 35
3.5
W and VOUT (LSB)
1.11
Effects of Dither
VREF VREF
VIN W XNN–1:0
1:0 VOUT
+ ADC DAC
D
Good consequences
• Quantisation
Q ti ti noisei llevell iis constant
t t iindependent
d d t off VIN
• Quant noise is uncorrelated with VIN no distortion
• Signal variations are preserved even when < 1 LSB
Bad consequence
• RMS quantisation noise increases from 0.3 to 0.5 LSB
04
0.4
RMS noise (LSB)
-0.2
without dither
0.3
-0.4
0.2 -0.6
-0.8
08 without
ith t dith
dither
0.1
-1
0
0 2 4 6 8 0 2 4 6 8
Triangle wave amplitude (+- LSB) Triangle wave amplitude (+- LSB)
ANALOG.PPT(01/10/2009) 4.23
Quiz
– What is a bipolar
p A/D converter ?
– What is the amplitude of the quantisation noise
introduced by an A/D converter ?
– How many threshold voltages are there in an n-bit
converter ?
– What is the function of a priority encoder ?
– What is the level of quantisation noise for large signal
variations ?
– What are the good and bad consequences of adding
dither to a signal before conversion to digital ?
ANALOG.PPT(01/10/2009) 4.24
Lecture 12
Objectives
–8 –7 –6 –5 –4 –3 –2 –1 0 1 2 3 4 5 6 7
1 t guess: –0.25
1st 0 25 V
(too high)
X=1???
X=0???
VIN
+ HIGHER X3:0
–
VREF
STATE4:0
X3:0
DAC
State Diagram:
–8 –7 –6 –5 –4 –3 –2 –1 0 1 2 3 4 5 6 7
(too low)
t
X=111?
Vo
lta
ge
VREF
CLOCK
START
X0:7
C DONE
Choice of C is a compromise:
– Big C keeps constant voltage despite leakage
currents since dV/dt = Ileakage/C
– Small C allows faster acquisition time for any given
input current since dV/dt = Iin/C.
START
DONE
X0:n
Sample/Hold Circuit
+
IN –
– OUT
+
SAMPLE
Sampling ADC
Many A/D converters include a sample/hold within them:
these are sampling A/D converters.
0111 1000 V
X=8
X=7
Deglitching
To minimize the effect of glitches:
– Use a register to make inputs change as
simultaneously as possible
– Use a sample/hold circuit to disconnect the DAC
output
p while it is changing
g g
VREF
CLOCK
C1
CONTROL
D7:0
CLOCK
X7:0
VDAC
CONTROL
VOUT
ANALOG.PPT(01/10/2009) 4.33
Summary
D/A Converters:
– Weighted resistor: very fast (no op-amp), each bit can
have an arbitrary weight, no good for big numbers.
– R-2R ladder: used for most converters, switch
currents rather than voltages for higher speed.
Multiplying DAC has an analog input as well.
– converters used for audio: very good linearity
linearity.
A/D Converters:
– Flash converter: very fast (down to 1 ns), low
precision (8 bits max), expensive and power hungry. A
“pipeline” converter uses a DAC to subtract the
converted value and measures the difference with
another flash converter .
– Successive
S i A Approximation:
i ti medium
di speed d (d
(down tto
0.1 µs), need to use sample/hold circuit to avoid input
changing during conversion.
– converters dominate the medium to low speed
market ((down to 0.5 µs).
µ ) Longg been standard for
audio: very good linearity (up to 24 bits). Very high
speed sampling at low precision with dither, followed
by low-pass digital filter and sub-sampling to desired
sample rate.
ANALOG.PPT(01/10/2009) 4.34
Quiz