# Chapter13-Operational Amplifier Circuits¶

## Ex1-pg824¶

In [1]:
import math

V1=15.;##positive supply voltage
V2=-15.;##negative supply voltage
Veb12=-0.6;
Vbe11=0.6;
Rs=40.;
Iref=(V1-V2-Veb12-Vbe11)/Rs;
print"%s %.2f %s"%('\nreference current= ',Iref,' mA\n')
Ic10=19.;
Ic1=Ic10/2.;
print"%s %.2f %s"%('\nIc1=Ic2=Ic3=Ic4= ',Ic1,'microA\n')
Ic1=Ic1*0.001;##mA
Vbe7=0.6;
Vbe6=0.6;
Ic6=Ic1;
R2=1.;
Vc6=Vbe7+Vbe6+Ic6*R2+V2;
print"%s %.2f %s"%('\nvoltage at collector of Q6= ',Vc6,' V\n')

reference current=  0.75  mA

Ic1=Ic2=Ic3=Ic4=  9.50 microA

voltage at collector of Q6=  -13.79  V



## Ex2-pg827¶

In [2]:
import math

##Example 13.2
Iref=0.72;
Ic17=0.75*Iref;
print"%s %.2f %s"%('\ncollector currents in Q17= ',Ic17,' mA\n')
b=200.;
Ib17=Ic17/b;
Ie17=Ic17;
R8=0.100;
Vbe17=0.6;
R9=50.;
Ic16=Ib17+(Ie17*R8+Vbe17)/R9;
Ic16=Ic16*1000.;
print"%s %.2f %s"%('\ncollector current in Q16= ',Ic16,' microA\n')

collector currents in Q17=  0.54  mA

collector current in Q16=  15.78  microA



## Ex3-pg829¶

In [3]:
import math

##Example 13.3
Is1=10**-14;##reverse saturation currents for Q18 Q19
Is2=3*10**-14;##reverse saturation currents for Q14 Q20
Iref=0.72;
Vt=0.026;
Ic13a=0.25*Iref;
print"%s %.2f %s"%('\nIc13a= ',Ic13a,' mA\n')
Vbe19=0.6;
R10=50.;
Ir1o=Vbe19/R10;
print"%s %.2f %s"%('\ncurrent in Ro= ',Ir1o,' mA\n')
Ic19=Ic13a-Ir1o;
print"%s %.2f %s"%('\ncurrent in Q19 = ',Ic19,'mA\n')
Ic19=Ic19*0.001;##A
Vbe19=Vt*math.log(Ic19/Is1);
print"%s %.2f %s"%('\nB-E voltage of Q19= ',Vbe19,' V\n')
b=200.;
Ic19=Ic19*10**6;##micro A
Iv19=Ic19*1000.;
Ib18=Ic19/b;
Ir1o=Ir1o*1000.;
print"%s %.2f %s"%('\nbase current in Q18= ',Ib18,' microA\n')
Ic18=Ir1o+Ib18;
print"%s %.2f %s"%('\ncurrents in Q18= ',Ic18,' microA\n')
Ic18=Ic18*10**-6;
Vbe18=Vt*math.log(Ic18/Is1);
print"%s %.2f %s"%('\nB-E voltage of Q18= ',Vbe18,' V\n')
Vbb=Vbe18+Vbe19;
print"%s %.2f %s"%('\nvoltage difference Vbb= ',Vbb,' V\n')
Ic14=Is2*math.exp(Vbb/(2.*Vt));
Ic14=Ic14*10**6;##micro A
print"%s %.2f %s"%('\nquiescent currents in Q14 and Q20  ',Ic14,'microA\n')

Ic13a=  0.18  mA

current in Ro=  0.01  mA

current in Q19 =  0.17 mA

B-E voltage of Q19=  0.61  V

base current in Q18=  0.84  microA

currents in Q18=  12.84  microA

B-E voltage of Q18=  0.55  V

voltage difference Vbb=  1.16  V

quiescent currents in Q14 and Q20   139.33 microA



