# given data
R1= 20## kΩ
R2= 10## kΩ
R_E= 10## kΩ
R_D= 8.2## kΩ
V_G= 10## V
V_BE= 0.7## V
V_GS= -2## V
V_DD= 30## V
V_B= R2*V_DD/(R1+R2)## V
I_E= (V_B-V_BE)/R_E## mA
I_D= I_E## mA
# The dc voltage from the drain to ground
V_D= V_DD-I_D*R_D## V
# The source voltage to ground
Vs= V_G-V_GS## V
print "The dc voltage from the drain to ground = %.2f volts"%V_D
print "The source voltage to ground = %.2f volts"%Vs
# given data
gmo= 3000## µmhoS
V_GSoff= -4## V
I_DSS= 10## mA
print "Part (i) When V_GS= -1"
V_GS= -1## V
# The value of gm
gm= gmo*(1-V_GS/V_GSoff)## µS
print "The value of gm = %.2f µS"%gm
print "Part (ii) When I_D= 2.5 mA"
I_D= 2.5## mA
# The value of gm
gm= gmo*2*I_D/I_DSS## µS
print "The value of gm = %.2f µS"%gm
# given data
gm= 2000## µS
gm=gm*10**-6## S
R_D= 4.7## kΩ
Vin= 2## mV
R_L= 10## kΩ
r_D= R_D*R_L/(R_D+R_L)## kΩ
r_D= r_D*10**3## Ω
A= gm*r_D## unit less
# The output voltage
Vout= A*Vin## mV
print "The output voltage = %.2f mV"%Vout
# Note: The calculated value of A = %.2f the book is wrong. Correct value of A6.39, So the answer in the book is wrong.
# given data
R_D= 7.5## kΩ
R_L= 3## kΩ
r_s= R_D*R_L/(R_D+R_L)## kΩ
r_s= r_s*10**3## Ω
gm= 2500*10**-6## S
# The voltage gain
A= gm*r_s/(1+gm*r_s)## unit less
print "The voltage gain = %.2f"%A