from __future__ import division
#Given data
Rs = 10 # in k ohm
Rs = Rs * 10**3 # in ohm
Rin = 10 # in ohm
Rout = 10 # in k ohm
Rout = Rout * 10**3 # in ohm
R_L = 10 # in ohm
Ai = 1000 # unit less
VinBY_Iin= Rin # in ohm
VoutBY_Iin= Ai*Rout*R_L/(Rout+R_L) # in V
Av= VoutBY_Iin/VinBY_Iin # unit less
print "The voltage gain = %0.f " %Av
Ai= (VoutBY_Iin/R_L)/((Rs+Rin)/Rs) # unit less
Ap= Av*Ai # unit less
print "The power gain = %0.2e " %Ap
#Given data
Beta = 0.01 #feedback fraction
# Voltage gain with negative feedback
A = 3000 # unit less
Af = A/(1+(Beta*A)) # unit less
print "The voltage gain of the amplifier = %0.3f " %Af
#Given data
A = 75 # internal gain
Beta = 1/15 #feedback fraction
Af = A/(1+(Beta*A)) # voltage gain with negative feedback
print "The voltage gain with negative feedback = %0.1f " %Af
A_desh = 2*A # unit less
A_desh_f = A_desh/(1+(Beta*A_desh)) # unit less
print "The new value of gain = %0.2f " %A_desh_f
from math import log10
#Given data
A = 40 # open loop voltage gain
Beta = 10/100 # feedback ratio
Af = A/(1+(Beta*A)) # voltage gain with feedback
print "The voltage gain with feedback = %0.f " %Af
Amount = 20*log10(abs( 1/(1+(Beta*A)) )) # Amount of feedback in dB
print "Amount of feedback = %0.2f dB " %Amount
Loopgain = A*Beta # unit less
print "The Loop gain = %0.f " %Loopgain
#Given data
A = 60 # in dB
A = 10**(A/20) # unit less
Beta = 1/20 # feedback fraction
Af = A/(1+(Beta*A)) # gain with feedback
Af = 20*log10(Af) # in dB
print "The gain with feed back = %0.2f dB " %Af
#Given data
A = 2500 # open loop gain
# Desensitivity of transfer gain
trnsfr_gain_densitivity = 40 # in dB
trnsfr_gain_densitivity = 10**(trnsfr_gain_densitivity/20)
Af = A/trnsfr_gain_densitivity # unit less
print "The gain with feed back = %0.f " %Af
I = A/Af # assumed
print "The input for same output will become ",int(I)," times the input without feedback."
#Given data
A = 60 # in dB
A = 10**(A/20) # unit less
Af = 40 # in dB
Af = 10**(Af/20) # unit less
# Af = A/(1+(A*Beta))
BetaIntoA = (A/Af)-1 # feedback factor
print "The feed back factor = %0.f " %BetaIntoA
#Given data
A = 600 # unit less
Af = 50 # unit less
# Af = A/(1+(A*Beta))
Beta = ((A/Af)-1)/A # unit less
#P = Vf/Vout = Beta*100
P = Beta*100 # percentage of output voltage in %
print "The percentage of output voltage = %0.3f %%" %P
#Given data
Vout = 12.5 # in V
Vin = 0.25 # in V
Av = Vout/Vin # unit less
print "The voltage gain without feed back is = %0.f " %Av
Vin = 1.5 # in V
Avf = round(Vout/Vin) # unit less
# Avf = Av/(1+(Beta*Av))
Beta = ((Av/Avf)-1)/Av # unit less
Beta = Beta*100 # in %
print "The value of ß = %0.1f %% " %Beta
from fractions import Fraction
#Given data
Af = -100 # unit less
Vin = 0.06 # in V
Vout = Af*Vin # in V
Vin = 50 # in mV
Vin = Vin * 10**-3 # in V
A = Vout/Vin # unit less
#Af = A/(1+(A*Beta))
Beta = (abs(A)-abs(Af))/(Af*A) # unit less
print "The value of ß =",Fraction(Beta).limit_denominator(1000)
Amount = 20*log10(abs( 1/(1+(-Af*Beta)) )) # in dB
print "The Amount of feed back = %0.2f dB " %Amount
#Given data
A = 1000 # unit less
Beta = 0.002 # unit less
Af = A/(1+(A*Beta)) # unit less
# When open-loop gain is reduced by
A_desh = (1-15/100)*A # unit less
A_desh_f = A_desh/(1+(A_desh*Beta)) # unit less
P = ((Af-A_desh_f)/Af)*100 # percentage change in overall gain in %
print "The change in overall gain = %0.1f %% " %P
#Given data
R_C = 2.5 # in k ohm
R_C = R_C * 10**3 # in ohm
R_E = 1 # in k ohm
R_E = R_E * 10**3 # in ohm
h_ie = 1.1 # in k ohm
h_ie = h_ie * 10**3 # in ohm
h_fe = 200 # unit less
Beta = 200 # unit less
A = round((-h_fe/h_ie)*R_C) # unit less
print "The voltage gain without feed back = %0.f " %A
Af = -R_C/R_E # unit less
print "The voltage gain with feed back = %0.1f " %Af
# Af = A/(1+(A*Beta))
Beta = (abs(A)-abs(Af))/(A*Af) # unit less
print "The feed back ratio = %0.3f " %Beta
feedbackfactor = round(abs(A)*Beta) # unit less
print "The feed back factor = %0.f " %feedbackfactor
#Given data
dAvByAv = 20/100 # variation in open loop gain
dAvf_by_Avf = 1/100 # variation in closed loop gain
BetaAv = (dAvByAv/dAvf_by_Avf)-1 # feedback factor
Avf = 100 #unit less
Av = Avf*(1+BetaAv) # open loop voltage gain
print "The value of Av = %0.f " %Av
Beta = ((Av/Avf)-1)/Av # unit less
print "The value of ß = %0.4f " %Beta
#Given data
Av =10000 # open loop gain
Beta = 1/10 # feedback ratio
Avf = Av/(1+(Av*Beta)) # closed loop gain
dAvByAv = 50/100 # change in open loop gain
dAvByAvf = 1/(1+(Beta*Av))*dAvByAv*100 # change in closed loop gain in %
print "The percentage change in closed loop gain = %0.5f %% " %dAvByAvf
#Given data
BetaAvPlus1 = 10 # in dB
BetaAvPlus1 = 10**(BetaAvPlus1/20) # unit less
BetaAv = BetaAvPlus1 - 1 # unit less
dAvByAv = 0.05 # unit less
#Beta*Av = (dAvByAv/dAvfByAvf)-1
dAvfByAvf = dAvByAv/( BetaAv+1 ) # unit less
dAvfByAvf = dAvfByAvf * 100 # in %
print "The percentage change in the closed loop gain = %0.2f %% " %dAvfByAvf
#Given data
D = 10/100 # distortion without feedback
Df = 1/100 # distortion with feedback
Beta = 10/100 # feedback ratio
# Df = D/(1+(Beta*A))
A = ((D/Df)-1)/Beta # open loop gain
print "The open loop gain = %0.f " %A
Af = A/(1+(Beta*A)) # closed loop gain
print "The closed loop gain = %0.f " %Af
#Given data
A = 150 # open loop voltage gain
Beta = 10/100 # feedback ratio
D = 5/100 # distortion without feedback
Df = D/(1+(Beta*A)) # distortion with feedback
Df = Df * 100 # in %
print "The distortion of the amplifier with feed back = %0.4f %% " %Df
#Given data
D = 10/100 # distortion without feedback
Df = 1/100 # distortion with feedback
A = 200 # unit less
# Df = D/(1+(Beta*A))
Beta = ((D/Df)-1)/A # unit less
Af = A/(1+(Beta*A)) # unit less
print "The gain voltage with feed back = %0.f " %Af
Vs = 10 # in mV
Vs = Vs * 10**-3 # in V
Vout = Af*Vs # in V
print "The output voltage with feed back = %0.1f V " %Vout
#Given data
A = 1000 # open loop gain
D = 10/100 # distortion without feedback
Vs = 10 # in mV
Vs = Vs * 10**-3 # in V
BetaA = 40 # in dB
BetaA= 10**(BetaA/20) # unit less
Vdesh_s = Vs*(1+BetaA) # in V
print "The required input signal = %0.2f V " %Vdesh_s
Df = (D/(1+BetaA))*100 # in %
print "The percentage second harmonic distortion = %0.1f %% " %Df
Af = A/(1+BetaA) # unit less
print "The closed loop voltage gain = %0.1f " %Af
#Given data
A = 300 # voltage gain
Rin = 1.5 # in k ohm
Rout = 50 # in k ohm
Beta = 1/15 # unit less
Af = A/(1+(Beta*A)) # unit less
print "The voltage gain = %0.1f " %Af
Rinf = (1+(Beta*A))*Rin # in k ohm
print "The input resistance = %0.1f k ohm " %Rinf
Routf = Rout/(1+(Beta*A)) # in k ohm
print "The output resistance = %0.2f k ohm " %Routf
#Given data
dA_ByA = 0.1 # change in gain of internal amplifier
A = 60 # in dB
A = A * 16.666 # unit less
Zo = 12 # in k ohm
Zo = Zo * 10**3 # in ohm
Zoutf = 600 # in ohm
Beta = ((Zo/Zoutf)-1)/A # unit less
print "The value of feed back factor = %0.3f " %Beta
dAf_byAf = 1/(1+(A*Beta))*(dA_ByA)*100 # change in overall gain in %
print "The percentage change in overall gain = %0.1f %% " %dAf_byAf
#Given data
D = 5/100 # distortion without feedback
A = 1000 # open loop voltage gain
Beta = 0.01 # feedback ratio
Af = A/(1+(Beta*A)) # unit less
print "The Amplifier voltage gain = %0.2f " %Af
f1 = 50 # in Hz
fdas1 = f1/(1+(Beta*A)) # in Hz
print "The lower cutoff frequency with feedback = %0.2f Hz " %fdas1
f2 = 200 # in kHz
f2 = f2 * 10**3 # in Hz
fdas2 = f2*(1+(Beta*A)) # in Hz
fdas2 = fdas2 * 10**-6 # in MHz
print "The upper cutoff frequency with feedback = %0.1f MHz " %fdas2
Df = (D/(1+(Beta*A)))*100 # in %
print "The distortion with feed back = %0.3f %% " %Df
#Given data
Avm = 1500 # midband gain
Avmf = 150 # midband gain with feedback
# Avmf = Avm/(1+(Beta*Avm))
BetaAvm = (Avm/Avmf)-1 # feedback factor
print "The value of feed back factor = %0.f " %BetaAvm
bandwidth = 4 # in MHz
BWf = (1+BetaAvm)*bandwidth # in MHz
print "The band width with feedback = %0.f MHz " %BWf
#Given data
A = 100 #mid frequency gain
BW = 200 # in kHz
Beta = 5/100 # feedback ratio
BWf = (1+(Beta*A))*BW # in kHz
BWf = BWf * 10**-3 # in MHz
print "The bandwidth with feedback = %0.1f MHz " %BWf
Af = A/(1+(Beta*A)) # unit less
print "The gain with feedback = %0.2f " %Af
BWf = 1000 # in kHz
Beta = ((BWf/BW)-1)/A*100 #feedback ratio in %
print "The amount of feedback = %0.f %% " %Beta
#Given data
V_CC = 20 # in V
R1 = 10 # in k ohm
R1 = R1 * 10**3 # in ohm
R2 = 10 # in k ohm
R2 = R2 * 10**3 # in ohm
R_E = 9.3 # in k ohm
R_E = R_E * 10**3 # in ohm
R_L = 18.6 # in k ohm
R_L = R_L * 10**3 # in ohm
V2 = (V_CC/(R1+R2))*R2 # in V
V_BE = 0.7 # in V
Ve = V2-V_BE # in V
Ie = Ve/R_E # in A
V_T = 25*10**-3 # in V
rdase = V_T/Ie # in ohm
RdasE = (R_E*R_L)/(R_E+R_L) # in ohm
Beta = 100 # unit less
Zinbase = Beta*(rdase+RdasE) # in ohm
Zin =R1*R2*Zinbase/(R1*R2+R2*Zinbase+Zinbase*R1) # in ohm
Zin= Zin*10**-3 # in k ohm
print "The input impedance = %0.2f k ohm " %Zin