summaryrefslogtreecommitdiff
path: root/3754/CH24/EX24.2/24_2.sce
blob: 5eab675f84ee4c02b8995d954636977126e3fcb1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
clear//

//Variables

Ri = 2.5                         //Input resistance (in kilo-ohm)
Av = 200.0                       //Voltage gain
Vs = 5.0 * 10**-3                //Input signal voltage (in volts)
beta = 50.0                      //Common emitter current gain

//Calculation

IB = Vs / Ri                     //Base current (in milli-Ampere)   
IC = beta * IB                   //Collector current (in milli-Ampere)
Ai = beta                        //Current gain
Ap = Ai * Av                     //Power gain
Gp = 10 * log10(Ap)              //dB power gain (in decibel)

//Result

printf("\n The base current is  %0.3f  mA.\nThe collector current is  %0.3f  mA.\nThe power gain is  %0.3f .\nThe dB power gain is  %0.3f  dB.",IB,IC,Ap,Gp)