## Ex4-pg832¶

In [4]:
import math

##Example 13.4
b=200.;
Va=50.
Vt=0.026;
R2=1.;
Ic6=0.0095;
Ic4=Ic6;
Ic16=0.0158;
Ic17=0.54;
r17=b*Vt/Ic17;
print"%s %.2f %s"%('\ninput resistance to gain stage= ',r17,' KOhm\n')
R9=50.;
R8=0.100;
x=r17+(1.+b)*R8;
Re=x*R9/(x+R9);
print"%s %.2f %s"%('\nRe= ',Re,' KOhm\n')
r16=b*Vt/Ic16;
print"%s %.2f %s"%('\nr16= ',r16,' KOhm\n')
Ri2=r16+(1.+b)*Re;
Ri2=Ri2*0.001;##MOhm
print"%s %.2f %s"%('\nRi2= ',Ri2,' KOhm\n')
r6=b*Vt/Ic6;
print"%s %.2f %s"%('\nresistance of the active load= ',r6,' KOhm\n')
gm=Ic6/Vt;
print"%s %.2f %s"%('\ntransconductance = ',gm,'mA/V\n')
ro6=Va/Ic6;
ro6=ro6*0.001;##MOhm
print"%s %.2f %s"%('\nro6= ',ro6,' MOhm\n')
R=ro6*(1.+gm*R2*r6/(R2+r6));
print"%s %.2f %s"%('\neffective resistance of active load= ',R,' MOhm\n')
ro4=Va/Ic4;
ro4=ro4*0.001;##Mohm
print"%s %.2f %s"%('\nResistance ro4= ',ro4,' KOhm\n')
Icq=9.5;
x=Ri2*R/(R+Ri2);
y=ro4*x/(ro4+x);
print"%s %.2f %s"%('\nsmall signal differential voltage gain=\n',Ad,'')

input resistance to gain stage=  9.63  KOhm

Re=  18.64  KOhm

r16=  329.11  KOhm

Ri2=  4.08  KOhm

resistance of the active load=  547.37  KOhm

transconductance =  0.37 mA/V

ro6=  5.26  MOhm

effective resistance of active load=  7.18  MOhm

Resistance ro4=  5.26  KOhm

small signal differential voltage gain=
-635.97


## Ex5-pg835¶

In [5]:
import math

##Example 13.5
bp=50.;
bn=200.;
Va=50.;
R9=50.;
R8=0.100;
Rl=2.;
Vt=0.026;
Ri2=4070.;
Ic20=0.138;
r20=bp*Vt/Ic20;
print"%s %.2f %s"%('\nr20= ',r20,' KOhm\n')
R20=r20+(1.+bp)*Rl;
print"%s %.2f %s"%('\nR20= ',R20,' KOhm\n')
Ic13A=0.18;
R19=Va/Ic13A;
print"%s %.2f %s"%('\nR19= ',R19,' KOhm\n')
r22=bp*Vt/Ic13A;
print"%s %.2f %s"%('\nr22= ',r22,' KOhm\n')
Ri3=r22+(1.+bp)*R19*R20/(R19+R20);
Ri3=Ri3*0.001;##MOhm
print"%s %.2f %s"%('\ninput resistance to the output stage= ',Ri3,' MOhm\n')
Ic13B=0.54;
R=Va/Ic13B;
print"%s %.2f %s"%('\neffective resistance of the active load= ',R,' KOhm\n')
Ic17=Ic13B;
R17=Va/Ic17;
print"%s %.2f %s"%('\noutput resistance Ro17 = ',R17,'KOhm\n')
Ri3=Ri3*1000.;##KOhm
r17=9.63;
x=R17*Ri3/(Ri3+R17);
y=x*R/(R+x);
A=-bn*R9*(1.+bn)*y/(Ri2*(R9+r17+(1.+bn)*R8));
print"%s %.2f %s"%('\nsmall signal voltage gain=\n',A,'')

r20=  9.42  KOhm

R20=  111.42  KOhm

