In [1]:

```
import math
#Variables
VCC = 10.0 #Source voltage (in volts)
RC = 10.0 #Collector resistance (in kilo-ohm)
RB = 1.0 * 10**3 #Base resistance (in kilo-ohm)
beta = 100.0 #Common emitter current gain
VBE = 0.7 #Emitter-to-Base Voltage (in volts)
#Calculation
IB = (VCC - VBE) / RB #Base current (in milli-Ampere)
IC = beta * IB #Collector current (in milli-Ampere)
IE = IC #Emitter current (in milli-Ampere)
r1e = 25.0 / IE * 10**-3 #a.c resistance of emitter diode (in kilo-ohm)
R1 = beta * r1e #Input resistance looking directly into the base (in kilo-ohm)
Ris = RB * R1/(RB + R1) #Stage input resistance (in kilo-ohm)
Ro = RC #Output resistance (in kilo-ohm)
Av = RC / r1e #Voltage gain
#Result
print "Input resistance looking into the base is ",round(R1,2)," kilo-ohm.\nInput resistance of the stage is ",round(Ris,3)," kilo-ohm.\nOutput resistance is ",Ro," kilo-ohm.\nVoltage gain is ",Av,"."
#Correction to be done in the book for the formula of Ris in the question.
```

In [2]:

```
import math
#Variables
Ri = 2.5 #Input resistance (in kilo-ohm)
Av = 200.0 #Voltage gain
Vs = 5.0 * 10**-3 #Input signal voltage (in volts)
beta = 50.0 #Common emitter current gain
#Calculation
IB = Vs / Ri #Base current (in milli-Ampere)
IC = beta * IB #Collector current (in milli-Ampere)
Ai = beta #Current gain
Ap = Ai * Av #Power gain
Gp = 10 * math.log10(Ap) #dB power gain (in decibel)
#Result
print "The base current is ",IB," mA.\nThe collector current is ",IC," mA.\nThe power gain is ",Ap,".\nThe dB power gain is ",Gp," dB."
#Wrong unit of IB. IB is in micro Ampere but in book it is given in milli-Ampere in solution.
#Also wrong unit in IC.
```

In [3]:

```
import math
#Variables
VCC = 20.0 #Source voltage (in volts)
RC = 5.0 #Collector resistance (in kilo-ohm)
RE = 1.0 #Emitter resistance (in kilo-ohm)
RB = 100.0 #Base resistance (in kilo-ohm)
beta = 150.0 #Common emitter current gain
#Calculation
IC = VCC / (RE + RB/beta) #Collector current (in milli-Ampere)
IE = IC #Emitter current (in milli-Ampere)
r1e = 25.0 / IE * 10**-3 #a.c. resistance of emitter diode (in kilo-ohm)
Ri = beta * (r1e + RE) #Input resistance looking directly into the base (in kilo-ohm)
Ris = RB * Ri / (RB + Ri) #Input resistance of the stage (in kilo-ohm)
Av = RC / RE #Voltage gain
Gp = 10 * math.log10(Av) #dB power gain (in decibel)
#Result
print "Input resistance looking into the base is ",round(Ri)," kilo-ohm.\nInput resistance of the stage is ",round(Ris)," kilo-ohm.\nVoltage gain is ",Av,".\ndB voltage gain is ",round(Gp)," dB."
```

In [4]:

```
import math
#Variables
VCC = 12.0 #Source voltage (in volts)
RC = 10.0 * 10**3 #Collector resistance (in ohm)
RE = 1.0 * 10**3 #Emitter resistance (in ohm)
RB = 500.0 * 10**3 #Base resistance (in ohm)
beta = 50.0 #Common emitter current gain
#Calculation
IC = VCC / (RE + RB/beta) #Collector current (in Ampere)
IE = IC #Emitter current (in Ampere)
r1e = 25.0 / IE * 10**-3 #a.c. resistance of emitter diode (in ohm)
Ri = beta * (r1e) #Input resistance looking directly into the base (in ohm)
Ris = RB * Ri / (RB + Ri) #Input resistance of the stage (in ohm)
Av = RC / r1e #Voltage gain
AV1 = RC / RE #New voltage gain
#Result
print "Input resistance looking into the base is ",round(Ri)," ohm.\nInput resistance of the stage is ",round(Ris,1)," kilo-ohm.\nVoltage gain is ",round(Av,2),".\nNew Voltage gain is ",AV1,"."
#Slight variations in answers due to high precision.
```

