Basically, digital-to-analog conversion is the opposite of analog-to-digital conversion. In most cases, if the analog-digital converter (ADC) is placed behind the DAC in the communication circuit, the digital signal output is exactly the same as the input digital signal. And, in most cases, when the DAC is placed behind the ADC, the output analog signal is exactly the same as the input analog signal.

Binary digital pulses can show a long series of 1s and 0s entirely on their own, which has no obvious meaning to human observers. But when the DAC is used to decode the binary digital signal, the rich meaning of the output is revealed. This output may be text, pictures, or mechanical actions.

DAC and ADC are very important in some applications that process digital signals. The comprehensibility or fidelity of the analog signal can be improved by using ADC to convert the analog input signal into a digital form, and then the digital signal is "cleaned up", and the final digital pulse is reconverted into an analog signal by using a DAC .

## Basic principle

Digital quantity is composed of digits one by one, and each digit represents a certain power. For example, the binary number 1001, the weight of the highest bit is 23=8, the code 1 on this bit represents the value 1*23=8; the weight of the lowest bit is 20=1, the code 1 on this bit represents the value 1*20 =1; the other digits are all 0, so the binary number 1001 is equal to the decimal number 9.

In order to turn a digital quantity into an analog quantity, each digit must be converted into a corresponding analog quantity according to the weight, and then the analog quantities are added together, so that the total analog quantity obtained corresponds to Given data.

The main component of the D/A converter is a resistance switch network. Usually, the bits of the input binary number control some switches. Proportional currents, these currents are added and converted by operational amplifiers to become analog voltages proportional to binary numbers.

The principle circuit of D/A conversion is shown in Figure 5-1. It is a reference voltage with sufficient precision. Each branch of the input terminal of the grate amplifier corresponds to the 0th and the first of the data to be converted. 1 bit,..., n-1th bit. The switch in the branch is controlled by the corresponding digit. If the digit is "1", the corresponding switch is closed; if the digit is "0", the corresponding switch is open. The resistances in each input branch are R, 2R, 4R, ... These resistances are called weight resistances. They convert digital quantities into electrical analog quantities, that is, convert binary digital quantities into electrical analog quantities proportional to their value.

## Performance indicators

### Resolution

Resolution refers to the number of binary digits that the D/A converter can convert. The more digits, the higher the resolution. For a D/A converter with a resolution of n bits, the input signal that can be resolved is 1/2n of the full scale.

For example: 8-bit D/A converter, if the voltage full range is 5V, the minimum voltage that can be resolved is 5V/28≈20mV, 10-bit D/A converter, if the voltage is full If the range is 5V, the minimum voltage that can be distinguished is 5V/210≈5mV.

### Conversion time

The conversion time refers to the time required for the D/A converter from the digital input to the stable output. The conversion time is also called the hidden time or the set-up time. When the output analog quantity is voltage, the settling time is longer, mainly the time required to output the operational amplifier. The ts shown in Figure 5-2 is the conversion time.

### Conversion accuracy

The conversion accuracy refers to the error between the actual output of the D/A converter and the theoretical value. Conversion accuracy can be divided into absolute accuracy and relative accuracy.

(1) Absolute accuracy refers to the difference between the actual measured analog output value (current or voltage) at the output terminal of the D/A converter and the theoretical value corresponding to a given digital quantity. The absolute accuracy is determined by the comprehensive factors such as the gain error, linearity error and noise of the D/A conversion.

(2) Relative accuracy refers to the difference between the analog output of various digital inputs and the theoretical value after calibration of the zero point and full scale value, and the error of various inputs can be drawn into a curve. For linear D/A conversion, relative accuracy is nonlinearity.

Accuracy generally uses the least significant digit of the digital quantity as the unit of measurement, which is generally taken as ± 1/2 LSB. For example, if it is an 8-bit D/A converter, the conversion accuracy is ±(1/2)*(1/256) = ±1/512.

### Linear error

Linear error is used to describe the degree of change in the electrical analog output of the D/A conversion output according to the proportional relationship when the digital quantity changes. The maximum deviation of the analog output from the ideal output is called linearity error.

### Temperature Coefficient

The temperature coefficient refers to the change of parameters such as gain, linearity, zero point and offset for every 1℃ change in temperature within the specified range. The temperature coefficient directly affects the conversion accuracy.

