# Design a Differential Amplifier the Easy Way with Mathcad

For those of you who have Mathcad, designing a differential amplifier is really easy.

Let’s say you need to design a unipolar to bipolar converter and you decide to use a differential amplifier for this task. You know the input and output voltage range and you need to calculate the resistors based on a voltage reference you have in the system. All you have to do is to create a Mathcad file for a quick response. Then store it some place for future designs.

If you would like to know why the unipolar to bipolar converter can be designed with a differential amplifier, read this article, Design a Unipolar to Bipolar Converter for a Unipolar Voltage Output DAC .

Let’s take an example.

If you have a DAC that outputs 0 to +2.5V, with a reference of 2.5V, and you need a bipolar output of –1V to +1V, write down the differential amplifier transfer function as follows:

where the resistors are those in Figure 1.   For the proof of this transfer function read How to Derive the Differential Amplifier Transfer Function.

Figure 1

Let’s rewrite the transfer function as a mathematical relation that depends on the resistor ratios R1/R2 and R4/R3.

This is the equation form we will use in Mathcad.  I use it for clarity and to show the resistor ratios.

Open Mathcad and type the voltage reference and a choice for R2 and R3, say 10 kOhm.  On the next line type some guess values for R1 and R4, say 10 kOhm also.  These two resistors are the unknowns.

Next comes a solving block for two equations with two unknowns.  The solving block is delimited by the keywords Given and Find.

Inside the solving block lets write the differential amplifier transfer function in two instances, one when the output voltage is –1V and one for +1V.  I also replaced V2 with Vref and V1 with the input signal.  The Mathcad code should look like this:

The “Find” function gives the answer in the form of a matrix of one column and two rows.  For this example, R1 = 7.5 kOhm and R4 = 4 kOhm.  Choose the standard values of 7.5 kOhm 1% and 4.02 kOhm 1% respectively. During the Mathcad calculations I prefer to attach the units as well.  If there is a mistake, Mathcad will flag that the units do not match.  This is a great way to verify your equations and assumptions on fly.

Figure 2 shows the final schematic.

Figure 2

### 9 thoughts on “Design a Differential Amplifier the Easy Way with Mathcad”

1. jeffhill

I applied this method and it works great. For some input/output ranges I am getting a negative value for R1 or R4. Why is that?

2. A negative resistance is theoretical. The system of equations has a solution, but the solution is negative. It means that your design needs an extra source of energy in order to output the voltage range you need for the given input range. In practice, you have two choices: change the reference voltage, or change the amplifier topology. A lot of times it is easier to change the reference value than to change the op amp configuration. This method is great because it lets you find the correct resistor values by trying different voltage references.

Which Mathcad version did you use?

4. I used Mathcad 2001. However, any version between 2001 and Mathcad 14 would work the same.

5. where can i get Mathcad.Is there a Mathcad equivalent that works on Linux.

• Mathcad is owned and distributed by PTC. Here is the link:

They have a trial version and also a student version. I am not aware of any Linux version.

6. taher benisa

Great article. Precise and brief. Great job

7. A free and cross-platform (i.e. it works on Linux) Mathcad-like alternative is:

http://en.smath.info/

which also has a cloud version.

It is not as extensive as Mathcad but it is very like Mathcad to use and should handle the Mathcad calculations given here.

• Thank you, Andy, for you comment. I was not aware of this math program. I will check it in the next few days.

'