2 ObjectivesRecognize the relationship between digital and analog values in D/A and A/D converters.Identify two types of D/A:the binary weighted resistor networkthe R-2R ladder network.Explain the operation of three types of A/D:CountingFlashSuccessive approximation
3 Analog signalsAnalog 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 ApplicationsMicrophones - take your voice varying pressure waves in the air and convert them into varying electrical signalsThermocouple – temperature measuring device converts thermal energy to electric energyDigital Multimeters
4 A/D and D/A converters Vmax = 7.5V Vmin = proportionality 0V 1111 1110 000000100100011010001010110000010011010101111001101111010.5V1.0V1.5V2.0V2.5V3.0V3.5V4.0V4.5V5.0V5.5V6.0V6.5V7.0Vanalog to digital4321t1t2t3t4010001100101timeanalog input (V)Digital outputdigital to analog43210100100001100101t1t2t3t4timeanalog output (V)Digital inputVmin =Embedded Systems Design: A Unified Hardware/Software Introduction, (c) 2000 Vahid/Givargis
5 Relationship Between Analog and Digital Values An ideal A/D converts an analog voltage to a linearly proportional digital representation.The A/D has two sides: analog and digital.proportionalityVmax = 7.5V0V11111110000000100100011010001010110000010011010101111001101111010.5V1.0V1.5V2.0V2.5V3.0V3.5V4.0V4.5V5.0V5.5V6.0V6.5V7.0VAnalog DigitalVmin: :VmaxVmin =If input voltage > Vmax the digital output isSimilarly if input < Vmin the digital output is
6 Relationship Between Analog and Digital Values Let the A/D converter has n-bit digital output and let A be Analog Value and D be the equivalent Digital Number.Then,proportionalityVmax = 7.5V0V11111110000000100100011010001010110000010011010101111001101111010.5V1.0V1.5V2.0V2.5V3.0V3.5V4.0V4.5V5.0V5.5V6.0V6.5V7.0VAnalog DigitalVminA DVmaxVmin =
7 Some definitionsOffset: 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:
8 ExampleGiven 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:
10 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 byD/As are electronic circuits that convert digital, (usually binary) signals (for example, ) to analog electrical quantities (usually voltage) directly related to the digitally encoded input number.Weighting23222120Binary Digit1State+5V0V
11 Types of D/A Converters We will consider two types of D/A:the binary weighted resistor networkthe R-2R ladder network.
12 The binary weighted resistor network Comprises of a register and resistor networkOutput 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.
13 D/A ExampleIn 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, andR = Rf = 1k.Answer:I1 = I4 = 0I2 = 5V / 2R = 5 / 2KΩ = 2.5 mAI3 = 5V / 4R = 5 / 4KΩ = 1.25 mAVo = -If Rf= -(I4 + I3+ I2+ I1)Rf= -( ) x 1000= V
14 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.
15 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.Bit Current2 I/21 I/40 I/8bit bit bit 0
16 The R-2R Ladder Resistor Network The state of the bits is used to switch a voltage source
18 A/D converterConverts analog signals into binary words
19 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.
20 Types of A/D Converters There several type of A/D converters. Here, we will consider the following three types:1. Counting type2. Parallel or Flash3. Successive Approximation
21 1- Counting A/DSTARTComparatorVinControl LogicclockCounterD/ADigital OutputWhen START is received, control logic sets counter to 0, and turns on Clock sending regular pulses to the counter.As the Clock sends regular pulses to the counter, the counter outputs a digital signal to the Digital-to-Analog converter
22 Note that the conversion time depends on the size of the input signal As the counter counts, its output to the D/A generates a staircase ramp to the comparator.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.VinNote that the conversion time depends on the size of the input signalV’inConversion timeConv.time
23 2- Flash ConvertersIf 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.
24 Flash ConvertersThe 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.
25 Flash ConvertersThe 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.
26 3- Successive approximation A/D 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 ~ s, are adequate for most laboratory functions. Good tradeoff between speed and costGenerates the digital output serially (one bit at a time).
27 Successive approximation A/D Vrefanalog inputD/A ConverterDigital Output DatacomparatorSuccessive Approximation RegisterclockSTRTAt the beginning, all bits from the SAR are set to zero, and conversion begins by taking STRT line low.
28 Successive approximation A/D Vrefanalog inputD/A ConverterDigital Output DatacomparatorSuccessive Approximation RegisterclockSTRTFirst 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.
29 Successive approximation A/D Vrefanalog inputD/A ConverterDigital Output DatacomparatorSuccessive Approximation RegisterclockSTRTThe 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.
30 Successive approximation A/D Vrefanalog inputD/A ConverterDigital Output DatacomparatorSuccessive Approximation RegisterclockSTRTIf the D/A output is > Vin then the MSB is set to 0 and the next bit is set equal to 1.
31 Successive approximation A/D 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.
32 Example Calculate the maximum conversion time of 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 = 256Therefore, the maximum conversion time is
33 Example, continued(b) For a 8-bit successive approximation A/D, the conversion time is constant and equal toIt is noted that the conversion speed of successive approximation A/D is much faster than the integrating type.
34 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.
35 AliasingOccurs 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.