R19=  277.78  KOhm

r22=  7.22  KOhm

input resistance to the output stage=  4.06  MOhm

effective resistance of the active load=  92.59  KOhm

output resistance Ro17 =  92.59 KOhm

small signal voltage gain=
-283.53


## Ex6-pg837¶

In [6]:
import math

##Example 13.6
Ic20=2.;
bn=200.;
bp=50.;
Va=50.;
r17=9.63;
r22=7.22;
R20=0.260;
gm17=20.8;
ro17=92.6;
Ro13B=92.6;
R8=0.100;
Rc17=ro17*(1.+gm17*R8*r17/(R8+r17));
print"%s %.2f %s"%('\nRc17= ',Rc17,' KOhm\n')
Rc22=(r22+Rc17*Ro13B/(Rc17+Ro13B))/(1.+bp);
print"%s %.2f %s"%('\nRc22= ',Rc22,' KOhm\n')
Ic13A=0.18;
Rc19=Va/Ic13A;
print"%s %.2f %s"%('\nRc19= ',Rc19,' KOhm\n')
Rc20=(R20+Rc22*Rc19/(Rc22+Rc19))/(1.+bp);
print"%s %.2f %s"%('\nRc20= ',Rc20,' KOhm\n')
Rc20=Rc20*1000.;##Ohm
R3=22.;
Ro=R3+Rc20;
print"%s %.2f %s"%('\noutput resistance= ',Ro,' Ohm\n')

Rc17=  283.23  KOhm

Rc22=  1.51  KOhm

Rc19=  277.78  KOhm

Rc20=  0.03  KOhm

output resistance=  56.54  Ohm



## Ex7-pg838¶

In [7]:
import math

##Example 13.7
Av2=285.;
C1=30.;
Ci=C1*(1.+Av2);
print"%s %.2f %s"%('\ninput capacitance= ',Ci,' pF\n')
Ri2=4.07;
Ract=7.18;
ro4=5.26;
Ro1=Ract*ro4/(Ract+ro4);
print"%s %.2f %s"%('\ngate stage input resistance= ',Ro1,' MOhm \n')
Req=Ro1*Ri2/(Ri2+Ro1);
print"%s %.2f %s"%('\nequivalent resistance= ',Req,' MOhm\n')
Req=Req*10**6;##Ohm
Ci=Ci*10**-12;##F
fPD=1/(2.*math.pi*Req*Ci);
print"%s %.2f %s"%('\ndominant pole frequency = ',fPD,' Hz\n')

input capacitance=  8580.00  pF

gate stage input resistance=  3.04  MOhm

equivalent resistance=  1.74  MOhm

dominant pole frequency =  10.67  Hz



## Ex9-pg842¶

In [8]:
import math

##Example 13.9
##lambda=y
y=0.02;
##W/L=x and u*Cox/2=t
x=12.5;
t=10.;
Kp1=x*t;
print"%s %.2f %s"%('\nconduction parameters of M1 and M2= ',Kp1,' microA/V^2\n')
Kp1=Kp1*0.001;##mA/V^2
Id=0.0199;
ro2=1./(y*Id);
ro2=ro2*0.001;##Mohm
print"%s %.2f %s"%('\noutput resistance= MOhm\n',ro2,'')
Iq=0.0397;
ro2=ro2*1000.;##Kohm
ro4=ro2;
print"%s %.2f %s"%('\nthe gain of input stage= \n',Ad,'')
Kn7=0.250;
Id7=Iq;
gm7=2.*math.sqrt(Kn7*Id7)
print"%s %.2f %s"%('\ntransconductance of M7= ',gm7,' mA/V\n')
ro7=1./(y*Id7);
ro7=ro7*0.001;
print"%s %.2f %s"%('\noutput resistance of M7 and M8 = ',ro7,'MOhm\n')
ro7=ro7*1000.;##Kohm
ro8=ro7;
Av2=gm7*ro7*ro8/(ro7+ro8);
print"%s %.2f %s"%('\ngain of the second stage=\n',Av2,'')
print"%s %.2f %s"%('\noverall voltage gain=\n',Av,'')

