Digital Electronics: CT 304N
Unit–7
 D/A and A/D Converters
          Dr. Anand J. Patel
                          Index
• Introduction
• D/A converters:
      o the binary weighted resistor network
      o the R-2R ladder network.
• A/D converters:
      o Counting
      o Tracking
      o Flash
      o Successive approximation
      o Dual slope
                                               2
                   Introduction
• Analog output is typical of most transducers and
  sensors. In order to use the power of digital
  electronics with the real world, one must convert from
  analog to digital and vice versa.
• Examples of A/D Applications
   – Microphones - take your voice varying pressure waves in
     the air and convert them into varying electrical signals
   – Thermocouple – temperature measuring device converts
     thermal energy to electric energy
   – Digital Multimeters
                                                                3
          The need for Data Converters
                         PRE-PROCESSING                    DIGITAL               POST-PROCESSING
ANALOG SIGNAL                                                                                           ANALOG
                         (Filtering and analog           PROCESSOR                 (Digital to analog   OUTPUT
(Speech, Images,         to digital conversion)         (Microprocessor)            conversion and       SIGNAL
 Sensors, Radar, etc.)                                                                  filtering)
                                                                                                        (Actuators, antennas, etc.)
                                                          CONTROL
                             ANALOG               A/D       DIGITAL        D/A           ANALOG
                         In many applications, performance is critically
                             limited by the A/D and D/A performance
                     A/D and D/A converters
Vmax = 7.5V         1111                      4                                                         4
      7.0V          1110
      6.5V          1101                      3                                                         3
                                                                                    analog output (V)
                           analog input (V)
      6.0V          1100
      5.5V          1011
                                              2                                                         2
      5.0V          1010
      4.5V          1001
      4.0V                                    1                                                         1
                    1000
      3.5V          0111
      3.0V          0110                                                     time                                                          time
                                                   t1    t2      t3     t4                                   t1       t2      t3      t4
      2.5V          0101
      2.0V          0100                          0100   0110 0110 0101                                     0100     1000 0110        0101
      1.5V          0011                                 Digital output                                             Digital input
      1.0V          0010
      0.5V          0001
Vmin = 0V           0000
         proportionality                                 analog to digital                                        digital to analog
                                                                                                                                                  5
   Relationship Between Analog and Digital Values
Vmax = 7.5V
      7.0V
                    1111
                    1110
                           An ideal A/D converts an analog voltage to a
      6.5V
      6.0V
                    1101   linearly proportional digital representation.
                    1100
      5.5V          1011
                           The A/D has two sides: analog and digital.
      5.0V          1010
      4.5V          1001
      4.0V          1000
      3.5V          0111
      3.0V          0110
      2.5V          0101
      2.0V          0100                Analog            Digital
      1.5V          0011                Vmin              0..000
      1.0V
      0.5V
                    0010                  :                  :
                    0001
Vmin = 0V           0000                Vmax              1..111
         proportionality
                           • If input voltage > Vmax the digital output is 1..111.
                           • Similarly if input < Vmin the digital output is 0..000.
                                                                                       6
   Relationship Between Analog and Digital Values
Vmax = 7.5V
      7.0V
                    1111
                    1110
                           Let the A/D converter has n-bit digital output
      6.5V
      6.0V
                    1101   and let A be Analog Value and D be the
                    1100
      5.5V          1011   equivalent Digital Number.
      5.0V          1010
      4.5V          1001
      4.0V
      3.5V
                    1000
                    0111
                           Then,
      3.0V          0110
      2.5V          0101
      2.0V          0100             Analog         Digital
      1.5V          0011             Vmin           0..000
      1.0V
      0.5V
                    0010
                                      A                D
                    0001
Vmin = 0V           0000             Vmax           1..111
         proportionality
                                        A  Vmin
                                    D             (2 n  1)
                                       Vmax  Vmin
                                                                            7
                                  Some definitions
Offset: minimum analog value Vmin
Span (or Range): is the difference between maximum and minimum analog values Vmax - Vmin
Step Size (or Resolution, Q): smallest analog change resulting from changing one bit in the digital number,
or the analog difference between two consecutive digital numbers:
                                           Vmax  Vmin
                                        Q
                                             2n  1
                    stepsize
% Resolution :               x100%
                    Fullscale
                                                                                                        8
                   DAC SPECIFICATIONS
• D/A converters are available with wide range of specifications
  specified by manufacturer. Some of the important
  specifications are Resolution, Accuracy, linearity, monotonicity,
  conversion time, settling time and stability.
                                                                      9
                       DAC SPECIFICATIONS
