In [1]:

```
from __future__ import division
#Overall voltage gain, Overall current gain
bta=100#
r_pi=0.5# # in kilo-ohms
# From Fig. 9.4
Rs=2# # in kilo-ohms
RC=2# # in kilo-ohms
RE=5# # in kilo-ohms
# As the first stage ia a CE amplifier stage
AV1=-bta*RC/(Rs+r_pi)# # Voltage gain of first amplifier
# The second stage is a CC amplifier
AV2=(1+bta)*RE/(Rs+r_pi+(1+bta)*RE)# # Voltage gain of second amplifier
AV=AV1*AV2# # Overall voltage gain
AI=Rs*AV/RE# # Overall current gain
print "Overall voltage gain = %0.2f "%AV
print "Overall current gain = %0.2f "%AI
```

In [2]:

```
from __future__ import division
#Overall voltage gain, Current gain, Input impedance, Output impedance
bta=100#
VBE=0.7# # in volts
VT=25e-3# # Voltage equivalent to temperatue at room temperature in volts
# From Fig. 9.7
R1=22# # in kilo-ohms
R2=3.3# # in kilo-ohms
RC1=6# # in kilo-ohms
RE1=0.5# # in kilo-ohms
R3=16# # in kilo-ohms
R4=6.2# # in kilo-ohms
RC2=2# # in kilo-ohms
RE2=1# # in kilo-ohms
RL=10# # in kilo-ohms
# DC analysis
# From simplified dc equivalent circuit for stage 1 in Fig. 9.8(a)
RB1=R1*R2/(R1+R2)# # in kilo-ohms
VBB1=15*R2/(R1+R2)# # in volts
IB1=(VBB1-VBE)/(RB1+(1+bta)*RE1)# # in mili-amperes
IC1=bta*IB1# # in mili-amperes
gm1=IC1/VT# # in mili-Siemens
r_pi1=bta/gm1# # in kilo-ohms
# From simplified dc equivalent circuit for stage 2 in Fig. 9.8(b)
RB2=R3*R4/(R3+R4)# # in kilo-ohms
VBB2=15*R4/(R3+R4)# # in volts
IB2=(VBB2-VBE)/(RB2+(1+bta)*RE2)# # in mili-amperes
IC2=bta*IB2# # in mili-amperes
gm2=IC2/VT# # in mili-Siemens
r_pi2=bta/gm2# # in kilo-ohms
# AC analysis
# Applying Thevnin theorem at 1-1' in ac equivalent circuit in Fig. 9.9 to obtain equivalent circuit of stage 1 in Fig. 9.10(a)
RL1=RC1*RB2/(RC1+RB2)# # Effective load for first stage in kilo-ohms
AV1=-bta*RL1/r_pi1# # Voltage gain of first stage
# Using the Thevnin's equivalent of first stage the equivalent circuit of second stage is shown in Fig. 9.10(b)
RL2=RC2*RL/(RC2+RL)# # Effective load for second stage in kilo-ohms
AV2=-bta*RL2/(RL1+r_pi2)# # Voltage gain of second stage
Io_Ic2=-RC2/(RC2+RL)# # Io/Ic2
Ic2_Ib2=-bta# # Ic2/Ib2
#From simplified diagram in Fig. 9.11
Ib2_Ic1=-RL1/(RL1+r_pi2)# # Ib2/Ic1
Ic1_Ib1=-bta# # Ic1/Ib1
Ib1_Ii=RB1/(RB1+r_pi1)# # Ib1/Ii
AV=AV1*AV2# # Overall voltage gain
AI=Io_Ic2*Ic2_Ib2*Ib2_Ic1*Ic1_Ib1*Ib1_Ii# # Overall current gain
Ri=RB1*r_pi1/(RB1+r_pi1)# # Input impedance in kilo-ohms
Ro=RC2*RL/(RC2+RL)# # Output impedance in kilo-ohms
print "Overall voltage gain = %0.2f "%AV
print "Overall current gain = %0.2f "%AI
print "Imput impedance = %0.2f kΩ "%Ri
print "Output impedance = %0.2f kΩ "%Ro
```

In [3]:

```
from __future__ import division
#Voltage gain
bta=150#
VA=130# # in volts
IC=100# # in micro-amperes
Rs=50# # in kilo-ohms
RC=250# # in kilo-ohms
VT=25# # Voltage equivalent to temperatue at room temperature in mili-volts
gm=IC/VT# # in mili-Siemens
ro=VA/IC# # in Megaohms
ro=ro*1e3# # in kilo-ohms
r_pi=bta/gm# # in kilo-ohms
# From ac equivalent circuit of the first CC stage using hybrid-π model in Fig. 9.13(a)
# Voltage gain of CC stage
AV1=(1+bta)*ro/(Rs+r_pi+(1+bta)*ro)# # Voltage gain of first stage
Ro1=(Rs+r_pi)/(1+bta)# # in kilo-ohms
Ro1_dash=ro*Ro1/(ro+Ro1)# # in kilo-ohms
# From the ac equivalent circuit of second stage in Fig. 9.13(b)
RL=ro*RC/(ro+RC)# # Effective load for second stage in kilo-ohms
AV2=-bta*RL/(Ro1_dash+r_pi)# # Voltage gain of second stage
AV=AV1*AV2# # Overall voltage gain
print "Voltage gain = %0.2f "%AV
```

In [4]:

