# Chapter11-Differential and Multistage Amplifier¶

## Ex1-pg642¶

In [1]:
import math

##Example 11.1
V1=10.;
V2=-10.;
Iq=1.;
Rc=10.;
Vbe=0.7;
iC1=Iq/2.;
iC2=iC1;
print"%s %.2f %s"%('\ncollector currents = ',iC1,'mA\n')
Vc1=V1-iC1*Rc;
Vc2=Vc1;
print"%s %.2f %s"%('\ncollector voltages = ',Vc1,'V\n')
Vcm=0.;
Ve=Vcm-Vbe;
Vce1=Vc1-Ve;
print"%s %.2f %s"%('\ncollector emitter voltage= ',Vce1,' V\n')
Vcm=-5.;
Ve=Vcm-Vbe;
Vce1=Vc1-Ve;
print"%s %.2f %s"%('\ncollector emitter voltage = ',Vce1,'V\n')
Vcm=5.;
Ve=Vcm-Vbe;
Vce1=Vc1-Ve;
print"%s %.2f %s"%('\ncollector emitter voltage= ',Vce1,' V\n')

collector currents =  0.50 mA

collector voltages =  5.00 V

collector emitter voltage=  5.70  V

collector emitter voltage =  10.70 V

collector emitter voltage=  0.70  V



## Ex3-pg650¶

In [2]:
import math

##Example 11.3
V1=10.;
V2=-10.;
Iq=0.8*10**-3;
Rc=12000.;
Ro=25000.;
b=100.;
Vt=0.026;
Acm=-(Iq*Rc/(2.*Vt))/(1.+(1.+b)*Iq*Ro/(Vt*b));
print"%s %.2f %s"%('\ncommon mode gain=\n',Acm,'')

differential gain=
92.31

common mode gain=
-0.24


## Ex7-pg657¶

In [3]:
import math

##Example 11.7
Acm=0.237;##mod of Acm
print"%s %.2f %s"%('\ncommon mode rejection ratio=\n',CMRR,'')
CMRRdB=20.*math.log10(CMRR);
print"%s %.2f %s"%('\nCMRR in decibels= ',CMRRdB,' dB\n')

common mode rejection ratio=
389.45

CMRR in decibels=  51.81  dB



## Ex8-pg658¶

In [4]:
import math

##Example 11.8
CMRRdB=90.;##dB
CMRR=3.16*10**4;
b=100.;
Vt=0.026;
Iq=0.8;
Ro=(2.*CMRR-1.)*Vt*b/((1.+b)*Iq);
Ro=Ro*10**-3;##Mohm
print round(Ro,2)

2.03


## Ex9-pg661¶

In [5]:
import math

##Example 11.9
b=100.;
Vbe=0.7;
Va=100.;
Vt=0.026;
Iref=0.5;
Iq=Iref;
I1=Iq/2.
Icq=I1;
r=b*Vt/Icq;
print"%s %.2f %s"%('\nsmall signal parameter= ',r,' KOhm\n')
ro=Va/Icq;
print"%s %.2f %s"%('\nro= ',ro,' KOhm\n')
Ro=Va/Iq;
print"%s %.2f %s"%('\noutput resistance of Q4= ',Ro,' KOhm\n')
Rid=2.*r;
print"%s %.2f %s"%('\ndifferential mode input resistance = ',Rid,'KOhm\n')
Ricm=(1.+b)*(Ro*ro/2.)/(Ro+ro/2.);
Ricm=Ricm*0.001;##Mohm
print"%s %.2f %s"%('\ncommon mode input resistance= ',Ricm,' MOhm\n')

small signal parameter=  10.40  KOhm

ro=  400.00  KOhm

output resistance of Q4=  200.00  KOhm

differential mode input resistance =  20.80 KOhm

common mode input resistance=  10.10  MOhm



## Ex10-pg664¶

In [3]:
import math
import numpy
from numpy import poly
##Example 11.10
Kn1=0.1;
Kn2=Kn1;
Kn3=0.1;
Kn4=Kn3;
R1=30.;
Vtn=1.;
Rd=16.;

Vgs4=2.40;
I1=(20.-Vgs4)/R1;
print"%s %.2f %s"%('\nI1= ',I1,' mA\n')
Iq=I1;
Id1=Iq/2.;
print"%s %.2f %s"%('\nId1 and Id2 = ',Id1, 'mA\n')
Vgs1=math.sqrt(Id1/Kn1)+Vtn;
print"%s %.2f %s"%('\nVgs1 and Vgs2 = ',Vgs1,'V\n')
vo1=10.-Id1*Rd;
print"%s %.2f %s"%('\nvo1 and vo2= ',vo1,' V\n')
Vds1=Vgs1-Vtn;
print"%s %.2f %s"%('\nVds1=Vds2=Vds1(sat)= ',Vds1,' V\n')
Vcm=vo1-Vds1+Vgs1;
print"%s %.2f %s"%('\nVcm max= ',Vcm,' V\n')
Vds4=Vgs4-Vtn;
print"%s %.2f %s"%('\nVds4= ',Vds4,' V\n')
Vcm2=Vgs1+Vds4-10.;
print"%s %.2f %s"%('\nVcm min= ',Vcm2,'V\n')

