Ad/Da Converter
Ad/Da Converter
DEE30043–Electronic Circuits
AD/DA CONVERTER
              Together, they are often used in digital systems to provide complete interface
        with analog sensors and output devices for control systems such as those used in
        automotive engine controls:
                                                1
                                 ELECTRICAL ENGINEERING DEPARTMENT
                               POLITEKNIK SULTAN ABDUL HALIM MU’ADZAM
                                                   SHAH
                                     06000 JITRA, KEDAH DARUL AMAN
DEE30043–Electronic Circuits
   It is much easier to convert a digital signal into an analog signal than it is to do the
   reverse. Therefore, we will begin with DAC circuitry and then move to ADC circuitry.
                   A DAC, on the other hand, inputs a binary number and outputs an analog
                   voltage or current signal. In block diagram form, it looks like this:
Audio
           Most modern audio signals are stored in digital form (for example MP3s and CDs)
           and in order to be heard through speakers they must be converted into an analog
           signal. DACs are therefore found in CD players, digital music players, and PC sound
           cards.
           Specialist standalone DACs can also be found in high-end hi-fi systems. These
           normally take the digital output of a compatible CD player or dedicated transport
           (which is basically a CD player with no internal DAC) and convert the signal into
           an analog line-level output that can then be fed into an amplifier to drive speakers.
           Data transmission over the Internet is done digitally so in order for voice to be
           transmitted it must be converted to digital using an Analog-to-Digital Converter
                                                 2
                                      ELECTRICAL ENGINEERING DEPARTMENT
                                    POLITEKNIK SULTAN ABDUL HALIM MU’ADZAM
                                                        SHAH
                                          06000 JITRA, KEDAH DARUL AMAN
DEE30043–Electronic Circuits
           and be converted into analog again using a DAC so the voice it can be heard on the
           other end.
Video
                                        D
                                        C
                                        B         DAC              VOUT             1V
                                        A          Resolusi
                                                    (1 V)
                                    clock                         0V
                                    mo                                                                  Bin
                                                                   0000 …    1001 ………..
                                                              3
                                  ELECTRICAL ENGINEERING DEPARTMENT
                                POLITEKNIK SULTAN ABDUL HALIM MU’ADZAM
                                                    SHAH
                                      06000 JITRA, KEDAH DARUL AMAN
DEE30043–Electronic Circuits
                      All resistors must be of equal value. If any of the input resistors were
               different, the input voltages would have different degrees of effect on the
               output, and the output voltage would not be a true sum. Let's consider,
               however, intentionally setting the input resistors at different values. Suppose
               we were to set the input resistor values at multiple powers of two: R, 2R, and
               4R, instead of all the same value R:
               Starting from V1 and going through V3, this would give each input voltage
               exactly half the effect on the output as the voltage before it. In other words,
               input voltage V1 has a 1:1 effect on the output voltage (gain of 1), while input
               voltage V2 has half that much effect on the output (a gain of 1/2), and V3 half
               of that (a gain of 1/4). If we drive the inputs of this circuit with digital gates so
               that each input is either 0 volts or full supply voltage, the output voltage will be
               an analog representation of the binary value of these three bits.
                                                   4
                                 ELECTRICAL ENGINEERING DEPARTMENT
                               POLITEKNIK SULTAN ABDUL HALIM MU’ADZAM
                                                   SHAH
                                     06000 JITRA, KEDAH DARUL AMAN
DEE30043–Electronic Circuits
                      If we chart the output voltages for all eight combinations of binary bits
               (000 through 111) input to this circuit, we will get the following progression of
               voltages (for VDD =10 volts):
                       If we wish to expand the resolution of this DAC (add more bits to the
               input), all we need to do is add more input resistors, holding to the same
               power-of-two sequence of values:
                                                 5
                                    ELECTRICAL ENGINEERING DEPARTMENT
                                  POLITEKNIK SULTAN ABDUL HALIM MU’ADZAM
                                                      SHAH
                                        06000 JITRA, KEDAH DARUL AMAN
DEE30043–Electronic Circuits
D C B A
                     3V
                                      18.7K    37.5K   75K       150K
                                                                               RF
                                 R4     R        R      R
                                        3        2      1                      20K
                                                                          --
                                                                                                     VVout
                                                                                                         o
                                                                          ++                         V
                                                                                                      ut