• Resolution: The resolution of a DAC is the reciprocal of the number of
  discrete steps in the DAC. This is independent of the number of
  bits. Resolution can also be shown as the number of bits converted.
• Accuracy: This is the comparison of the actual output of a DAC with the
  expected output. This is expressed as a percentage of a full scale, or
  maximum output voltage.
• Linearity: A linear error is a deviation from the ideal straight-line output of
  a DAC.
• Monotonicity: A DAC is monotonic if it does not take any reverse steps
  then it is sequenced over its entire range of input bits.
• Setting Time: This is the time it takes a DAC to settle within +/- 1/2 of a
  least significant bit of its final value when a change occurs in the input
  code.
                                                                                10
                                  Resolution
• Resolution:
• Resolution is defined as the number of different analog output voltage levels
  that can be provided by a DAC.
• Or alternatively resolution is defined as the ratio of a change in output voltage
  resulting for a change of 1 LSB at the digital input. Simply, resolution is the value
  of LSB.
• Example:
• Resolution for an 8 – bit DAC for example is said to have:
• 8 – bit resolution
• A resolution of 0.392 of full-Scale (1/255)
• A resolution of 1 part in 255.
• Thus resolution can be defined in many different ways.
                                                                                          11
                        Example
Given an 4-bit A/D converter having an analog input that
ranges form 0V to 7.5V. What is the resolution of this A/D
converter?
Answer:
                 Vmax  Vmin 7.5  0
              Q             4       0.5V
                   2 1
                     n
                              2 1
                                                             12
D/A Converter
                13
       Binary representation and bit weight
In an electronic circuit, a combination of high voltage (+5V) and
low voltage (0V) is usually used to represent a binary number.
For example, a binary number 1010 is represented by
                  Weighting     23    22   21    20
                 Binary Digit    1    0     1    0
                    State       +5V   0V   +5V   0V
D/As are electronic circuits that convert digital, (usually binary)
signals (for example, 1000100) to analog electrical quantities
(usually voltage) directly related to the digitally encoded input
number.
                                                                      14
                 Types of D/A Converters
We will consider two types of D/A:
     o the binary weighted resistor network
     o the R-2R ladder network.
                                              15
The binary weighted resistor network
– Comprises of a register and resistor network
– Output of each bit of the register will be low (0V) or high (5V)
– Input resistance is inversely proportional to the binary weight
  of each digit.
      MSB                     R   I1             Rf
             4-bit register
                              2R I2     If
                              4R I3          -
                                       S I
      LSB                     8R I4          +
                                                              Vo
             Vo   I f R f  ( I1  I 2  I 3  I 4 ) R f          16
                     D/A Example
In the previous D/A, calculate the output voltage for an input
code word 0110 if a logic 1 is 5V and a logic 0 is 0V, and
R = Rf = 1k.
Answer:
   • I1 = I4 = 0
   • I2 = 5V / 2R = 5 / 2KΩ = 2.5 mA
   • I3 = 5V / 4R = 5 / 4KΩ = 1.25 mA
   Vo = -If Rf
      = -(I4 + I3+ I2+ I1)Rf
      = -(2.5+1.25) x 1000
      = -3.75 V
                                                                 17
         The binary weighted resistor network
• Very difficult to manufacture very accurate resistors over this
  range.
• Seldom used for digital numbers having more than 6 bits.
                                                                    18
 The R-2R Ladder Resistor Network
• Only two resistance values R and 2R are used.
• The principle of the network is based on Kirchhoff's current rule.
• Note that the network of resistors to the right of each node has an
  equivalent resistance of 2R.
   I       I/2     R           I/4     R        I/8
                                                              Bit   Current
                                                              2     I/2
                                                              1     I/4
   2R                  2R                  2R            2R
                                                              0     I/8
          I1=I/2              I2=I/4            I3=I/8
        bit 2               bit 1           bit 0
                                                                              19
The R-2R Ladder Resistor Network
                                The state of the
                                bits is used to
                                switch a voltage
                                source
                        I      I    I
            Vo   R f  b2  b1  b0 
                        2      4    8            20
Analog to Digital Converter
                              21
                A/D converter
• Converts analog signals into binary words
                                              22
       The Sample & Hold (S/H)
To measure an AC voltage at a particular instant in time, it is
necessary to sample the waveform with a ‘sample and hold’
(S/H) circuit.
                                                                  23
      Types of A/D Converters