In [5]:

```
import math
#Variables
VCC = 30.0 #Source voltage (in volts)
RC = 10.0 #Collector resistance (in kilo-ohm)
RE = 8.2 #Emitter resistance (in kilo-ohm)
RL = 3.3 #Load resistance (in kilo-ohm)
beta = 200.0 #Common emitter current gain
VBE = 0.7 #Emitter-to-Base Voltage (in volts)
R1 = 47.0 #Resistance (in kilo-ohm)
R2 = 15.0 #Resistance (in kilo-ohm)
Vs = 5.0 #a.c voltage (in milli-volts)
#Calculation
Vth = VCC * R2 / (R1 + R2) #Thevenin's voltage (in volts)
Rth = R1 * R2 / (R1 + R2) #Thevenin's equivalent voltage (in volts)
IE = (Vth - VBE)/(RE + Rth/beta) #Emitter current (in milli-Ampere)
r1e = 25.0 / IE #a.c. resistance of emitter diode (in ohm)
rL = RC * RL/(RC + RL) #a.c load seen by the amplifier (in kilo-ohm)
Av = rL * 10**3 / r1e #Voltage gain
vo = Av * Vs #Output voltage (in volts)
Ri = beta * r1e * 10**-3 #Input resistance looking directly into the base (in ohm)
Ris = Rth * Ri / (Rth + Ri) #input resistance of the stage (in ohm)
#Result
print "a.c output voltage is ",round(vo,2)," mV.\nInput impedance for the circuit is ",round(Ris)," kilo-ohm."
#Slight variation in value of vo due to higher precision.
```

In [6]:

```
import math
#Variables
VCC = 10.0 #Source voltage (in volts)
RC = 5.0 #Collector resistance (in kilo-ohm)
RE = 1.0 #Emitter resistance (in kilo-ohm)
beta = 50.0 #Common emitter current gain
VBE = 0.7 #Emitter-to-Base Voltage (in volts)
R1 = 50.0 #Resistance (in kilo-ohm)
R2 = 10.0 #Resistance (in kilo-ohm)
Vs = 10.0 #a.c voltage (in milli-volts)
RS = 600.0 * 10**-3 #Source resistance (in kilo-ohm)
#Calculation
Vth = VCC * R2 / (R1 + R2) #Thevenin's voltage (in volts)
Rth = R1 * R2 / (R1 + R2) #Thevenin's equivalent voltage (in volts)
IE = (Vth - VBE)/(RE + Rth/beta) #Emitter current (in milli-Ampere)
r1e = 25.0 / IE * 10**-3 #a.c. resistance of emitter diode (in kilo-hm)
Ris = Rth * beta*r1e/(Rth + beta*r1e) #input resistance of the stage (in ohm)
rL = RC * R1/(RC + R1) #a.c load seen by the amplifier (in kilo-ohm)
Av = rL / r1e #Voltage gain
vin = Vs * Ris / (Ris + RS) #input voltage (in milli-volts)
vo = Av * vin #Output voltage (in milli-volts)
Avs = Av * vin / Vs #Overall voltage gain
#Result
print "The output voltage is ",round(vo * 10**-3,3)," V.\nThe overall voltage gain is ",round(Avs,2),"."
#Slight variation due to higher precision.
```

In [7]:

```
import math
#Variables
VCC = 12.0 #Source voltage (in volts)
RC = 4.0 #Collector resistance (in kilo-ohm)
RE = 3.3 #Emitter resistance (in kilo-ohm)
beta = 120.0 #Common emitter current gain
VBE = 0.7 #Emitter-to-Base Voltage (in volts)
R1 = 60.0 #Resistance (in kilo-ohm)
R2 = 30.0 #Resistance (in kilo-ohm)
#Calculation
Vth = VCC * R2 / (R1 + R2) #Thevenin's voltage (in volts)
Rth = R1 * R2 / (R1 + R2) #Thevenin's equivalent voltage (in volts)
IE = (Vth - VBE)/(RE + Rth/beta) #Emitter current (in milli-Ampere)
r1e = 25.0 / IE * 10**-3 #a.c. resistance of emitter diode (in kilo-hm)
rL = RC #Load resistance (in kilo-ohm)
Av = RC / r1e #Voltage gain
#Result
print "The voltage gain is ",round(Av,1),"."
#Slight variation due to higher precision.
```