Example:- T
             Calculate the resistive value of R1, R2,R3 and R4 for                   4   bit DAC circuit above and
             find out the Vout for 0001 and 0110 input.
             Resistive value:-
             R 1 =150K Bit 20 (LSB)
             R2 = R1 = 150K = 75k,  Bit 21
                  21    21
                R 1 150K 150K
            R3 =  2
                    =   2
                          =       = 37.5k ,  Bit 2 2
                2     2       4
                R 1 150K
            R4 = 3 =      = 18.75k   Bit 2 3
                2      8
                                                             6
                                  ELECTRICAL ENGINEERING DEPARTMENT
                                POLITEKNIK SULTAN ABDUL HALIM MU’ADZAM
                                                    SHAH
                                      06000 JITRA, KEDAH DARUL AMAN
DEE30043–Electronic Circuits
                 or
                 RIN =          1           dan Vout = Vref RF RIN, so we can find Vout with
                          1   1   1   1
                            +   +   +
                         R 4 R 3 R 2 R1
                 replacing RIN, and for all sixteen combinations of binary bits (0000 through
                 1111) input to this circuit, we will get the following progression of voltages
                 (for VCC =6 volts): -
                          0         0        0            0            0        0
                          1         0        0            0            1       0.4
                          2         0        0            1            0       0.8
                          3         0        0            1            1       1.2
                          4         0        1            0            0       1.6
                          5         0        1            0            1       2.0
                          6         0        1            1            0       2.4
                          7         0        1            1            1       2.8
                          8         1        0            0            0       3.2
                          9         1        0            0            1       3.6
                         10         1        0            1            0       4.0
                         11         1        0            1            1       4.4
                         12         1        1            0            0       4.8
                         13         1        1            0            1       5.2
                         14         1        1            1            0       5.6
                         15         1        1            1            1       6.0
                                                 7
                                           ELECTRICAL ENGINEERING DEPARTMENT
                                         POLITEKNIK SULTAN ABDUL HALIM MU’ADZAM
                                                             SHAH
                                               06000 JITRA, KEDAH DARUL AMAN
DEE30043–Electronic Circuits
               It uses resistors of only two different values, and their ratio is 2:1. An N-bit
               DAC requires 2N resistors, and they are quite easily trimmed.
                                                                        Vref R f
           a) For input equal to 012 = 110, Vout =                               , 3 circuit below show you the
                                                                         4 R
               equivalent circuit
                            Vref
                                           B
                               A
                                   I1                Rf
                                                                        I1 = Vref/2R, I2 = 0/2R = 0.
                        A                B
                       2R                                          I2
                                    I3
                                         2R                             I3 = I1 + I2 = Vref/2R
                       2                         -
                      Vth1 I
                       R (1+2R                   -
                                                 +                      Rth = 2R 2R = R, Vth1 = Vref/2
                       2R      ) I2
                                                            VOUT
                      then,
                        2
                        R
                                                              8
                                                   ELECTRICAL ENGINEERING DEPARTMENT
                                                 POLITEKNIK SULTAN ABDUL HALIM MU’ADZAM
                                                                     SHAH
                                                       06000 JITRA, KEDAH DARUL AMAN
DEE30043–Electronic Circuits
                                                                         B
                                                                                                               I4 = Vref/2R = 0/2R = 0.
                                                                                      Rf
                                                                I4
                                                                B                                          I I5 = Vref/(2 X 2R) = Vref/(4R)
                                                               2R
                                                                                                           2
                            then,
                               VREF/2
                                                                2R                                             Rth = 2R 2R = R, Vth2 = Vref/4
                                                                                  -
                                            I5    R            R Vth
                                                                                  -
                                                                     2
                                                                                  +
                                                                                                  VOUT
                                                      2
                                                          Rf
                                                      R
                             I6                                              IO                                I6 = Vref/4R = -Io
                                                      -
                         I(1+2 R                      -                                                        VOUT (01) = Io X Rf = Vref/(4R) x Rf
                     VREF/4
                         )                            +
                                           2R
                                                                             VOUT                                               Rf
                                                                                                                = (Vref/4)
                                                                                                                                R