I1=  0.59  mA

Id1 and Id2 =  0.29 mA

Vgs1 and Vgs2 =  2.71 V

vo1 and vo2=  5.31  V

Vds1=Vds2=Vds1(sat)=  1.71  V

Vcm max=  6.31  V

Vds4=  1.40  V

Vcm min=  -5.89 V



## Ex11-pg668¶

In [7]:
import math

##Example 11.11
Kn=0.5;
Iq=1.;
Vt=0.026;
##transconductance of the MOSFET
gm=2.*math.sqrt(Kn*Iq/2);
print"%s %.2f %s"%('\ntransconductance= ',gm,' mA/V\n')
##transconductance of the bipolar transistor
gm=Iq/(2.*Vt);
print"%s %.2f %s"%('\ntransconductance= ',gm,' mA/V\n')

transconductance=  1.00  mA/V

transconductance=  19.23  mA/V



## Ex12-pg670¶

In [8]:
import math

##Example 11.12
Iq=0.587;
Kn=1.;
Rd=16.;
##lambda=y
y=0.01;
Ro=1./(y*Iq);
print"%s %.2f %s"%('\noutput resistance = ',Ro,'KOhm\n')
print"%s %.2f %s"%('\ndifferential mode voltage gain= \n',Ad,'')
Acm=-math.sqrt(2.*Kn*Iq)*Rd/(1.+2.*math.sqrt(2.*Kn*Iq)*Ro);
print"%s %.2f %s"%('\ncommon mode voltage gain=\n',Acm,'')
print"%s %.2f %s"%('\ncommon mode rejection ratio= ',CMRR,' dB\n')

output resistance =  170.36 KOhm

differential mode voltage gain=
8.67

common mode voltage gain=
-0.05

common mode rejection ratio=  45.35  dB



## Ex13-pg678¶

In [9]:
import math

##Example 11.13
Iq=0.2;
Va=100.;
Va2=Va;
Va4=Va;
Rl=100.;
Vt=0.026;
print"%s %.2f %s"%('\nopen circuit voltage gain=\n',Ad,'')

open circuit voltage gain=
1923.08

voltage gain=
320.51


## Ex15-pg684¶

In [10]:
import math

##Example 11.15
Kn=0.2;
Idq=0.1;
ro4=1000.;##Kohm
ro6=1000.;##KOhm
ro2=ro4;
##lambda=y
y=0.01;
gm=2.*math.sqrt(Kn*Idq);
print"%s %.2f %s"%('\ntransconductance= ',gm,' mA/V\n')
ro=1./(y*Idq);
print"%s %.2f %s"%('\noutput resistance= ',ro,' KOhm\n')
Ro=ro4+ro6*(1.+gm*ro);
Ro=Ro*0.001;##Mohm
print"%s %.2f %s"%('\noutput resistance of the cascode active load= ',Ro,'Mohm\n')
Ro=Ro*1000.;##KOhm
print"%s %.2f %s"%('\ndifferential mode voltage gain=\n',Ad,'')

transconductance=  0.28  mA/V

output resistance=  1000.00  KOhm

output resistance of the cascode active load=  284.84 Mohm

differential mode voltage gain=
281.85


## Ex16-pg693¶

In [11]:
import math

##Example 11.16
Iq=0.2;
Ic1=Iq;
Icb=1.;
R4=10.;
R3=0.2;
b=100.;
Va=100.;
Vt=0.026;
Ri=2.*(1.+b)*b*Vt/Iq;
Ri=Ri*0.001;##MOhm
print"%s %.2f %s"%('\ninput resistance= ',Ri,' MOhm\n')
R11=b*Vt/Iq;
print"%s %.2f %s"%('\nresistance R11= ',R11,' KOhm\n')
Re=R11*R3/(R11+R3);
print"%s %.2f %s"%('\nRe= ',Re,' KOhm\n')
gm11=Iq/Vt;
print"%s %.2f %s"%('\ngm11= ',gm11,' mA/V\n')
ro11=Va/Iq;
print"%s %.2f %s"%('\nro11 = ',ro11,'KOhm\n')
Rc11=ro11*(1+gm11*Re);
Rc11=Rc11*0.001;##MOhm
print"%s %.2f %s"%('\nRc11= ',Rc11,' MOhm\n')
r8=b*Vt/Icb;
print"%s %.2f %s"%('\nresistance= ',r8,'KOhm\n')
##answer of following given in the book is wrong
Rb8=r8+(1.+b)*R4;
Rb8=Rb8*0.001;##MOhm
print"%s %.2f %s"%('\nRb8 = ',Rb8,'MOhm\n')
Rl7=Rc11*Rb8/(Rc11+Rb8);
print"%s %.2f %s"%('\nRl7= ',Rl7,' MOhm\n')
Av=Iq*Rl7/(2.*Vt);
print"%s %.2f %s"%('\nsmall signal voltage gain=\n',Av,'')