There several type of A/D converters. Here, we
will consider the following types:
  1. Counting type
  2. Tracking type
  3. Parallel or Flash
  4. Successive Approximation
  5. Dual slope
                                                 24
                    ADC Specifications
• Like DAC, ADCs are also having many important specifications.
  Some of them are Resolution, Quantization error, Conversion
  time, Analog error, Linearity error, DNL error, INL error & Input
  voltage range.
                                                                      25
                     ADC Specifications
• Resolution:
• The resolution refers to the finest minimum change in the signal
  which is accepted for conversion, and it is decided with respect to
  number of bits. It is given as 1/2n, where n is the number of bits in
  the digital output word. As it is clear, that the resolution can be
  improved by increasing the number of bits or the number of bits
  representing the given analog input voltage.
• Resolution can also be defined as the ratio of change in the value of
  input voltage Vi, needed to change the digital output by 1 LSB.
                                                                      26
                     ADC Specifications
• Quantization error:
• If the binary output bit combination is such that for all the
  values of input voltage Vi between any two voltage levels,
  there is a unavoidable uncertainty about the exact value of Vi
  when the output is a particular binary combination. This
  uncertainty is termed as quantization error. Its value is ± (1/2)
  LSB.
                                                                      27
                                ADC Specifications
• Analog Error:
• An error occurring due to the variations in DC switching point of the comparator, resistors, reference
  voltage source, ripples and noises introduced by the circuit components is termed as Analog error.
• Linearity Error:
• It is defined as the measure of variation in voltage step size. It indicates the difference between the
  transitions for a minimum step of input voltage change. This is normally specified as fraction of LSB.
• DNL (Differential Non-Linearity) Error:
• The analog input levels that trigger any two successive output codes should differ by 1 LSB. Any
  deviation from this 1 LSB value is called as DNL error.