A Vref
                                  B
                                                                                           Vref
                                                                                                                                              Rf
                                           Rf                                                     B
                     I1                                                                                   Rf
              AI                                                                        I4                                       I6
              2R      2R                                                                   B                           I                           IO
                                                                                      2R                               VREF/2             -
             2
                   2 I3
                                                               0
                                                                                                                        2       I(1   R   -
                    2R                -                                                                                                   +
             Vth1 I
             R (1 R                    -                                              2R              -
                                                                                                      -
                                                                                                                                +2)
                                      +                            I5    R        I(1R Vt                                                          VOUT
             2R    +2)I2                          VOUT                                       h2
                                                                                                      +                              2
                                                                                  +2)
               2                                                                                                 VOU                 R
                                                                             2                                   T      I6 = Vref/2R = -Io
               R                                                                                                        VOUT (10) = Io X Rf =
                                                                             R
                                                                                                                        Vref/(2R) x Rf
              I1 = Vref/2R= I2 = 0/2R I4 = Vref/2R.                                                                                        R
              = 0.                     I5 = 0                                                                                  = (Vref/2) f
              I3 = I1 + I2 = Vref/2R Rth = R, Vth2 = Vref/2                                                                                R
              =0                                    9
              Rth =2R 2R = R, Vth1  DAC circuit for R/2R for 102 bit input
              =0
                                            ELECTRICAL ENGINEERING DEPARTMENT
                                          POLITEKNIK SULTAN ABDUL HALIM MU’ADZAM
                                                              SHAH
                                                06000 JITRA, KEDAH DARUL AMAN
DEE30043–Electronic Circuits
                     A
                                        Vref
                                    B
                                                                                      Vref                                       Rf
                                               Rf
                          I1                                                                 B   Rf
                    AI                                                           I4                                                   IO
                   2R          2R                                                 B                       I      I7
                                                                                                        3VREF/4              -
                   2
                        2 I3                                                     2R
                                                                                                                I(1      R   -
                   Vth1 I 2R
                                                                                                          2
                                         -
                                          -                 Vref/2                                                           +
                   R (1 R                +                                         2    -                          +2)
                   2R +2)I2                                          I5   R
                                                                                        -
                                                                               I(1RRVth +                                2
                                                                                                                                      VOU
                                                                                                                                      T
                                                      VOU
                    2                                 T                        +2)    2
                                                                                                      VOUT               R
                    R                                                   2
                                                               I4 = VrefR/2R.                                I7 = 3Vref/4R = -Io
                  I1 = Vref/2R, I2 = 0                         I5 = Vref/4R,                                 VOUT (11) = Io X Rf
                  I3 = I 1 + I 2 =                             I6 = I 4 + I 5 =                                        = 3Vref/(4R) x Rf
                                                               3Vref/4R                                                               R
                  Vref/2R                                      Rth = 2R//2R =                                = (3Vref/4) f
                  Rth = 2R//2R = R,                                                                                      R
                                                               R,
                   Vth1 = Vref/2                               Vth2 = 3V ref/4
                                                                       DAC   circuit for R/2R for 102 bit input
                                 V0ut =
                                                    Vref R f
                                                             0 + 1 + 2 + 3
                                                     4 R
                   Most of the digital to analog converters are available in the form of Integrated
                   circuit (IC). It is important that you know some features or specifications of the
                   manufacturer to apply on any circuit. There are five specifications for the DAC,
                   which we discuss.
                                                                          10
                                 ELECTRICAL ENGINEERING DEPARTMENT
                               POLITEKNIK SULTAN ABDUL HALIM MU’ADZAM
                                                   SHAH
                                     06000 JITRA, KEDAH DARUL AMAN
DEE30043–Electronic Circuits
           Figure 6.1.3 shows the DAC receives digital input from mode counter 16. 4-bit DAC has a
           resolution of 1 V and maximum output voltage or full-scale voltage of 15 V. Now let us
           examine the specifications for digital to analog converter.
