In [1]:

```
import math
#Variables
R1 = 6.0 #Resistance (in ohm)
R2 = 4.0 #Resistance (in ohm)
R3 = 4.0 #Resistance (in ohm)
#Calculation
#Let i1 = 10 A and v2 = 10 V.
i1 = 10.0 #Assumed current (in Ampere)
v2 = 10.0 #Assumed voltage (in volts)
#Parameters h11 and h21
h11 = R1 + R2 * R3/(R2 + R3) #Input resistance looking from the input terminals (in ohm)
i2 = -i1 / 2 #Current2 (in Ampere)
h21 = i2/i1 #h21
#Parameters h12 and h22
v1 = v2/2 #Voltage1 (in volts)
h12 = v1 / v2 #h12
rnet = R2 + R3 #Output resistance (in ohm)
h22 = 1/rnet #h22 (in mhos)
#Result
print "h11 : ",h11,"\nh21 : ",h21,"\nh12 : ",h12,"\nh22 : ",h22
```

In [2]:

```
import math
#Variables
hie = 1.0 * 10**3 #hie (in ohm)
hre = 1.0 * 10**-4 #hre
hoe = 100.0 * 10**-6 #hoe (in mho)
RC = 1.0 * 10**3 #Collector resistance (in ohm)
RS = 1000.0 #Source resistance (in ohm)
hfe = beta = 50.0 #Common emitter current gain
#Calculation
rL = RC #a.c. load resistance (in ohm)
Ai = -hfe /(1 + hoe * rL) #Current gain of a transistor
Ri = hie + hre * Ai * rL #Input resistance looking directly into the base (in ohm)
Ris = Ri #Iput resistance of the amplified stage (in ohm)
dh = hie * hoe - hre * hfe #Change in h
Ro = (RS + hie)/(RS * hoe + dh) #Output resistance looking directly into collector (in ohm)
Ros = Ro * rL /(Ro + rL) #Output resistance of the amplified stage (in ohm)
Ais = Ai * RS / (RS + Ris) #Current gain of amplified stage
Av = Ai * rL / Ri #Voltage gain of transistor
Avs = Av * Ris / (RS + Ris) #Voltage gain of amplified stage
#Result
print "Input resistance of the amplifier stage is ",round(Ris)," ohm.\nOutput resistance of amplifier stage is ",round(Ros)," ohm.\nCurrent gain of amplified stage is ",round(Ais,1),"\nVoltage gain of amplifier stage is ",round(Avs,1),"."
```

In [3]:

```
import math
#Variables
hie = 1.1 * 10**3 #hie (in ohm)
hre = 2.5 * 10**-4 #hre
hoe = 25.0 * 10**-6 #hoe (in mho)
RS = 1000.0 #Source resistance (in ohm)
hfe = beta = 50.0 #Common emitter current gain
rL = 1000.0 #ac.c load resistance (in ohm)
#Calculation
Ai = hfe /(1 + hoe * rL) #Current gain of a transistor
Ri = hie + hre * Ai * rL #Input impedance (in ohm)
Av = Ai * rL / Ri #Voltage gain
#Result
print "Current gain is ",round(Ai,2),"\nInput impedance is ",round(Ri,1),"\nVoltage gain is ",round(Av,2)
```

In [4]:

```
import math
#Variables
RC = 4.0 * 10**3 #Collector resistance (in ohm)
RB = 40.0 * 10**3 #Base resistance (in ohm)
RS = 10.0 * 10**3 #Source resistance (in ohm)
hie = 1100.0 #hie (in ohm)
hfe = 50.0 #hfe
hre = hoe = dh = 0 #hre and hoe
#Calculation
RB2 = RB #Resistance (in kilo-ohm)
rL = RC * RB2 /(RC +RB2) #a.c. load resistance (in ohm)
Ai = -hfe #Current gain
Ri = hie #Input resistance of the amplifier looking into the base (in ohm)
Av = Ai * rL / Ri #Voltage gain
RB1 = RB/(1 - Av) #Resistance (in ohm)
Ris = Ri * RB1 / (Ri + RB1) #Input resistance looking from source terminals (in ohm)
Ro = "infinite" #Output resistance (in ohm)
Ros = rL #Output resistance of the stage (in ohm)
Avs = Av * Ris / (RS + Ris) #Voltage gain of the stage
#Result
print "Voltage gain is ",round(Avs,1),".\nInput resistance is ",round(Ris)," ohm.\nOutput resistance is ",round(Ros)," ohm."
#Slight variation due to higher precision.
```

In [1]:

