from __future__ import division
from numpy import pi
# Given data
R1 = 600 # in ohm
R2 = 1000 # in ohm
R_TH = (R1*R2)/(R1+R2) # in ohm
X_C = 37.5 # in ohm
f = 1 # in kHz
f= f*10**3 # in Hz
C = 1/(2*pi * f*X_C) # in F
print "Value of C = %0.1f µF" %(C*10**6)
# Given data
R_C= 3.6*10**3 # in ohm
R_L= 10*10**3 # in ohm
r_c = (R_C*R_L)/(R_C+R_L) # in ohm
V_CC = 10 # in V
V_BE = 0.7 # in V
R_E = 1 # in kohm
R_E = R_E * 10**3 # in ohm
R1 = 10 # in kohm
R1= R1*10**3 # in ohm
R2 = 2.2 # in kohm
R2= R2*10**3 # in ohm
V_B = (V_CC*R2)/(R1+R2) # in V
I_E = (V_B-V_BE)/R_E # in A
V = 25*10**-3 # in V # only value is given in the book
r_e = V/I_E # in ohm
A_V = round(r_c/r_e)
print "The voltage gain = %0.f" %A_V
V_in = 2 #in mV
V_out = A_V*V_in # in mV
print "The output voltage = %0.f mV" %V_out
# Given data
A_V = 117
r_e = 22.7 # in ohm
bita = 300
Zin_base = bita*r_e # in ohm
R1 = 2.2*10**3 # in ohm
R2 = 10*10**3 # in ohm
Zin_stage = (Zin_base*R1*R2)/(Zin_base*R1+R1*R2+R2*Zin_base) # in ohm
R = 600 # in ohm
V = 2 # in mV
V_in = (Zin_stage/(R+Zin_stage))*V # in mV
V_out = A_V * V_in # in mV
print "The output voltage = %0.f mV" %round(V_out)
# Given data
R1 = 4.3 # in K ohm
R1= R1*10**3 # in ohm
R2 = 10 # in K ohm
R2= R2*10**3 # in ohm
r_e = (R1*R2)/(R1+R2) # in ohm
bita = 200
V=25 # in mV
I= 1 # in mA
r_e_desh= V/I # in ohm
Zin_base = bita*(r_e + r_e_desh) # in ohm
print "The input impedence of the base = %0.f kΩ" %(Zin_base*10**-3)
R3 = 10*10**3 # in ohm
Zin_stage = (R2*R3*Zin_base)/(R2*Zin_base+R3*Zin_base+R2*R3) # in ohm
print "The input impedance of the stage = %0.2f kΩ" %(Zin_stage*10**-3)
print "Because the input impedence of base is much larger than the input impedence of the stage,"
print "usually approximate the input impedence of the stage as the parallel of the biasing resistor only %0.f kΩ" %(Zin_stage*10**-3)
Zin_stage= R2*R3/(R2+R3) # in ohm
# Given data
V_CE = 0.2 # in V
V_BE= 0.7 # in V
R = 1 # in kohm
R = R * 10**3 # in ohm
V = 10 # in V
I_C = (V-V_CE)/R # in A
beta_min = 50
I_B = I_C/beta_min # in A
I_B1 = V*I_B # in A
V1 = 5 # in V
R_B = (V1-V_BE)/I_B1 # in ohm
print "The base resistance = %0.1f kΩ" %(R_B*10**-3)
# Given data
R = 10 # in K ohm
R = R * 10**3 # in ohm
X_C = 0.1 * R
C = 47 # in µF
C = C * 10**-6 # in F
f = 1/(2*pi * X_C *C) # in Hz
print "Lowest frequency = %0.2f Hz" %f
# Given data
C = 220 # in µF
C = C * 10**-6 # in F
R1 = 10 # in kohm
R1 = R1 * 10**3 # in ohm
R2 = 2.2 # in kohm
R2 = R2 * 10**3 # in ohm
R_TH = (R1*R2)/(R1+R2) # in ohm
X_C = 0.1*R_TH # in ohm
f = 1/(2*pi*C*X_C) # in Hz
print "The lowest frequency = %0.2f Hz" %f
# Given data
i_c = 15 # in mA
i_c = i_c * 10**-3 # in A
i_b = 100 # in µA
i_b = i_b * 10**-6 # in A
bita = i_c/i_b
print "The value of ac bita = %0.f" %bita
# Given data
R_C = 3.6 # in kohm
R_C= R_C*10**3 # in ohm
R_L = 10 # in kohm
R_L=R_L*10**3 # in ohm
R_TH = (R_C*R_L)/(R_C+R_L) # in ohm
V_CC = 10 # in V
R2 = 2.2 # in kohm
R2 = R2 * 10**3 # in ohm
R1 = 10 # in kohm
R1 = R1 * 10**3 # in ohm
V_BE = 0.7 # in V
V_B = (V_CC*R2)/(R1+R2) # in V
R_E = 1 # in kohm
R_E = R_E *10**3 # in ohm
I_E = (V_B-V_BE)/R_E # in A
V1 = 25 # in mV
V1 = V1*10**-3 # in V
r_e = V1/(I_E) # in ohm
A_v = (R_TH)/r_e
V_in = 2 # in mV
V_in = V_in * 10**-3 # in V
V_out = A_v*V_in # in V
print "The output voltage = %0.2f V" %V_out
# Given data
R_L = 10 # in kohm
R_L= R_L*10**3 # in ohm
R_C = 3.6 # in kohm
R_C= R_C*10**3 # in ohm
r_e_desh = 22.73 # in ohm
R_L_desh = R_L/2 # in ohm
A_v = ( (R_C*R_L_desh)/(R_C+R_L_desh))/r_e_desh
print "The voltage gain = %0.2f" %A_v
# Given data
R_E = 1 # in kohm
R_E = R_E * 10**3 # in ohm
R_L = 3.3 # in kohm
R_L = R_L * 10**3 # in ohm
r_e = (R_E*R_L)/(R_E+R_L) # in ohm
V_CC = 15 # in V
R2 = 2.2 # in K ohm
R2 = R2 * 10**3 # in ohm
R1 = R2 # in ohm
V_B = (V_CC*R2)/(R1+R2) # in V
V_BE = 0.7 # in V
R_E = 1 # in K ohm
R_E = R_E * 10**3 # in ohm
I_E = (V_B-V_BE)/R_E # in A
V1 = 25*10**-3 # in V
r_e1 = V1/I_E
bita = 200
Zin_base = bita*(r_e+r_e1) # in ohm
print "The input impedence of the base = %0.2f kΩ" %(Zin_base*10**-3)
Zin_stage = (R1*R2*Zin_base)/(R1*R2+R2*Zin_base+R1*Zin_base) # in ohm
print "The input impedance of the stage = %0.2f kΩ" %(Zin_stage*10**-3)
# Given data
r_e = 767.44
r_e1 = 3.68
V_in = 1 # in V
A_v = round(r_e/(r_e+r_e1))
print "The voltage gain = %0.f" %A_v
V_o = A_v*V_in # in V
print "The load voltage = %0.f V" %V_o