Resolution
           Defined as the smallest change achieved in the analog output as a result of changes in
           digital input.
           Manufacturers often refer to the resolution of the DAC is in the number of bits. For
           example, 10-bit DAC has a resolution of 10 bits. 10-bit DAC has a resolution smaller than
           8-bit DAC.
           Resolution can be expressed in two cases, either the Voltage or Ampere and percent.
           Resolution in the voltage or Ampere is also known as the step size. You can see in Figure
           6.1.3 above, the output waveform versus the digital input is shaped into a staircase has
           15 stairs and 16 step. 15 stairs is known as the number of steps. So the step size or
           resolution for digital to analog converter in this figure is 1 V. To your knowledge is often
           the resolution is equal to the value of the product when the first digital input of 00012.
           Percentage Resolution can be expressed as the amount of it is also useful to express it as
           a percentage of the full-scale output.
           Example
           Digital to analog converter 10-bit with step size 10 mV. Search for full-scale voltage and
           the percent resolution.
           Solution
           Number of bits = 10
           The total step size = 210-1 = 1023 steps
           Thus, the full-scale output voltage = 10mV x 1023 = 10.23 V
                                                  11
                                    ELECTRICAL ENGINEERING DEPARTMENT
                                  POLITEKNIK SULTAN ABDUL HALIM MU’ADZAM
                                                      SHAH
                                        06000 JITRA, KEDAH DARUL AMAN
DEE30043–Electronic Circuits
                                   stepsize              10mV
           % Resolution =                        100 =           100 = 0.1%
                               fullscalevoltage         10 .23 V
                                     1               1
           or % resolution =                100 =       100 = 0.1%
                                 totalstep         1023
Advantages
                                              Disadvantages
                          Resistive Divider                          R/2R
                  • Hard to match resistors           • More parts
                                                    12
                                 ELECTRICAL ENGINEERING DEPARTMENT
                               POLITEKNIK SULTAN ABDUL HALIM MU’ADZAM
                                                   SHAH
                                     06000 JITRA, KEDAH DARUL AMAN
DEE30043–Electronic Circuits
               An analog signal is a signal that may assume any value within a continuous
        range. Examples of analog signals commonly encountered every day are sound, light,
        temperature, and pressure, all of which may be represented electrically by an analog
        voltage or current. A device that is used to convert an analog signal into an analog
        voltage or current is known as a transducer. An analog-to-digital converter is used
        to further translate this analog voltage or current into digital codes that consist of 1's
        and 0's.
                                                                      MSB
                                                                                D
                           Clock
                                                    ADC                         C
                  Input
                               0–                                               B
                  Voltage                                              LSB
                  Aanalog      3V                                               A
                A typical ADC, therefore, has an analog input and a digital output, which may
        either be 'serial' (consisting of just one output pin that delivers the output code one
        bit at a time) or 'parallel' (consisting of several output pins that deliver all the bits of
        the output code at the same time).
                                                  13
                                    ELECTRICAL ENGINEERING DEPARTMENT
                                  POLITEKNIK SULTAN ABDUL HALIM MU’ADZAM
                                                      SHAH
                                        06000 JITRA, KEDAH DARUL AMAN
DEE30043–Electronic Circuits
             output of the DAC is applied to the other terminal of the comparator. Since the
             output of the DAC is increasing with the counter, it will trigger the comparator at
             some point when its voltage exceeds the analog input. The transition of the
             comparator stops the binary counter, which at that point holds the digital value
             corresponding to the analog voltage.
                                                                                Q0
                            Clock =                                             Q1       Output
                               A                            CK                           digital
                                                                                Q2
                               START
                                         B                  Counter             Q3
                                                            Mod 16
                   Input                                    reset
                             VA
                   analog
                            VA’   +      Voltage
                                  -      Comparator                             DAC
                                        VA > VA’ = 1
                                        VA < VA’ = 0
                                                                                     VOUT
                                       Figure : 4-Bit Digital Ramp Circuit
             1. A positive pulse 'Start' is supplied, a count restored to zero. AND gate output is low,
                so there is no receive any triggered counter bell-shaped.
             2. When the zero count, VA '= 0, so the comparator output is high voltage. When the
                pulse returns low and triggered at the output of the AND gate will be high (because
                all entries are in a logic high) and allows the counter count.
             3. Output DAC, VA 'increase in the voltage step (step voltage) corresponding to the
                step size or resolution.
             4. This process will continue until the VA ' VA. Comparator output will be low; the
                counter will stop on the count represented by the VA. The conversion process is
                complete; the conversion at the output of the comparator from high to low the
                conversion process is complete (EOC - End Of Conversion).
         Example
         Now let's see an example of the conversion of analog inputs, VA = 0.75 V using a
         converter 4-bit digital ramp with a step size 0.2V.
                                                       14
                                     ELECTRICAL ENGINEERING DEPARTMENT
                                   POLITEKNIK SULTAN ABDUL HALIM MU’ADZAM
                                                       SHAH
                                         06000 JITRA, KEDAH DARUL AMAN