In [8]:

```
import math
#Variables
VCC = -18.0 #Source voltage (in volts)
RC = 4.3 #Collector resistance (in kilo-ohm)
RE = 1.0 #Emitter resistance (in kilo-ohm)
beta = 200.0 #Common emitter current gain
VBE = -0.7 #Emitter-to-Base Voltage (in volts)
R1 = 39.0 #Resistance (in kilo-ohm)
R2 = 8.2 #Resistance (in kilo-ohm)
RL = 3.0 #Load resistance (in kilo-ohm)
#Calculation
Vth = VCC * R2 / (R1 + R2) #Thevenin's voltage (in volts)
Rth = R1 * R2 / (R1 + R2) #Thevenin's equivalent voltage (in volts)
IC = (Vth - VBE)/(RE + Rth/beta) #Collector current (in milli-Ampere)
IE = -IC #Emitter current (in milli-Amper)
r1e = 30.0/IE * 10**-3 #a.ac resistance (in kilo-ohm)
Ris = Rth * beta*r1e/(Rth + beta*r1e) #input resistance of the stage (in ohm)
rL = RC * RL / (RC + RL) #a.c. load resistance (in kilo-ohm)
Av = rL / r1e #Voltage gain
#Result
print "Voltage gain is ",round(Av,1),"."
#printing mistake in book about formula for rL it is in fact rL = RC * RL /(RC + RL).
#Slight variation due to higher precision.
```

In [15]:

```
import math
#Variables
VCC = 20.0 #Source voltage (in volts)
RC = 5.7 #Collector resistance (in kilo-ohm)
RE = 1.0 #Emitter resistance (in kilo-ohm)
beta = 100.0 #Common emitter current gain
VBE = 0.7 #Emitter-to-Base Voltage (in volts)
R1 = 100.0 #Resistance (in kilo-ohm)
R2 = 10.0 #Resistance (in kilo-ohm)
Vs = 10.0 * 10**-3 #a.c voltage (in volts)
RS = 100.0 * 10**-3 #Source resistance (in kilo-ohm)
#Calculation
Vth = VCC * R2 /(R1 + R2) #Thevenin's voltage (in volts)
Rth = R1 * R2 / (R1 + R2) #Thevenin's equivalent resistance (in kilo-ohm)
IE = (Vth - VBE)/(RE + Rth/beta) #Emitter current (in milli-Ampere)
r1e = 25.0 / IE * 10**-3 #a.c. resistance of emitter diode (in kilo-hm)
Ris = Rth * beta*r1e/(Rth + beta*r1e) #input resistance of the stage (in ohm)
rL = RC #Load resistance (in kilo-ohm)
Av = rL / r1e #Voltage gain
vin = Vs * Ris / (Ris + RS) #input voltage (in milli-volts)
vo = Av * vin #Output voltage (in milli-volts)
Avs = Av * vin / Vs #Overall voltage gain
#Result
print "Av is ",Av,".\nRi is ",round(Ris * 10**3,2)," ohm.\nVo is ",round(vo,2)," V.\nAvs is ",round(Avs,2),"."
#Slight variation due to higher precision.
```

In [1]:

```
import math
#Variables
VCC = -18.0 #Source voltage (in volts)
RC = 4.3 #Collector resistance (in kilo-ohm)
RE = 1.0 #Emitter resistance (in kilo-ohm)
beta = 200.0 #Common emitter current gain
VBE = -0.7 #Emitter-to-Base Voltage (in volts)
R1 = 39.0 #Resistance (in kilo-ohm)
R2 = 8.2 #Resistance (in kilo-ohm)
RV = 75.0 * 10**-3 #Resistance (in kilo-ohm)
re = 30.0 * 10**-3 #Emitter resistance (in kilo-ohm)
RL = 3.3 #Load resistance (in kilo-ohm)
#Calculation
Vth = VCC * R2 /(R1 + R2) #Thevenin's voltage (in volts)
Rth = R1 * R2 / (R1 + R2) #Thevenin's equivalent resistance (in kilo-ohm)
IE = (Vth - VBE)/(RE + Rth/beta) #Emitter current (in milli-Ampere)
IC = round(IE,2) #Collector current (in milli-Ampere)
VCE = VCC - IC * (RC + RE) #Collector-to-Emitter voltage (in volts)
r1e = 30.0/abs(IE) * 10**-3 #a.c. resistance (in kilo-ohm)
Ris = Rth * beta*r1e/(Rth + beta*r1e) #input resistance of the stage (in ohm)
rL = RC * RL / (RC + RL) #Load resistance (in kilo-ohm)
Av = rL / (r1e + RV) #Voltage gain
#Result
print "Voltage gain Av is ",round(Av,1),".\nInput impedance is ,",round(Ris,3)," kilo-ohm.\nVCE is ",VCE," V."
#Slight variation due to higher precision.
```