• INL (Integral Non-Linearity Error:
• The deviation of characteristics of an ADC due to missing codes causes INL error. The maximum
  deviation of the code from its ideal value after nulling the offset and gain errors is called as Integral
  Non-Linearity Error.
• Input Voltage Range:
• It is the range of voltage that an A/D converter can accept as its input without causing any overflow
  in its digital output.
                                                                                                          28
                           Counting ADC
                  Comparator                                         START
       Vin                                           Control Logic
                                                                      clock
                                                       Counter
                            D/A
                                                   Digital Output
o When START is received, control logic sets counter to 0, and turns on Clock
  sending regular pulses to the counter.
o As the Clock sends regular pulses to the counter, the counter outputs a digital
  signal to the Digital-to-Analog converter
                                                                                    29
•   As the counter counts, its output to the D/A generates a staircase ramp to
    the comparator.
    Vin
                                                    Note that the conversion
    V’in                                            time depends on the size
                                                    of the input signal
             Conversion time         Conv.time
•   As the ramp voltage increases to the comparator, it rises closer and closer to
    Vin. When the ramp voltage exceeds Vin , the comparator output shifts which
    signals the control logic to turn off the clock. With the clock off, the counter
    reading is proportional to Vin.
•   With a counting type A/D, if the signal is varying rapidly, the counter must
    count up and reset before each cycle can begin, making it difficult to follow
    the signal.
                                                                                       30
Tracking type ADC
                    31
Tracking type ADC
• Tracking uses an up-down counter and is faster that the counting type ADC
  because the counter is not reset after each sample.
• It tracks analog input hence the name tracking.
• In order for this to work, the output reference voltage should be lower than the
  analog input.
• When the comparator output is high, the counter is in counting up mode of
  binary numbers.
• As a result, this increases stair step reference voltage out until the ramp reaches
  the input voltage amount.
• When reference voltage equals the input voltage the comparators output is
  switched to low mode and starts counting down.
• If the analog input is decreasing the counter will continue to back down to track
  input. If the analog input is increasing the counter will go down one count and
  resume counting up to follow the curve or until the comparison occurs.
                                                                                    32
        Flash Converters ADC
• If very high speed conversions are needed,
  e.g. video conversions, the most commonly
  used converter is a Flash Converter.
• While such converters are extremely fast,
  they are also very costly compared to other
  types.
                                                33
Flash Converters
The resistor network
is a precision voltage
divider, dividing Vref
into equal voltage
increments to one
input of the
comparator.
The other comparator
input is the input
voltage.
                         34
                     Flash Converters
• The encoder logic implements a truth table to convert the ladder of
  inputs to the binary number output.
• The cost of this type of converter stems from the circuit complexity
  since the number of comparators and resistors required increases
  rapidly. The 3-bit example required 7 converters, 6-bits would
  require 63, while an 8-bits converter would need 255 comparators
  and equivalent precision resistors.
                                                                         35
         Successive approximation ADC
• This is the most common A/D used in the
  laboratory environment.
• It is reasonably priced for large bit values, i.e. 10,
  12.
• Its conversion times, typically ~ 10-20 s, are
  adequate for most laboratory functions. Good
  tradeoff between speed and cost
• Generates the digital output serially (one bit at a
  time).
                                                           36
               Successive approximation ADC
analog                  D/A Converter      Vref
input
                                             Digital
                                             Output
                                             Data
  comparator
                            Successive       clock
                           Approximation
                             Register
                 STRT
  At the beginning, all bits from the SAR are set to zero, and
  conversion begins by taking STRT line low.
                                                                 37
               Successive approximation ADC
analog                    D/A Converter      Vref
input
                                               Digital
                                               Output
                                               Data
  comparator
                              Successive       clock
                             Approximation
                               Register
                  STRT
         First the logic in the SAR sets the MSB bit equal to 1
         (+5 V). Remember that a 1 in bit 7 will be half of full
         scale.
                                                                   38
               Successive approximation ADC
analog                  D/A Converter      Vref
input
                                             Digital
                                             Output
                                             Data
  comparator
                            Successive       clock
                           Approximation
                             Register
                 STRT
The output of the SAR feeds the D/A converter producing an
output compared to the analog input voltage. If the D/A output is
< Vin then the MSB is left at 1 and the next bit is then tested.
                                                                    39
               Successive approximation ADC
analog                  D/A Converter      Vref
input
                                             Digital
                                             Output
                                             Data
  comparator
                            Successive       clock
                           Approximation
                             Register
                 STRT
   If the D/A output is > Vin then the MSB is set to 0 and
   the next bit is set equal to 1.
                                                             40
         Successive approximation ADC
• Successive bits are set and tested by comparing the
  D/A output to the input Vin in an 8 step process (for
  an 8-bit converter) that results in a 8-bit binary
  output that represents the input voltage.
• Note that the successive approximation process
  takes a fixed time - 8 clock cycles for the 8-bit
  example.
                                                          41
                             Example
Calculate the maximum conversion time of
(a)a 8-bit counting A/D and
(b) a successive approximation A/D,
if the clock rate is 2MHz.
Solution:
(a)   For a 8-bit counting A/D, the maximum number of count is
                             nc = 28 = 256
Therefore, the maximum conversion time is
                   nc     256
              Tc                128  10 6
                                               s  128s
                    f   2  10 6
                                                                 42
               Example, continued
(b) For a 8-bit successive approximation A/D, the
conversion time is constant and equal to
                    n    8
             Tc              4  10 6
                                          s  4s
                    f 2  106
It is noted that the conversion speed of successive
approximation A/D is much faster than the counting type.
                                                           43
Dual slope ADC
                 44
Dual slope ADC
• Dual-Slope ADC operate on the principle of integrating the
  unknown input and then comparing the integration times with
  a reference cycle. The basic way is to use two slopes (dual) as
  in this diagram:
                                                                45
Dual slope ADC
• This circuit operates by switching in the unknown input signal and then
  integrating for full scale number counts.
• During this cycle the reference is switched in and if the reference is of
  opposite polarity, the ramp will be driven back towards ground.
• The time that is takes for the ramp to again reach the comparator threshold
  of ground will be directly proportional to the unknown input signal.
• Since the circuit uses the same time constant for the integrator, the
  component tolerances will be the same for both the integration and
  differentiation cycles.
• Therefore the errors will cancel except for the offset voltage that will be
  additive during both the cycles.
• The main benefits of this type is the increased range, the increased accuracy
  and resolution, and the increased speed.                                      46
               Accuracy of A/D Conversion
There are two ways to improve accuracy of A/D conversion:
• increasing the resolution (by increasing the number of bits e.g. 10-
  bit, 12-bit, etc.) which improves the accuracy in measuring the
  amplitude of the analog signal.
• increasing the sampling rate which increases the maximum
  frequency that can be measured.
                                                                         47
                     Aliasing
• Occurs when the input signal is changing much faster
  than the sample rate.
  For example, a 2 kHz sine wave being sampled at 1.5
  kHz would be reconstructed as a 500 Hz (the aliased
  signal) sine wave.
Nyquist Rule:
• Use a sampling frequency at least twice as high as
  the maximum frequency in the signal to avoid
  aliasing.
                                                         48
The End
          49