Unit 7 : A/D and D/A Converter
Lesson 1 : Interfacing with the Analog World
1.1. Learning Objectives
On completion of this lesson you will be able to :
♦ learn about various terms of A/D and D/A converters.
1.2. Interfacing with the Analog World
A digital quantity will have a value that is specified as one of two
possibilities such as 0 or 1, LOW or HIGH, true or false, and so on. In
A digital quantity will have practice, the voltage representation a digital quantity such as a may
a value that is specified as actually have a value that is anywhere within specified ranges. For
one of two possibilities
example, for TTL logic :
such as 0 or 1.
0V to 0.8V = logic 0
2V to 5V = logic 1
Any voltage falling in the range 0 to 0.8 V is given the digital value 0,
and any voltage in the range 2 to 5 V is assigned the digital value 1. The
digital circuits respond accordingly to all voltage values within a given
range.
Most physical variables are analog in nature and can take on any value
Most physical variables within a continuous range of values. Examples include temperature,
are analog in nature and pressure, light intensity, audio signals, position, rotational speed, and
can take on any value flow rate. Digital systems perform all of their internal operations using
within a continuous range digital circuitry and digital operations. Any information that has to be
of values. inputted to a digital system must first be put into digital form. Similarly,
the outputs from a digital system are always in digital form.
1.2.1. Transducer
The physical variable is normally a nonelectrical quantity. A transducer
A transducer is a device is a device that converts the physical variable to an electrical variable.
that converts the physical Some common transducers include thermistors, photocells, photodiodes,
variable to an electrical flow meters, pressure transducers, and tachometers. The electrical output
variable. of the transducer is an analog current or voltage that is proportional to
the physical variable it is monitoring. For example, the physical variable
could be the temperature of water. Let’s say that the water temperature
varies from 80 to 1500 F and that a thermistor and its associated circuitry
convert this water temperature to a voltage ranging from 800 to
Digital Systems and Computer Organization
1500mV. Note that the transducer’s output is directly proportional to
temperature; such that each 10 F produces a 10mV output. Analog-to-
digital converter (ADC) and digital-to-converter (DAC) are used to
interface a computer to the analog world so that the computer can
monitor and control a physical variable Fig. 7.1.
Analog
output
Analog 2 3 4
input
5
1
Physical Digital To
variable Transducer ADC DAC Actuator
System control
physical
variable
Digital Digital
inputs outputs
Fig. 7.1 : Interfacing with the analog world using Analog-to-Digital
Converter (ADC) and Digital-to-Analog Converter (DAC).
1.2.2. Analog-to-Digital Converter (ADC)
The transducer’s electrical analog output serves as the analog input to
The transducer’s electrical the ADC. The ADC converts this analog input to a digital output. This
analog output serves as digital output consists of a number of bits that represent the value of the
the analog input to the analog input. For example, the ADC might convert the transducer’s 800-
ADC. The ADC converts to 1500-mV analog values to binary values ranging from 01010000 (80)
this analog input to a to 10010110 (150). Note that the binary output from the ADC is
digital output. proportional to the analog input voltages so that each unit of the digital
output represents 10mV.
The digital representation of the analog vales is transmitted from the
ADC to the digital computer, which stores the digital value and
processes it according to a program of instructions that it is executing.
1.2.3. Digital-to-Analog Converter (DAC)
This digital output from
the computer is connected This digital output from the computer is connected to a DAC, which
to a DAC, which converts converts it to a proportional analog voltage or current. For example, the
it to a proportional analog
computer might produce a digital output ranging from 0000000 to
voltage or current.
11111111, which the DAC converts to a voltage ranging from 0 to 10V.
1.2.4. Actuator
The analog signal from the
DAC is often connected to The analog signal from the DAC is often connected to some device or
some device or circuit that circuit that serves as an actuator to control the physical variable. For our
serves as an actuator to water temperature example, the actuator might be an electrically
control the physical controlled valve that regulates the flow of hot water into the tank in
variable. accordance with the analog voltage from the DAC. The flow rate would
168
A/D and D/A Converter
vary in proportion to this analog voltage, with 0 V producing no flow
and 10 V producing the maximum flow rate.
Thus we see that ADCs and DACs function as interfaces between a
completely digital system, like a computer, and the analog world.
1.3. Digital-to-Analog Conversion
Basically, D/A conversion is the process of taking a value represented in
D/A conversion is the digital code (such as straight binary or BCD) and converting it to a
process of taking a value voltage or current which is proportional to the digital value. Fig. 7.2
represented in digital shows the symbol for a typical 4-bit D/A converter. Now, we will
code. examine the various input/output relationships.
MSB
Digital D/A converter Vout
Analog
inputs (DAC) output
LSB
Fig. 7.2 : Four bit DAC with voltage output.
The digital inputs D,C,B, and A are usually derived from the output
register of a digital system. The 24 = 16 different binary numbers
represented by these 4 bits for each input number, the D/A converter
output voltage is a unique value. In fact, for this case, the analog output
voltage Vout is equal in volts to the binary number.
In general,
Analog output = K × digital input
where K is the proportionality factor and it is constant value for a given
DAC. The analog output can of course be a voltage or current. When it
is a voltage, K will be in voltage units, and when the output is current, K
will be in current units. For the DAC of K=1 V, so that
VOUT = (1 V) × digital input
We can use this to calculate VOUT for any value of digital input. For
example, with a digital input of 11002 = 1210, we obtain
VOUT = 1V × 12 = 12V
169
Digital Systems and Computer Organization
Problem 1
A 5-bit DAC has a current output. For a digital input of 101000, an
output current of 10mA is produced. What will IOUT be for a digital
Problem 1 and Solution input of 11101?
Solution
The digital input 101002 is equal to decimal 20. Since IOUT = 10 mA for
this case, the proportionality factor as 0.5 mA. Thus, we can find for a
digital input such as 111012 = 2910 as follows :
IOUT = (0.5mA) × 29
= 14.5 mA
Remember, the proportionality factor, K, will vary from one DAC to
another.
Problem 2
What is the largest value of output voltage from an 8-bit DAC that
produces 1.0V for a digital input of 00110010?
Solution
001100102 = 5010
1.0 V = K× 50
Therefore,
K = 20 mV
The largest output will occur for an input of 111111112 = 25510.
VOUT(max) = 20mV×255
= 5.10 V
Analog Output
The output of a DAC is technically not an analog quantity because it can
take on only specific values like the 16 possible voltage levels for Vout.
Analog Output Thus, in that sense, it is actually digital. However, the number of
different possible output levels can be increased and the difference
between successive values can be decreased by increasing the number of
input bits. This will allow us to produce an output that is more and more
like an analog quantity that varies continuously over a range of values.
170
A/D and D/A Converter
Input Weights
For the DAC of it should be noted that each digital input contributes a
different amount to the analog output. This is easily seen if we examine
the cases where only one input is HIGH Table 7.1. The contributions of
each digital input are weighted according to their position in the binary
number.
D C B A VOUT (V)
0 0 0 1 → 1
0 0 1 0 → 2
0 1 0 0 → 4
1 0 0 0 → 8
Table 7.1
Thus, A, which is the LSB, has a weight of 1V, B has a weight of 2V, C
has a weight of 4 V, and D, the MSB, has the largest weight 8V. The
weights are successively doubled for each bit, beginning with the LSB.
Thus, we can consider VOUT to be the weighted sum of the digital inputs.
For instance, to find VOUT for the digital input 0111 we can add the
weights of the C, B, and A bits to obtain 4 V + 2V + 1V=7V.
Problem 3
A 5-bit D/A converter produces VOUT = 0.2 V for a digital input of 0001.
Input Weights Find the value of Vout for an input of 11111.
Problem 3 and Solution
Solution
Obviously, 0.2 V is the weight of the LSB. Thus, the weights of the
other bits must be 0.4 V, 0.8 V, 1.6 V, and 3.2 V respectively. For a
digital input of 11111, then, the value of VOUT will be 3.2 V + 1.6 V+
0.8V + 0.4V + 0.2 V = 6.2 V.
1.4. Resolution
Resolution of a D/A converter is defined as the smallest change that can
occur in he analog output as a result of a change in the digital input. We
Resolution of a D/A can see that the resolution is 1V, since VOUT can change by no less than
converter is defined as the 1 V when the digital input value is changed. The resolution is always
smallest change that can equal to the weight of the LSB and is also referred to as the step size. As
occur in he analog output the counter is being continually cycled through its 16 states by the clock
as a result of a change in signal, the DAC output is a staircase waveform that goes up 1 V per
the digital input.
step. When the counter is at 1111, the DAC output is at its maximum
value of 15 V; this is its full-scale output. When the counter recycles to
171
Digital Systems and Computer Organization
0000, the DAC output returns to 0V. The resolution or step size of the
jumps in the staircase waveform; in this case, each step is 1 V.
Full-scale
(input = 1111) 15 V
4-bit
counter
10V
D
D/A
converter
C
V OUT 5V
B 4V Input
3V
Resolution 2V recycled to
A =1V 1V 0000
0V Time
Clock
Resolution = step size = 1 V
Fig. 7.3 : Output wave forms of a four bit DAC.
Note that the staircase has 16 levels corresponding to the 16 input states,
but there are only 15 steps or jumps between the 0-V level and full-scale,
In general, for an N-bit DAC the number of different levels will be 2N,
and the number of steps will be 2N - 1.
You may have already figured out the resolution (step size) is the same
as the proportionality factor in the DAC input/output relationship :
analog output = K × digital input
A new interpretation of this expression would be that the digital input is
equal to the number of the step, K is the amount of voltage (or current)
per step, and the analog output is the product of the two.
Problem 4
For the DAC of Example 3 determine VOUT for a digital input of 10001.
Solution
The step size is 0.2 V, which is the proportionality factor K. The digital
input is 10001 = 1710. Thus we have :
VOUT = (0.2 V) × 17
= 3.4V
172
A/D and D/A Converter
1.5. Percentage Resolution
Although resolution can be expressed as the amount of voltage or current
per step, it is also useful to express it as a percentage of the full-scale
output. To illustrate, in Fig. 7.3 the DAC has a maximum full-scale
output of 15 V (when the digital input is 1111). The step size is 1V,
which gives a percentage resolution.
step size
% resolution = × 100%
full scale ( F . S . )
1V
= × 100% = 6.67%
15 V
Percentage Resolution
Problem 5 and Solution Problem 5
A 10-bit DAC has a step size of 10 mV. Determine the full-scale output
voltage and the percentage resolution.
Solution
With 10 bits, there will be 210 - 1 = 1023 steps of 10mV each. The full-
scale output will therefore be 10mV × 1023 = 10.23 V and
10 mV
% resolution = × 100% ≈ 01%
.
10.23 V
Problem 4 helps to illustrate the fact that the percentage resolution
becomes smaller as the number of input bits is increased. In fact, the
percentage resolution can also be calculated from.
1
% resolution = × 100%
total number of steps
For an N-bit binary input code the total number of steps is 2N-1. Thus,
for the previous example,
1
% resolution = 10 × 100%
2 −1
1
= × 100%
1023
≈ 01%
.
173