conduction parameters of M1 and M2=  125.00  microA/V^2

output resistance= MOhm
2.51

the gain of input stage=
125.16

transconductance of M7=  0.20  mA/V

output resistance of M7 and M8 =  1.26 MOhm

gain of the second stage=
125.47

overall voltage gain=
15703.52


## Ex10-pg845¶

In [9]:
import math

##Example 13.10
Iref=100;
Kn=80;
Kp=40;
##W/L=x
x=25;
##lambda=y
y=0.02;
Id=Iref/2.;
gm1=2.*math.sqrt(Kp*x*Id/2.);
print"%s %.2f %s"%('\ntransconductance gm1=gm8= ',gm1,' microA/V\n')
gm6=2.*math.sqrt(Kn*x*Id/2.);
print"%s %.2f %s"%('\ntransconductance= ',gm6,' microA/V\n')
ro1=1./(y*Id);
ro8=ro1;
ro6=ro1;
ro10=ro1;
print"%s %.2f %s"%('\noutput resistance ro1=ro8=ro6=ro10= ',ro1,' MOhm\n')
Id4=Iref;
ro4=1./(y*Id4);
print"%s %.2f %s"%('\nro4= ',ro4,' MOhm\n')
Ro8=gm1*ro8*ro10;
print"%s %.2f %s"%('\ncomposite output resistances = ',Ro8,'MOhm\n')
Ro6=gm6*ro6*ro4*ro1/(ro4+ro1);
print"%s %.2f %s"%('\ncomposite output resistances= ',Ro6,' MOhm\n')

transconductance gm1=gm8=  316.23  microA/V

transconductance=  447.21  microA/V

output resistance ro1=ro8=ro6=ro10=  1.00  MOhm

ro4=  0.50  MOhm

composite output resistances =  316.23 MOhm

composite output resistances=  149.07  MOhm

differential voltage gain=
32037.72


## Ex12-pg854¶

In [10]:
import math

##Example 13.12
Kp=0.6;
bn=200.;
Va=50.;
Vt=0.026;
Ic13=0.20;
Ri2=bn*Vt/Ic13;
print"%s %.2f %s"%('\ninput resistance to the gain stage= ',Ri2,' KOhm\n')
Iq5=Ic13;
print"%s %.2f %s"%('\nsmall signal voltage gain=\n',Ad,'')

input resistance to the gain stage=  26.00  KOhm

small signal voltage gain=
12.74


## Ex13-pg855¶

In [11]:
import math

##Example 13.13
Va=150.;
Vt=0.026;
Ic13=0.2;
gm13=Ic13/Vt;
print"%s %.2f %s"%('\ntransconductance= ',gm13,' mA/V\n')
ro13=Va/Ic13;
print"%s %.2f %s"%('\noutput resistance= ',ro13,' KOhm\n')
Av2=gm13*ro13;
print"%s %.2f %s"%('\nvoltage gain= \n',Av2,'')

transconductance=  7.69  mA/V

output resistance=  750.00  KOhm

voltage gain=
5769.23


## Ex14-pg856¶

In [12]:
import math

##Example 13.14
Av2=5768.;
C1=12.;
Ci=C1*(1.+Av2);
print"%s %.2f %s"%('\neffective input capacitance= ',Ci,' pF\n')
Ri2=26000.;##gain stage input resistance (Ohm)
Ci=Ci*10**-12;##F
fPD=1/(2.*math.pi*Ri2*Ci);
print"%s %.2f %s"%('\ndominant pole frequency= ',fPD,' Hz\n')
Av=73254.;
fT=fPD*Av;
fT=fT*10**-6;##MHz
print"%s %.2f %s"%('\nunity gain bandwidth= ',fT,' MHz\n')

effective input capacitance=  69228.00  pF

dominant pole frequency=  88.42  Hz

unity gain bandwidth=  6.48  MHz