##Ex:7.1
import math
I_i=4.;
V_o=2.;
V_i=50.*10**-3;
I_o=200.;
A_v=V_o/V_i;
A_i=I_o/I_i;
print'%s %.2f %s'%(" Volt gain = ",A_v,"");
print'%s %.2f %s'%("\n Current gain = ",A_i,"");
print'%s %.2f %s'%("\n Power gain = ",A_i*A_v,"");
##Ex:7.2
import math
A_v_max=35.;
A_v_cutoff=0.707*A_v_max;
print'%s %.2f %s'%(" Mid-band Volt gain = ",A_v_cutoff,"");
print("\n upper freq = 590Hz & lower freq = 57Hz");
##Ex:7.3
import math
A=50.;
b=0.1;
G=A/(1.+b*A);
print'%s %.2f %s'%(" overall Volt gain = ",G,"");
##Ex:7.4
import math
A=50.;
A_new=A+0.2*A;
b=0.1;
G=A_new/(1.+b*A_new);
dG=8.33-G/8.33;
print'%s %.2f %s'%(" percentage change in overall volt gain = ",dG,"");
##Ex:7.5
import math
A=100.;
G=20.;
b=(1./G)-(1./A);
print'%s %.2f %s'%("amount of feedback required = ",b,"");
##Ex:7.6
import math
h_oe=80.*10**-6;
R_l=10000.;
I_f=320.*10**-6;
I_c=I_f*(1./h_oe)/((1./h_oe)+R_l);
V_out=I_c*R_l;
print'%s %.2f %s'%("Output voltage = ",V_out," V");
##Ex:7.7
import math
b=200.;
h_ie=1.5*10**3;##in ohms
h_fe=150.;
R_l=b*h_ie/h_fe;
print'%s %.2f %s'%("Load resistance = ",R_l," ohms");
##Ex:7.8
import math
V=9.;
V_e=2.;
R4=1000.;
V_b=2.6;
R2=33.*10**3;
R1=68000.;
I_r1=(V-V_b)/R1;
R3=2.2*10**3;
I_b=15.1*10**-6;
I_c=2.0151*10**-3;
V_r3=I_c*R3;
V_c=V-V_r3;
print'%s %.2f %s'%("Collector voltage = ",V_c," V");
##Ex:7.9
import math
V_pp=14.8-3.3;
print("Collector quiescent voltage = 9.2 V");
print("\nCollector quiescent current = 7.3mA");
print'%s %.2f %s'%("\nOutput peak-peak voltage = ",V_pp," V");