Unit 7. Digital-to-Analog Conversion
Download
Report
Transcript Unit 7. Digital-to-Analog Conversion
EET 252 Unit 7
Digital-to-Analog Conversion
Read Floyd, Sections 12-3 to 12-5
(through page 707).
Study Unit 7 e-Lesson.
Do Lab #7.
Homework #7 and Lab #7 due next
week.
Quiz next week.
The Big Picture
•An analog-to-digital converter (ADC) takes an
analog voltage or current as its input and
produces a digital code as its output. This
digital code is proportional to the analog input.
•A digital-to-analog converter (DAC) takes a
digital code as its input and produces an
analog voltage or current as its output. This
analog output is proportional to the digital input.
Review
Digital
outputs
Digital
inputs
Analog input
(voltage or
current)
Physical
variable
Transducer
Analog output
(voltage or
current)
ADC
.
.
.
Computer
.
.
.
DAC
Actuator
Control
physical
variable
Review: Resolution
•Just as with ADCs, there are several common
ways of specifying a DAC’s resolution:
•Number of bits, n
n
•Number of output codes, = 2 , or number of
n
steps in the output, = 2 − 1
n
•Percentage resolution, = 1 / (2 − 1),
expressed as a percentage
•Step size, = Vref / 2
n
Resolution: Examples
Formula
Number of bits
Number of output
codes
Number of steps in
the output
Percentage
resolution
Step size (assuming
5 V reference
voltage)
n
2n
2n−1
1 / (2n−1)
Vref / 2n
4-bit DAC
10-bit DAC
An 8-Bit DAC in Multisim
•Note 8 digital inputs, 1 analog output, and
input reference voltage.
Calculating the Output Voltage
•For an 8-bit multiplying DAC like the one in
previous slide, the output voltage is given by
the following equation, where Din is the number
(between 0 and 255) present on the digital
inputs:
V
Vout Din
ref
256
•This gives the ideal value. In practice, various
factors can cause the actual value to deviate
from this predicted value.
Voltage or Current?
•Some DACs are designed to produce an
output current (rather than an output voltage)
that is proportional to the digital input.
•For such a DAC, we’d simply change our
equation to
I out Din
I ref
256
•The DAC chip that we’ll use in this week’s lab
is a current chip.
How to Build a DAC
•Two standard ways of building a digital-toanalog converter:
1. Binary-weighted input
2. R/2R Ladder
•Both methods use operational amplifiers with
negative feedback.
Op Amp with Negative Feedback
•In many applications, the op amp’s output is
connected back to its inverting input directly or
through a component (resistor or capacitor).
This configuration is called negative feedback.
For example:
“Golden Rules” of Op Amps with
Negative Feedback
•In The Art of Electronics, Horowitz and Hill
give two “golden rules” for analyzing circuits
that contain op amps with negative feedback:
1. The output attempts to do whatever is
necessary to make the voltage difference
between the inputs zero.
2. The inputs draw no current.
•
Warning: These two rules apply only if the
op amp has negative feedback.
Binary-weighted-input DAC
In a binary-weighted-input DAC, the input current in each
resistor is proportional to the column weight in the binary
numbering system. It requires very accurate resistors and
identical HIGH level voltages.
The MSB is represented by the
largest current, so it has the
smallest resistor. To simplify
analysis, assume all current
goes through Rf and none into
the op-amp.
Floyd, Digital Fundamentals, 10th ed
LSB
D0
8R
4R
I0
Rf
+
If
D1
2R
I1
D2
D3
MSB
–
I=0
R
I2
–
+
Vout
Analog
output
I3
© 2009 Pearson Education, Upper Saddle River, NJ 07458. All Rights Reserved
Binary-weighted-input DAC
A certain binary-weighted-input DAC has a binary input of
1101. If a HIGH = +3.0 V and a LOW = 0 V, what is Vout?
120 kW
Rf
+3.0 V
60 kW
0V
30 kW
+3.0 V
10 kW
–
Vout
+
15 kW
+3.0 V
I out ( I 0 I1 I 2 I 3 )
3.0 V 3.0 V
3.0 V
0 V
0.325 mA
120
k
W
30
k
W
15
k
W
Vout = Iout Rf = (−0.325 mA)(10 kW) = −3.25 V
Floyd, Digital Fundamentals, 10th ed
© 2009 Pearson Education, Upper Saddle River, NJ 07458. All Rights Reserved
R/R2 Ladder DAC
The R-2R ladder DAC requires only two values of resistors. By
calculating a Thevenin equivalent circuit for each input, you can
show that the output is proportional to the binary weight of inputs
that are HIGH.
Each input that is HIGH contributes to the output:
where VS = input HIGH level voltage
n = number of bits
Inputs
i = bit number
D0
D1
D2
For accuracy, the resistors
R1
R3
R5
must be precise ratios,
2R
2R
2R
R2
R4
R6
R8
which is easily done in
integrated circuits.
2R
R
R
R
Floyd, Digital Fundamentals, 10th ed
D3
R7
2R
Rf = 2R
–
+
Vout
© 2009 Pearson Education, Upper Saddle River, NJ 07458. All Rights Reserved
R/R2 Ladder DAC
An R-2R ladder DAC has a binary input of 1011. If a
HIGH = +5.0 V and a LOW = 0 V, what is Vout?
D0
+5.0 V
R2
50 kW
D1
+5.0 V
R1
50 kW
R4
D2
0V
D3
+5.0 V
R3
50 kW
R6
R5
50 kW
R8
25 kW 25 kW
25 kW
R7
50 kW
Rf = 50 kW
–
Vout
+
Apply
to all HIGH inputs, then sum the results.
Applying superposition, Vout = −6.875 V
Floyd, Digital Fundamentals, 10th ed
© 2009 Pearson Education, Upper Saddle River, NJ 07458. All Rights Reserved
Using a Reference Voltage
•In the previous circuits, the output voltage depended
on the precise voltage present on the digital inputs.
This is undesirable, since a digital HIGH on one of
these pins could be anywhere from about 2.4 V to
about 5 V.
•We’d rather have the output voltage depend only on
whether the inputs are HIGH or LOW, regardless of the
precise voltage.
•So most DAC chips use additional circuitry and a
reference voltage that sets the full-scale output,
independent of the precise voltages present on the
digital inputs.
Binary-Weighted DAC, Using a
Reference Voltage
A Popular DAC Chip
•MC1408 8-bit DAC (Datasheet on course
website.)
•It’s also known as a DAC0808.
•This chip requires a ground connection and
positive (VCC) & negative (VEE) supply voltages.
•Its output current is given by
Io = Iref x Din / 256
where Iref is the current into pin 14 (typically 2
mA).
Digital Signal Processing
A digital signal processor (DSP) is optimized for speed and
working in real time (as events happen). It is basically a
specialized microprocessor with a reduced instruction set.
After filtering and converting the analog signal to digital, the DSP takes
over. It may enhance the signal in some predetermined way (reducing
noise or echoes, improving images, encrypting the signal, etc.). The
signal can then be converted back to analog form if desired.
Analog
signal
Anti-aliasing
filter
Floyd, Digital Fundamentals, 10th ed
Sample-andhold circuit
10110
01101
00011
11100
ADC
10110
01101
00011
11100
DSP
DAC
Reconstruction
filter
Enhanced
analog
signal
© 2009 Pearson Education, Upper Saddle River, NJ 07458. All Rights Reserved