from math import pi,sqrt
from __future__ import division
# Given data
R_C = 10# k ohm
R_C = R_C * 10**3# ohm
f = 2# kHz
f = f * 10**3# Hz
R = 8# k ohm
R = R * 10**3# ohm
#Formula, f = 1/(2*pi*R*C*sqrt(6+((4*R_C)/R)))
C = 1/(2*pi*R*f*sqrt(6+((4*R_C)/R)))# F
C= C*10**6# µF
print "The value of capacitor = %.4f µF"%C
h_fe= 23+29*R/R_C+4*R_C/R
print "The value of h_fe is : %.2f"%h_fe
from math import pi,sqrt
from __future__ import division
# Given data
f = 10# kHz
f = f * 10**3# Hz
R = 100# k ohm
R = R * 10**3# ohm
#Formula used, f = 1/(2*pi*R*C)
C = 1/(2*pi*R*f)# F
C = round(C * 10**12)# pF
print "The value of capacitor = %.2f pF"%C
from math import pi,sqrt
from __future__ import division
# Given data
C = 0.06# pF
C = C * 10**-12# F
L = 0.5# H
R = 10# k ohm
R = R * 10**3# ohm
Cm = 1# pF
Cm = Cm * 10**-12# F
# The parallel resonant frequency
f_p = (1/(2*pi))*( sqrt( (C+Cm)/(L*C*Cm) ) )# Hz
f_p= f_p*10**-3# kHz
print "The parallel resonant frequency = %.2f kHz"%f_p
# The series resonant frequency
f_s = 1/(2*pi*(sqrt(L*C)))# Hz
f_s= f_s*10**-3# kHz
print "The series resonant frequency = %.2f kHz"%f_s
omega_s = 2*pi*f_s*10**3# rad/sec
# The Q factor of the crystal
Q = (omega_s*L)/R
print "The Q factor of the crystal = %.2f"%Q
from __future__ import division
# Given data
R1 = 6# ohm
R2 = 4# ohm
R3 = 4# ohm
h11 = R1+( (R2*R3)/(R2+R3) )# ohm
print "The value of h11 = %.2f ohm"%h11
# i2 = -i*1/2 and h21 = i2/i1 = (-i1/2)/2, So
h21 = -1/2
print "The value of h21 = %.2f"%h21
# V1 = V2/2 and h12 = V1/V2 = (V2/2)/2, SO
h12 = 1/2
print "The value of h12 = %.2f"%h12
Zo = R2+R3## output resistance = %.2f ohm
h22 = 1/Zo# mho
print "The value of h22 = %.2f mho"%h22
from __future__ import division
# Given data
R1 = 3# ohm
R2 = 6# ohm
R3 = 2# ohm
# V1 = (R1*I1)+ (R2*(I1+I2)) = ((R1+R2)*I1)+(R2*I2) (i)
# V2 = (R3*I2) + (R2*(I1+I2)) = (R2*I1) + ((R1+R3)*I2) (ii)
# Standard h-parameter equation
#V1= h11*I1 +h12*I2 and V2= h21*I1 + h22*I2
# Comparing eq (i) and (ii) with standard equaation, we get
h11= R1+R2
print "The value of h11 = %.2f"%h11
h12= R2
print "The value of h12 = %.2f"%h12
h21= R2
print "The value of h21 = %.2f"%h21
h22= R2+R3
print "The value of h22 = %.2f"%h22
from __future__ import division
# Given data
h_ic = 1.1# k ohm
h_ic = h_ic * 10**3# ohm
h_rc = 1
h_fc = -51
h_oc = 25# µA/V
h_oc = h_oc * 10**-6# A/V
R_L = 10# k ohm
R_L = R_L * 10**3# ohm
R_S = R_L# ohm
# The current gain,
Ai = -h_fc/(1+(h_oc*R_L))
print "The value of Ai = %.2f"%Ai
# The value of Ri
Ri = h_ic+(h_rc*Ai*R_L)# ohm
Ri= Ri*10**-3# k ohm
print "The value of Ri = %.2f k ohm"%Ri
Ri= Ri*10**3# ohm
# The value of A_V
A_V = (Ai*R_L)/Ri
print "The value of A_V = %.2f"%A_V
Gamma_o = h_oc - ( (h_fc*h_rc)/(h_ic+R_S) )# mho
# The value of Ro
Ro = round(1/Gamma_o)# ohm
print "The value of Ro = %.2f ohm"%Ro
A_VS = (A_V*Ri)/(Ri+R_S)
print "The value of A_VS = %.2f"%A_VS
from __future__ import division
# Given data
h_ie = 1.5# ohm
h_fe = 100
h_re = 3 * 10**-4
h_oe = 25 * 10**-6# mho
V_CC = 20# V
R1 = 50 * 10**3# ohm
R2 = 5 * 10**3# ohm
R_C = 5 * 10**3# ohm
R_L = 10 * 10**3# ohm
R_S = 1# k ohm
Ri= 1.4*10**3# ohm
R_B = (R1*R2)/(R1+R2)# ohm
R_Ldesh= R_L*R_C/(R_L+R_C)# ohm
# Current gain for transisor,
Ai= -h_fe/(1+h_oe*R_Ldesh)
# Overall current gain, A_I= Ai+Ib/I= Ai+R_B/(R_B+Ri)
A_I= Ai*R_B/(R_B+Ri)
print "The overall current gain is : %.2f"%A_I
#Part (ii)
R_i= R_B*Ri/(R_B*Ri)# k ohm
print "The value of Ri = %.2f k ohm"%R_i
# Part (iii)
Av= A_I*R_Ldesh/Ri## voltage gain for transistor
# overall voltage gain,
A_VS= Av*R_i/(R_S+R_i)
print "The value of A_VS is : %.2f"%A_VS
# Part (iv)
R_S=R_S*10**3# ohm
R_Sdesh= R_S*R_B/(R_S+R_B)# ohm
gamma_o= h_re*h_fe/(h_ie+R_Sdesh)-h_oe# mho
gamma_o= round(gamma_o*10**6)# µ mho
print "The value of gamma_o = %.2f µ mho"%gamma_o
# Note: In the book, all these calculated value is not accurate.
from __future__ import division
# Given data
R_S = 800# ohm
R_L = 2# k ohm
R_L = R_L * 10**3# ohm
h_ie = 1.1# k ohm
h_ie = h_ie * 10**3# ohm
h_fe = 50
h_oe = 25# µohm
h_oe = h_oe * 10**-6# ohm
h_re = 2.5*10**-4
# Part (a) : Exact analysis
print "Part (a) : Exact analysis"
# The current gain
Ai_exact = -h_fe/(1+(h_oe*R_L))
print "The current gain = %.2f"%Ai_exact
# The input resistance
Ri = h_ie + (h_re*Ai_exact*R_L)# ohm
Ri= Ri*10**-3# k ohm
print "The input resistance = %.2f k ohm"%Ri
Ri= Ri*10**3# ohm
A_V = (Ai_exact*R_L)/Ri
# The voltage gain,
A_VS = (A_V*Ri)/(Ri+R_S)
print "The voltage gain = %.2f"%A_VS
Gamma_o = h_oe - ( (h_re*h_fe)/(h_ie+R_S) )# mho
# The output resistance
Ro = 1/Gamma_o# ohm
Ro= Ro*10**-3## k ohm
print "The output resistance = %.2f k ohm"%Ro
Ro= Ro*10**3## ohm
# The power gain,
Ap = Ai_exact*A_V
print "The power gain = %.2f"%Ap
# The output terminal resistance
Rot = (Ro*R_L)/(Ro+R_L)# ohm
Rot= Rot*10**-3# k ohm
print "The output terminal resistance = %.2f k ohm"%Rot
Rot= Rot*10**3# ohm
# Part (b) : Approximate analysis
print "Part (b) : Approximate analysis"
h_re =0
h_oe = 0
Ai_app = -h_fe/(1+(h_oe*R_L))
print "The value of Ai = %.2f"%Ai_app
Ri = h_ie+(h_re*Ai_app*R_L)
print "The value of Ri = %.2f ohm"%Ri
A_V= Ai_app*R_L/Ri
A_VS = (-A_V*h_ie)/(R_S+h_ie)
print "The value of A_VS = %.2f"%A_VS
Gamma_o = 18.42# = %.2f µohms
Gamma_o = Gamma_o * 10**-6# mho
# # The output resistance
Ro = 1/Gamma_o# ohm
Ro= Ro*10**-3## k ohm
print "The output resistance = %.2f k ohm"%Ro
Ro= Ro*10**3## ohm
Ap = Ai_app*A_V
print "The value of Ap = %.2f"%Ap
#The output terminal resistance, Rot = (Ro*R_L)/(Ro+R_L)= 20# k ohm
Rot= 20# k ohm
print "The output terminal resistance = %.2f k ohm"%Rot
Rot= Rot*10**3# ohm
# Percentage error
Per_error= abs((Ai_exact-Ai_app)/Ai_exact*100)# %
print "The percentage error = %.2f %%"%Per_error
from __future__ import division
# Given data
R_S = 600# ohm
r_i = 400# ohm
Vs = 1# mV
Vs = Vs * 10**-3# V
#Input voltage
Vi = Vs*(r_i/(R_S+r_i))# V
# Input current
Ii =Vs/(R_S+r_i)# A
Vo = 100# mV
Vo = Vo * 10**-3# V
R_L = 5# k ohm
R_L = R_L * 10**3# ohm
# Output current
Io = Vo/R_L# A
# voltage gain
A_V =Vo/Vi #
print "The voltage gain",A_V
# current gain
A_I = Io/Ii
print "The current gain",A_I
# Power gain
P =A_V*A_I
print "The power gain",P
from __future__ import division
# Given data
A = 125
Beta = 1/10
# Gain of negative feedback
Af = A/(1+(A*Beta))
print "The gain of negative feedback : %.3f"%Af
from __future__ import division
# Given data
Af = 100
Vi = 0.6# V
Vo =Af*Vi# V
Vi = 50# mV
Vi = Vi * 10**-3# V
# Internal gain of amplifier,
A = Vo/Vi
print "The value of A is : %.2f"%A
B= ((A/Af)-1)/A
print "The value of B : %.2f"%B
from __future__ import division
# Given data
A = 60# dB
A =10**(A/20)
Beta = 0.005
dAbyA = -12/100##gain reduction = %.2f %
dAf_byAf = (1/(1+(A*Beta)))*dAbyA## change = %.2f overall gain
dAf_byAf = dAf_byAf * 100# %
print "The change in overall gain = %.2f %%"%dAf_byAf
print "Thus, the overall gain will be reduced by 2%"
from __future__ import division
# Given data
Zo = 12.6# k ohm
Zo = Zo * 10**3# ohm
A = 60# dB
A = 10**(A/20)
Zof = 500# ohm
# Zof = Zo/(1+(A*Beta))
Beta = ((Zo/Zof)-1)/A
print "The value of feed back factor = %.2f"%Beta
# Part (ii)
dAbyA= 20/100## change = %.2f gain of basic amplifier
dAf_byAf =dAbyA*1/(1+A*Beta)*100##change = %.2f overall gain = %.2f %
print "The change in overall gain for 20 %% change in gain of the basic amplifier = %.2f %%"%dAf_byAf
# Note: In the book, there is calculation error to find the value of dAf/Af
from __future__ import division
# Given data
Vo = 36# V
Vi = 0.028# V
A = Vo/Vi
Vf = 1.2
Vo = 100
Beta = Vf/Vo
# Gain with feedback
Af = A/(1+(A*Beta))
Vs = Vi# V
# Output voltage
Vo =Af*Vs# V
print "The output voltage = %.2f V"%Vo
#Df =D/(1+(A*Beta))
DbyDf = 7/1
ABeta = (DbyDf)-1
Af =A/(1+(ABeta))
Vo = 36# V
# The input voltage,
Vs =Vo/Af
print "The input voltage = %.2f"%Vs
from __future__ import division
# Given data
dAf_byAf = 10/100
dAbyA = 10
A = 1000
# dAf_byAf = dAbyA*(1/(1+(A*Beta)))
# The required feed back
Beta = ((dAbyA/dAf_byAf)-1)/A
print "The required feed back = %.2f"%Beta
Af = A/(1+(A*Beta))## closed loop voltage gain
print "The closed loop voltage gain = %.2f"%Af
from __future__ import division
# Given data
Vi= 10*10**-3## input voltage = %.2f V
A=1000## open loop voltage gain
Do= 10##second harmonic distortion = %.2f %
feedback= 40##feedback = %.2f dB
feedback= 10**(feedback/20)
# feedback= 1+A*bita or
bita= (feedback-1)/A
Af= A/(1+A*bita)
# New value of second harmonic distortion,
Df= Do/(1+A*bita)# %
print "The new value of second harmonic distortion = %.2f %%"%Df
# New value of input required,
Vs= Vi*(1+A*bita)# V
print "The new value of input required = %.2f volts"%Vs
from __future__ import division
# Given data
D = 10/100
Df = 1/100
A = 200
Vs = 10# mV
Vs = Vs * 10**-3# V
# Df = D/(1+A*Beta)
Beta = (((D/Df)-1)/A)
# gain with feedback
Af = A/(1+(A*Beta))
print "The gain with feedback is : %.2f"%Af
# The output voltage
Vo = Af*Vs# V
print "The output voltage = %.2f V "%Vo
# The input voltage
Vin = Df+(-Beta*Vo)# V
print "The input voltage = %.4f V"%Vin
from __future__ import division
# Given data
A = 10000
Beta = 0.02
Zi = 1# k ohm
Zi = Zi * 10**3# ohm
Zo = 10# k ohm
Zo = Zo * 10**3# ohm
# The input impedance
Zif = Zi*(1+(A*Beta))# ohm
Zif= Zif*10**-3# k ohm
print "The input impedance = %.2f k ohm"%Zif
# The output impedance
Zof = Zo/(1+(A*Beta))# ohm
Zof= Zof*10**-3# k ohm
print "The output impedance = %.2f k ohm"%Zof
# Note:In the book, there is calculation error to find the value of Zof because 10/201 will be 0.04975 not 0.4975
from __future__ import division
# Given data
A = 400
Beta = 0.01
# The gain with feedback
Af =A/(1+(A*Beta))
print "The gain with feedback = %.2f"%Af
f_L = 200# Hz
# The Lower cut-off frequency with feedback
f_LF = f_L/(1+(A*Beta))# Hz
print "The Lower cut-off frequency with feedback = %.2f Hz"%f_LF
f_H = 40# kHz
f_H = f_H * 10**3# Hz
# The Upper cut-off frequency with feedback
f_HF = f_H*(1+(A*Beta))# Hz
f_HF=f_HF*10**-3# k Hz
print "The Upper cut-off frequency with feedback = %.2f kHz"%f_HF
# Note:In the book, there is calculation error to find the value of gain with feedback i.e. Af, so the answer = %.2f the book is wrong.
from __future__ import division
# Given data
A = 4000
R1 = 1# k ohm
R1 = R1 * 10**3# ohm
R2 = 9# k ohm
R2 = R2 * 10**3# ohm
Beta = R1/(R1+R2)## feedback fraction
print "The feedback fraction = %.2f"%Beta
# The overall voltage gain with feedback
Af = A/(1+(A*Beta))
print "The overall voltage gain with feedback = %.2f"%Af
Vs = 2# mV
#Af = Vo/Vs
# The output voltage
Vo = Af*Vs# mV
print "The output voltage = %.2f mV"%Vo
from math import log
from __future__ import division
# Given data
A = 54.8
A = 20 * log(A)
Beta = 1/50## feedback factor
# gain with feedback
Af = A/(1+(A*Beta))
#Distortion with feedback, Df = D/(1+(A*Beta))
Df = 1
D = 12
Pd = (Df/D)*100## percenatge change = %.2f distortion = %.2f %
print "The percentage reduction in harmonic distortion = %.2f %%"%Pd
from __future__ import division
# Given data
# Part(iii)
Vf_byVo= 1/3
bita= Vf_byVo
# A*bita>=1 or
# The minimum gain required for oscillation
Amin= 1/bita
print "The minimum gain required for oscillation is : %.2f"%Amin
from math import sqrt,tan,pi
from __future__ import division
# Magnitude of loop gain, Mag_Tf= bita*100/(sqrt(1+(f/10**5)**2))**3 (i)
# Phase of loop gain, P_Tf= -3*atand(f/10**5) (ii)
f_180= tan(pi/180*180/3)*10**5## from eq(ii), frequency at which phase becomes -180°
bita= 0.20
T_f_180= bita*100/(sqrt(1+(f_180/10**5)**2))**3## from eq (i), the magnitude of loop gain at f_180 for bita= 0.20
print "The magnitude of loop gain for beta = 0.20 is : %.2f"%T_f_180
bita= 0.02
T_f_180= bita*100/(sqrt(1+(f_180/10**5)**2))**3## from eq (i), the magnitude of loop gain at f_180 for bita= 0.20
print "The magnitude of loop gain for beta = 0.20 is : %.2f"%T_f_180
print "Hence system is unstable for beta=0.20 and stable for beta= 0.02 because at beta= 0.20 gain is greater than 1."
from math import sqrt,pi
from __future__ import division
# Given data
L = 0.01# H
C = 10# pF
C = C * 10**-12# F
# The frequency of oscillation
f = 1/(2*pi*sqrt(L*C))# Hz
f = f * 10**-3# kHz
print "The frequency of oscillation = %.2f kHz"%f
# Note:In the book, the calculation is wrong.
from math import sqrt,pi
from __future__ import division
# Given data
L = 150# µH
L = L * 10**-6# H
# f = 1/(2*pi*sqrt(L*C)) or C = 1/(4*pi**2*f**2*L)
#For f= 500 kHz
f1 = 500# kHz
f1 = f1 * 10**3# Hz
C1 = 1/(4*pi**2*f1**2*L)# F
#For f= 1500 kHz
f2 = 1500# kHz
f2 = f2 * 10**3# Hz
C2 = 1/(4*pi**2*f2**2*L)# F
C1= C1*10**12# pF
C2= C2*10**12# pF
print "The required capacitor range is : %.2f"%(C2),"pF to %.2f"%(C1),"pF"
# Note: The answer in the book is wrong.
from math import sqrt,pi
from __future__ import division
# Given data
L = 100# µH
L = L * 10**-6# H
A=10
C1 = 0.001# µF
C1 = C1 * 10**-6# F
C2 = 0.01# µF
C2 = C2 * 10**-6# F
C = (C1*C2)/(C1+C2)# F
f = 1/(2*pi*sqrt( L*C ))# Hz
f = round(f * 10**-3)# kHz
print "The operating frequency = %.2f kHz"%f
Beta = C1/C2## feedback fraction
print "The feed back fraction = %0.2f"%Beta
#Minimum gain to sustain oscillations, Amin*Beta = 1
Amin = 1/Beta
print "The minimum gain to sustain oscillation = %.2f"%Amin
# A = R_C/R_E
R_C = 2.5# ohm
R_E = R_C/A# ohm
print "The emitter resistance = %.2f ohm"%R_E
from math import pi
from __future__ import division
# Given data
L1 = 0.1# mH
L1 = L1 * 10**-3# H
L2 = 10# mH
L2 = L2 * 10**-3# H
L = 150# µH
L = L * 10**-6# H
f = 4110# kHz
f = f * 10**3# Hz
#Frequency of oscillations, f = 1/(2*pi*sqrt(L*C)), So
C = 1/(4*(pi**2)*(f**2)*L )# F
C = round(C * 10**12)# pF
print "The value of capacitor = %.2f pF"%C
from math import sqrt,pi,tan
from __future__ import division
# Given data
f = 1# kHz
f = f * 10**3# Hz
R = 10# k ohm
R = R * 10**3# ohm
omega = 2*pi*f##in rad/sec
phi = 60# degree
# tand(phi) = Alpha_C/R = 1/(omega*C*R)
C = 1/(omega*R*tan(pi/180*phi))# F
C = C * 10**6# µF
print "The value of C = %.2f µF"%C
from __future__ import division
from math import sqrt,pi
# Given data
R2 = 200# k ohm
R2 = R2 * 10**3# ohm
R1 = R2# ohm
C2 = 250# pF
C2 = C2 * 10**-12# F
C1 = C2# F
R = R2# ohm
C = C2# F
# Frequency of oscillations,
f = 1/(2*pi*R*C)# Hz
print "The frequency = %.2f Hz"%f
# Note: The answer in the book is not accurate.
from __future__ import division
from math import sqrt,pi
# Given data
C1 = 300# pF
C2 = 100# pF
Ceq = (C1*C2)/(C1+C2)# pF
Ceq = Ceq * 10**-12# F
L = 50# µH
L = L * 10**-6# H
# The frequency of oscillation
f = 1/(2*pi*sqrt(L*Ceq))# Hz
f = f * 10**-6# MHz
print "The frequency of oscillation = %.2f MHz"%f
# For maintaining oscillation, A_loop >=1 and Aopenloop*Beta = 1
# Beta = C2/C1
Aopenloop = C1/C2
print "The minimum gain for maintaining oscillation = %.2f"%Aopenloop