format shortEng
% CONSTANTS
VT = 26e-3
VT =
26.0000e-003
% VOLTAGE
vcc = 12
vcc =
12.0000e+000
% FROM DATASHEET
% Find them in your datasheet and change
beta = 100
beta =
100.0000e+000
hfe = 110
hfe =
110.0000e+000
hre = 1.8e-4
hre =
180.0000e-006
hoe = 15.6
hoe =
15.6000e+000
% DESIGN PARAMETERS
RB = 220e3
RB =
220.0000e+003
RE = 2.2e3
RE =
2.2000e+003
alpha = beta/(beta+1)
alpha =
990.0990e-003
IB = (vcc - 0.7)/(RB + (beta+1)*RE)
IB =
25.5540e-006
IC = (beta+1)*IB
IC =
2.5810e-003
gm = IC/VT
gm =
99.2676e-003
re = alpha/gm
re =
9.9740e+000
rpi = beta/gm
rpi =
1.0074e+003
rmu = rpi/hre
rmu =
5.5965e+006
% ro = (hoe - hfe/rmu)^-1
% It should be like that but it seems our datasheet is misleading.
% Therefore, we will discard that formula and cheat from LTSPICE indeed.
% You may uncommnet that formula and remove the below line if your datasheet is correct.
% Or if yours is wrong too, cheat from LTSPICE and edit the below line
ro = 3.9e4 %% from LTSPICE OP log
ro =
39.0000e+003
Rout = parallels([RE, ro, re])
Rout =
9.9265e+000
Rin = parallels([RB, (beta+1)*(re + parallels([RE, ro]))])
Rin =
107.7921e+003
absGain = parallels([RE, ro])/(re + parallels([RE, ro]))
absGain =
995.2334e-003
function res = parallel(R1, R2)
res = (R1^-1 + R2^-1)^-1;
end
function res = parallels(arr)
res = (sum(arr.^-1))^-1;
end