```
import math
#Variables
hie = 1.1 * 10**3 #hie (in ohm)
hre = 2.5 * 10**-4 #hre
hoe = 25.0 * 10**-6 #hoe (in mho)
RS = 10000.0 #Source resistance (in ohm)
hfe = beta = 50.0 #Common emitter current gain
rL = 1000.0 #ac.c load resistance (in ohm)
RB = 200.0 * 10**3 #Feedback resistor (in ohm)
RC = 5.0 * 10**3 #Collector resistance (in ohm)
#Calculation
rL = RC * RB / (RC + RB) #a.c. load resistance (in ohm)
Ai = hfe /(1 + hoe * rL) #Current gain
Ri = hie + hre * Ai * rL #Input resistance of the amplifier looking into the base (in ohm)
Av = Ai * rL / Ri #Voltage gain
RB1 = RB/(1 - (-17.4)) #Resistance (in ohm)
Ris = Ri * RB1 / (Ri + RB1) #Input resistance looking from source terminals (in ohm)
Avs = Av * Ris / (RS + Ris) #Voltage gain of the stage
#Result
print "Ai is ",round(Ai,2),"\nAv is ",round(Av,2),"\nAvs is ",round(Avs,1),"\nRi is ",round(Ri*10**-3,3)," kilo-ohm."
```

In [6]:

```
import math
#Variables
hib = 28.0 #hib (in ohm)
hfb = -0.98 #hfb
hrb = 5.0 * 10**-4 #hrb
hob = 0.34 * 10**-6 #hoh (in Siemen)
rL = 1.2 * 10**3 #a.c. load resistance (in ohm)
RS = 0.0 #Source resistance (in ohm)
#Calculation
Ai = -(hfb/(1 + hob * rL)) #Current gain
Ri = hib + hrb * Ai * rL #Input resistance (in ohm)
dh = hib * hob - hrb * hfb #change in h
Ro = (RS + hib)/(RS*hib + dh)#Output resistance (in ohm)
Av = Ai * rL / Ri #Voltage gain
#Result
print "The value of input resistance is ",round(Ri,1)," ohm.\nThe value of output resistance is ",round(Ro * 10**-3)," kilo-ohm.\nThe value of current gain is ",round(Ai,2)," .\nThe value of voltage gain is ",round(Av)," ."
```

In [7]:

```
import math
#Variables
hic = 2.0 * 10**3 #hic (in ohm)
hfc = -51.0 #hfe
hrc = 1.0 #hrc
hoc = 25.0 * 10**-6 #hoc (in mho)
rL = RE = 5.0 * 10**3 #a.c. load resistance (in ohm)
RS = 1.0 * 10**3 #Source resistance (in ohm)
R1 = R2 = 10.0 * 10**3 #Resistance (in ohm)
#Calculation
Ai = -hfc / (1 + hoc * rL) #Current gain
Ri = hic + hrc * Ai * rL #Input resistance (in ohm)
Ris = (R1*R2*Ri)/(Ri*R1 + Ri*R2 + R1*R2) #Input resistance of the amplified stage (in ohm)
Ro = -(RS + hic)/hfc #Output resistance (in ohm)
Ros = Ro * RE / (Ro + RE) #Input resistance of the amplified stage (in ohm)
Ais = Ai * RS / (RS + Ris) #Current gain of amplified stage
Av = Ai * rL / Ri #Voltage gain
Avs = Av * Ris / (RS + Ris) #Voltage gain of amplified stage
#Result
print "The value of input resistance of amplified stage is ",round(Ris)," ohm.\nThe value of output resistance of amplified stage is ",round(abs(Ros),1)," kilo-ohm.\nThe value of current gain of amplified stage is ",round(Ais,1)," .\nThe value of voltage gain of amplified stage is ",round(Avs,3)," ."
#Slight variation due to higher precision.
```

In [8]:

