Why Analog Electronics Is So Complex. Part 2. R2R DAC

In the first part I considered in detail the device of a voltage divider, which already has nonlinearity, while being the simplest analog circuit. Such a voltage divider can only be used if an extremely small current will leak into the load due to its relatively high resistance.

In this article, we will look at one well-known analog circuit, which is entirely composed of voltage dividers. And with fixed voltage and resistance values. How can this be complicated? Of course!

This circuit is called R2R DAC and everyone knows how it works, but few can calculate it. That's what we'll do, calculate R2R DAC.

If you haven't tried it yet, try calculating the R2R DAC yourself. And then come back to this article. You'll get enough context for its perception.

Let me say right away that the purpose of the article is not to demonstrate the skills of solving systems of linear equations. In this article, we will see how theoretical knowledge really helps to easily do what previously seemed like magic.

Base

The circuit diagram of a multi-bit R2R DAC is quite simple and is shown in the figure.

6-bit DAC

6-bit DAC

It consists of n-cascades with the same (within the cascade) resistance values. There are as many cascades as there are bits. You apply digital voltages (0 or 1) to the inputs, and you get one of the following at the output: 2^n analog voltage levels

in the range from 0 to \frac{2^n - 1}{2^n}V with a step \frac{V}{2^n}.

For example, the maximum voltage that an 8-bit DAC can produce (255/256)V

The main difficulty in making such a DAC in practice is that it is necessary to maintain high accuracy of all resistances. If you want to make a 16-bit DAC, then the resistances should have an error in the region \frac{1}{65536}which is several orders of magnitude less than 1%.

In this article I will calculate the ideal R2R DAC, so I will use ideal resistances.

1-bit

A 1-bit DAC is easy to understand. It is a voltage divider with 2R and 2R arms.

It is capable of generating 2^1 voltage levels:

V_0 = 0, V_{out} = 0

V_0 = V, V_{out} = \frac{V}{2}

Why are the shoulders not R and R, but 2R and 2R? We are not asking this question yet, but simply trying to calculate the known scheme.

We also assume that the load connected to this DAC is buffered, i.e. it does not consume any current at all, and therefore does not distort the output voltage. This effect can be achieved by connecting the operational amplifier using a non-inverting circuit. More details about operational amplifiers were in my article about feedback. So, from now on we will assume that no current from the DAC goes to the load.

2-bit

Let's connect the next bit to the one-bit DAC.

The circuit has not become very complicated, but the calculation of the output voltage has become radically more complicated.

Let's see that Vout is a function of V_0 And V_1which can only take digital values ​​0 or 1. All other elements of the circuit do not change. It is enough to match each combination of input voltages with the output voltage and you can consider that the circuit is designed.

This sounds like a simple plan, but for each combination of input voltages we have a unique circuit for which we need to calculate the equivalent resistances to ultimately calculate the output voltage.

If you do this, you will see that the values ​​are correct and the circuit works.

V_0 = 0\space V_1 = 0\space \to Vout = 0

V_0 = 1\space V_1 = 0\space \to Vout = 1/4

V_0 = 0\space V_1 = 1\space \to Vout = 1/2

V_0 = 1\space V_1 = 1\space \to Vout = 3/4

However, if you add another bit, the number of options will double, the scheme will work again, but there will be no more understanding of why this happens. Therefore, I will not go down this path.

I propose to find a way to analytically express the output voltage through the input. For this, we have the beloved Kirchhoff rules, which in the world of analog electronics are a direct method of solving the problem.

I have renamed the points of the 2-bit DAC circuit, since we will need to indicate the current strengths in the sections of the circuit. Let's write down the system of equations.

6 equations and 6 unknowns. Let's find its solution. We are most interested in the value V_Dwhich corresponds to the output voltage.

Calculations

Someone very attentive can replace that it is not necessary to write down such a large system of equations. The current Icd is always equal to the sum of the currents of the two branches of the circuit, which come from V_A And V_B. Let's write down one equation, find Vc from it, and then find it through the voltage divider. V_DAs a result, we manage to get by with a system of two equations.

