VCC=15 #supply voltage(V)
RE=7.5 #Emitter resistance(KOhm)
IT=VCC/RE #tail current (mA)
IE=IT/2 #emitter current (mA)
print 'tail current = ',IT,'mA'
print 'emitter current = ',IE,'mA'
VCC=15 #supply voltage(V)
RE=7.5 #Emitter resistance(KOhm)
VBE=0.7 #base-emitter voltage(V)
RC=5 #collector resistance(KOhm)
IT=(VCC-VBE)/RE #tail current (mA)
IE=IT/2 #emitter current (mA)
VC=VCC-(IE*RC) #collector quiescent voltage(V)
print 'tail current = ',round(IT,2),'mA'
print 'emitter current = ',round(IE,2),'mA'
print 'collector quiescent voltage VC = ',round(VC,2),'V'
VCC=12.0 #supply voltage(V)
RE=5.0 #Emitter resistance(KOhm)
RC=3.0 #collector resistance(KOhm)
IT=VCC/RE #tail current (mA)
IE=IT/2 #emitter current (mA)
VC=VCC-(IE*RC) #collector quiescent voltage(V)
IT1=(VCC-VBE)/RE #tail current (mA)
IE1=IT1/2 #emitter current (mA)
VC1=VCC-(IE1*RC) #collector quiescent voltage(V)
print 'tail current = ',IT,'mA'
print 'emitter current = ',IE,'mA'
print 'collector quiescent voltage VC = ',VC,'V'
print 'with second approximation,'
print 'tail current = ',IT1,'mA'
print 'emitter current = ',IE1,'mA'
print 'collector quiescent voltage VC = ',VC1,'V'
VCC=12.0 #supply voltage(V)
RE=7.5 #Emitter resistance(KOhm)
RC=5.0 #collector resistance(KOhm)
IE=1 #emitter current as per preceding example(mA)
Vin=1 #input ac voltage(mV)
B=300 #current gain
re=25/IE #ac emitter resistance(Ohm)
Av=1000*RC/re #voltage gain
Vout=Av*Vin #Output voltage(mV)
Zinb=2*B*re #input impedance of diff amp(Ohm)
print 'voltage gain Av = ',Av
print 'Output voltage Vout = ',Vout,'mV'
print 'input impedance of diff amplifier, Zin(base) = ',Zinb/1000,'KOhm'
VCC=12.0 #supply voltage(V)
RE=7.5 #Emitter resistance(KOhm)
RC=5.0 #collector resistance(KOhm)
IE=0.955 #emitter current as per previous example(mA)
Vin=1 #input ac voltage(mV)
B=300 #current gain
re=25/IE #ac emitter resistance(Ohm)
Av=1000*RC/re #voltage gain
Vout=Av*Vin #Output voltage(mV)
Zinb=2*B*re #input impedance of diff amp(Ohm)
print 'voltage gain Av = ',Av
print 'Output voltage Vout = ',Vout,'mV'
print 'input impedance of diff amplifier, Zin(base) = ',round((Zinb/1000),2),'KOhm'
VCC=12.0 #supply voltage(V)
RE=7.5 #Emitter resistance(KOhm)
RC=5.0 #collector resistance(KOhm)
IE=1 #emitter current as per preceding example(mA)
V2=1 #input ac voltage(mV)
B=300 #current gain
re=25/IE #ac emitter resistance(Ohm)
Av=1000*RC/re #voltage gain
Vout=Av*V2 #Output voltage(mV)
Zinb=2*B*re #input impedance of diff amp(Ohm)
print 'V2 input is at inverting input, So, ideally same as previous case.'
print 'Voltage gain Av = ',Av
print 'Output voltage Vout = ',Vout,'mV'
print 'input impedance of diff amplifier, Zin(base) = ',Zinb/1000,'KOhm'
VCC=15.0 #supply voltage(V)
RC=1.0**10**6 #collector resistance(Ohm)
RE=1.0**10**6 #emitter resistance(Ohm)
IE=1 #emitter current as per preceding example(mA)
Vin=7 #input ac voltage(mV)
B=300 #current gain
IT=VCC/RE #tail current (uA)
IE=IT/2 #emitter current (uA)
re=25/IE/1000 #ac emitter resistance(Ohm)
Av=RC/(2*re) #voltage gain
Vout=Av*Vin #Output voltage(V)
Zinb=2*B*re #input impedance of diff amp(MOhm)
print 'Voltage gain Av = ',Av
print 'Output voltage Vout = ',Vout/1000,'V'
print 'input impedance of diff amplifier, Zin(base) = ',Zinb,'MOhm'
VCC=15.0 #supply voltage(V)
RC=5.0*10**3 #collector resistance(Ohm)
RE=7.5*10**3 #emitter resistance(Ohm)
RB=1*10**3 #base resistance(Ohm)
Vin=10 #input ac voltage(mV)
Av=200 #voltage gain
Iinb=3*10**-6 #bias current(A)
Iino =0.5*10**-6 #Iin(off) (A)
Vino=1.0 #Vin(off) (mV)
V1err=RB*Iinb*1000 #dc error input1 (mV)
V2err=RB*(Iino/2)*1000 #dc error input2 (mV)
V3err=Vino #dc error input3 (mV)
Verror=Av*(V1err+V2err+V3err) #output error voltage(mV)
V1err1=0 #dc error input1 (mV)
V2err1=RB*Iino*1000 #dc error input2 (mV)
V3err1=Vino #dc error input3 (mV)
Verror1=Av*(V1err1+V2err1+V3err1) #output error voltage(mV)
print 'output error voltage Verror = ',Verror,'mV'
print 'output error voltage Verror = ',Verror1,'mV'
VCC=15.0 #supply voltage(V)
RC=1.0*10**6 #collector resistance(Ohm)
RE=1.0*10**6 #emitter resistance(Ohm)
RB=10*10**3 #base resistance(Ohm)
Vin=10 #input ac voltage(mV)
Av=300 #voltage gain
Iinb=80*10**-9 #bias current(A)
Iino=20*10**-9 #Iin(off) (A)
Vino=5.0 #Vin(off) (mV)
V1err=0 #dc error input1 (mV)
V2err=RB*(Iino/2)*1000 #dc error input2 (mV)
V3err=Vino #dc error input3 (mV)
Verror=Av*(V1err+V2err+V3err) #output error voltage(mV)
print 'output error voltage Verror = ',Verror/1000,'V'
VCC=15.0 #supply voltage(V)
RC=1.0*10**6 #collector resistance(Ohm)
RE=1.0*10**6 #emitter resistance(Ohm)
Vin=1 #input ac voltage(mV)
Av_CM=RC/(2*RE) #common mode voltage gain
Vout=Av_CM*Vin #output voltage(mV)
print 'common mode voltage gain : Av(CM) = ',Av_CM
print 'Output voltage Vout = ',Vout,'mV'
Vin=1 #input ac voltage(mV)
Av=150 #voltage gain
Av_CM=0.5 #common mode voltage gain
Vout1=Av*Vin #output voltage1(mV)
Vout2=Av_CM*Vin #output voltage2(mV)
Vout=Vout1+Vout2 #output volatge(mV)
print 'output voltage Vout1 = ',Vout1,'mV'
print 'output voltage Vout2 = ',Vout2,'mV'
print 'output voltage Vout = ',Vout,'mV'
CMRR_dB=90 #CMRR(dB)
Av=200000 #voltage gain
Vin=1*10**-6 #input voltage(V)
CMRR=10**(CMRR_dB/20.0) #CMRR
Av_CM=Av/CMRR #common mode voltage gain
Vout1=Av*Vin #desired output: voltage1(V)
Vout2=Av_CM*Vin #common mode output: voltage2(V)
print 'output voltage Vout1 = ',Vout1,'V'
print 'output voltage Vout2 = ',round((Vout2*10**6),2),'uV'
print 'see, desired output is much larger than common mode output.'
VCC=15.0 #supply voltage(V)
RC=7.5*10**3 #collector resistance(Ohm)
RE=7.5*10**3 #emitter resistance(Ohm)
V1=10 #input ac voltage(mV)
re=25 #as per example 17-4 (Ohm)
RL=15*10**3 #load resistance(KOhm)
Av=RC/re #voltage gain
Vout=Av*V1/1000 #output voltage(V)
RTH=2*RC #Thevenin resistance(Ohm)
VL=(RL/(RL+RTH))*Vout #load voltage(V)
print 'Load voltage VL = ',VL,'V'
RL=15.0 #load resistance as per previous example(Ohm)
VL=3 #load voltage as per previous example(V)
iL=VL/RL #load current(mA)
print 'Load current iL = ',iL,'mA'