In [10]:

```
import math
#Variables
VCC = 10.0 #Source voltage (in volts)
RC = 5.0 #Collector resistance (in kilo-ohm)
rE = 500 * 10**-3 #Emitter resistance (in kilo-ohm)
beta = 50.0 #Common emitter current gain
VBE = 0.7 #Emitter-to-Base Voltage (in volts)
R1 = 50.0 #Resistance (in kilo-ohm)
R2 = 10.0 #Resistance (in kilo-ohm)
Vs = 100.0 * 10**-3 #a.c voltage (in volts)
RS = 600.0 * 10**-3 #Source resistance (in kilo-ohm)
RL = 50.0 #Load resistance (in kilo-ohm)
RE1 = 500.0 * 10**-3 #Resistance (in kilo-ohm)
#Calculation
Vth = VCC * R2 /(R1 + R2) #Thevenin's voltage (in volts)
Rth = R1 * R2 / (R1 + R2) #Thevenin's equivalent resistance (in kilo-ohm)
RE = RE1 + rE #Emitter total resistance (in kilo-ohm)
IE = (Vth - VBE)/(RE + Rth/beta) #Emitter current (in milli-Ampere)
r1e = 25.0 / IE * 10**-3 #a.c. resistance (in kilo-ohm)
Ri = beta * (rE + r1e) #Input resistance directly into the base (in kilo-ohm)
Ris = Rth * Ri/(Rth + Ri) #Input resistance of the stage (in kilo-ohm)
rL = RC * RL / (RC + RL) #a.c. load resistance (in kilo-ohm)
Av = rL/(rE + r1e) #Voltage gain
Avs = Av * Ris / (RS + Ris) #Overall voltage gain
Vo = Avs * Vs #Output voltage (in volts)
#Result
print "Input resistance looking directly into the base is ",round(Ri,1)," kilo-ohm.\nInput resistance of the stage is ",round(Ris,2)," kilo-ohm.\nVoltage gain is ",round(Av,3)," .\nOverall voltage gain is ",round(Avs,2)," .\nOutput voltage is ",round(Vo,2),"V."
#Slight variations due to higher precision.
#Vo in the book is not properly calculated. Calculation error in Vo. Vo value should be 0.78 V.
```

In [1]:

```
import math
#Variables
VCC = 10.0 #Source voltage (in volts)
RC = 10.0 #Collector resistance (in kilo-ohm)
alpha = 0.98 #Common base current gain
VBE = 0.7 #Emitter-to-Base Voltage (in volts)
Vs = 10.0 * 10**-3 #a.c voltage (in volts)
RL = 5.1 #Load resistance (in kilo-ohm)
RE = 20.0 #Resistance (in kilo-ohm)
VEE = 10.0 #Voltage (in volts)
#Calculation
IE = (VEE - VBE) / RE #Emitter current (in milli-Ampere)
r1e = 25.0 / IE * 10**-3 #a.c. emitter resistance (in kilo-ohm)
Ri = r1e #input resistance looking directly in the emitter (in kilo-ohm)
Ris = RE * r1e / (RE + r1e) #Input resistance of the stage (in kilo-ohm)
Ai = alpha #Current gain
rL = RC * RL / (RC + RL) #a.c. load resistance (in kilo-ohm)
Av = rL / r1e #Voltage gain
Ap = Av * Ai #Power gain
Gp = 10 * math.log10(Ap) #Power gain (in decibels)
vin = Vs #input voltage (in volts)
Vo = Av * vin #Output voltage (in volts)
#Result
print "The input resistance looking directly into the emitter is ",round(Ri * 10**3,1)," ohm.\nThe input resistance of the stage is ",round(Ris * 10**3,2)," ohm.\nThe current gain is ",Ai," .\nThe voltage gain is ",round(Av,1)," .\nThe power gain is ",round(Ap,2)," .\nThe power gain in decibels is ",round(Gp,1)," dB.\nThe output voltage is ",round(Vo * 10**3)," mV."
```