```
import math
#Variables
hie = 1500.0 #hie (in ohm)
hfe = 50.0 #hfe
hre = 50.0 * 10**-4 #hre
hoe = 20.0 * 10**-6 #hoe
R1 = 20.0 * 10**3 #Resistance (in ohm)
R2 = 10.0 * 10**3 #Resistance (in ohm)
RC = 5.0 * 10**3 #Collector resistance (in ohm)
RE = 1.0 * 10**3 #Emitter resistance (in ohm)
RL = 10.0 * 10**3 #Load resistance (in ohm)
RS = 0 #Source resistance (in ohm)
#Calculation
Ai = -hfe
rL = RC * RL /(RC + RL) #a.c. load resistance (in ohm)
Ri = hie #Input resistance (in ohm)
Ris = (R1*R2*Ri)/(Ri*R1 + Ri*R2 + R1*R2) #Input resistance of the amplified stage (in ohm)
Ro = 1 / hoe #Output resistance (in ohm)
Ros = Ro * rL /(Ro + rL) #Output resistance of the stage (in ohm)
Av = Ai * rL / Ri #Voltage gain
Avs = Av * Ris / (RS + Ris) #Voltage gain of the stage
Ais = Ai #Current gain of the stage
#Result
print "Input resistance of the stage is ",round(Ris * 10**-3,2)," kilo-ohm.\nOutput resistance of the stage is ",round(Ros * 10**-3,1)," kilo-ohm.\nVoltage gain of the stage is ",round(Avs)," .\nCurrent gain of the stage is ",Ai," ."
#Slight variation due to higher precision.
```

In [9]:

```
import math
#Variables
RC = 12.0 * 10**3 #Collector resistance (in ohm)
RL = 4.7 * 10**3 #Load resistance (in ohm)
R1 = 33.0 * 10**3 #Resistance (in ohm)
R2 = 4.7 * 10**3 #Resistance (in ohm)
IC = 1.0 * 10**-3 #Collector current (in Ampere)
hiemin = 1.0 * 10**3 #hie minimum (in ohm)
hiemax = 5.0 * 10**3 #hie maximum (in ohm)
hfemin = 70.0 #Current gain minimum
hfemax = 350.0 #Current gain maximum
#Calculation
hie = (hiemin * hiemax)**0.5 #hie (in ohm)
hfe = (hfemin * hfemax)**0.5 #current gain
Ri = hie #input resistance (in ohm)
Ris = (R1*R2*Ri)/(Ri*R1+Ri*R2+R1*R2) #Input resistance of the amplified stage (in ohm)
Ai = hfe #Current gain of transistor
rL = RC * RL / (RC + RL) #a.c. load resistance (in ohm)
Avs = Av = Ai*rL / Ri #overall voltage gain
#Result
print "Input impedance is ",round(Ris * 10**-3,2)," kilo-ohm.\nOverall voltage gain is ",round(Avs,1),"."
#Calculation error in book for hfe.
```

In [10]:

```
import math
#Variables
RB = 330.0 * 10**3 #Base resistance (in ohm)
RC = 2.7 * 10**3 #Collector resistance (in ohm)
hfe = 120.0 #current gain
hie = 1.175 * 10**3 #hie (in ohm)
hoe = 20 * 10**-6 #hoe (in Ampere per volt)
#Calculation
Ri = hie #Input resistance of transistor (in ohm)
Ris = hie * RB /(hie + RB) #Input resistance of the circuit (in ohm)
Ro = 1 / hoe #Output resistance of transistor (in ohm)
Ros = Ro * RC / (Ro + RC) #Output resistance of the circuit (in ohm)
Ai = hfe #Current gain of the circuit
Avs = Ai * RC / Ri #Overall voltage gain
#Result
print "Input resistance of the circuit is ",round(Ris * 10**-3,2)," kilo-ohm.\nOutput resistance of the circuit is ",round(Ros * 10**-3,2)," kilo-ohm.\nCurrent gain of the circuit is ",Ai,".\nVoltage gain of the circuit is ",round(Avs,1),"."
```

In [11]:

```
import math
#Variables
hfe = 50.0 #Current gain
#Calculation
hfb = -hfe / (1 + hfe) #hfb
hfc = -(1 + hfe) #hfc
#Result
print "Value of hfb = ",round(hfb,2),".\nValue of hfc = ",hfc,"."
```

In [12]:

```
import math
#Variables
hie = 1100.0 #hie (in ohm)
hre = 2.5 * 10**-4 #hre
hfe = 50.0 #Current gain
hoe = 24.0 * 10**-6 #hoe (in Ampere per volt)
rL = RL = 10.0 * 10**3 #Load resistance (in ohm)
RS = 1.0 * 10**3 #Source resistance (in ohm)
#Calculation
hic = hie #hic (in ohm)
hrc = (1 - hre) #hrc
hfc = -(1 + hfe) #hfc
Ai = -(hfc/(1 + hoe * rL)) #Current gain
Ri = hic + hrc * Ai * rL #Input resistance (in ohm)
Av = Ai * rL / Ri #Voltage gain
#Result
print "Current gain is ",round(Ai,1),".\nInput resistance is ",round(Ri * 10**-3,1)," kilo-ohm.\nVoltage gain is ",round(Av,3),"."
#Slight variation due to higher precision.
```