ENGR338 Digital Electronics Laboratory
Lab 2  Design an R-2R DAC

Objectives:
1. Understand the operation of the ideal ADC and DAC
2. Design a R-2R DAC in Electric VLSI to replace the ideal DAC
3. Be familiar with Electric VLSI and LTSpice for integrated circuit design


Lab Tasks:

Task 1: Copy the existing ideal ADC-DAC files to your ENGR338 library and run the simulation.
(30 points).

Follow the Electric VLSI tutorial here to set up the Electric/LTSpice configuration.

Download the libraries of the ideal ADC/DAC from here.
. Unzip the downloaded folder, place the lab2.jelib file into the Electric VLSI's installation folder. Open the library from File - Open Library.

Go to Files - New Library to create an ENGR338 library:



Copy the files in the lab2.jelib library to your ENGR338 library from Cell - Cross-Library Copy:
(Note: you only need to select the sim_ADC_DAC{sch} file and check the boxes at the bottom (copy subcells and copy all related views) because it contains all other cells.



Open
sim_ADC_DAC{sch} and run the simulation from Tools - Simulation (Spice) - Write Spice Deck..





You should be able to see the following simulation results in LTSpice. If you can't, stop and go back to the Electric VLSI tutorials to figure this out first.
You can observe that the Vout is being digitized and showing a discrete signal to track the analog sine wave from Vin.



Task 2: Build the schematic of the R-2R DAC and run the simulation.
(30 points).

Create a new schematic view called 'R_2R_Ladder'.

Use n-well resistors, pins, and the GND component in the schematic view to build the circuit.
Be sure that the port should be 'off page' ports. Select the pin and press Ctrl + e on the keyboard to export it.



Eventually the ladder looks like this:



and, of course, it should be DRC clean. (Press F5 and check the message box).



Next, let's create an icon view of this R2R ladder. While have the schematic open, go to View - Make Icon View:



It'll show this icon view in the schematic and also create a icon entry in the explorer. Double click that entry to edit it.



Use Ctrl + i to edit the properties of the text. Press 'y' on the keyboard to select the frame of the icon to adjust it. Select both the arc and the text of the pins, press Ctrl + j to rotate it. (you must select both to rotate it).

The icon looks like the following one:



Next, duplicate the original simulation file and rename it as 'sim_ADC_R_2R_DAC' so you can reuse the Spice code and the ADC in that simulation file.



Drag the R_2R_Ladder {icon} and drop it in this simulation file to replace the original ideal DAC. You need to reconect all the bits and extend the Vout of the DAC using a regular trace. Also, you need to select the trace and press 'Ctrl + i' to name the Arc as 'Vout' so the Spice code can identify it. Please note that here you name the Arc but when you make a subcell, you export the pin using 'Ctrl + e'.

(After you made every connection of the bits, the name of the Arc disappears. if you want to see the pin names inside the chip, you can go back and add Text in your the icon.



After the pin texts are added to the icon:





When all the connections are done, run the simulation as you did before, you should see the very similar results as the ideal one:




Task 3: Test the time delay from the B9 pin when the DAC drives a 10 pF load. (30 points).


Duplicate the simulation view to create another schematic view for this task.



Ground the B0 - B8 pins, only leave the B9 pin connected to a pulse. Add a 10 pF load to the output and test the time delay of this circuit. (Use the 0.7RC equation and the Thevenin Equivalent circuit theorem).



From the following analysis, we expect that the final pulse will be VDD/2, or 2.5 V.



Simulate it and probe the time delay (Double click the V(vout) tag to show two cursors. Probe the 1.25 V of the out put for the time delay).



Compare the simulation to your hand calculation.





-------------------------------------
Lab report grading rubric:

Task 1: 30 points.
Task 2: 30 points.
Task 3: 30 points.
Writing/formatting: 10 points.


Common mistakes:

1. If your dicrete signal looks odd, you may have copied/pasted the resistors at the same spot. Make sure that when you copy/paste the resistors to make up that R/2R ladder follow this procedure: Select the resistor - Ctrl + c - single left click the empty space - Ctrl + v.

2. Do not forget to change the resistor value to 10k.