#Caption:Design a non inverting amplifier by determining Required resistances and output voltage
Av=28.#Voltage gain
E=50.#Input voltage(in mV)
Ib=500.#Base current(in nA)
i=100.*Ib*0.001
R3=E/i
Vo=Av*E*0.001
r=Vo*1000./i
R2=r-R3
R1=(R2*R3)/(R2+R3)
print '%s %.1f %s %.f %s %.f %s %.f' %('Output voltage(in volts)=',Vo,'\nRequired resistances\nR3(in kilo ohm)=',R3,'\nR2(in kilo ohm)=',R2,'\nR1(in kilo ohm)=',R1)
#Caption:Design an inverter by determining input resistance,current and capacitance
Vo=11.#Output voltage(in volts)
Vcc=12.#Collector voltage(in volts)
Vi=6.#Input voltage(in volts)
f=1.#Frequency(in Khz)
Vb=0.5#Base voltage(in volts)
Vee=-12.#Emitter voltage(in volts)
Ib=500.#Max base current(in nA)
Vc=2.#Collector voltage(in volts)
Vr2=Vb-Vee
I2=100.*Ib*0.001
R2=Vr2/I2
i=Vr2/R2
R1=(Vcc-Vb)/i
Ri=99.
Ii=60.6
pw=1000./(2.*f)
C=(Ii*pw)*10.**(-6)/Vc
print '%s %.f %s %.1f %s %.3f' %('Input resistance(in kilo ohm)=',Ri,'\nInput current(in micro ampere)=',Ii,'\nCapacitance(in micro farad)=',C)
#Caption:Design a differentiating circuit by determining required resistances and capacitance
Vo=5.#Output voltage(in volts)
Vi=1.#Change in input voltage(in volts)
t=100.#Time period(in micro sec)
I=1.#Circuit current(in mA)
R2=Vo/I
R1=235.
R3=R2
C=Vo*t/(R2*Vi*1000.)
print '%s %.1f %s %.f %s %.f %s %.f' %('Required components for circuit are \nCapacitance(in micro farad)=',C,'\nResistances R1(in ohm)=',R1,'\nR2(in kilo ohm)=',R2,'\nR3(in kilo ohm)=',R3)
#Caption:Calculate lowest operating frequency for circuit
import math
V=4.#Peak to peak amplitude of output waveform(in volts)
Vi=10.#Input voltage(in volts)
Vs=15.#Supply voltage(in volts)
Ib=500.#Maximum Base current(in nA)
f=250.#Frequency of input waveform(in hz)
I=1.#Circuit current(in mA)
R1=Vi/I
R3=20.*R1
R2=(R3*R1)/(R1+R3)
t=1000./(2.*f)
C=(I*t)/V
F=22.*1000./(2.*math.pi*C*R3)
print '%s %.f' %('Required frequency(in hz)=',F)