# 僅20個電阻器就可以組成的髙速DAC

用DDS制做AWG（隨意波形發生器）很重要，針對瞭解基礎知識也十分有協助，因而蘇老師將要發佈一套DDS的線上課程、方案於春節後做一次專題講座的線下培訓，並對於這套視頻和線下培訓設計方案了一套訓煉服務平臺，關鍵作用以下（木板剛取得，也有一部分元器件沒有安裝上）：

## 應用腳丫FPGA造成DDS數位邏輯和波表

應用20個電阻器根據R-2R的構造來做DDS的DAC，輸出脈衝信號脈衝信號範疇為-3V-+3V，輸出脈衝信號的直流電偏位元可調式，從-1.9V到+1.9V

另外根據PWM造成較低頻率的AWG做比照，感受二種不一樣DAC方法的輸出實際效果及其身後的基本原理

造成2路可以調整輸出的交流電壓，調整範疇～—9V到+9V，調整精密度精准到0.01V

下邊是這一訓煉板的3D效果圖（商品因為缺乏一部分元器件，且攝影技術較為渣，故或是用KiCad的3D效果圖），掃描器木板上的二維碼能夠進到到DDSAWG技術性專題講座網頁頁面（已經基本建設中….）。

從上邊的波形圖能夠看得出R-2R的輸出實際效果或是非常好的，假如在其後邊再加上截止頻率為3MHz的LPF，波型會十分光潔。

假如將FPGA運作高些的頻率，例如100MHz，能夠獲得10MHz之內的正弦波形（一個週期時間10個抽樣點，並配相對應的LPF）。

為將R-2R的DAC和昨日文章內容中敘述的PWM組成的DAC做比照，特將R-2R秘密頻道的正弦波形的相位差輸出到PWM秘密頻道，以鋸齒狀波的方法變為模擬量輸入。

因此 ….

用心閱讀文章蘇老師的文章內容，你也就能夠學好用最划算的方式造成隨意波型及其可程式設計控制器輸出的交流電壓，根據動手能力，還能學得更多精彩的專業技能！這種，針對你將來的產品研發工作中、電賽都十分有協助哦。

有關R-2R的原理，在網上有一大把的技術性文章內容，為激勵大夥兒更為嫺熟應用專業英文，在這兒或是奉上一篇英語版的技術性文章內容，它來源於知名的儀器設備生產商Tektronix！

With the recent announcement of the world’s fastest Digital to Analog Converter (DAC) from Tektronix Component Solutions, i assumed it’d be interesting to wish a quick tutorial tour through one of the sole DAC architectures – the high voltage resistor ladder network as shown in Figure 1below.

The r-2r resistor ladder network converts a parallel virtual symbol/word into an analog voltage. Every digital enter (b0, b1, etc.) Provides its personal weighted contribution to the analog output. This community has some precise and interesting houses.

## Scalable To Any Desired Number Of Bits

Makes use of best two values of resistors which convey smooth and accurate fabrication and integration.

Output impedance is capable R, regardless of the quantity of bits, simplifying filtering and further analog signal processing circuit design

Reading the r-2r network brings returned reminiscences of the limitless form of networks that you’re asked to unravel in the course of your undergraduate ee studies. The reality although, is that the analysis of this community and consequently the way it works simple. Via methodical application of thevenin identical circuits and superposition, we’ll display how the r-2r circuit works.

Let’s begin by analyzing the output impedance. Working through the circuit, simplifying it with Thevenin equivalents, makes this process simple. Thevenin says that if your circuit contains linear elements like voltage sources, current sources and resistors, that you simply can cut your circuit at any point and replace everything on one side of the cut with a voltage source and one series resistor. The voltage source is that the open-circuit voltage at the cut point, and thus the series resistor is that the equal circuit resistance with all voltage sources shorted.

Figure 2 below indicates the locations of the “reduce strains” we’ll use to simplify this circuit to calculate its output impedance. For this evaluation, the virtual inputs will all be taken into consideration shorted to ground.

The two 2R resistors to the left of the primary cut line in Figure 2 appear in parallel (when the digital bit b0 is grounded), and may get replaced with one resistor R as shown in Figure 3. The series combination of the 2 R resistors on the left of Figure 3 combine to one resistor useful 2R, which is in parallel with the 2R resistor to b1.

You may notice that this process repeats itself whenever we work from left to right, successively replacing combinations of resistors with their equivalents. As you’ll see in Figure 4, the circuit ultimately simplifies to one resistor R.

Thus, the output impedance of the R-2R resistor network is usually adequate to R, no matter the dimensions (number of bits) of the network. This simplifies the planning of any filtering, amplification or additional analog signal conditioning circuitry which will follow the network.

Next, we’ll inspect the thanks to calculate the analog voltage output for a given parallel digital input on the b0, b1, etc. inputs. We’ll use the same Thevenin equivalents technique shown above, also as Superposition. Superposition tells us that if you individually compute the contribution of a given source to the output (with all others voltage sources shorted and current sources opened), you’ll then sum the results for each of the sources to urge the last word result for the output.

We’ll calculate the contribution of two of the bits of our 4-bit R-2R DAC in Figure 5 to point out the method . We’ll assume the bits b0 and b2 are logic high, and bits b1 and b3 are logic low (ground).

We start by replacing the circuit to the left of the left-most cut-line with its Thevenin equivalent. Figure 6 shows the Thevenin equivalent, which is that the series resistor useful R (parallel combination of two 2R resistors), and thus the circuit voltage from the resistor divider (Vb0/2).

The process continues methodically, step by step for each cut-line, substituting the equivalent circuit for each stage, as shown graphically in Figure 7.

We can see that the voltage contribution from bit b0 is 1/16th of the logic high voltage capacitor. Each bit stage that this voltage passes through cuts the contribution by an element of two . you’ll begin to ascertain a topic here…

Next, we’ll compute the contribution from bit b2.

From the Thevenin equivalent analysis shown earlier, we all know that we will replace any portion of this circuit to the left of any of the cut lines with a resistor useful R, shown because the initiative in Figure 8. Next, we follow an equivalent Thevenin equivalent process to the output. As you’ll have already suspected, the contribution of bit b2 is just Vb2/4. Thus, the analog output voltage when bits b0 and b2 are adequate to logic one is just given by Vb0/16 + Vb2/4.

In a more general sense, the contribution of every bit to the output may be a simple binary weighting function of every bit. As you’re employed back from the MSB to the LSB, the voltage contribution each bit is cut in half. Thus, the overall sort of the equation to calculate the output voltage.

The R-2R resistor ladder based digital-to-analog converter (DAC) could also be an easy , effective, accurate and cheap because of create analog voltages from digital values. Monolithic R-2R resistor networks are available from various resistor component manufacturers, making it easy to incorporate them into your designs.

最後還是幾個技術問題來思考一下：

R-2R這種結構對於這20個電阻有什麼要求？

R-2R這種結構能夠輸出多高頻率的波形？

相比於專用的DAC晶片，R-2R沒有時鐘輸入端和參考基準電壓，會有什麼不利的地方？

R-2R這種結構對電路板的佈局佈線有什麼要求？

要取得更高的性能，應該如何改進？