## Broadband Amplifier Design: An Example of Project Documentation

### Introduction

The following notebook is an example of how Mathematica can be used for project documentation.  The capability of the front end to mix text, graphics, and Mathematica input and output make it a great program for maintaining information about a project. Throughout the document, you will find cells such as this one set off from the rest; they point out features of the interface that are especially useful for documentation.

This notebook describes some aspects of the design of a broadband amplifier, set in the context of project meetings, design sessions, and the other interactions that occur in the creation of any new product. Here, an engineer debates the issues involved in the creation of a component for a CATV chip set being developed by his company.

In[1]:=<<EE`

### Project

A broadband amplifier is required for our CATV chip set. This amplifier will be realized as part of an IC process with resistors and transistors. It was mentioned in the latest project meeting that the following amplifier configuration will make a broadband amplifier with matched input and output impedances. It was also stated that information on the resistor values could not be found, but the amplifier is trivial to analyze.

Mathematica enables you to easily mix graphics with your descriptive text. This graphic was created elsewhere in Mathematica, but it could easily have been pasted in from a circuit-drawing application, or imported from an AutoCAD DXF file. It is said that a picture is worth a thousand words the impact of your presentations can be substantially enhanced by this capability.

### Analysis

The hierarchical arrangement of cells in a notebook enables you to control the presentation of information to the viewer. By hiding information under headings, you can present overviews and detailed analysis with no additional effort. In an educational document, you can present a problem and hide the answer in a following closed group.

After some experimentation it was found that this circuit is best analyzed by deriving its input and output impedances and matching these to the system impedance. All biasing analysis will be omitted. The single node formulation of this network equation is used. A subtlety in the following analysis is that since gm is infinity, the voltage at the top of Rs will be driven to be VIn, so V will be zero.

We can represent our circuit for the purposes of analysis.

Zin is the impedance looking into the amplifier; analysis is performed by current at the node drawn as a filled circle.

We have the following equations at the main node.

In[2]:=eqnZinI={0==il + i2-il2, il==vIn-vOut/Rfb, i2==-vOut/zo, vIn=il2Rs};

We can solve for the input, collecting the current and output voltage terms.

In[3]:=solnZinI=Solve[eqnZinI,vIn,{i2,i12,vOut}]
Out[3]={{vIn-> -(-ilRfbRs - ilRszo)/(Rs + zo)}}

This, in turn, can be simplified.

In[4]:=ZInI=Simplify[First[VIn/il /. solnZinI]]

`Out[4]=VIn/il`
Zout is found in a similar fashion. Note that the same base nodal equation is used, but now the output port is analyzed with the input terminated in zo

In[5]:=eqnZoutI={0==il+i2-il2,  il==-vIn/zo, vOut==vIn - ilRfb, vIn==il2Rs}

In[6]:=solnZoutI=Solve[eqnZoutI,vOut,{i1,i12,vIn}]
Out[6]= {{vOut ->i2Rs(Rfb +zo)/(Rs + zo)}}

In[7]:=zOutI=Simplify[First[vOut/i2/. solnZoutI]]

`Out[7]= Rs(Rfb + zo)/Rs + zo`
Now we can solve for the resistor configuration that makes the amplifier matched.

In[8]:=rConstraint=Solve[{zInI==zo,zOutI==zo},Rs] [1,1];

`Out[8]=Rs->zo2/Rfb`
The missing factor in our design is the gain of our amplifier. We can use Solve again, considering the network driven and terminated in a 50-ohm resistor.

In[9]:= eqnGain={0==il + i2, il==vIn-vOut/Rfb, i2==-vOut/zo, vIn=il2Rs, v1=vIn+ilzo};

In[10]:= solnGain=Solve[eqnGain,vOut,{i1,i2,i12,v1}]

`Out[10]= {{vOut -> -(RfbvIn - RsvIn)zo/RfbRs + Rszo}}`
In[11]:= gain=Simplify[First[vOut/vIn/. solnGain]]
`Out[11]= (-Rfb + Rs)zo/Rs(Rfb + zo)`
Our system impedance, zo, is typically 50 or 75 ohms. Once we substitute the constraint on Rs, we have our gain in terms of Rfb

In[12]:= RfbSoln=gain/.rConstraint

`Out[12]= Rfb(-Rfb + so2/Rfb)/zo(Rfb+zo)`
The use of live Mathematica input and output in your documents will allow other engineers to check your solutions and assure themselves of their accuracy. You can easily change the calculations as well, should design constraints change. Suppose, for instance, that it becomes necessary to analyze the above amplifier with unmatched lines. Mathematica's ability to perform symbolic computation can also give your models a generality that other systems can't offer, sometimes allowing you to understand the physical characteristics in ways not apparent from the numbers alone.

### Result

This nonlinear equation becomes our amplifier design equation because we are typically given a gain specification and told to design the amplifier. Most system designers keep specifications to 5-decibel increments, so a table of designs will probably be all we will ever need. We can use the Mathematica function FindRoot to solve the gain equation and then backsolve for Rs. Since most amplifiers are between 5 and 30 decibels of gain we will confine our table to that range. We will also use a 50-ohm system.

We begin by setting up a range of decibel values.

In[13]:= gainsDB=Range[5,30,5];

We then establish the gain equation. Note that the equation assumes an inverting amplifier.

In[14]:= gainEqn=Abs[RfbSoln/.zo->50.0];

We can now solve the equation.

In[15]:= rfbs=(Rfb/. FindRoot[gainEqn - 10.0#1/20.0, {Rfb, {50, 500}}] & )/@gainsDB

`Out[15]= {138.914, 208.114, 331.171, 550., 939.14, 1631.14}`
The next step is to find our Rs values.

In[16]:= rsVals= Rs/.rConstraint/.Rfb->rfbs/.{zo->50};

We can place the derived values in tabular form.

In[17]:= NumberForm[TableForm[Transpose[{gainsDB,rfbs,N[rsVals]}],

 "GainDB" "Rfb" "Rs" "5" "138.9" "18." "10" "208.1" "12.01" "15" "331.2" "7.549" "20" "550." "4.545" "25" "939.1" "2.662" "30" "1631." "1.533"
Out[17]//TableForm

The ability to create and format tables is quite useful. Although you can simply use the original formulas in your calculations, if the information is needed for off-site engineers who may not have the computational resources you do, the ability to create tables is vital. Mathematica can assist you in the automation of this activity.

### Potential Problems

Mathematica makes it easy for us to test how finite transconductances of real transistors deteriorate the gain and impedance match of this amplifier. We can copy all of the preceding analysis and add in the gm factor.

In[18]:= eqnZin =
{0 == i1 + i2 - i12, i1 == (vIn - vOut)/Rfb,
i2 == (-(vOutzo)), i12 == gm v, v == vIn - i12Rs};

In[19]:= solnZin = Solve[eqnZin,vIn,{i2,i12,vOut,v}];

In[20]:= zIn = Simplify[First[vIn/i1 /. solnZin]])
Out[20]= (1 + gmRs) (Rfb + zo)/(1 + gm (Rs + zo)

Finally we substitute our constraint for Rs and set zo to 50 to get zIn in terms of gm and Rfb

In[21]:= zInFcn[gm_,Rfb_]=Simplify[zIn/.rConstraint/.zo->50]

`Out[21]= (50 + Rfb)(2500gm + Rfb)/ Rfb + 50gm(50+Rfb)`
Note the ability to set up a function that can be used throughout the entire document. In fact, you can assign certain cells the characteristic of being "initialization" cells, which are evaluated whenever the user opens the document. This allows you to be certain that all critical calculations for your presentation are evaluated.

In[22]:= eqnGain = {0 == i1+i2-i12, i1 ==(vIn - vOut)Rfb, i2 ==(-(vOut/zo), i12 == gmv,
v == vIn-i12Rs, v1 == vIn+i1zo};

`In[23]:=solnGain = Solve[eqnGain, vOut, {i1, i2, i12, v1, v}];`
In[24]:= gain = Simplify[First[vOut/vIn /. solnGain]])
Out[24]= (1 + gm(-Rfb+ Rs))zo/(1 + gmRs)(Rfb + zo)

Finally we substitute our constraint for Rs and set zo to 50 ohms to get gain in terms of gm and Rfb

In[25]:=gainFcn[gm_,Rfb_]=Simplify[gain/.rConstraint/.zo->50]

`Out[25]= -50(-Rfb+ gm(-2500+ Rfb2))/(50 + Rfb)(2500gm + Rfb)`
Since we expect our 15-decibel gain amplifier to be the most common, let's analyze our errors with the corresponding value of Rfb

In[26]:=Plot[{zInFcn[gm,330],20 Log[10,Abs[gainFcn[gm,330]]]},{gm,0.1,4},Frame->True,FrameLabel->{"gm","{Zin,Gain_db}"},PlotLabel->"Amplifier Finite gm Errors",GridLines->Automatic]

`Out[26]= -Graphics-`
Graphics produced by Mathematica have many characteristics that you can modify to present your information in the most effective fashion.

This amplifier will certainly work, given a finite gm. We must use bipolar transistors with gms greater than 1.0 to get good gain and terminal impedances. This translates to bias currents greater than 26 mA since gm is approximately ImA/26

It is possible that the feedback resistors could be optimized for low-current operation, but this would have to be done on an as-needed basis. Also, we would expect the simple relationship between Rs and Rfb to be violated since the errors with gm show our input impedance increasing and our gain decreasing. This is because any increase in Rfb to compensate for gain reduction would also increase Zin and so not solve our error problem.

### Conclusion

A procedure for designing a standard broadband amplifier has been created. Other engineers can follow the design development or use the design summary table. If devices are use at currents less than 26 mA, we can optimize the feedback resistors for best performance rather than just using the tabulated values.  Any errors in the table presumably get worse as gm is reduced and gain is increased.

The text mixed throughout the document will enable you to come back to it long after the design has been forgotten, and will allow you to re-create your work with no effort. Other engineers can follow your work, and you can present powerful graphics to enhance your presentations to management and laypersons. The live documents allow viewers to modify ranges of inputs to perform "what-if" analysis, and the computational power of Mathematica enables you to handle an amazing array of problems. Mathematica is not merely a tool for computation &mdash; it can be used as a tool for documentation and presentation as well.