```
from __future__ import division
# (i) Voltage gain, Input impedance, Output impedance
# (ii) Output voltage
gm=2.5# # in mili-Siemens
# From Fig. 9.14(a)
RG=3# # in Mega-ohms
RD=2.2# # in kilo-ohms
print "Part (i)"
AV1=-gm*RD# # Voltage gain of both individual stages
AV=AV1**2# # Overall voltage gain
print "Voltage gain = %0.2f "%AV
print "Input impedance = %0.2f MΩ "%RG
print "Output impedance = %0.2f kΩ "%RD
print "Part (ii)"
Vi=10# # in mili-volts
RD_dash=RD*10/(RD+10)# # Effective load of secong stage in kilo-ohms
# Now the gain of second stage
AV2=-gm*RD_dash#
AV=AV1*AV2# # Overall voltage gain
Vo=Vi*AV# # Output voltage in mili-volts
print "Output voltage = %0.2f mV "%Vo
```

In [5]:

```
from __future__ import division
## (i) Gain of each stage
# (ii) Overall voltage gain
# (iii) Output resistance Ro'
gm=1 # in mili-mho
rd=40# # in kilo-ohms
# From Fig. 9.14(b)
RD1=40 # in kilo-ohms
RS1=2 # in kilo-ohms
RD2=10 # in kilo-ohms
RS3=5 # in kilo-ohms
mu=rd*gm# # Amplification factor
print "Part (i)"
AV1=-mu*RD1/(rd+RD1+(1+mu)*RS1)# # Voltage gain of first stage (CS amplifier with RS1)
AV2=-mu*RD2/(rd+RD2)# # Voltage gain of second stage (CS amplifier stage)
AV3=mu*RS3/(rd+(1+mu)*RS3)# # Voltage gain of third stage (CD amplifier stage)
print "Voltage gain of first stage = %0.2f CS amplifier with RS1 "%AV1
print "Voltage gain of second stage = %0.2f CS amplifier stage "%AV2
print "Voltage gain of third stage = %0.2f CD amplifier stage "%AV3
print "Part (ii)"
AV=AV1*AV2*AV3# # Overall voltage gain
print "Overall voltage gain = %0.2f "%AV
print "Part (iii)"
# Last stage is a CD amplifier, therefore
Ro=rd/(1+mu)# # in kilo-ohms
Ro_dash=Ro*RS3/(Ro+RS3)# # in kilo-ohms
print "Output resistance = %0.3f kΩ "%Ro_dash
```

In [6]:

```
from __future__ import division
#Input impedance, Output impedance, Voltage gain
gm=2.5# # in mili-Siemens
r_pi=1.3# # in kilo-ohms
bta=200#
# From Fig. 9.14(c)
Ri2=15*4.7*1.3/(15*4.7+15*1.3+4.7*1.3)# # Input impedance of second stage in kilo-ohms
RD_dash=1.8*Ri2/(1.8+Ri2)# # Effective load for the first stage in kilo-ohms
AV1=-gm*RD_dash# # Voltage gain of the loaded 1st stage
AV2=-bta*2.7/r_pi# # Voltage gain of the 2nd stage
AV=AV1*AV2# # Overall voltage gain
print "Input impedance = %0.2f MΩ "%10
print "Output impedance = %0.2f kΩ "%2.70
print "Voltage gain = %0.2f "%AV
```

In [7]:

```
from __future__ import division
#AV, Ri, Ro
RE=0.5# # in kilo-ohms
Rs=50# # in kilo-ohms
Ic1=15e-3# # in mili-amperes
Ic2=1# # in mili-amperes
VA=100# # in volts
bta=150#
VT=25e-3# # Voltage equivalent to temperatue at room temperature in volts
# For Q1
gm1=Ic1/VT# # in mili-mho
r_pi1=bta/gm1# # in kilo-ohms
ro1=VA/Ic1# # in kilo-ohms
# For Q2
gm2=Ic2/VT# # in mili-mho
r_pi2=bta/gm2# # in kilo-ohms
ro2=VA/Ic2# # in kilo-ohms
# From ac equivalent circuit in Fig. 9.17
RE2=ro2*RE/(ro2+RE)# # Effective load for stage Q2 in kilo-ohms
Ri2=r_pi2+(1+bta)*RE2# # Input resistance for second stage in kilo-ohms
AV2=(1+bta)*RE2/Ri2# # Voltage gain of the second stage
RE1=ro1*Ri2/(ro1+Ri2)# # Effective load for the first stage in kilo-ohms
Ri1=r_pi1+(1+bta)*RE1# # Input resistance for first stage in kilo-ohms
AV1=(1+bta)*RE1/Ri1# # Voltage gain of first stage
AV=AV1*AV2# # Overall voltage gain
Ro=ro2*(r_pi2+ro1)/(ro2*(1+bta)+r_pi2+ro1)# # Output resistance in kilo-ohms
Ri1=Ri1*1e-3# # in Mega-ohms
print "AV = %0.2f "%AV
print "Ri = %0.2f MΩ "%Ri1
print "Ro = %0.2f kΩ "%Ro
```

In [8]:

```
from __future__ import division
IC=1# # in mili-amperes
bta=120#
VT=25e-3# # Voltage equivalent to temperatue at room temperature in volts
# From Fig. 9.20
RC=6# # in kilo-ohms
AV1=-1# # Voltage gain of CE stage (from Eqn. 9.35)
gm=IC/VT# # in mili-mho
AV2=gm*RC# # Voltage gain of CB stage
AV=AV1*AV2# # Overall voltage gain
print "Gain = %0.2f "%AV
```