DEE30043–Electronic Circuits
               Table 4: Example for ADC with Input Analog 0.75V and 0.33 V digital Ramp 4-bit
            Cycle   Row           Device                 Input Condition            Output
                     1          Comparator        VA = 0.75V, VA’ = 0V, VA > VA’             ‘1’
                     2    Get DAN active                 A = clock, B = ‘1’             1st Pulse
              1
                     3            Counter                     1 clock                     0001
                     4            Display             Q0=’1’, Q1= Q2= Q3=’0’              0001
                     5             DAC                         0001                    VOUT = 0.2V
                     6          Comparator        VA = 0.75V, VA’ = 0.2V,VA > VA’            ‘1’
                     7         Get DAN active            A = clock, B = ‘1’         Pulse 2 to counter
              2
                     8          Comparator                    1 clock                        0
                     9            Display             Q1 = ’1’, Q0= Q2= Q3=’0’            0010
                    10             DAC                         0010                    VOUT = 0.4V
                    11          Comparator        VA = 0.75V, VA’ = 0.4V,VA > VA’            ‘1’
                    12         Get DAN active            A = clock, B = ‘1’         Pulse 3 to counter
              3
                    13            Counter                     1 clock                     0011
                    14            Display            Q1= Q0 = ’1’, Q2= Q3=’0’             0011
                    15             DAC                         0011                    VOUT = 0.6V
                    16          Comparator        VA = 0.75V, VA’ = 0.6V,VA > VA’        Tinggi
                    17         Get DAN active            A = clock, B = ‘1’         Pulse 4 to counter
              4
                    18            Counter                     1 clock                     0100
                    19            Display            Q0= Q1= Q3=’0’ , Q2=’1’              0100
                    20             DAC                         0100                    VOUT = 0.8V
                    21          Comparator        VA = 0.75V, VA’ = 0.8V,VA < VA’            ‘0’
                    22    Get DAN not active             A = clock, B = ‘0’             No Pulse
              5
                    23            Counter            Q0= Q1= Q3=’0’ , Q2=’1’              0100
                    24            Display                Output counter                   0100
                                                        15
                                     ELECTRICAL ENGINEERING DEPARTMENT
                                   POLITEKNIK SULTAN ABDUL HALIM MU’ADZAM
                                                       SHAH
                                         06000 JITRA, KEDAH DARUL AMAN
DEE30043–Electronic Circuits
             Resolution and accuracy of the analog to digital converter is the same as the resolution
             and accuracy for the digital to analog converter
             Conversion time is the time taken to convert the analog input digital exit. For the
             digital ramp converters, counters count from 0 to VA ' VA. Time to complete the
             conversion process, depending on the value of analog input, VA. The greater the value
             of the VA, then more steps and longer time of conversion. We will now see the
             expression for the exchange of digital ramp converter.
                                                      16
                                  ELECTRICAL ENGINEERING DEPARTMENT
                                POLITEKNIK SULTAN ABDUL HALIM MU’ADZAM
                                                    SHAH
                                      06000 JITRA, KEDAH DARUL AMAN
DEE30043–Electronic Circuits
             Example
             Digital ramp ADC has the following values:
             Bell-shaped frequency = 1 MHz, the VT (voltage 'threshold sensitivity' = (VA '- VA) =
             0.1 mV, filled with Scale voltage 10-bit DAC = 10.23V. Find the following values;
             a) If VA = 3568 V, what is the equivalent output.
             b) conversion time.
             c) The resolution of the converter in volts and percent.
