Digital design width CPLD Application and VHDL - Chapter 12 potx

56 325 0
Digital design width CPLD Application and VHDL - Chapter 12 potx

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

Thông tin tài liệu

565 ❘❙❚❘❙❚❘❙❚❘❙❚❘❙❚❘❙❚❘❙❚❘❙❚❘❙❚❘❙❚❘❙❚ ❙❚❘❙❚❘❙❚❘❙❚❘❙❚❘❙❚❘❙❚❘❙❚❘❙❚❘❙❚❘❙❚❘❙❚❘❙❚❘❙❚❘❙❚❘❙❚❘❙❚❘❙❚❘❙❚❘❙❚❘❙❚❘❙❚❘❙❚❘❙❚❘❙❚❘❙❚❘❙❚❘❙❚❘❙❚❘❙❚❘❙❚❘❙❚❘❙❚❘❙❚❘❙❚❘❙❚❘❙❚❘❙❚❘❙❚❘❙❚❘❙❚❘❙❚❘❙❚❘❙❚❘❙❚❘❙❚❘❙❚❘❙❚❘❙❚❘❙❚❘❙❚❘❙❚❘❙❚❘❙❚❘❙❚❘❙❚❘❙❚❘❙❚❘❙❚❘❙❚❘❙❚❘❙❚❘❙❚❘❙❚❘❙❚ CHAPTER 12 Interfacing Analog and Digital Circuits OUTLINE 12.1 Analog and Digital Signals 12.2 Digital-to-Analog Conversion 12.3 Analog-to-Digital Conversion 12.4 Data Acquisition CHAPTER OBJECTIVES Upon successful completion of this chapter, you will be able to: • Define the terms “analog” and “digital” and give examples of each. • Explain the sampling of an analog signal and the effects of sampling fre- quency and quantization on the quality of the converted digital signal. • Draw the block diagram of a generic digital-to-analog converter (DAC) and circuits of a weighted resistor DAC and an R-2R ladder DAC. • Calculate analog output voltages of a DAC, given a reference voltage and a digital input code. • Configure an MC1408 integrated circuit DAC for unipolar and bipolar out- put, and calculate output voltage from known component values, reference voltage, and digital inputs. • Describe important performance specifications of a digital-to-analog converter. • Draw the circuit for a flash analog-to-digital converter (ADC) and briefly explain its operation. • Define “quantization error” and describe its effect on the output of an ADC. • Explain the basis of the successive approximation ADC, draw its block dia- gram, and briefly describe its operation. • Describe the operation of an integrator with constant input voltage. • Draw the block diagram of a dual slope (integrating) ADC and briefly ex- plain its operation. • Explain the necessity of a sample and hold circuit in an ADC and its operation. • State the Nyquist sampling theorem and do simple calculations of maxi- mum analog frequencies that can be accurately sampled by an ADC system. • Describe the phenomenon of aliasing and explain how it arises and how it can be remedied. • Interface an ADC0808 analog-to-digital converter to a CPLD-based state machine. • Design a 4-channel data acquisition system, including an ADC0808 analog- to-digital converter and a CPLD-based state machine. 566 CHAPTER 12 • Interfacing Analog and Digital Circuits E lectronic circuits and signals can be divided into two main categories: analog and dig- ital. Analog signals can vary continuously throughout a defined range. Digital signals take on specific values only, each usually described by a binary number. Many phenomena in the world around us are analog in nature. Sound, light, heat, po- sition, velocity, acceleration, time, weight, and volume are all analog quantities. Each of these can be represented by a voltage or current in an electronic circuit. This voltage or cur- rent is a copy, or analog, of the sound, velocity, or whatever. We can also represent these physical properties digitally, that is, as a series of num- bers, each describing an aspect of the property, such as its magnitude at a particular time. To translate between the physical world and a digital circuit, we must be able to convert analog signals to digital and vice versa. We will begin by examining some of the factors involved in the conversion between analog and digital signals, including sampling rate, resolution, range, and quantization. We will then examine circuits for converting digital signals to analog, since these have a fairly standard form. Analog-to-digital conversion has no standard method. We will study several of the most popular: simultaneous (flash) conversion, successive approximation, and dual slope (integrating) conversion. 12.1 Analog and Digital Signals Continuous Smoothly connected. An unbroken series of consecutive values with no instantaneous changes. Discrete Separated into distinct segments or pieces. A series of discontinuous values. Analog A way of representing some physical quantity, such as temperature or ve- locity, by a proportional continuous voltage or current. An analog voltage or current can have any value within a defined range. Digital A way of representing a physical quantity by a series of binary numbers. A digital representation can have only specific discrete values. Analog-to-digital converter A circuit that converts an analog signal at its input to a digital code. (Also called an A-to-D converter, A/D converter, or ADC.) Digital-to-analog converter A circuit that converts a digital code at its input to an analog voltage or current. (Also called a D-to-A converter, D/A converter, or DAC.) Electronic circuits are tools to measure and change our environment. Measurement instru- ments tell us about the physical properties of objects around us. They answer questions such as “How hot is this water?”, “How fast is this car going?”, and “How many electrons are flowing past this point per second?” These data can correspond to voltages and currents in electronic instruments. If the internal voltage of an instrument is directly proportional to the quantity being measured, with no breaks in the proportional function, we say that it is an analog voltage. Like the property being measured, the voltage can vary continuously throughout a defined range. For example, sound waves are continuous movements in the air. We can plot these movements mathematically as a sum of sine waves of various frequencies. The patterns of magnetic domains on an audio tape are analogous to the sound waves that produce them and electromagnetically represent the same mathematical functions. When the tape is played, the playback head produces a voltage that is also proportional to the original sound waves. This analog audio voltage can be any value between the maximum and minimum voltages of the audio system amplifier. KEY TERMS 12.1 • Analog and Digital Signals 567 If an instrument represents a measured quantity as a series of binary numbers, the rep- resentation is digital. Since the binary numbers in a circuit necessarily have a fixed num- ber of bits, the instrument can represent the measured quantities only as having specific discrete values. A compact disc stores a record of sound waves as a series of binary numbers. Each number represents the amplitude of the sound at a particular time. These numbers are de- coded and translated into analog sound waves upon playback. The values of the stored numbers (the encoded sound information) are limited by the number of bits in each stored digital “word.” The main advantage of a digital representation is that it is not subject to the same dis- tortions as an analog signal. Nonideal properties of analog circuits, such as stray induc- tance and capacitance, amplification limits, and unwanted phase shifts, all degrade an ana- log signal. Storage techniques, such as magnetic tape, can also introduce distortion due to the nonlinearity of the recording medium. Digital signals, on the other hand, do not depend on the shape of a waveform to pre- serve the encoded information. All that is required is to maintain the integrity of the logic HIGHs and LOWs of the digital signal. Digital information can be easily moved around in a circuit and stored in a latch or on some magnetic or optical medium. When the informa- tion is required in analog form, the analog quantity is reproduced as a new copy every time it is needed. Each copy is as good as any previous one. Distortions are not introduced be- tween copy generations, as is the case with analog copying techniques, unless the con- stituent bits themselves are changed. Digital circuits give us a good way of measuring and evaluating the physical world, with many advantages over analog methods. However, most properties of the physical world are analog. How do we bridge the gap? We can make these translations with two classes of circuits. An analog-to-digital con- verter accepts an analog voltage or current at its input and produces a corresponding digi- tal code. A digital-to-analog converter generates a unique analog voltage or current for every combination of bits at its inputs. Sampling an Analog Voltage Sample An instantaneous measurement of an analog voltage, taken at regular intervals. Sampling frequency The number of samples taken per unit time of an analog signal. Quantization The number of bits used to represent an analog voltage as a digital number. Resolution The difference in analog voltage corresponding to two adjacent digi- tal codes. Analog step size. Before we examine actual D/A and A/D converter circuits, we need to look at some of the theoretical issues behind the conversion process. We will look at the concept of sampling an analog signal and discover how the sampling frequency affects the accuracy of the digital representation. We will also examine quantization, or the number of bits in the digital representation of the analog sample, and its effect on the quality of a digital sig- nal. Figure 12.1 shows a circuit that converts an analog signal (a sine pulse) to a series of 4-bit digital codes, then back to an analog output. The analog input and output voltages are shown on the two graphs. There are two main reasons why the output is not a very good copy of the input. First, the number of bits in the digital representation is too low. Second, the input signal is not KEY TERMS 568 CHAPTER 12 • Interfacing Analog and Digital Circuits sampled frequently enough. To help us understand the effect of each of these factors, let us examine the conversion process in more detail. The analog input signal varies between 0 and 8 volts. This is evenly divided into 16 ranges, each corresponding to a 4-bit digital code (0000 to 1111). We say that the signal is quantized into 4 bits. The resolution, or analog step size, for a 4-bit quantization is 8 V/16 steps ϭ 0.5 V/step. Table 12.1 shows the codes for each analog range. FIGURE 12.1 Analog Input and Output Signals Table 12.1 4-bit Digital Codes for 0 to 8 V Analog Range Analog Voltage Digital Code 0.00–0.25 0000 0.25–0.75 0001 0.75–1.25 0010 1.25–1.75 0011 1.75–2.25 0100 2.25–2.75 0101 2.75–3.25 0110 3.25–3.75 0111 3.75–4.25 1000 4.25–4.75 1001 4.75–5.25 1010 5.25–5.75 1011 5.75–6.25 1100 6.25–6.75 1101 6.75–7.25 1110 7.25–8.00 1111 12.1 • Analog and Digital Signals 569 The analog input is sampled and converted at the beginning of each time division on the graph. The 4-bit digital code does not change until the next conversion, 1 ms later. This is the same as saying that the system has a sampling frequency of 1 kHz ( f ϭ 1/T ϭ 1/(1 ms) ϭ 1 kHz). Table 12.2 shows the digital codes for samples taken from t ϭ 0 to t ϭ 18 ms. The ana- log voltages in Table 12.2 are calculated by the formula V analog ϭ 8 V sin (t ϫ (10°/ms)) For example at t ϭ 2 ms, V analog ϭ 8 V sin (2 ms ϫ (10°/ms)) ϭ 8 V sin (20°) ϭ 2.736 V. The calculated analog values are compared to the voltage ranges in Table 12.1 and as- signed the appropriate code. The value 2.736 V is between 2.25 V and 2.75 V and therefore is assigned the 4-bit value of 0101. Table 12.2 4-bit Codes for a Sampled Analog Signal Time (ms) Analog Amplitude (volts) Digital Code 0 0.000 0000 1 1.389 0011 2 2.736 0101 3 4.000 1000 4 5.142 1010 5 6.128 1100 6 6.928 1110 7 7.518 1111 8 7.878 1111 9 8.000 1111 10 7.878 1111 11 7.518 1111 12 6.928 1110 13 6.128 1100 14 5.142 1010 15 4.000 1000 16 2.736 0101 17 1.389 0011 18 0.000 0000 Table 12.3 8-bit Codes for a Sampled Analog Signal Time (ms) Analog Amplitude (volts) Digital Code 0 0.000 00000000 1 1.389 00101100 2 2.736 01011100 3 4.000 10000000 4 5.142 10100101 5 6.128 11000010 6 6.928 11011110 7 7.518 11110001 8 7.878 11111100 9 8.000 11111111 10 7.878 11111100 11 7.518 11110001 12 6.928 11011110 13 6.128 11000010 14 5.142 10100101 15 4.000 10000000 16 2.736 01011100 17 1.389 00101100 18 0.000 00000000 The digital-to-analog converter in Figure 12.1 continuously converts the digital codes to their analog equivalents. Each code produces an analog voltage whose value is the mid- point of the range corresponding to that code. For this particular analog waveform, the A/D converter introduces the greatest inaccu- racy at the peak of the waveform, where the magnitude of the input voltage changes the least per unit time. There is not sufficient difference between the values of successive ana- log samples to map them into unique codes. As a result, the output waveform flattens out at the top. This is the consequence of using a 4-bit quantization, which allows only 16 differ- ent analog ranges in the signal. By using more bits, we could divide the analog signal into a greater number of smaller ranges, allowing more accurate conversion of a signal having small changes in amplitude. For example, an 8-bit code would give us 256 steps (a resolution of 8 V/256 ϭ 31.25 mV). This would yield the code assignments shown in Table 12.3. Note that for an 8-bit code, there is a unique value for every sampled voltage. Figure 12.2 shows how different levels of quantization affect the accuracy of a digital representation of an analog signal. The analog input is a sine wave, converted to digital 570 CHAPTER 12 • Interfacing Analog and Digital Circuits codes and back to analog, as in Figure 12.1. The graphs show the analog input and three analog outputs, each of which has been sampled 28 times per cycle, but with different quantizations. The corresponding digital codes range from a maximum negative value of n 0s to a maximum positive value of n 1s for an n-bit quantization (e.g., for a 4-bit quantiza- tion, maximum negative ϭ 0000, maximum positive ϭ 1111). The first output signal has an infinite number of bits in its quantization. Even the smallest analog change between samples has a unique code. This ideal case is not attain- able, since a digital circuit always has a finite number of bits. We can see from the codes in Table 12.3 that an 8-bit quantization is sufficient to give unique codes for this waveform. An infinite quantization implies that the resolution is small enough that each sampled volt- age can be represented, not only by a unique code, but as its exact value rather than a point within a range. The 4-bit and 3-bit quantizations in the next two graphs show progressively worse rep- resentation of the original signal, especially at the peaks. The change in analog voltage is too small for each sample to have a unique code at these low quantizations. Figure 12.3 shows how the digital representation of a signal can be improved by increasing its sampling frequency. It shows an analog signal and three analog wave- forms resulting from an analog-digital-analog conversion. All waveforms have infinite quantization, but different numbers of samples in the analog-to-digital conversion. As the number of samples decreases, the output waveform becomes a poorer copy of the input. In general, the sampling frequency affects the horizontal resolution of the digitized waveform and the quantization affects the vertical resolution. FIGURE 12.2 Effect of Quantization 12.2 • Digital-to-Analog Conversion 571 ❘❙❚ SECTION 12.1 REVIEW PROBLEM 12.1 An analog signal has a range of 0 to 24 mV. The range is divided into 32 equal steps for conversion to a series of digital codes. How many bits are in the resultant digital codes? What is the resolution of the A/D converter? 12.2 Digital-to-Analog Conversion Full scale The maximum analog reference voltage or current of a digital-to- analog converter. Figure 12.4 shows the block diagram of a generalized digital-to-analog converter. Each digital input switches a proportionally weighted current on or off, with the current for the MSB being the largest. The second MSB produces a current half as large. The current gen- erated by the third MSB is one quarter of the MSB current, and so on. These currents all sum at the operational amplifier’s (op amp’s) inverting input. The total analog current for an n-bit circuit is given by: I a ϭ b nϪ1 2 nϪ1 ϩиииϩb 2 2 2 ϩ b 1 2 1 ϩ b 0 2 0 I ref 2 n The bit values b 0 , b 1 , . . . b n can be only 0 or 1. The function of each bit is to include or exclude a term from the general expression. KEY TERM FIGURE 12.3 Effect of Sampling Frequency 572 CHAPTER 12 • Interfacing Analog and Digital Circuits The op amp acts as a current-to-voltage converter. The analysis, illustrated in Figure 12.4b, is the same as for an inverting op amp circuit with a constant input current. The input impedance of the op amp is the impedance between its inverting (Ϫ) and noninverting (ϩ) terminals. This value is very large, on the order of 2 M⍀. If this is large compared to other circuit resistances, we can neglect the op amp input current, I in . This implies that the voltage drop across the input terminals is very small; the invert- ing and noninverting terminals are at approximately the same voltage. Since the noninvert- ing input is grounded, we can say that the inverting input is “virtually grounded.” Current I F flows in the feedback loop, through resistor R F . Since I a Ϫ I in Ϫ I F ϭ 0 and I in ഠ 0, then I F ഠ I a . By Ohm’s law, the voltage across R F is given by V F ϭ I a R F . The feed- back resistor is connected to the output at one end and to virtual ground at the other. The op amp output voltage is measured with respect to ground. The two voltages are effectively in parallel. Thus, the output voltage is the same as the voltage across the feedback resistor, with a polarity opposite to V F , calculated above. V a ϭϪV F ϭϪI a R F ϭ I ref R F The range of analog output voltage is set by choosing the appropriate value of R F . ❘❙❚ EXAMPLE 12.1 Write the expression for analog current, I a , of a 4-bit D/A converter. Calculate values of I a for input codes b 3 b 2 b 1 b 0 ϭ 0000, 0001, 1000, 1010, and 1111, if I ref ϭ 1 mA. Solution The analog current of a 4-bit converter is: I a ϭ b 3 2 3 ϩ b 2 2 2 ϩ b 1 2 1 ϩ b 0 2 0 2 4 I ref Ϫb nϪ1 2 nϪ1 ϩиииϩb 2 2 2 ϩ b 1 2 1 ϩ b 0 2 0 ᎏᎏᎏᎏᎏ 2 n FIGURE 12.4 Analysis of a Generalized Digital-to-Analog Converter 12.2 • Digital-to-Analog Conversion 573 ϭ 8b 3 ϩ 4b 2 ϩ 2b 1 ϩ b 0 (1 mA) 16 b 3 b 2 b 1 b 0 ϭ 0000, I a ϭ (0 ϩ 0 ϩ 0 ϩ 0)(1 mA) ϭ 0 16 b 3 b 2 b 1 b 0 ϭ 0001, I a ϭ (0 ϩ 0 ϩ 0 ϩ 1)(1 mA) ϭ 1 mA ϭ 62.5 ␮A 16 16 b 3 b 2 b 1 b 0 ϭ 1000, I a ϭ (8 ϩ 0 ϩ 0 ϩ 0)(1 mA) ϭ 8 (1 mA) ϭ 0.5 mA 16 16 b 3 b 2 b 1 b 0 ϭ 1010, I a ϭ (8 ϩ 0 ϩ 2 ϩ 0)(1 mA) ϭ 10 (1 mA) ϭ 0.625 mA 16 16 b 3 b 2 b 1 b 0 ϭ 1111, I a ϭ (8 ϩ 4 ϩ 2 ϩ 1)(1 mA) ϭ 15 (1 mA) ϭ 0.9375 mA 16 16 ❘❙❚ Example 12.1 suggests an easy way to calculate D/A analog current. I a is a fraction of the reference current I ref . The denominator of the fraction is 2 n for an n-bit converter. The numerator is the decimal equivalent of the binary input. For example, for input b 3 b 2 b 1 b 0 ϭ 0111, I a ϭ (7/16)(I ref ). Note that when b 3 b 2 b 1 b 0 ϭ 1111, the analog current is not the full value of I ref ,but 15/16 of it. This is one least significant bit less than full scale. This is true for any D/A converter, regardless of the number of bits. The maximum analog current for a 5-bit converter is 31/32 of full scale. In an 8-bit converter, I a cannot ex- ceed 255/256 of full scale. This is because the analog value 0 has its own code. An n-bit converter has 2 n input codes, ranging from 0 to 2 n Ϫ 1. The difference between the full scale (FS) of a digital-to-analog converter and its maxi- mum output is the resolution of the converter. Since the resolution is the smallest change in output,equivalenttoachangeintheleastsignificantbit,wecandefinethemaximumoutputas FS Ϫ 1LSB. (As an example, in thecase of an8-bit converterFS Ϫ1LSB ϭ 255/256I ref .) ❘❙❚ SECTION 12.2A REVIEW PROBLEM 12.2 Calculate the range of analog voltage of a 4-bit D/A converter having values of I ref ϭ 1 mA and R F ϭ 10 k⍀. Repeat the calculation for an 8-bit D/A converter. Weighted Resistor D/A Converter Figure 12.5 shows the circuit of a 4-bit weighted resistor D/A converter. The heart of this circuit is a parallel network of binary-weighted resistors. The MSB has a resistor value of R. Successive branches have resistor values that double with each bit: 2R, 4R, and 8R. The branch currents decrease by halves with each descending bit value. FIGURE 12.5 Weighted Resistor D-to-A Converter 574 CHAPTER 12 • Interfacing Analog and Digital Circuits The bit inputs, b 3 , b 2 , b 1 , and b 0 , are either 0 V or V ref . When the corresponding bits are HIGH, the branch currents are: I 3 ϭ V ref /R I 2 ϭ V ref /2R I 1 ϭ V ref /4R I 0 ϭ V ref /8R The sum of branch currents gives us the analog current I a . We can calculate the analog voltage by Ohm’s law: V 2 ϭϪI a R F ϭϪI a (R/2) ϭ Ϫ ΄ ᎏ b 1 3 ᎏ ϩ ᎏ b 2 2 ᎏ ϩ ᎏ b 4 1 ᎏ ϩ ᎏ b 8 0 ᎏ ΅ ᎏ V R ref ᎏ ᎏ R 2 ᎏ ϭ Ϫ ΄ ᎏ b 1 3 ᎏ ϩ ᎏ b 2 2 ᎏ ϩ ᎏ b 4 1 ᎏ ϩ ᎏ b 8 0 ᎏ ΅ ᎏ V 2 ref ᎏ ϭ Ϫ ΄ ᎏ b 2 3 ᎏ ϩ ᎏ b 4 2 ᎏ ϩ ᎏ b 8 1 ᎏ ϩ ᎏ 1 b 6 0 ᎏ ΅ V ref The choice of R F ϭ R/2 makes the analog output a binary fraction of V ref . ❘❙❚ EXAMPLE 12.2 Calculate the analog voltage of a weighted resistor D/A converter when the binary inputs have the following values: b 3 b 2 b 1 b 0 ϭ 0000, 1000, 1111. V ref ϭ 5 V. Solution b 3 b 2 b 1 b 0 ϭ 0000 V a ϭ Ϫ ΄ ᎏ 0 2 ᎏ ϩ ᎏ 0 4 ᎏ ϩ ᎏ 0 8 ᎏ ϩ ᎏ 1 0 6 ᎏ ΅ V ref ϭ 0 b 3 b 2 b 1 b 0 ϭ 1000 V a ϭ Ϫ ΄ ᎏ 1 2 ᎏ ϩ ᎏ 0 4 ᎏ ϩ ᎏ 0 8 ᎏ ϩ ᎏ 1 0 6 ᎏ ΅ V ref ϭ Ϫ ᎏ 1 2 ᎏ (5 V) ϭϪ2.5 V b 3 b 2 b 1 b 0 ϭ 1111 V a ϭ Ϫ ΄ ᎏ 1 2 ᎏ ϩ ᎏ 1 4 ᎏ ϩ ᎏ 1 8 ᎏ ϩ ᎏ 1 1 6 ᎏ ΅ V ref ϭϪ ᎏ 1 1 5 6 ᎏ (5 V) ϭϪ4.69 V ❘❙❚ The weighted resistor DAC is seldom used in practice. One reason is the wide range of resistor values required for a large number of bits. Another reason is the difficulty in ob- taining resistors whose values are sufficiently precise. A 4-bit converter needs a range of resistors from R to 8R. If R ϭ 1 k⍀, then 8R ϭ 8 k⍀. An 8-bit DAC must have a range from 1 k⍀ to 128 k⍀. Standard value resistors are specified to two significant figures; there is no standard 128-k⍀ resistor. We would need to use relatively expensive precision resistors for any value having more than two significant figures. I bV R bV R bV R bV R b bb b V R a =+++ =+++       3 21 0 3 21 0 248 1248 ref ref ref ref ref [...]... to generate an 8-bit digital equivalent value if the DAC in the circuit has a reference voltage of 12 V Solution Figure 12. 24 shows the steps the converter performs to generate the 8-bit digital equivalent of 9.5 V The conversion process is also summarized in Table 12. 4 12. 3 • Analog-to -Digital Conversion FIGURE 12. 24 Example 12. 11 Successive Approximation A/D Conversion Table 12. 4 8-Bit Successive... ❘❙❚ SECTION 12. 2C REVIEW PROBLEM 12. 4 Calculate Va for an 8-bit R-2R ladder DAC when the input code is 10100001 Assume that Vref is 10 V MC1408 Integrated Circuit D/A Converter KEY TERM Multiplying DAC A DAC whose output changes linearly with a change in DAC reference voltage 12. 2 • Digital- to-Analog Conversion 579 A common and inexpensive DAC is the MC1408 8-bit multiplying digital- to-analog converter... mV ϭ 0.48 LSB LE[%FS] ϭ OE[%FS] ϭ (15 mV/8 V) ϫ 100% FS ϭ 0.188% FS ❘❙❚ 12. 3 Analog-to -Digital Conversion We saw in an earlier section of this chapter that all digital- to-analog converters can be described by a generic form This is not true of analog-to -digital converters There are many circuits for converting analog signals to digital codes, each with its own advantages We will look at several of the.. .12. 2 • Digital- to-Analog Conversion 575 Another DAC circuit, the R-2R ladder, is more commonly used It requires only two values of resistance for any number of bits ❘❙❚ SECTION 12. 2B REVIEW PROBLEM 12. 3 The resistor for the MSB of a 1 2- bit weighted resistor D/A converter is 1 k⍀ What is the resistor value for the LSB? R-2R Ladder D/A Converter Figure 12. 6 shows the circuit of an R-2R ladder... diagram of an 8-bit dual slope analog-to -digital converter Integrator output voltages for several input values are shown in Figure 12. 28 Assume that the integrator has the same R and C values as in Figure 12. 25 FIGURE 12. 27 Dual Slope ADC FIGURE 12. 28 Integrator Outputs for Various Input Voltages 600 C H A P T E R 1 2 • Interfacing Analog and Digital Circuits 1 Before conversion starts, an auto-zero circuit... ᎏᎏ (24 k⍀)(5 V) ϭ 11.906 V (256)(5 k⍀) 10 k⍀ ΅ (Note: 12 V Ϫ 2 LSB ϭ 12 V Ϫ (12 V /128 ) ϭ 12 V Ϫ 94 mV ϭ 11.906 V.) ❘❙❚ SECTION 12. 2E REVIEW PROBLEM 12. 6 Why is the actual maximum value of an 8-bit DAC less than its reference (i.e., its apparent maximum) voltage? DAC Performance Specifications A number of factors affect the performance of a digital- to-analog converter The major factors are briefly described... simultaneous converter) An analog-to -digital converter that uses comparators and a priority encoder to produce a digital code Priority encoder An encoder that will produce a binary output corresponding to the subscript of the highest-priority active input This is usually defined as the input with the largest subscript Figure 12. 21 shows the circuit for a 3-bit flash analog-to -digital converter The circuit... to 9.961 V (FS Ϫ 1 LSB ϭ 10 V Ϫ (10 V/256) ϭ 9.961 V) 12. 2 ❘❙❚ EXAMPLE 12. 7 • Digital- to-Analog Conversion 583 Figure 12. 14 shows the circuit of an analog ramp (sawtooth) generator built from an MC1408 DAC, an op amp, and an 8-bit synchronous counter (A ramp generator has numerous analog applications, such as sweep generation in an oscilloscope and frequency sweep in a spectrum analyzer.) Vref ϭ ϩ... analog-to -digital converter based on an integrator The name derives from the fact that during the conversion process the integrator output changes linearly over time, with two different slopes A dual slope analog-to -digital converter is based on an integrator circuit, such as the one shown in Figure 12. 25 The circuit output is proportional to the integral of the input FIGURE 12. 25 Integrator 12. 3 •... V/ms)] ϭ 12 V The output changes at a rate of Ϫ4 V/ms for 3 ms 3 to 9 ms: The output at 9 ms is given by: Vin (Ϫ0.5 V) slope ϭ ᎏᎏ ϭ Ϫᎏᎏ RC (0.025␮F)(10 k⍀) ϭ ϩ2 V/ms 12. 3 • Analog-to -Digital Conversion 599 Vo (9 ms) ϭ vo(3 ms) Ϫ (t/RC) Vin ϭ 12 V ϩ [(6 ms)(ϩ 2 V/ms)] ϭ 12 V ϩ ( 12 V) ϭ0V The output changes at a rate of ϩ2 V/ms for 6 ms This cancels the effect of the original input ❘❙❚ Figure 12. 27 shows . 565 ❘❙❚❘❙❚❘❙❚❘❙❚❘❙❚❘❙❚❘❙❚❘❙❚❘❙❚❘❙❚❘❙❚ ❙❚❘❙❚❘❙❚❘❙❚❘❙❚❘❙❚❘❙❚❘❙❚❘❙❚❘❙❚❘❙❚❘❙❚❘❙❚❘❙❚❘❙❚❘❙❚❘❙❚❘❙❚❘❙❚❘❙❚❘❙❚❘❙❚❘❙❚❘❙❚❘❙❚❘❙❚❘❙❚❘❙❚❘❙❚❘❙❚❘❙❚❘❙❚❘❙❚❘❙❚❘❙❚❘❙❚❘❙❚❘❙❚❘❙❚❘❙❚❘❙❚❘❙❚❘❙❚❘❙❚❘❙❚❘❙❚❘❙❚❘❙❚❘❙❚❘❙❚❘❙❚❘❙❚❘❙❚❘❙❚❘❙❚❘❙❚❘❙❚❘❙❚❘❙❚❘❙❚❘❙❚❘❙❚❘❙❚❘❙❚❘❙❚ CHAPTER 12 Interfacing Analog and Digital Circuits OUTLINE 12. 1 Analog and Digital Signals 12. 2 Digital- to-Analog Conversion 12. 3 Analog-to -Digital Conversion 12. 4 Data Acquisition CHAPTER. system, including an ADC0808 analog- to -digital converter and a CPLD- based state machine. 566 CHAPTER 12 • Interfacing Analog and Digital Circuits E lectronic circuits and signals can be divided into. voltage. KEY TERM 12. 2 • Digital- to-Analog Conversion 579 A common and inexpensive DAC is the MC1408 8-bit multiplying digital- to-analog con- verter. This device also goes by the designation DAC0808.

Ngày đăng: 14/08/2014, 10:22

Từ khóa liên quan

Tài liệu cùng người dùng

  • Đang cập nhật ...

Tài liệu liên quan