Calculations

Well, we've shown that a 2-bit DAC works. Let's move on.

3-bit

Let's update the circuit for a 3-bit DAC. To calculate it, we need to find the voltages V_D, V_E And V_F.

Let's use the previous method and write down a system of equations. Current flows into section DO from two branches. Current flows into section ED from two other branches. These two equations are enough to find V_E And V_D. The equation for the voltage divider will be needed to find the output voltage V_F.

Calculations

As a result, we get the cherished formula, which shows that the 3-bit DAC works. But there is no desire to move on. Why?

Because it is known that R2R DAC works for any number of bits. And the current method allows us to find a solution only for the current bit depth. Of course, it is possible to compose a system of equations in general form and find its solution.

But another question arises. Did the person who developed the R2R DAC sit and randomly solve systems of equations? Or did he know some secret that simplified the solution of this problem many times over.

Secret

If you have read the legendary Horowitz and Hill circuit design guide, you will recall that the discussion there begins with an examination of the voltage divider.

Then the authors move on to Thevenin's theorem. For some reason they apply this theorem to a voltage divider. Personally, after this example, it became even less clear to me why this theorem is needed. Isn't there some more vivid example of a circuit that would “easily show” the advantage of using this theorem?

I remembered about Thevenin's theorem only when I tried to calculate R2R DAC. Let me remind you of the conditions of the theorem.

Any two-terminal circuit containing constant current sources, voltage sources and impedances can be represented as a series-connected voltage source Uth and equivalent resistance Rth.
Uth is equal to the voltage at the circuit outputs without load.

Rth is the resistance of the voltage source that provides the same current as in the original circuit, the terminals of which are short-circuited.

It's easier to show with an example.

Let's start with the 1-bit DAC. This is the same voltage divider.

If there is no load applied to it, the output voltage is

V_{th}^0 = V \frac{2R}{2R+2R}

Let's close the terminals. Check yourself, what terminals does this circuit have?

Let's close the output to ground.

\frac{V_{th}^0}{R_{th}^0} = \frac{V}{2}\frac{1}{R_{th}^0} = \frac{V}{2R} \ to R_{th}^0 = R.

Now we have done a very big thing – we have got rid of the voltage divider. We have removed the connection to the common wire. Now the output of this DAC is connected to the voltage on the source. This will help us in the future, when we add the 2nd bit stage.

Voltage Vth1 is the output voltage of the voltage divider.

V_{th}^1 = V_{th}^0 + \frac{2R}{4R}(V_1 - V_{th}^0).

To put it simply, it will be exactly the middle between the levels V_1 And V_0/2

We find the equivalent resistance through the sum of the currents from both voltage sources

\frac{V_{th}^1}{R_{th}^1} = \frac{V_1/2 + V_0/4}{R_{th}^0} = \frac{V_0/2}{2R} + \frac{V_1}{2R} \to R_{th}^1 = R

Now when we add the 3rd bit stage, almost nothing changes for us. The output voltage is equal to the middle between V_2 And V_{th}^1and the equivalent resistance R_{th}^2 similarly will be equal to R. Thus, we can repeat the procedure iteratively to obtain a DAC with the required bit depth.

Conclusion

Using Thevenin's theorem, we obtained a solution to the problem without the need to solve the SLAE and go through the input voltage options.

But for me the most important thing is that having a good example creates the right context for the tool. It is possible to apply Thevenin's theorem to a voltage divider, as Horowitz and Hill did, but it is not clear what the point is.

On the other hand, the meaning becomes most clear in contrast. After solving several systems of equations without any hope for the future, the power of this theorem will become obvious to anyone.

If you want to consolidate the skills from this article, I suggest you independently calculate a circuit built on the same principle, but with different resistance values. For example:

Maybe someone will be able to open a DAC with new interesting properties. The task is really difficult, I started thinking about it myself.

Someone will say, why think about it? The answer is obvious: to overcome functional fixation.

Thank you all for your attention. I wish you good luck in your research!

Similar Posts

Leave a Reply

Your email address will not be published. Required fields are marked *