Hello, and welcome to the TI Precision Lab covering statistical error analysis for data converters. Overall, this video will cover how a SPICE analysis option called Monte Carlo analysis can be used to determine a statistically valid estimate of gain error. This video will cover a step-by-step approach for running a Monte Carlo analysis on TINA SPICE, as well as explain how to interpret the results. Let's start by looking at the circuit covered in the TI Precision Labs video titled Understanding and Calibrating the Offset and Gain for ADC Systems. In this example, the gain error of the current shunt amplifier was specified in the device datasheet because its gain is set by internal resistors. In many cases, however, the gain is set by external discrete resistors. This example circuit shows a discrete implementation of a differential in, differential out amplifier. The differential gain for this circuit is given by 2 times Rf divided by Rg, which is 0.04 in this case. So for a plus or minus 100-volt input signal, the differential voltage delivered to the ADC is plus or minus 4 volts. The gain accuracy for this circuit depends on the tolerance Rf and Rg throughout the circuit. Often, engineers will do a worst-case analysis based on the resistor tolerance. But as we've mentioned before, this can yield results that are statistically unlikely. The industrial version of TINA SPICE and many other SPICE simulators provide an analysis tool called Monte Carlo analysis that can be very useful for doing a statistical error analysis. This presentation will explain how to use the TINA SPICE Monte Carlo analysis tool. Before doing the Monte Carlo analysis, let's look at the DC transfer function for this circuit. In TINA, use the DC Analysis, DC Transfer Characteristics option. In the DC Transfer Characteristics window, set Vin as the input. Enter the voltage range of negative 100 volts to positive 100 volts for the start value and end value. Press OK, and you will get the graph shown at the right. This graph shows that for an input of negative 100 volts the differential output is positive for volts. And for an input of positive 100 volts, the differential output is negative 4 volts. Before running the Monte Carlo analysis, you will need to set the tolerance for each resistor and capacitor in the circuit. Just double-click on the resistor, and a window listing the parameters will pop up. Press the button next to the resistance, and a window to set the tolerance parameters will pop up. In this window, set the tolerance according to your design, and use Gaussian for the distribution type. In this example, we are using 1% resistors. To turn on Monte Carlo analysis, select Mode under the Analysis menu option. In the Analysis Mode selection window, select Monte Carlo. For Percentage of Population, enter 99.73%. This sets the component tolerance to plus or minus 3 standard deviations for the Monte Carlo analysis. Thus, in this example, plus or minus 3 standard deviations occurs at plus or minus 1%. What we are really doing here is forcing the majority of the Gaussian population to be inside the tolerance limits. Notice that the default of 68.26% corresponds to one standard deviation, and this is not practical for resistor and capacitor tolerances. After entering the percentage of population, enter the number of cases that will be run in the simulation. In this example, we run the maximum of 1,000 cases. This will cause the simulation to rerun 1,000 times using random resistor values according to the Gaussian distribution. In general, you should set this number as high as possible to get a good statistical result. The only disadvantage to setting this to the maximum limit of 1,000 is that it will increase simulation time. Now that the Monte Carlo function is turned on, any analysis will run as a Monte Carlo analysis. In this example, a DC transfer characteristic is run. So the DC transfer function is simulated 1,000 times using random Gaussian resistor values for each simulation. Even though the result looks like a single curve, it actually contains 1,000 closely spaced curves. Now we want to use these curves to get a statistically valid gain error. To do this, we first need to select all of the curves by pressing Control-Alt. Next, under the Processes menu, we should select Statistics. Under Statistics, we want to select the Cut option. Cut will select the distribution on the y-axis for a particular value on the x-axis. In this case, we want to look at the gain error at the ends of the transfer function, or where Vin equals 100 volts. It is easier to understand the vertical cut set when looking at a zoomed-in version of the transfer characteristic. In this graph, you can see that there are many closely spaced curves that correspond to the different random resistor values. The x-axis value for the cut set, which is 100 volts in this example, is entered in the adjacent box. Finally, select the number of bars that will be displayed in the histogram. In general, 10 is sufficient. Next, press Calculate on the Statistics window. This will cause the mean and standard deviation of the cut set to be displayed. This information can now be used to calculate the gain error and percentage for our circuit. For a typical gain error corresponding to one standard deviation, take the standard deviation and divide by the mean value, and multiply by 100 to get percentage. A worst-case estimate can be set using the statistical factors introduced earlier. For example, multiplying the typical gain error by three sets a maximum limit that will include 99.73% of the population. That concludes this video. Thank you for watching. Please try the quiz to check your understanding of this video's content.