## Classification

There are many types of integrated D/A converters, and there are multiple classification methods:

1) According to their conversion methods, they can be divided into parallel And serial;

2) According to the production process, it can be divided into bipolar type (TTL type) and CMOS type, etc., their accuracy and speed are different;

3) According to the resolution, it can be divided into 8-bit, 10-bit, 12-bit, 16-bit, etc.;

4) According to the output mode, it can be divided into two types: voltage output type and current output type.

## Basic circuit

### T-type resistor network

Figure 9-3 is a schematic diagram of a 4-bit D/A converter with a T-type resistor network. The resistance decoding network in Figure 9-3 is a T-type resistance network composed of two resistances, R and 2R, and an operational amplifier constitutes a voltage follower. In Figure 9-3, the data latch and electronic switches S3 and S2 are omitted. , S1, S0 are under the control of the corresponding bit of the binary number D or connected to the reference voltage VR (the corresponding bit is 1) or grounded (the corresponding bit is 0). When the electronic switches S3, S2, S1, and S0 are all grounded, the equivalent resistance viewed from any node a, b, c, d to the lower left is equal to R.

The following uses the superposition principle and Thevenin theorem to find the output U0 of the converter.

When D0 acts alone, the T-type resistor network is shown in Figure 9-4 (a). The lower left of point a is equivalent to the Thevenin power supply, as shown in Figure 9-4 (b); then the lower left circuits of points b, c, and d are equivalent to the Thevenin power supply, respectively, as shown in Figure 9- Figures (c), (d), and (e) in Figure 4. Since the input resistance of the voltage follower is very large, much larger than R, so when D0 acts alone, the potential at point d is almost the open circuit voltage D0VR/16 of Thevenin power supply, and the output of the converter at this time is

< /p>

When D1 acts alone, the T-type resistor network is shown in Figure 9-5 (a), and the Thevenin of the lower left circuit at point d is equivalent to Figure 9-5 (b) Shown. Similarly, the Thevenin equivalent power supply of the lower left circuit at point d when D2 is acting alone is shown in Figure 9-5 (c); when D3 is acting alone, the Thevenin equivalent power supply of the lower left circuit at point d is shown in Figure 9-5. Figure (d) shows. Therefore, when D1, D2, and D3 are acting separately, the output of the converter is >

It can be seen that the output analog voltage is proportional to the digital input. Generalized to n-bit, the output of the D/A converter is

Because the T-type resistor network only uses R and 2R resistors, its accuracy is easy to improve , It is also easy to manufacture integrated circuits. However, the T-type resistor network also has the following shortcomings: In the working process, the T-type network is equivalent to a transmission line. It takes a certain transmission time from the beginning of the resistance to the establishment of a stable current and voltage at the input of the op amp. When a digital signal is input When the number of digits is large, it will affect the working speed of the D/A converter. In addition, the resistance network used as the load resistance of the converter reference voltage VR will fluctuate with the difference of the binary number D, and the stability of the reference voltage may be affected. So in practice, the following inverted T-type D/A converters are commonly used.

### Inverted T resistor network

Figure 9-6 is the schematic diagram of the inverted T resistor network D/A converter. Since point P is grounded and point N is virtual ground, no matter if the numbers D0, D1, D2, and D3 are 0 or 1, the electronic switches S0, S1, S2, and S3 are all equivalent to grounding. Therefore, the magnitudes of the branch currents I0, I1, I2, I3, and IR in Figure 9-6 will not change due to the difference in binary numbers. Moreover, the equivalent resistance viewed from the upper left of any node a, b, C, d is equal to R, so the total current flowing out of VR is

and flowing into each 2R branch The current of the circuit is as follows

The current flowing into the inverting terminal of the operational amplifier is

p>The output voltage of the operational amplifier is

If Rf=R and IR=VR/R is substituted into the above formula, there is

It can be seen that the output analog voltage is proportional to the digital input. Generalized to n-bit, the output of the D/A converter is

The inverted T-type resistor network also only uses R and 2R resistors, but it is not the same as the T-type resistor. Compared with the resistance network, since the current of each branch is always present and constant, there is no transmission time for the current of each branch to the inverting input of the op amp, so it has a higher conversion speed.