input resistance=  2.63  MOhm

resistance R11=  13.00  KOhm

Re=  0.20  KOhm

gm11=  7.69  mA/V

ro11 =  500.00 KOhm

Rc11=  1.26  MOhm

resistance=  2.60 KOhm

Rb8 =  1.01 MOhm

Rl7=  0.56  MOhm

small signal voltage gain=
2.16


## Ex17-pg694¶

In [12]:
import math

##Example 11.17
Va=100.;
R4=10.;
b=100.;
Rc11=1.26*10**3;
r8=2.6;
Iq=0.2;
Rc7=Va/Iq;
print"%s %.2f %s"%('\nRc7= ',Rc7,' KOhm\n')
Z=Rc11*Rc7/(Rc11+Rc7);
print"%s %.2f %s"%('\nZ= ',Z,' KOhm\n')
x=(r8+Z)/(1.+b);
Ro=R4*x/(R4+x);
print"%s %.2f %s"%('\noutput resistance= ',Ro,' KOhm\n')

Rc7=  500.00  KOhm

Z=  357.95  KOhm

output resistance=  2.63  KOhm



## Ex19-pg697¶

In [13]:
import math

##Example 11.19
b=100.;
Vt=0.026;
Rc=20.;
Ir4=0.4;
Iq=Ir4;
Ir6=Ir4;
r4=b*Vt/Ir4;
print"%s %.2f %s"%('\nr4= ',r4,' KOhm\n')
r3=b**2*Vt/Ir4;
print"%s %.2f %s"%('\nr3= ',r3,' KOhm\n')
Ri2=r3+(1.+b)*r4;
print"%s %.2f %s"%('\ninput resistance= ',Ri2,' KOhm\n')
gm=Iq/(2.*Vt);
print"%s %.2f %s"%('\ntransconductance= ',gm,' mA/V\n')
print"%s %.2f %s"%('\ngain of differential amplifier stage=\n',Ad1,'')
r5=b*Vt/Ir6;
print"%s %.2f %s"%('\nr5 = ',r5,'KOhm\n')
Ir7=2.;
r6=b*Vt/Ir7;
print"%s %.2f %s"%('\nr6= ',r6,' KOhm\n')
R6=16.5;
R7=5.;
Ri3=r5+(1.+b)*(R6+r6+(1.+b)*R7);
Ri3=Ri3*0.001;##MOhm
print"%s %.2f %s"%('\nRi3= ',Ri3,' MOhm\n')
Rs=5.;
A2=Ir4*Rs/(2.*Vt);
print"%s %.2f %s"%('\nvoltage gain A2=\n',A2,'')
A3=1.;##vo/vo3
print"%s %.2f %s"%('\nsmall signal voltage gain=\n',Ad,'')

r4=  6.50  KOhm

r3=  650.00  KOhm

input resistance=  1306.50  KOhm

transconductance=  7.69  mA/V

gain of differential amplifier stage=
75.76

r5 =  6.50 KOhm

r6=  1.30  KOhm

Ri3=  52.81  MOhm

voltage gain A2=
38.46

small signal voltage gain=
2913.97


## Ex20-pg702¶

In [14]:
import math

##Example 11.20
Ro=10000000.;
Co=1.*10**-12;
Rb=500.;
r=10000.;
b=100.;
f=1./(2.*math.pi*Ro*Co);
f=f*0.001;##KHz
print"%s %.2f %s"%('\nfrequency of the zero= ',f,' KHz\n')
Req=Ro*(1.+Rb/r)/(1.+Rb/r+2.*(1.+b)*Ro/r);
print"%s %.2f %s"%('\nReq= ',Req,' Ohm\n')
f=1/(2.*math.pi*Req*Co);
f=f*10**-9;##GHz
print"%s %.2f %s"%('\nfrequency of the pole= ',f,' GHz\n')

frequency of the zero=  15.92  KHz

Req=  51.98  Ohm

frequency of the pole=  3.06  GHz