In [12]:

```
import math
#Variables
Rs = 50.0 #source resistance (in ohm)
IE = 0.465 #Emitter current (in milli-Ampere)
r1e = 53.8 #a.c. resistance (in ohm)
Ri = 53.8 #Input resistance (in ohm)
Ris = 52.4 #Input resistance of stage (in ohm)
RL = 3.38 * 10**3 #Load resistance (in ohm)
Vs = 10.0 * 10**-3 #Input a.c. voltage (in volts)
#Calculation
Avs = RL / (Rs + r1e) #Overall voltage gain
Av = RL / r1e #Voltage gain
vo = Avs * Vs #Output a.c. voltage (in volts)
vin = vo / Av #input voltage (in volts)
#Result
print "Voltage gain from source to output is ",round(Avs,1)," .\nVoltage gain from emitter to output is ",round(Av,1)," .\nValue of Vin is ",round(vin * 10**3,1)," V."
```

In [13]:

```
import math
#Variables
VEE = 10.0 #Voltage (in volts)
RE = 10.0 * 10**3 #Emitter resistance (in ohm)
RB = 100.0 * 10**3 #Base resistance (in ohm)
beta = 50.0 #Common emitter current gain
VBE = 0.7 #Emitter-to-Base Voltage (in volts)
#Calculation
IE = (VEE - VBE)/(RE + RB/beta) #Emitter current (in Ampere)
r1e = 25.0 / IE * 10**-3 #a.c. resistance (in ohm)
Ri = beta * (RE + r1e) #Input resistance directly looking into the base (in ohm)
Ris = RB * Ri / (RB + Ri) #Input resistance of the stage (in ohm)
Ro = r1e #Output resistance (in ohm)
Av = RE / (r1e + RE) #Voltage gain
#Result
print "Input resistance looking directly into the base is ",round(Ri * 10**-3,1)," ohm.\nInput resistance of the stage is ",round(Ris * 10**-3 ,1)," ohm.\nOutput resistance is ",round(Ro,1)," ohm.\nVoltage gain is ",round(Av,3)," ."
```

In [14]:

```
import math
#Variables
beta = 80.0 #Common emitter current gain
VBE = 0.7 #Emitter-to-Base Voltage (in volts)
VCC = 15.0 #Voltage (in volts)
R1 = 20.0 * 10**3 #Resistance (in ohm)
R2 = 20.0 * 10**3 #Resistance (in ohm)
Vs = 5.0 * 10**-3 #a.c voltage (in volts)
RE = 8.2 * 10**3 #Emitter resistance (in ohm)
RL = 1.5 * 10**3 #Load resistance (in ohm)
RS = 2.0 * 10**3 #Source resistance (in ohm)
#Calculation
Vth = VCC * R2 / (R1 + R2) #Thevenin's voltage (in volts)
Rth = R1 * R2 / (R1 + R2) #Thevenin's equivalent resistance (in ohm)
IE = (Vth - VBE)/(RE + Rth / beta) #Emitter resistance (in ohm)
r1e = 25.0 / IE * 10**-3 #a.c resistance of emitter diode (in ohm)
rL = RE * RL /(RE + RL) #a.c. load resistance (in ohm)
Ri = beta * (rL + r1e) #Input resistance looking directly into the base (in ohm)
Ris = Rth * Ri / (Rth + Ri) #Input resistance of the stage (in ohm)
Ro = r1e + (RS*Rth)/(Rth + RS)/beta #Output resistance of the stage (in ohm)
Vin = Vs * (Ris / (RS + Ris)) #Input voltage (in volts)
Vo = Vin #Output voltage (in volts)
#Result
print "Value of input resistance looking directly into the base is ",round(Ri * 10**-3)," kilo-ohm.\nValue of input resistance of the stage is ",round(Ris * 10**-3,1)," kilo-ohm.\nOutput resistance is ",round(Ro,1)," ohm.\nA.C. output voltage is ",round(Vo * 10**3,1)," mV."
```