Digital-to-Analog Conversion
Outline
ADC vs DAC
Choosing a DAC
Specifications
Resolution
Speed
Linearity
Settling Time
Reference Voltages
Errors
Types of DAC
Binary Weighted Resistor
R-2R Ladder
Multiplier DAC
Non-Multiplier DAC
Applications
References
ADC vs DAC
•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 Digital
inputs outputs
Analog input Analog output
(voltage or (voltage or
current) current)
. . Control
Physical Transducer ADC . Computer . DAC Actuator physical
variable variable
. .
Overview
Digital to Analog Converter (DAC)
A digital to analog converter (DAC) is a
device that converts digital numbers (binary)
into an analog voltage, current, or electric
charge output.
Overview
Digital to Analog Converter (DAC)
• Generate piecewise continuous signals from digital code.
Overview
Each binary number sampled by the DAC
corresponds to a different output level.
Choosing a DAC
There are six(6) main specifications that should be considered
when choosing a DAC for a particular project.
Reference Voltage
Resolution
Linearity
Speed
Settling Time
Error
Specifications
Reference Voltage
To a large extent the output properties of a DAC are
determined by the reference voltage.
Multiplier DAC – The reference voltage is constant and is set by
the manufacturer.
Non-Multiplier DAC – The reference voltage can be changed
during operation.
Specifications
Resolution
The resolution is the amount of voltage rise created by
increasing the LSB (Least Significant Bit) of the input
by 1. This voltage value is a function of the number of
input bits and the reference voltage value.
1 bit DAC is designed to reproduce 2 (21) levels while an 8 bit DAC is
designed for 256 (28) levels.
Increasing the number of bits results in a finer resolution
Most DACs are in the 12-18 bit range
Reference Voltage
Resolution
2 # _ of _ bits
Specifications
Linearity
The linearity is the relationship between the output
voltage and the digital signal input.
Specifications
Speed
Usually specified as the conversion rate or sampling
rate.
It is the rate at which the input register is updated.
High speed DACs are defined as operating at greater than 1 MHz.
Some state of the art 12-16 bit DAC can reach speeds of 1GHz
The conversion of the digital input signal is limited by the clock
speed of the microprocessor and the settling time of the DAC.
Specifications
Settling Time
Ideally a DAC would instantaneously change its output value
when the digital input would change.
In a real DAC it takes time for the DAC to reach the actual
expected output value.
Ideal Sampled Signal Real DAC Output
Specifications
Error
There are multiple sources of error in computing the
analog output.
Gain Error
Offset Error
Full Scale Error
Linearity
Non-Monotonic Output Error
Settling Time and Overshoot
Resolution
Trayvon Leslie
Errors
Gain Error
Deviation in the slope of the ideal curve and with
respect to the actual DAC output
High Gain Error: Step
amplitude is higher than
the desired output
Low Gain Error: Step
amplitude is lower than
the desired output
Errors
Offset Error
Occurs when there is an offset in the output
voltage in reference to the ideal output.
This error may be
detected when all
input bits are low
(i.e. 0).
Errors
Full Scale Error
Occurs when there is an
offset in voltage form the
ideal output and a
deviation in slope from
the ideal gain.
Errors
Non-Linearity
Differential Non-Linearity: Voltage step size
differences vary as digital input increases. Ideally
each step should be equivalent.
Errors
Non-Linearity
Integral Non-Linearity: Occurs when the
output voltage is non linear. Basically an inability
to adhere to the ideal slope.
Orlando Carreon
Errors
Non-Monotonic Output Error
Occurs when the an increase in digital
input results in a lower output voltage.
Orlando Carreon
Errors
Settling Time and Overshoot
Settling Time: The time required for the voltage to
settle within +/- the voltage associated with the VLSB.
Any change in the input time will not be reflected
immediately due to the lag time.
Overshoot: occurs when the output voltage overshoots
the desired analog output voltage.
Orlando Carreon
Errors
Settling Time and Overshoot
Orlando Carreon
Errors
Resolution
Inherent errors associated with the
resolution
More Bits = Less Error and Greater
Resolution
Less Bits = More Error and Less Resolution
Orlando Carreon
Errors
Resolution Poor Resolution (1 Bit)
Does not accurately
approximate the
desired output due
large voltage divisions.
Ref Voltage
Res # of bits
2
Orlando Carreon
Errors
Resolution Better Resolution (3 Bit)
Better
approximation of the
of the desired output
signal due to the
smaller voltage
divisions.
Ref Voltage
Res # of bits
2
Orlando Carreon
Resolution
•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
n
•Step size, = Vref / 2
Resolution: Examples
Formula 4-bit DAC 10-bit DAC
Number of bits n
Number of output 2n
codes
Number of steps in 2n−1
the output
Percentage 1 / (2n−1)
resolution
Step size (assuming Vref / 2n
5 V reference
voltage)
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 ref
I out Din
256
How to Build a DAC
•Two standard ways of building a digital-to-
analog converter:
1. Binary-weighted input
2. R/2R Ladder
•Both methods use operational amplifiers with
negative feedback.
Types of DAC
Binary Weighted Resistor
Basic Ideas: Assumptions:
• Use a summing op-amp • Ideal Op-Amp
circuit
• No Current into Op-Amp
• Use transistors to
switch between high and • Virtual Ground at Inverting
ground Input
• Use resistors scaled by •Vout = -IRf
two to divide voltage on
each branch by a power
of two
Zack Sosebee
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:
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.
LSB 8R
D0 Rf
The MSB is represented by the + –
I0
4R If
largest current, so it has the D1
smallest resistor. To simplify I1 – Vout
2R
analysis, assume all current D2 I=0
I2 + Analog
goes through Rf and none into R output
the op-amp. D3
MSB I3
Floyd, Digital Fundamentals, 10th ed © 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
+3.0 V Rf
60 kW 10 kW
0V
30 kW
–
+3.0 V 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 kW 30 kW 15 kW
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 D3
For accuracy, the resistors R1 R3 R5 R7 Rf = 2R
must be precise ratios, 2R 2R 2R 2R
R2 R4 R6 R8
which is easily done in –
integrated circuits. 2R R R R Vout
+
Floyd, Digital Fundamentals, 10th ed © 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 D1 D2 D3
+5.0 V +5.0 V 0V +5.0 V
R1 R3 R5 R7 Rf = 50 kW
50 kW 50 kW 50 kW 50 kW
R2 R4 R6 R8
–
50 kW 25 kW 25 kW 25 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
•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.
10110 10110
01101 01101
00011 00011
11100 11100 Enhanced
Analog Anti-aliasing Sample-and- Reconstruction
signal filter hold circuit ADC DSP DAC filter analog
signal
Floyd, Digital Fundamentals, 10th ed © 2009 Pearson Education, Upper Saddle River, NJ 07458. All Rights Reserved