# Chapter08: Feedback¶

## Ex8.1:pg-808¶

In [9]:
# By inspection we can write down the expressions for A, B , closed loop gain , the input resistance and the output resistance
u=10**4; # (ohm)
R_id=100.0*10**3; # (ohm)
r_o=1000.0; # (ohm)
R_L=2000.0; # (ohm)
R_1=1000.0; # (ohm)
R_2=10.0**6; # (ohm)
R_S=10000.0; # (ohm)
A=u*(R_L*(R_1+R_2)/(R_L+R_1+R_2))*R_id/(((R_L*(R_1+R_2))/(R_L+R_1+R_2)+r_o)*(R_id+R_S+(R_1*R_2)/(R_1+R_2)))
print int(A),"= Voltage gain without feedback (V/V)"
B=R_1/(R_1+R_2); # Beta value
print round(B,5), "= Beta value "
A_f=A/(1.0+A*B);
print int(A_f),"= Voltage gain with feedback (V/V)"
R_i=R_S+R_id+(R_1*R_2/(R_1+R_2))# Input resistance of the A circuit in fig 8.12a of textbook
R_if=R_i*7;
R_in=R_if-R_S;
print round(R_in/1000.0,1),"= Input resistance (Kohm)"
R_o=1.0/(1/r_o+1/R_L+1/(R_1+R_2));
R_of=R_o/(1.0+A*B);
R_out=R_of*R_L/(R_L-R_of);
print round(R_out),"= the output resistance (ohm)"
# the answer for input resistance is incorrect in the textbook

6002 = Voltage gain without feedback (V/V)
0.001 = Beta value
857 = Voltage gain with feedback (V/V)
767.0 = Input resistance (Kohm)
100.0 = the output resistance (ohm)


## Ex8.2:pg-815¶

In [14]:
# Consider the given three stage series-series feedback
h_fe=100.0;
g_m2=40.0*10**-3; # (A/V)
r_e1=41.7; # (ohm)
a_1=0.99; # alpha value
R_C1=9000.0; # (ohm)
R_E1=100.0; #(ohm)
R_F=640.0; # (ohm)
R_E2=100.0; #(ohm)
r_pi2=h_fe/g_m2;
R_C2=5000.0; # (ohm)
r_e3=6.25; # (ohm)
R_C3=800.0; #(ohm)
# First stage gain A_1=V_c1/V_i
A_1=-a_1*R_C1*r_pi2/((R_C1+r_pi2)*(r_e1+((R_E1*(R_F+R_E2))/(R_E1+R_F+R_E2))))
print round(A_1,2),"=The voltage gain of the first stage (V/V)"
# Gain of the second stage A_2=Vc2/V_c1
A_2=-g_m2*((R_C2*(h_fe+1)/(R_C2+h_fe+1))*(r_e3+(R_E2*(R_F+R_E1))/(R_E2+R_F+R_E1)))
print round(A_2,1),"=The second stage gain (V/V)"
# Third stage gain A_3 I_O/V_i
A_3=1/(r_e3+(R_E2*(R_F+R_E1)/(R_E2+R_F+R_E1)));
print round(A_3*1000,1),"=The third stage gain (mA/V)"
A=A_1*A_2*A_3; # combined gain
print A,"=Combined gain (V/V)"
B=R_E1*R_E2/(R_E2+R_F+R_E1);
print B,"=Beta value"
A_f=A/(1.0+A*B);
print round(A_f*1000.0,2),"=Closed loop gain (mA/V)"
A_v=-A_f*R_C3; # Voltage gain
print round(A_v,1),"=Voltage gain (V/V)"
R_i=(h_fe+1)*(r_e1+(R_E1//(R_F+R_E2))/(R_E1+R_F+R_E2));
R_if=R_i*(1+A*B);
print round(R_if/1e6,1),"=Input resistance (Mohm)"
R_o=(R_E2//(R_F+R_E1)/(R_F+R_E1+R_E2))+r_e3+R_C2/(h_fe+1);
R_of=R_o*(1.0+A*B);
print round(R_of/1000,1),"=Output voltage (kohm)"
r_o=25000; # (ohm)
g_m3=160*10**-3; # (mho)
r_pi3=625; # (ohm)
R_out=r_o+(1+g_m3*r_o)*R_of*r_pi3/(R_of+r_pi3);
print round(R_out/1e6,1),"=R_out (Mohm)"
# the answer in the textbook is slightly dirfferent due to approximation

-14.92 =The voltage gain of the first stage (V/V)
-373.6 =The second stage gain (V/V)
10.6 =The third stage gain (mA/V)
59.0958738355 =Combined gain (V/V)
11.9047619048 =Beta value
83.88 =Closed loop gain (mA/V)
-67.1 =Voltage gain (V/V)
3.0 =Input resistance (Mohm)
39.3 =Output voltage (kohm)
2.5 =R_out (Mohm)


## Ex8.3:pg-821¶

In [18]:
B=100.0; # beta value
I_B=0.015*10**-3; # (A)
I_C=1.5*10**-3; # (A)
V_C=4.7; # (V)
g_m=40.0*10**-3;
R_f=47000.0;
R_S=10000.0;
R_C=4700.0;
r_pi=B/g_m;
A=-358.7*10**3; # V_o/I_i= -g_m(R_f||R_C)(R_S||R_F||r_pi)
R_i=1400.0; # R_i=R_S||R_f||r_pi (ohm)
R_o=R_C*R_f/(R_C+R_f);
B=-1/R_f;
A_f=A/(1.0+A*B); # V_o/I_s
A_v=A_f/R_S; # V_o/V_s
print round(A_v,2),"= The gain (V/V)"
R_if=R_i/(1+A*B);
print round(R_if,1),"= R_if (ohm)"
R_of=R_o/(1+A*B);
print round(R_of),"= R_of (ohm)"

-4.16 = The gain (V/V)
162.2 = R_if (ohm)
495.0 = R_of (ohm)


## Ex8.4:pg-825¶

In [29]:
R_S=10.0*10**3; # (ohm)
R_B1=100.0*10**3; # (ohm)
R_B2=15.0*10**3; # (ohm)
R_C1=10.0*10**3; # (ohm)
R_E1=870.0; # (ohm)
R_E2=3400.0; # (ohm)
R_C2=8000.0; # (ohm)
R_L=1000.0; # (ohm)
R_f=10000.0; # (ohm)
B=100.0; # beta value
V_A=75.0; # (V)
A=-201.45 # I_o/I_i (A/A)
R_i=1535.0; # (ohm)
R_o=2690.0; # (ohm)
B=-R_E2/(R_E2+R_f);
R_if=R_i/(1+A*B);
R_in=1/((1/R_if)-(1/R_S));
print round(R_in,1), "= R_in (ohm)"
A_f=A/(1+A*B); # I_o/I_S
gain=R_C2*A_f/(R_C2+R_L); # I_o/I_S
print round(gain,2),"= I_o/I_S (A/A)"
R_of=R_o*(1+A*B); # (ohm)
r_o2=75/0.0004; # (ohm)
g_m2=0.016; # (A/V)
r_pi2=6250; # (ohm)
R_out=r_o2*(1+g_m2*(r_pi2*R_of/(r_pi2+R_of)))
print round(R_out/1e6,1),"= R_out (Mohm)"

29.5 = R_in (ohm)
-3.44 = I_o/I_S (A/A)
18.1 = R_out (Mohm)