COURSE / CODE DIGITAL SYSTEM FUNDAMENTALS (ECE421) DIGITAL ELECTRONICS FUNDAMENTAL (ECE422) ANALOG TO DIGITAL (ADC) and DIGITAL TO ANALOG CONVERTERS (DAC) Connecting digital circuitry to sensor devices is simple if the sensor devices are inherently digital themselves. Switches, relays, and encoders are easily interfaced with gate circuits due to the on/off nature of their signals. However, when analog devices are involved, interfacing becomes much more complex. What is needed is a way to electronically translate analog signals into digital (binary) quantities, and vice versa. An analog-to-digital converter, or ADC, performs the former task while a digital-to-analog converter, or DAC, performs the latter. An ADC inputs an analog electrical signal such as voltage or current and outputs a binary number. In block diagram form, it can be represented as such: 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: 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: It is much easier to convert a digital signal into an analog signal than it is to do the reverse. Mohd. Uzir Kamaluddin / Aug 2016 Page 1
Digital to Analog Conversion (DAC) Basically, D/A conversion is the process of taking a value represented in digital code (binary or BCD) and converting it into a voltage or current that is proportional to the digital value. In general, analog output = K x digital input Example 1: A 5-bit DAC has current output. For a digital input of 10100, an output current of 10mA is produced. What will be the current output IOUT for a digital input of 11101? (Ans: 14.5 ma) Example 2: What is the largest value of output voltage from an 8-bit DAC that produces 1 V for a digital input of 00110010? (Ans: 5.1 V) Binary Weighted Resistor DAC One way to achieve D/A conversion is to use a summing amplifier. It uses resistors scaled by two to divide voltage on each branch by a power of two. This approach is not satisfactory for a large number of bits because it requires too much precision in the summing resistors. This problem is overcome in the R-2R network DAC. Exercises: 1. Write down the amplifier output VOUT. 2. Determine the weight of each input bit of the DAC. 3. Change R3 to 2.5K and determine the full scale output. 4. A certain 6-bit binary weighted DAC uses 20K resistor as its MSB resistor. What is its LSB resistor? R-2R Ladder DAC The summing amplifier with the R-2R ladder of resistances shown produces the output where the binary input takes the value 0 or 1. The figure below is illustrated for 3 bits, but can be extended to any number with just the resistance values R and 2R. It can be shown that the value of output voltage Vout is given by the expression: VREF VOUT Binary Input 2 N Where normally VREF = 5 V (logic 1) and N is the number of input bits. Mohd. Uzir Kamaluddin / Aug 2016 Page 2
Exercise: Assume that the VREF= 5 V for the R/2R DAC, calculate the resolution and full-scale output. The resolution is when binary input = 001 and full-scale output is when binary input = 111. Specification of DACs Resolution (Step Size) The amount of variance in output voltage for every change of LSB in the digital input. The higher resolution will give a smaller voltage division at the output. Resolution = VLSB = VREF/2 N where N is the number of bits Example: A 5-bit DAC produces an output voltage of 0.2 V for a digital input of 00001. Find the output voltage for an input of 11111. (Ans: 6.2 V) What is the resolution (step size) of this DAC? (Ans: 0.2 V) Draw the staircase signal of this DAC. Determine the output voltage for this DAC if the digital input is 10001. (Ans: 3.4 V) Percentage 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. Example: A 4-bit DAC has a full scale output of 15 V. Its step size is 1 V thus its % resolution step size is 100 % =6.67% full scale Exercise: A 10-bit DAC has a step size of 10 mv. Determine the full scale output voltage and the percentage resolution. (Ans: FS output =10.23 V and % resolution = approx. 0.1%) The percentage resolution becomes smaller as the number of input bits increased. Percentage 1 resolution can also be calculated using 100 % total number of steps Speed The rate of conversion of a single digital input to its analog equivalent. Conversion rate normally depends on the clock speed of the input signal and the settling time of the converter. When the input changes rapidly, the DAC conversion speed must be high. Mohd. Uzir Kamaluddin / Aug 2016 Page 3
Settling time Settling time is the time required for the input signal voltage to the expected output voltage within ±½ VLSB (half the step-size). Ideally, an instantaneous change in analog voltage would occur when a new binary word enters into the DAC. Typical values of settling time is around 50ns to 10micro seconds. Linearity The difference between the desired analog output and the actual output over the full range of expected values. Ideally, a DAC would produce a linear relationship between a digital input and the analog output, but this is not always the case. Exercise: A certain 8-bit DAC has FS output of 2mA and a FS error of ±0.5%FS. What is the range of possible outputs for an input of 10000000? (Ans: 994 to 1014 microa) Reference voltage A specified voltage used to determine how each digital input will be assigned to each voltage division. Full scale voltage Defined as the output voltage when the digital input is all 1 s. Analog to Digital Conversion (ADC) A/D converters are electrical circuits that have the following characteristics. 1. The input to the A/D converter is a voltage. A/D converters may be designed for voltages from 0 to 10 V, from -5 to +5 V, etc., but they almost always take a voltage input. (Some rare exceptions occur with current inputs!) In any event, the input is an analog voltage signal for most cases. 2. The output of the A/D converter is a binary signal, and that binary signal encodes the analog input voltage. So, the output is some sort of digital number. This is a sample of the large number of analog-to-digital conversion methods. The basic principle of operation is to use the comparator principle to determine whether or not to turn on a particular bit of the binary number output. It is typical for an ADC to use a digital-to-analog converter (DAC) to determine one of the inputs to the comparator. Digital Ramp ADC Conversion from analog to digital form inherently involves comparator action where the value of the analog voltage at some point in time is compared with some standard. A common way to do that is to apply the analog voltage to one terminal of a comparator and trigger a binary counter which drives a DAC. The 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. Mohd. Uzir Kamaluddin / Aug 2016 Page 4
Example: Assume the ADC has the following values: clock frequency = 1 MHz, VT = 0.1 mv, FS output = 10.23 V and 10 input bit. Calculate: a) The digital equivalent obtained for VA=3.728 V (Ans: 0101110101) b) The conversion time. (Ans: 373 micro seconds) c) The resolution of the ADC. (Ans: approx. 0.1%) Conversion time tc is the time interval between the end of the start pulse and the activation of the end of conversion (EOC) output, and is given as tc (max) = (2 N -1) clock cycles, where N is the number of bits of the converter. Successive Approximation ADC The successive approximation ADC is much faster than the digital ramp ADC because it uses digital logic to converge on the value closest to the input voltage. A comparator and a DAC are used in the process. Shown below is a 4-bit SAC with 1 Volt step size. Mohd. Uzir Kamaluddin / Aug 2016 Page 5
The SAC does not use a counter to provide the input to the DAC block but uses a register instead. The control logic modifies the contents of the register bit by bit until the register data are the digital equivalent of the analog voltage VS within the resolution of the converter. Exercise 1: An 8-bit SAC has a resolution of 20 mv. What will its digital output be for an analog input of 2.17 V? (Ans: 011011002) Exercise 2: What is the conversion time for the 4- bit SAC if the processing of each bit takes one clock cycle? (Ans: 4 clock cycles) Flash ADC Shown below is a 3-bit flash ADC with resolution 1 Volt. The resistor net and comparators provide an input to the combinational logic circuit, so the conversion time is just the propagation delay through the network - it is not limited by the clock rate or some convergence sequence. It is the fastest type of ADC available, but requires a comparator for each value of output (63 for 6-bit, 255 for 8-bit, etc.) Such ADCs are available in IC form up to 8-bit and 10-bit flash ADCs (1023 comparators) are planned. The encoder logic executes a truth table to convert the ladder of inputs to the binary number output. Mohd. Uzir Kamaluddin / Aug 2016 Page 6
Exercise 1: A flash ADC does not contain a DAC, true or false? Exercise 2: How many comparators would a 12-bit flash converter require? How many resistors? Exercise 3: State the major advantage and disadvantage of a flash converter. Other A/D Conversion Methods Several other methods of A/D conversion have been in use for some time, each with its relative advantages and disadvantages. 1. Up/Down Digital Ramp ADC (Tracking ADC) The up/down counter is used instead of the up counter to reduce the time taken for conversion. When a new conversion is to begin, the counter is not reset to 0 but begins counting either up or down from its last value, depending on the comparator output. Mohd. Uzir Kamaluddin / Aug 2016 Page 7
2. Dual Slope Integrating ADC This ADC has the slowest conversion time but has the advantage of relatively low cost because it does not require precision components such as a DAC or a VCO. 3. Voltage to Frequency ADC This ADC is simpler than the other ADCs because it does not use a DAC, instead it uses linear voltage controlled oscillator (VCO) that produces an output frequency proportional to its input voltage. Mohd. Uzir Kamaluddin / Aug 2016 Page 8