DIGITAL TO ANALOG CONVERTERS DACS Eric Prebys P
DIGITAL TO ANALOG CONVERTERS (DACS) Eric Prebys
P 116 B - Winter 2020 P 116 B - DACs Transducers • Ultimately, we want our digital electronics to interact with the real (analog) world. • This will involve some sort of “transducer”, converting analog values to and from digital signals • Voltage • Charge • Current • Frequency • Temperature • Pressure • This will involve converting voltage, charge, or current to and from a digital representation
P 116 B - Winter 2020 P 116 B - DACs Digital to Analog Converter (DAC) • In general, a DAC will map a (binary) number D to an output analog signal A • Depending on our application, there are many possible mappings, but for now we’ll focus on “linear” conversion, in which an n-bit integer D produces a range of voltages between Amin and Amax, given by • For now we’ll consider voltage DACs that go between 0 and Vref.
P 116 B - Winter 2020 Resistive Ladder DAC • A resistive ladder DAC is a very simple device, in which a set of internal resistors is used to create a voltage ladder, and a digital multiplexer (decoder+analog switches) is used to select from among these voltages. • Very simple, but only practical for a small number of bits P 116 B - DACs
P 116 B - Winter 2020 P 116 B - DACs Weighted Resistor DAC • We can use a series of resistors to switch in currents corresponding to the bits of the number • More practical than ladder DAC, but requires precise resistors over a wide range of values
P 116 B - Winter 2020 P 116 B - DACs R-2 R DAC • The R-2 R DAC accomplishes the same functionality as the weighted resistor DAC with only two resistor values • Understanding it is a bit complicated…
P 116 B - Winter 2020 P 116 B - DACs Review: Thévenin’s Theorem • Any combination of voltages, current sources, and resistances can be replaced by one voltage source and resistor in series.
P 116 B - Winter 2020 P 116 B - DACs R-2 R Network • Look at just the lowest bit of the circuit nth bit
P 116 B - Winter 2020 P 116 B - DACs Moving On. . . • Insert the Thévenin equivalent of the first bit as input to the next and find the new Thévenin
P 116 B - Winter 2020 Continuing • At bit 2, I have Thévenin equivalent • At every step P 116 B - DACs
P 116 B - Winter 2020 P 116 B - DACs Variant: Current-switching DAC • Advantages • Can be faster and cheaper • Flexible output • Can sum signals directly
P 116 B - Winter 2020 P 116 B - DACs Bipolar DACs • In all of our previous examples, if we replace GND with Vmin and Vref with Vmax, then • If Vmin=-V 0 and Vmax = +V 0 • The natural encoding is “offset binary” • Some chips accept different encodings and convert them internally
P 116 B - Winter 2020 Serial Input DACs • Example: MCP 4822 P 116 B - DACs
P 116 B - Winter 2020 P 116 B - DACs as Variable Gain Amplifiers • A common application of DAC involves using Vref as an input, and treating the DAC as a variable gain amplifier (“multiplication mode”).
P 116 B - Winter 2020 P 116 B - DACs Commercial DACs range from. . . • Microchip MCP 4921 -E/P • Resolution: 12 bit • Data Input: serial • Settling time: 4. 5 ms • Max rate: ~100 KHz • Price: 1@$2. 08/each, 100@$1. 49/each
P 116 B - Winter 2020 to. . . • TI DAC 39 J 82 • Channels: 2 • Input: serial • Resulution: 16 -bit • Rate: 2 Gs/second • Price: 1000@$87. 50/each P 116 B - DACs
P 116 B - Winter 2020 P 116 B - DACs DAC Imperfections • Imperfections fall into three categories • Imperfections related to DAC performance • Gain • Offset • Linearity • Imperfections inherent in a finite sampling rate • Bandwidth limit • Imperfections inherent in the number of bits used for encoding • Dynamic range
P 116 B - Winter 2020 P 116 B - DACs Gain Error • Output is off by expectations by some factor • Most likely occurs with internal Vref
P 116 B - Winter 2020 P 116 B - DACs Differential Non-Linearity (DNL) • Individual steps don’t correspond to the expected value
P 116 B - Winter 2020 P 116 B - DACs Integral Nonlinearity (INL) • INL=Maximum deviation from a linear curve
P 116 B - Winter 2020 P 116 B - DACs Finite Sampling • A DAC produces an approximation of a waveform by outputing samples at discreet intervals • There are limits to this approximation
P 116 B - Winter 2020 P 116 B - DACs Nyquist’s Theorem • We need a sampling frequency of 2 f to reproduce a frequency of f • If this the digital output is rendered perfectly, lots of high frequency harmonics are introduced.
P 116 B - Winter 2020 P 116 B - DACs Spurious Frequency Components
P 116 B - Winter 2020 P 116 B - DACs Solution: Filtering • In general, the output of a DAC should be filtered with a cutoff frequency of half the sampling frequency
P 116 B - Winter 2020 P 116 B - DACs Dynamic Range • The dynamic range of the encoding is the largest value over the least value. If we assume that noise is less than the LSB • For unipolar signals n-bits has a DR of • For bi-polar signals, we lose one bit for sign, so • This is often expressed in deci. Bells Usually
P 116 B - Winter 2020 P 116 B - DACs Example: Audio Encoding • The human ear is an amazing device • Bandwidth 20 Hz-20 k. Hz = 3 orders of magnitude • Required at least 40 k. Hz sampling frequency • Dynamic Range: 0 d. B (threshold of hearing) to 120 d. B (threshold of pain) • 12 orders of magnitude in power For sound: • 6 orders of magnitude in amplitude • 1, 000 ~ 220 • At least 21 bit encoding (20 bit bipolar) • “CD Quality” • 44. 1 k. Hz rate • 22. 05 k. Hz bandwidth (> human ear)* • 16 bit linear encoding *There’s a little more to the story here, which we’ll get to
P 116 B - Winter 2020 P 116 B - DACs 16 -bit Dynamic Range • 16 bits can encode -215 ->215 -1 = -32768 ->32767 • d. B range • Examples of 90 d. B • Motorcycle at 25 feet • Lawnmower up close • If your music is that loud, the LSB is at the limit of human hearing • 90 d. B Signal-to-noise ratio (SNR) is about the limit of top end audio gear • i. e. if you buy a $3 K power amp and turn it all the way up, you might hit the limit of 16 bit audio • For comparison, the best vinyl DR is about 70 d. B.
P 116 B - Winter 2020 P 116 B - DACs High Quality Sound Encoding • DVDs allow for multiple Sampling/bit-depth combinations • Sound is stored either uncompressed or losslessly compressed • Compression algorithms (mp 3, AAC) complicate things a bit. • Maybe we’ll discuss those at some point
- Slides: 28