#Given data
A = 2*10**5
R_F = 4.7*10**3 # in ohm
R1 = 470 # in ohm
K = R_F/(R1+R_F)
B = R1/(R1+R_F)
A_F = -(A*R_F)/(R1+R_F+(R1*A))
print "The closed loop voltage gain = %0.f" %A_F
R_in = 2 # in M ohm
R_in = R_in * 10**6 # in ohm
R_inf = R1 + ( (R_F*R_in)/(R_F+R_in + (A*R_in)) ) # in ohm
print "Input resistance = %0.3f Ω" %R_inf
R_o = 75 # in ohm
R_of = R_o/(1+(A*B)) # in ohm
R_of = R_of * 10**3 # in mΩ
print "Output Resistance = %0.2f mΩ" %R_of
f_o = 5 # Hz
f_f = f_o*(1+(A*B)) # in Hz
f_f = f_f *10**-3 # in kHz
print "Band width with feedback = %0.3f kHz" %f_f
# Note: In the book, the unit of output resistant is wrong it will be mΩ (not MΩ)
from __future__ import division
#Given data
A_F = -30
R_F = 1 # in M ohm
R1 = -(R_F/A_F) # in Mohm
R_i = R1 # in Mohm
print "Input resistance = %0.2f kΩ" %(R_i*10**3)
#Given data
A_F = 61
R1 = 1 # in k ohm
R1 = R1 * 10**3 # in ohm
R_F = (A_F-1)*R1 # in ohm
R_F = R_F * 10**-3 # k ohm
print "The value of feedback resistance = %0.f kΩ" %R_F
#Given data
A = 2*10**5
R1 = 1 # in k ohm
R1 = R1 *10**3 # in ohm
R_F = 10 # in k ohm
R_F = R_F * 10**3 # in ohm
B = R1/(R1+R_F)
R_i = 2 # in M ohm
R_i = R_i * 10**6 # in ohm
R_o = 75 # in ohm
A_F = A/(1+(A*B))
print "The closed loop gain = %0.3f" %A_F
R_if = R_i * (1+(A*B)) # in ohm
print "Input resistance = %0.2f GΩ" %(R_if*10**-9)
R_of = R_o/(1+(A*B)) # in ohm
R_of = R_of * 10**3 # in mΩ
print "The output resistance = %0.2f mΩ" %R_of
f_o = 5 # in Hz
f_f = f_o*(1+(A*B)) # in Hz
f_f = f_f * 10**-3 # in kHz ... correction....
print "Bandwidth with feedback = %0.2f kHz" %f_f
#Given data
A =2*10**5
R_i = 2 # in M ohm
R1 = 1 # in ohm
R_o= 75 # in ohm
R_F = 1 # in ohm
B = R1/(R1+R_F)
A_F = -1
print "The voltage gain = %0.f" %A_F
R_if = 330 # in ohm
print "Input resistance = %0.f Ω" %R_if
R_of = R_o/(A/2) # in ohm
print "Output resistance = %0.5f Ω" %R_of
f_o = 5 # in Hz
f_F = (A/2)*f_o # in Hz
f_F = f_F * 10**-6 # in MHz
print "The bandwidth = %0.1f MHz" %f_F
#Given data
A = 2*10**5
R_i = 2 #in M ohm
R_i = 2*10**6 # in ohm
R_o = 75 #in ohm
f_o = 5 # in Hz
V_CC = 15 # in V
V_EE = -15 # in V
R1 = 1 # in k ohm
R1 = R1 * 10**3 # in ohm
R_F = 10 # in k ohm
R_F = R_F * 10**3 # in ohm
OVS= 13 # output voltage swing in V in ±
B = R1/(R1+R_F)
A_B = A*B
A_B1 = 1+(A*B)
A_F = (1+(R_F/R1))
print "Part (i) For non-inverting amplifier :-"
print "The value of A_F = %0.f" %A_F
R_iF = R_i * (A_B1) # in ohm
print "The value of R_iF = %0.4f GΩ" %(R_iF*10**-9)
R_OF = R_o/(A_B1) # in ohm
print "The value of R_OF = %0.5f ohm" %R_OF
f_F = f_o*A_B1 # in Hz
f_F =f_F * 10**-3 # in kHz
print "The value of f_F = %0.2f kHz" %f_F
V_ooT= OVS/(1+A*B) # in V
print "The value of VooT = ±",round(V_ooT,6),"volts = ±",round(V_ooT*10**3,3)," mV"
print "\nPart (ii) For inverting amplifier"
R_F = 4.7 # in k ohm
R_F = R_F* 10**3 # in ohm
R_1 = 470 # in ohm
A_F = -(R_F)/R_1
print "The value of A_F = %0.f" %A_F
R_iF = R_1# in ohm
print "The value of R_iF = %0.f Ω" %R_iF
R_OF = R_o/(A_B1) # in ohm
print "The value of R_OF = %0.5f Ω" %R_OF
f_F = f_o*A_B1 # in Hz
f_F =f_F * 10**-3 # in kHz
print "The value of f_F = %0.2f kHz" %f_F
V_ooT = OVS/A_B1 # in mV
print "The value of VooT = ±",round(V_ooT*10**3,3)," mV"
#Given data
R1 = 5 # in k ohm
R_F = 500 # in k ohm
V_in = 0.1 # in V
A_F = -(R_F/R1)
print "Voltage gain = %0.f" %A_F
R_i = R1 # in k ohm
print "The Input resistance = %0.f kΩ" %R_i
R_o = 0 # in ohm
print "Output resistance = %0.f Ω" %R_o
V_out = A_F*V_in # in V
print "Output voltage = %0.f V" %V_out
I_in = V_in/(R1*10**3) # in A
I_in = I_in * 10**3 # in mA
print "Input current = %0.2f mA" %I_in
#Given data
R_F = 1 # in M ohm
R_in = 1 # in M ohm
V_in = 1 # in V (assumed)
V_out = -(R_F/R_in)*V_in
A_v = V_out/V_in
print "The value of A_v = %0.f" %A_v
I_in = 1 # in A
I_out = I_in # in A
A_in = I_out/I_in
print "The value of A_in = %0.f" %A_in
A_P = abs(A_v*A_in)
print "The value of A_P = %0.f" %A_P
#Given data
R_F = 1 # in M ohm
R_F = R_F * 10**6 # in ohm
Av= -30
R1 = R_F/abs(Av) # in ohm
R1 = R1 * 10**-3 # in k ohm
print "The value of R_F = %0.f MΩ " %(R_F*10**-6)
print "The value of R1 = %0.f kΩ" %R1
#Given data
A_v = -8
V_in= -1 # in V
I1 = 15 # in µA
I1 = I1 * 10**-6 # in A
R1 = -(V_in)/I1 # in ohm
R1 = R1 * 10**-3 # in k ohm
print "Minimum value of R1 = %0.2f kΩ (standard value 68 kΩ)" %R1
R1= 68 # kohm (Use standard value)
R_F = -(A_v)*R1 # in k ohm
print "The minimum value of R_F = %0.f kΩ" %R_F
# Note: There is calculation error in the book to find the value of R_F so the answer in the book is wrong.