Solution:-
                                                    V FS    10 .23
                    size step = resolution =             =        = 10 mV
                                                 totalstep 1023
                   3.5681
                          = 356 .81 = 357 step  [Remember! These formulas are similar to the DAC
                   10 mV
                   output divided by the number of steps, before we know the number of steps =
                   full-scale voltage / step size]
                   When completed the process of conversion, the output of the counter is 35 710 =
                   01,011,001,012, a digital output when VA = 3.568V.
             b)    From a) above we know that the 357 steps required to get products
                   01011001012. Then 357 clock cycles occur at a rate of 1  s. So this will give time
                   for the conversion of 357  s.
                                                                               1
             c)    Resolution = DAC step size = 10 mv,% resolution =              x 100 = 0.1%
                                                                             1023
                                                    17
                                       ELECTRICAL ENGINEERING DEPARTMENT
                                     POLITEKNIK SULTAN ABDUL HALIM MU’ADZAM
                                                         SHAH
                                           06000 JITRA, KEDAH DARUL AMAN
DEE30043–Electronic Circuits
                   Initially all bits of SAR are set to 0. Then, beginning with the most
           significant bit, each bit is set to 1 sequentially. If the DAC output does not exceed
           the input signal voltage, the bit is left as a 1. Otherwise it is set back to 0. It is kind
           of a binary search. For an n-bit ADC, n steps are required.
            Masukan
                     VA
            analog
                    VA’
                          +
                          -
                               jam          Successive-approximation
                                                                            DR (Data ready end-of-
                                                 register (SAR)                conversion)
                                           MSB                  LSB
                          START
                                                                                   Q7
                                                                            Cp
                                                                                   Q6
                                                                           Output Q5    Keluaran
                                                                          register Q    digital
                                                                                    4
                                                                                   Q3
                             Vref =                                                Q2
                             10Vto digital process
           Explanation of analog
                                              8-Bit D/A
                                                       for SAC :-                  Q1
                                  Vout     Converter (DAC)
                                                                                   Q0
                                             Block diagram of 8-Bit SAR
                                                       18
                                  ELECTRICAL ENGINEERING DEPARTMENT
                                POLITEKNIK SULTAN ABDUL HALIM MU’ADZAM
                                                    SHAH
                                      06000 JITRA, KEDAH DARUL AMAN
DEE30043–Electronic Circuits
           1. SAC has a shorter conversion time and fixed (not dependent on the analog input
           value).
           2. SAC circuit using the register circuit to provide input to the DAC block where logic
           controllers ("control logic") to change the contents of the register-to-bit bit up in the
           registry data with an analog input, VA (within the resolution of the converter). Figure
           7.5 is a block diagram of the successive approximation converter.
           1. Control logic (in block list of tools SAC) Recharge the registrar to the logic high MSB
              and other bits to logic low. This produces a value VA 'on the weight of the DAC
              output with the MSB last. If the VA '> VA, the comparator output will be' low 'and this
              will cause the control logic will be reset to low MSB. If the VA '<VA MSB still' high '.
           2. Recharge control logic of the next bit to '1 '. This results in the VA 'a new one. If this
              value is greater than the VA, the comparator output will be 'low' and the control logic
              will be reset that bit to 0. Otherwise, the left bit ' 1 '.
           3. This process continues for each bit in the registry. This process requires a bell-
              shaped per bit. After all bits have been tested registrar will store the digital
              equivalent of the VA.
               Example
               SAC 4-bit converter with 1V step size was used to change the input values, VA
               = 9.9 V. Show each step of the conversion.
               Reset bit to 2 and set next to. ’,VA’ >     1010          10        9.9          ‘0’
               VA
               Reset bit to 3 and set LSB ,VA’ < VA        1001           9        9.9          ‘1’
                                                   19
                                 ELECTRICAL ENGINEERING DEPARTMENT
                               POLITEKNIK SULTAN ABDUL HALIM MU’ADZAM
                                                   SHAH
                                     06000 JITRA, KEDAH DARUL AMAN
DEE30043–Electronic Circuits
20