You are on page 1of 74

Scilab Textbook Companion for

A Textbook Of Electronic Devices And


Circuits
by S. Prakash And S. Rawat1
Created by
Arshad Khan
B.Tech
Computer Engineering
Uttarakhand Tech. University
College Teacher
NA
Cross-Checked by
Mukul R. Kulkarni
August 5, 2014

1 Funded

by a grant from the National Mission on Education through ICT,


http://spoken-tutorial.org/NMEICT-Intro. This Textbook Companion and Scilab
codes written in it can be downloaded from the Textbook Companion Project
section at the website http://scilab.in

Book Description
Title: A Textbook Of Electronic Devices And Circuits
Author: S. Prakash And S. Rawat
Publisher: Anand Publications, New Delhi
Edition: 3
Year: 2012
ISBN: 978-93-80225-48-7

Scilab numbering policy used in this document and the relation to the
above book.
Exa Example (Solved example)
Eqn Equation (Particular equation of the above book)
AP Appendix to Example(Scilab Code that is an Appednix to a particular
Example of the above book)
For example, Exa 3.51 means solved example 3.51 of this book. Sec 2.3 means
a scilab code whose theory is explained in Section 2.3 of the book.

Contents
List of Scilab Codes

1 Special Diodes

2 Bipolar Junction Transistors

18

3 Transistor Amplifiers

30

4 Frequency Response

40

5 Feed Back

42

6 Field Effect Transistors and MOSFETS

52

7 Magnetic Materials

58

8 Oscillators

62

9 Unijunction Transistor

71

11 Multivibrators

73

List of Scilab Codes


Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa

1.1
1.2
1.3
1.4
1.5
1.6
1.7
1.8
1.9
1.10
1.11
1.12
1.13
1.14
1.15
2.1
2.2
2.3
2.4
2.5
2.6
2.7
2.9
2.10
2.11
2.12
2.13
2.14

Reverse saturation current . . . . . . . . . . . . . . . .


Value of forward voltage . . . . . . . . . . . . . . . . .
DC current DC voltage Ripple factor . . . . . . . . . .
Average dc current rms current rectification efficieny PIV
Minimum value of resistance . . . . . . . . . . . . . .
Value of series Resistor . . . . . . . . . . . . . . . . .
Current limiting resistance and dissipated power . . .
Maximum and minimum input supply voltage . . . . .
Output voltage voltage drop and current in zener diode
Maximum and Minimum LED current . . . . . . . . .
Frequency range of tuning circuit . . . . . . . . . . . .
Diode Capacitance . . . . . . . . . . . . . . . . . . . .
Photocurrent . . . . . . . . . . . . . . . . . . . . . . .
Responsivity of InGaAs photodiode . . . . . . . . . .
Equilibrium contact potential . . . . . . . . . . . . . .
Current amplification factors . . . . . . . . . . . . . .
Value of IE . . . . . . . . . . . . . . . . . . . . . . . .
Change in collector current . . . . . . . . . . . . . . .
Input current in CE and CB configuration . . . . . . .
Current gain and base current . . . . . . . . . . . . .
Input resistance of transistor . . . . . . . . . . . . . .
Dynamic input resistance . . . . . . . . . . . . . . . .
Current gain input resistance and voltage gain . . . .
Collector emitter saturation voltage . . . . . . . . . .
Relative size of collector junction . . . . . . . . . . . .
DC load line and operating point . . . . . . . . . . . .
RB and new value of IC . . . . . . . . . . . . . . . . .
Set the operating point . . . . . . . . . . . . . . . . .
4

7
8
8
9
10
10
11
12
12
13
14
15
15
16
16
18
18
19
19
20
20
21
21
22
23
23
24
25

Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa

2.15
2.16
2.17
2.18
2.19
3.1
3.2
3.3
3.4
3.5
3.6
3.7
3.8
3.9
3.10
3.11
3.12
3.13
3.14
4.1
4.2
5.1
5.2
5.3
5.4
5.5
5.6
5.7
5.8
5.9
5.10
5.11
5.12
5.13
6.1
6.2

Exa 6.5

Value of IC . . . . . . . . . . . . . . . . . . . . . . . .
Operating point and stability factor . . . . . . . . . .
IC and VCE . . . . . . . . . . . . . . . . . . . . . . .
Region of Q point . . . . . . . . . . . . . . . . . . . .
Voltage across RE . . . . . . . . . . . . . . . . . . . .
Gain Impedence and ac load . . . . . . . . . . . . . .
Gain input and output impedence . . . . . . . . . . .
Input Output impedence and output voltage . . . . .
Net voltage gain in dB . . . . . . . . . . . . . . . . . .
Bandwidth and cut off frequencies . . . . . . . . . . .
Overall voltage gain . . . . . . . . . . . . . . . . . . .
Couopling capacitor . . . . . . . . . . . . . . . . . . .
Voltage gain . . . . . . . . . . . . . . . . . . . . . . .
Inductance of primary and secondary . . . . . . . . . .
Turn ratio of transformer . . . . . . . . . . . . . . . .
Collector efficieny and power rating . . . . . . . . . .
Power and effiiency . . . . . . . . . . . . . . . . . . . .
Maximum ac power output . . . . . . . . . . . . . . .
Maximum permissible power dissipation . . . . . . . .
3dB Frequeny . . . . . . . . . . . . . . . . . . . . . . .
Upper 3dB Frequency . . . . . . . . . . . . . . . . . .
Percentage of output which is fed back . . . . . . . . .
Voltage gain and reduction in voltage . . . . . . . . .
Gain with feedback factor and feedback voltage . . . .
Bandwidth with negative feedback . . . . . . . . . . .
Fraction of output fed back . . . . . . . . . . . . . . .
Small Change in gain . . . . . . . . . . . . . . . . . .
New gain distortion and input voltage . . . . . . . . .
Feedback rction voltage and impedence . . . . . . . .
Voltage gain input and output resistance . . . . . . . .
Gain wih feedbck in dB . . . . . . . . . . . . . . . . .
Bandwidth after feedback . . . . . . . . . . . . . . . .
Gain and new bandwidth . . . . . . . . . . . . . . . .
Input resistance and voltage gain . . . . . . . . . . . .
Value of Transconductance . . . . . . . . . . . . . . .
AC drain resistance transconductance and amplification
factor . . . . . . . . . . . . . . . . . . . . . . . . . . .
Voltage Amplification . . . . . . . . . . . . . . . . . .
5

26
26
27
28
29
30
31
32
33
33
34
34
35
35
36
36
37
38
38
40
40
42
42
43
44
45
45
46
47
48
48
49
49
50
52
52
53

Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa

6.6
6.7
6.8
6.10
6.11
7.1
7.2
7.3
7.4
7.5
7.6
8.m.1
8.m.2
8.m.3
8.m.4
8.m.5
8.1
8.2
8.3
8.4
8.5
8.6
8.7
8.8
8.9
8.10
9.1
9.2
9.3
11.1

Output voltage of amplifier . . . . . . . . . . . .


IDQ VGSQ VD VS VDS VDG . . . . . . . . . .
Pinch off voltage . . . . . . . . . . . . . . . . . .
Plot gm VS IDSS . . . . . . . . . . . . . . . . .
Channel width W . . . . . . . . . . . . . . . . .
Horizontal component of magnetic Intensity . . .
Current through solenoid . . . . . . . . . . . . .
Magnetic moment of rod . . . . . . . . . . . . . .
Flux density magnetic intensity and permeability
Relative Permeability . . . . . . . . . . . . . . .
Magnetising Force and material magnetisation .
Value of L1 . . . . . . . . . . . . . . . . . . . . .
Value of C and hfe . . . . . . . . . . . . . . . . .
Value of Capacitor . . . . . . . . . . . . . . . . .
Various parameter of colpitt oscillator . . . . . .
Resonant frequencies and Q factor . . . . . . . .
feed bck factor . . . . . . . . . . . . . . . . . . .
Range of variable capacitor . . . . . . . . . . . .
C2 of colpitt oscilator . . . . . . . . . . . . . . .
Frequency of oscillation . . . . . . . . . . . . . .
Amplifier voltage gain . . . . . . . . . . . . . . .
Frequency of oscillation and min current gain . .
Resistnce to cover frequency range . . . . . . . .
Resonant Frequency . . . . . . . . . . . . . . . .
Resonant Frequency . . . . . . . . . . . . . . . .
Parallel and series resonant frequencies . . . . . .
Stand off voltage and peak point Voltage . . . .
Time period of sawtooth waveform . . . . . . . .
Resistances RB1 and RB2 . . . . . . . . . . . . .
Frequency of Oscillators . . . . . . . . . . . . . .

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

54
54
56
56
57
58
58
59
59
60
61
62
62
63
63
64
65
65
66
66
67
67
68
69
69
70
71
71
72
73

Chapter 1
Special Diodes

Scilab code Exa 1.1 Reverse saturation current


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17

// Exa 1 . 1
clc ;
clear ;
close ;
// Given d a t a
I =40; // i n mA
V =0.25; // i n V o l t
T =20; // i n d e g r e e C
T = T +273; // i n K e l v i n
ETA =1; // For Ge
e =1.6*10^ -19; // i n Coulamb ( e l e c t r o n i c c h a r g e )
k =1.38*10^ -23; // i n J /K( Boltzman C o n s t a n t )
// Formula : I=I o ( exp ( %eV/ (ETA k T) ) 1)
y =( e * V /( ETA * k * T ) ) ; // Assumed
y = round ( y ) ;
Io = I *10^ -3/( exp ( y ) -1) ; // i n mA
disp ( Io *10^6 , R e v e r s e s a t u r a t i o n c u r r e n t i n m i c r o
Ampere : ) ;

Scilab code Exa 1.2 Value of forward voltage


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15

// Exa 1 . 2
clc ;
clear ;
close ;
// Given d a t a
Io =10; // i n uA
I =1; // i n Ampere
ETA =2; // For S i
T =27; // i n d e g r e e C
T = T +273; // i n K e l v i n
e =1.6*10^ -19; // i n Coulamb ( e l e c t r o n i c c h a r g e )
k =1.38*10^ -23; // i n J /K( Boltzman C o n s t a n t )
// Formula : I=I o ( exp ( %eV/ (ETA k T) ) 1)
V =( ETA * k * T / e ) * log ( I /( Io *10^ -6) +1) ; // i n V o l t
disp (V , Forward V o l t a g e a c r o s s t h e d i o d e i n V o l t : )
;

Scilab code Exa 1.3 DC current DC voltage Ripple factor


1
2
3
4
5
6
7
8
9
10
11
12
13
14

// Exa 1 . 3
clc ;
clear ;
close ;
// Given d a t a
RL =1; // i n kOhm
// r f <<RL
Vrms =200; // i n V o l t
// P a r t ( i )
Vo = Vrms * sqrt (2) ; // i n V o l t
Idc = Vo /( RL *10^3* %pi ) ; // i n Ampere
disp ( round ( Idc *10^3) ,DC c u r r e n t i n l o a d i n mA : ) ;
// P a r t ( i i )
Vdc = RL *10^3* Idc ; // i n V o l t
8

15
16
17
18
19
20
21
22

disp ( round ( Vdc ) ,DC v o l t a g e a c r o s s l o a d i n v o l t : ) ;


// P a r t ( i i i )
//Gamma=s q r t ( ( I r m s / I d c ) 2 1)=s q r t ( ( I o / 2 ) / ( I o / %pi ) 1)
=s q r t ( ( %pi / 2 ) 2 1)
Gamma = sqrt (( %pi /2) ^2 -1) ; // u n i t l e s s
disp ( Gamma , R i p p l e f a c t o r : ) ;
// P a r t ( i v )
PIV = Vrms * sqrt (2) ; // i n v o l t
disp ( PIV , Peak I n v e r s e V o l t a g e i n v o l t : ) ;

Scilab code Exa 1.4 Average dc current rms current rectification efficieny
PIV
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21

// Exa 1 . 4
clc ;
clear ;
close ;
// Given d a t a
rf =20; // i n ohm
RL =980; // i n Ohm
Vrms =50; // i n V o l t
Vo = Vrms * sqrt (2) ; // i n V o l t
Io = Vo /( RL + rf ) ; // i n Ampere
// P a r t ( i )
Idc =2* Io / %pi ; // i n Ampere
disp ( round ( Idc *10^3) , A v e r a g e DC c u r r e n t i n mA : ) ;
// P a r t ( i i )
Irms = Io / sqrt (2) ; // i n Ampere
disp ( Irms *1000 , rms v a l u e o f l o a d c u r r e n t i n mA : )
// P a r t ( i i i )
Vdc = RL * Idc ; // i n V o l t
disp ( Vdc , DC o u t p u t v o l t a g e i n v o l t : ) ;
// P a r t ( i v )
ETA =( Idc ^2* RL /( Irms ^2*( RL + rf ) ) ) *100; // R e c t i f i c a t i o n
Efficiency in %
9

disp ( R e c t i f i c a t i o n E f f i c i e n c y i s + string ( ETA ) + %


)
23 // P a r t ( v )
24 PIV =2* Vo ; // i n v o l t
25 disp ( PIV , Peak I n v e r s e V o l t a g e i n v o l t : ) ;

22

Scilab code Exa 1.5 Minimum value of resistance


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15

// Exa 1 . 5
clc ;
clear ;
close ;
// Given d a t a
Vin =40; // i n v o l t
VZ =10; // i n v o l t
Vo =10; // i n v o l t
IZmax =50; // i n mA
IL =0; // i n mA
// Formula : I=IZ+IL=IZmax+0
I = IZmax +0; // i n mA
// Formula : VZ=VinR I
Rmin =( Vin - VZ ) /( I *10^ -3) ; // i n Ohm
disp ( Rmin , Minimum v a l u e o f r e s i s t a n c e i n Ohm : ) ;

Scilab code Exa 1.6 Value of series Resistor


1 // Exa 1 . 6
2 clc ;
3 clear ;
4 close ;
5 // Given d a t a
6 Vmin =15; // Minimum i n p u t v o l t a g e i n v o l t
7 VZ =6.8; // V o l t a g e a c r o s s z e n e r i n v o l t

10

8 Vo = VZ ; // o u t p u t v o l t a g e i n v o l t
9 Vsr1 = Vmin - Vo ; // V o l t a g e a r o s s s e r i e s
10
11
12
13
14
15
16
17
18
19
20
21
22

r e s i s t a n c e in
volt
disp ( I f R i s t h e s e r i e s e s i s t a n c e , T o t a l c u r r e n t i n
s e r i e s r e s i s t a n c e i n Ampere : I=Vsr /R=8.2/R ) ;
ILmin =5; // i n mA
disp ( c u r r e n t i n z e n e r d i o d e i n Ampere : IZ=IIL
= ( 8 . 2 /RIL 10 3)
eqn ( 1 ) ) ;
Vmax =20; //mximum o u t p u t v o l t a g e
Vo = VZ ; // o u t p u t v o l t a g e i n v o l t
Vsr2 = Vmax - Vo ; // V o l t a g e a r o s s s e r i e s r e s i s t a n c e i n
volt
disp ( C u r r e n t i n s e r i e s r e s i s t a n c e c i r c u i t i n Ampere
: I=Vsr /R ) ;
ILmax =15; // i n mA
disp ( c u r r e n t i n z e n e r d i o d e i n Ampere : IZ=IIL =(Rs /
RIL 10 3)
eqn ( 2 ) )
disp ( For Z e n e r d i o d e t o work a s v o l t a g e r e g u l a t o r
, ( 1 ) and ( 2 ) must be same . ) ;
disp ( ( 8 . 2 / RIL 10 3) = ( 1 3 . 2 /RIL 10 3) )
R =( Vsr2 - Vsr1 ) /( ILmax *10^ -3 - ILmin *10^ -3) ; // i n Ohm
disp (R , R e q u i r e d v a l u e o f S e r i e s R e s i s t o r i n ohm :
);

Scilab code Exa 1.7 Current limiting resistance and dissipated power
1
2
3
4
5
6
7
8
9

// Exa 1 . 7
clc ;
clear ;
close ;
// Given d a t a
Vin =18; // i n v o l t
IZ =20; // i n mA
ILav =(5+35) /2; // i n mA
VZ =12; // i n v o l t
11

10
11
12
13
14
15

Vo =12; // i n v o l t
I = IZ + ILav ; // i n mA
R =( Vin - Vo ) /( I *10^ -3) ; // i n Ohm
disp (R , C u r r e n t l i m i t i n g r e s i s t a n c e i n Ohm : ) ;
P =( I *10^ -3) ^2* R ; // i n Watts
disp (P , Power d i s s p a t i o n i n r e s i s t a n c e i n Watt : ) ;

Scilab code Exa 1.8 Maximum and minimum input supply voltage
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18

// Exa 1 . 8
clc ;
clear ;
close ;
// Given d a t a
R =1; // i n kOhm
RL =5; // i n kOhm
VZ =10; // i n v o l t
Vo =10; // i n v o l t
P =250; // i n mW
IL = Vo / RL ; // i n mA
IZmin =0; // i n mA
IZmax = P / VZ ; // i n mA
Imin = IZmin + IL ; // i n mA
Imax = IZmax + IL ; // i n mA
Vin_min = VZ + Imin *10^ -3* R *10^3; // i n v o l t
Vin_max = VZ + Imax *10^ -3* R *10^3; // i n v o l t
disp ( The i n p u t v o l t a g e r a n g e s from + string ( Vin_min
) + V t o + string ( Vin_max ) + V ) ;

Scilab code Exa 1.9 Output voltage voltage drop and current in zener
diode
1

// Exa 1 . 9
12

2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24

clc ;
clear ;
close ;
// Given d a t a
R =5; // i n kOhm
R = R *1000; // i n Ohm
RL =10; // i n kOhm
RL = RL *1000; // i n Ohm
Vin =120; // i n V o l t
VZ =50; // i n V o l t
// P a r t ( i )
Vo = VZ ; // i n V o l t
disp ( Vo , Output v o l t a g e i n v o l t : ) ;
// P a r t ( i i )
VR = Vin - VZ ; // i n V o l t
disp ( VR , V o l t a g e d r o p a c r o s s s e r i e s r e s i s t a n c e i n
v o l t : );
// P a r t ( i i i )
IL = Vo / RL ; // i n Ampere
disp ( IL *1000 , Load C u r r e n t i n mA : ) ;
I = VR / R ; // i n Ampere
disp ( I *1000 , C u r r e n t t h r o u g h r e s i s t a n c e R i n mA : ) ;
IZ =I - IL ; // i n Ampere
disp ( IZ *1000 , Load C u r r e n t i n mA : ) ;

Scilab code Exa 1.10 Maximum and Minimum LED current


1 // Exa 1 . 1 0
2 clc ;
3 clear ;
4 close ;
5 // Given d a t a
6 VDmin =1.5; // i n V o l t
7 VDmax =2.3; // i n V o l t
8 VS =5; // i n V o l t

13

9 RS =270; // i n Ohm
10 Imin =( VS - VDmax ) / RS ; // i n Ampere
11 disp ( Imin *1000 , Minimum v a l u e o f LED c u r r e n t i n mA :
12
13

);
Imax =( VS - VDmin ) / RS ; // i n Ampere
disp ( round ( Imax *1000) ,Maximum v a l u e o f LED c u r r e n t
i n mA : ) ;

Scilab code Exa 1.11 Frequency range of tuning circuit


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25

// Exa 1 . 1 1
clc ;
clear ;
close ;
// Given d a t a
format ( v ,6) ;
C1min =10; // i n pF
C2max =50; // i n pF
L =5; // i n mH
L = L *10^ -3; // i n H
// Formula : CT=C1C2 / ( C1+C2 )
// Minimum
C1 =10; // i n pF
C2 =10; // i n pF
CTmin = C1 * C2 /( C1 + C2 ) ; // i n pF
CTmin = CTmin *10^ -12; // i n F
//Maximum
C1 =50; // i n pF
C2 =50; // i n pF
CTmax = C1 * C2 /( C1 + C2 ) ; // i n pF
CTmax = CTmax *10^ -12; // i n F
// Formula : f =1/(2 %pi s q r t ( LC) )
//maximum :
fmax =1/(2* %pi * sqrt ( L * CTmin ) ) ;
// minimum :
14

26
27

fmin =1/(2* %pi * sqrt ( L * CTmax ) ) ;


disp ( The f r e q u e n c y o f t u n i n g c i r c u i t r a n g e s from +
string ( fmin /10^6) + MHz t o + string ( fmax /10^6) +
MHz . ) ;
28 // Note : Answer i n t h e book i s wrong .

Scilab code Exa 1.12 Diode Capacitance


1
2
3
4
5
6
7
8
9
10
11
12
13

// Exa 1 . 1 2
clc ;
clear ;
close ;
// Given d a t a
format ( v ,6) ;
C1 =21; // i n pF
V1 =4; // i n v o l t
V2 =9; // i n v o l t
disp ( C i s p r o p o r t i o n a l t o 1/ s q r t (V) ) ;
disp ( So , C2/C1=s q r t ( V1/V2 ) ) ;
C2 = sqrt ( V1 / V2 ) * C1 ; // i n pF
disp ( C2 , At r e v e r s e b i a s 9V, Diode c a p a c i t a n c e i n pF
: );

Scilab code Exa 1.13 Photocurrent


1 // Exa 1 . 1 3
2 clc ;
3 clear ;
4 close ;
5 // Given d a t a
6 format ( v ,6) ;
7 R =0.90; // i n A/W
8 Pop =1; // i n mW

15

9 // P a r t ( i )
10 IP = R * Pop ; // i n mA
11 disp ( IP , Power o f

i n c i d e n t l i g h t 1mW, P h o t o c u r r e n t

i n mA i s : ) ;
// P a r t ( i i )
disp ( Here IP i s n o t p r o p o r t i o n a l t o Pop ( f o r Pop >1.5
mW) ) ;
14 disp ( Hence P h o t o u r r e n t can n o t be c a l c u l a t e d . ) ;
12
13

Scilab code Exa 1.14 Responsivity of InGaAs photodiode


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16

// Exa 1 . 1 4
clc ;
clear ;
close ;
// Given d a t a
format ( v ,7) ;
ETA =70; // i n %
Eg =0.75; // i n eV
Eg = Eg *1.6*10^ -19; // i n J o u l e
h =6.63*10^ -34; // P l a n k s c o n s t a n t i n Js
c =3*10^8; // s p e e d o f l i g h t i n m/ s
e =1.6*10^ -19; // i n coulamb
lambda = h * c / Eg ; // i n m e t e r
disp ( lambda *10^9 , Wavelength i n nm : ) ;
R =( ETA /100) * e * lambda /( h * c ) ; // i n A/W
disp (R , R e s p o n s i v i t y o f InGaAs p h o t o d i o d e i n A/W :
);

Scilab code Exa 1.15 Equilibrium contact potential


1 // Exa 1 . 1 5
2 clc ;

16

3 clear ;
4 close ;
5 // Given d a t a
6 W1 =2.5; // i n eV
7 W2 =1.9; // i n eV
8 ContactPotential = W1 - W2 ; // i n V o l t
9 disp ( ContactPotential , C o n t a c t p o t e n t i a l

);

17

in Volts :

Chapter 2
Bipolar Junction Transistors

Scilab code Exa 2.1 Current amplification factors


1 // Exa 2 . 1
2 clc ;
3 clear ;
4 close ;
5 // Given d a t a
6 deltaIB =50; // i n uA
7 deltaIC =1; // i n mA
8 deltaIC = deltaIC *10^3; // i n uA
9 Beta = deltaIC / deltaIB ; // u n i t l e s s
10 disp ( Beta , C u r r e n t A m p l i f i c a t i o n F a c t o r , Beta : ) ;
11 Alfa = Beta /(1+ Beta ) ; // u n i t t l e s s
12 disp ( C u r r e n t A m p l i f i c a t i o n F a c t o r , A l f a : + string (

Alfa ) + o r 2 0 / 2 1 ) ;

Scilab code Exa 2.2 Value of IE


1 // Exa 2 . 2
2 clc ;

18

3 clear ;
4 close ;
5 // Given d a t a
6 IB =25; // i n uA
7 Beta =40; // u n i t l e s s
8 IC = Beta * IB ; // i n uA
9 IE = IB + IC ; // i n uA
10 disp ( The v a l u e o f IE : + string ( IE ) + m i c r o Ampere )

Scilab code Exa 2.3 Change in collector current


1 // Exa 2 . 3
2 clc ;
3 clear ;
4 close ;
5 // Given d a t a
6 alfa =0.98; // u n i t l e s s
7 deltaIB =0.2; // i n mA
8 Beta = alfa /(1 - alfa ) ; // u n i t l e s s
9 deltaIC = Beta * deltaIB ; // i n mA
10 disp ( Change i n c o l l e c t o r c u r e n t

: + string ( deltaIC )

+ m i l l i Ampere . ) ;

Scilab code Exa 2.4 Input current in CE and CB configuration


1 // Exa 2 . 4
2 clc ;
3 clear ;
4 close ;
5 // Given d a t a
6 Beta =45; // u n i t l e s s
7 RL =1; // i n kOhm

19

8 deltaVCE =1; // i n v o l t
9 disp ( P a r t ( i ) : CE c o n i g u r a t i o n ) ;
10 IC = deltaVCE /( RL *1000) ; // i n Ampere
11 // Formula : Beta=d e l t a I C / d e l t a I B
12 IB = IC / Beta ; // i n Ampere
13 disp ( I n p u t Base C u r r e n t , IB i n mA : + string ( IB

*10^3) ) ;
14 disp ( P a r t ( i i ) : CB c o n i g u r a t i o n ) ;
15 IC = deltaVCE /( RL *1000) ; // i n Ampere
16 // Formula : Beta=d e l t a I C / d e l t a I B
17 IE = IB + IC ; // i n Ampere
18 disp ( I n p u t E m i t t e r C u r r e n t , IE i n mA : + string ( IE

*10^3) ) ;

Scilab code Exa 2.5 Current gain and base current


1
2
3
4
5
6
7
8
9
10
11
12
13
14

// Exa 2 . 5
clc ;
clear ;
close ;
// Given d a t a
Ileakage =12.5; // i n uA
ICBO =12.5; // i n uA
IE =2; // i n mA
IC =1.97; // i n mA
// Formula : IC= a l f a IE+ICBO
alfa =( IC - ICBO /10^3) / IE ; // u n i t l e s s
disp ( alfa , C u r r e n t Gain : ) ;
IB = IE - IC ; // i n mA
disp ( IB , Base c u r r e n t i n mA : ) ;

Scilab code Exa 2.6 Input resistance of transistor


20

1 // Exa 2 . 6
2 clc ;
3 clear ;
4 close ;
5 // Given d a t a
6 deltaVBE =200; // i n mVolt
7 deltaIB =100; // i n uA
8 ri = deltaVBE *10^ -3/( deltaIB *10^ -6) ; // i n Ohm
9 disp ( ri /1000 , I n p u t r e s i s t a n e o f t r a n s i s t o r

i n kohm

: );

Scilab code Exa 2.7 Dynamic input resistance


1 // Exa 2 . 7
2 clc ;
3 clear ;
4 close ;
5 // Given d a t a
6 deltaVEB =200; // i n mVolt
7 deltaIE =5; // i n mA
8 ri = deltaVEB *10^ -3/( deltaIE *10^ -3) ; // i n Ohm
9 disp ( ri , I n p u t r e s i s t a n e o f t r a n s i s t o r i n Ohm : ) ;

Scilab code Exa 2.9 Current gain input resistance and voltage gain
1 // Exa 2 . 9
2 clc ;
3 clear ;
4 close ;
5 // Given d a t a
6 format ( v ,10) ;
7 Ri =500; // i n Ohm
8 RL =1; // i n kOhm

21

9
10
11
12
13
14
15
16
17
18
19
20
21

hie =1; // i n kOhm


hre =2*10^ -4; // u n i t l e s s
hfe =50; // u n i t l e s s
hoe =25; // m i c r o mho
// P a r t ( a ) :
Ai = - hfe /(1+ hoe *10^ -6* RL *10^3) ; // u n i t l e s s
disp ( Ai , C u r r e n t Gain : ) ;
// P a r t ( b ) :
Rin = hie *10^3 -( hre * hfe /( hoe *10^ -6+1/ RL *10^3) ) ; // i n
Ohm
disp ( Rin , I n p u t R e s i s t a n c e i n Ohm : ) ;
// P a r t ( c ) :
Av = Ai * RL *10^3/ Ri ; // u n i t l e s s
disp ( Av , V o l t a g e Gain : ) ;

Scilab code Exa 2.10 Collector emitter saturation voltage


// Exa 2 . 1 0
clc ;
clear ;
close ;
// Given d a t a
alfaF =0.99; // u n i t l e s s
alfaR =0.20; // u n i t l e s s
IC =1; // i n mA
IB =50; // i n m i c r o Ampere
T =300; // i n k e l v i n
k =1.38*10^ -23; // Boltzman c o n s t a n t
e =1.6*10^ -19; // i n cooulamb
Vth = k * T / e ; // i n V o l t
VCEsat = Vth * log ((( IC *10^ -3*(1 - alfaR ) + IB *10^ -6) * alfaF )
/(( alfaF * IB *10^ -6 -(1 - alfaF ) * IC *10^ -3) * alfaR ) ) ; //
in volt
15 disp ( VCEsat , C o l l e c t o r E m i t t e r s a t u r a t i o n v o l t a g e i n
v o l t : );

1
2
3
4
5
6
7
8
9
10
11
12
13
14

22

Scilab code Exa 2.11 Relative size of collector junction


1 // Exa 2 . 1 1
2 clc ;
3 clear ;
4 close ;
5 // Given d a t a
6 IES =10^ -14; // i n A
7 alfaF =1; // u n i t l e s s
8 alfaR =0.1; // u n i t l e s s
9 // Formula : a l f a F IES=a l f a R ICS
10 ICS =( alfaF / alfaR ) * IES ; // i n Ampere
11 disp ( ICS , C o l l e c t o r b a s e j u n c t i o n s a t u r a t i o n
12
13
14
15

i n Ampere : ) ;
RelativeSize = ICS / IES ; // u n i t l e s s
disp ( C o l l e c t o r i s + string ( RelativeSize ) + t i m e s
l a r g e r i n s i z e than e m i t t e r . );
BetaR = alfaR /(1 - alfaR ) ; // u n i t l e s s
disp ( BetaR , V a l u e o f BetaR : ) ;

Scilab code Exa 2.12 DC load line and operating point


1
2
3
4
5
6
7
8
9

current

// Exa 2 . 1 2
clc ;
clear ;
close ;
// Given d a t a
Beta =100; // u n i t l e s s
VCC =6; // i n v o l t
RB =530; // i n kOhm
RC =2; // i n kOhm
23

10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26

VBE =0.7; // i n v o l t ( For S i )


// P a r t ( i )
IC1 =0; // i n A
VCE1 = VCC - IC1 * RC ; // i n v o l t
// I f VCE=0;// i n v o l t
VCE2 =0; // i n v o l t
IC2 = VCC / RC ; // i n Ampere
title ( DC l o a d l i n e ) ;
xlabel ( VCE( i n v o l t s ) ) ;
ylabel ( IC ( i n mA) ) ;
plot ([ VCE1 , IC1 ] ,[ VCE2 , IC2 ]) ; //DC l o a d l i n e
// Formula : VCC=VBE+IB RB
IB =( VCC - VBE ) /( RB *10^3) ; // i n Ampere
IC = Beta * IB ; // i n Ampere
VCE = VCC - IC * RC *10^3; // i n v o l t
disp ( Q p o i n t c o o r d i n a t e s a r e : ) ;
disp ( IC= + string ( IC *10^3) + mA and VCE= + string ( VCE
)+ Volt . );

Scilab code Exa 2.13 RB and new value of IC


1
2
3
4
5
6
7
8
9
10
11
12
13
14

// Exa 2 . 1 3
clc ;
clear ;
close ;
// Given d a t a
Beta =100; // u n i t l e s s
IC =1; // i n mA
VCC =12; // i n v o l t
VBE =0.3; // i n v o l t ( For Ge )
// P r t ( i )
IB = IC / Beta ; // i n mA
// Formula : VCC=VBE+IB RB
RB =( VCC - VBE ) /( IB *10^ -3) ; // i n Ampere
disp ( RB /10^3 , R e s i s t a n c e RB i n kOhm : ) ;
24

15 // p a r t ( i i )
16 Beta =50; // u n i t l e s s
17 IB =( VCC - VBE ) / RB ; // i n Ampere
18 IC = Beta * IB ; // i n Ampere
19 disp ( IC *10^3 , Z e r o s i g n a l IC i n mA: ) ;

Scilab code Exa 2.14 Set the operating point


1 // Exa 2 . 1 4
2 clc ;
3 clear ;
4 close ;
5 // Given d a t a :
6 format ( v ,10) ;
7 disp ( To s e t t h e r e q u i r e d
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23

operating point , value of

RB w i l l be f i n d o u t . )
IC =1; // i n mA
VCE =8; // i n v o l t
Beta =100; // u n i t l e s s
VCC =12; // i n v o l t
VBE =0.3; // i n v o l t ( For Ge )
// P r t ( i )
RC =( VCC - VCE ) /( IC *10^ -3) ; // i n ohm
IB = IC / Beta ; // i n mA
RB =( VCC - VBE - Beta *( IB *10^ -3) * RC ) /( IB *10^ -3) ; // i n Ohm
disp ( RB /1000 , V a l u e o f RB i n kOhm ) ;
// P a r t ( i i )
Beta =50; // u n i t l e s s
IB =( VCC - VBE ) /( RB + Beta * RC ) ; // i n mA
IC = Beta * IB ; // i n Ampere
VCE = VCC - IC * RC ; // i n v o l t
disp ( New o p e r a t i n g p o i n t i s ( + string ( VCE ) + V, +
string ( IC *10^3) + mA) ) ;

25

Scilab code Exa 2.15 Value of IC


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18

// Exa 2 . 1 5
clc ;
clear ;
close ;
// Given d a t a :
R1 =50; // i n kohm
R2 =10; // i n kohm
RE =1; // i n kohm
VCC =12; // i n v o l t
// P r t ( i )
VBE =0.1; // i n v o l t
VBBdash =( R2 /( R1 + R2 ) ) * VCC ; // i n v o l t
IC1 =( VBBdash - VBE ) /( RE *1000) ; // i n mA
disp ( IC1 *1000 , At VBE=0.1V, V a l u e o f IC i n mA : ) ;
// P a r t ( i i )
VBE =0.3; // i n v o l t
IC2 =( VBBdash - VBE ) /( RE *1000) ; // i n mA
disp ( IC2 *1000 , At VBE=0.3V, V a l u e o f IC i n mA : ) ;

Scilab code Exa 2.16 Operating point and stability factor


1
2
3
4
5
6
7
8
9

// Exa 2 . 1 6
clc ;
clear ;
close ;
// Given d a t a :
R1 =10; // i n kohm
R2 =5; // i n kohm
RE =2; // i n kohm
RC =1; // i n kohm
26

10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26

VCC =12; // i n v o l t
Beta =100; // u n i t l e s s
VBE =0.7; // i n v o l t
// P a r t ( i )
// Formula : VBE=VBBdashIB RBdashIE RE
disp ( IB i s v e r s m a l l : VBE=VBBdashIE RE ) ;
VBBdash =( R2 /( R1 + R2 ) ) * VCC ; // i n v o l t
IE =( VBBdash - VBE ) /( RE *10^3) ; // i n Ampere
disp ( As b a s e c u r r e n t i s v e r y s m a l l IC=IE ) ;
IC = IE ; // i n mA
// Formul : VCC=IC RC+VCE+IE RE
VCE = VCC - IC * RC *10^3 - IE * RE *10^3; // i n V o l t
disp ( O p e r a t i n g p o i n t i s ( + string ( VCE ) + V, + string (
IC *10^3) + mA) ) ;
// P a r t ( i i )
RBdash =( R1 * R2 /( R1 + R2 ) ) ; // i n kOhm
S =( Beta +1) /(1+ Beta *( RE /( RBdash + RE ) ) ) ;
disp ( S t a i l i t y f a c t o r S i s : + string ( S ) ) ;

Scilab code Exa 2.17 IC and VCE


1
2
3
4
5
6
7
8
9
10
11
12
13
14

// Exa 2 . 1 7
clc ;
clear ;
close ;
// Given d a t a :
R1 =200; // i n kohm
R2 =100; // i n kohm
RE =1; // i n kohm
RC =1; // i n kohm
VCC =9; // i n v o l t
he =2; // i n kohm
hfe =100; // u n i t l e s s
hoe =0; // u n i t l e s s
hre =0; // u n i t l e s s
27

15 VBE =0.7; // i n v o l t ( For S i )


16 // P a r t ( i )
17 RB = R1 * R2 /( R1 + R2 ) ; // i n kohm
18 VBBdash =( R2 /( R1 + R2 ) ) * VCC ; // i n v o l t
19 // A p p l y i n g K i r c h o f f Law
20 IB =( VBBdash - VBE ) /( RB *10^3+ RE *10^3*(1+ hfe ) ) ; // i n

Ampere
21 IC = hfe * IB ; // i n Ampere
22 disp ( IC *10^3 , V a l u e o f IC i n mA : ) ;
23 // P a r t ( i i )
24 // A p p l y i n g K i r c h o f f Law
25 VCE = VCC - IC * RC *10^3 - RE *1063* IB *( hfe +1) ; // i n v o l t
26 disp ( VCE , VCE i n v o l t : ) ;
27 // Note : Ans o f VCE i s wrong i n t h e book a s VCC=10 V

has been taken i n s t e a d o f 9 v o l t .

Scilab code Exa 2.18 Region of Q point


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16

// Exa 2 . 1 8
clc ;
clear ;
close ;
// Given d a t a :
RB =50; // i n kohm
RC =3; // i n kohm
VCC =10; // i n v o l t
VEE =5; // i n v o l t
hfe =100; // u n i t l e s s
VCEsat =0.2; // i n v o l t
VBEsat =0.8; // i n v o l t
VBEactive =0.7; // i n v o l t
VBE =0.7; // i n v o l t ( For S i )
// A p p l y i n g
IB =( VEE - VBE ) /( RB *10^3) ; // i n Ampere : K i r c h o f f 2 nd Law
: VEERB IBVBE=0
28

17 IC = hfe * IB ; // i n Ampere
18 VCB = VCC - IC * RC *10^3 - VBEactive ; // i n

19
20

21
22
23
24

v o l t : // A p p l y i n g
K i r c h o f f 2 nd Law t o c o l l e c t o r e m i t t e r l o o p : VCC
IC RCVCBVBEactive=0
disp ( VCB , C o l l e c t o r t o b a s e v o l t a g e , VCB( i n V) : ) ;
disp ( T h i s shows t h a t t h e b a s e c o l l e c t o r j u n c t i o n i s
forward b i a s e d . This i m p l i e s that the t r a n s i s t o r
i s i n s a t u r a t i o n r e g i o n . );
IB =( VEE - VBEsat ) /( RB *10^3) ; // i n Ampere
disp ( IB *10^3 , V a l u e o f IB i n mA : ) ;
IC =( VCC - VCEsat ) /( RC *10^3) ;
disp ( IC *10^3 , V a l u e o f IC i n mA : ) ;

Scilab code Exa 2.19 Voltage across RE


1
2
3
4
5
6
7
8
9
10
11
12
13
14

// Exa 2 . 1 9
clc ;
clear ;
close ;
// Given d a t a :
VCC =20; // i n v o l t
VBE =0.7; // i n v o l t ( For S i )
Beta =50; // u n i t l e s s
RE =200; // i n ohm
R1 =60; // i n kohm
R2 =30; // i n kohm
V2 = VCC * R2 /( R1 + R2 ) ; // i n v o l t
VEO = V2 - VBE ; // i n v o l t
disp ( VEO , V o l t a g e a c r o s s RE i n v o l t : ) ;

29

Chapter 3
Transistor Amplifiers

Scilab code Exa 3.1 Gain Impedence and ac load


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21

// Exa 3 . 2
clc ;
clear ;
close ;
// Given d a t a
ib =10; // i n uA
ic =1; // i n mA
ic = ic *10^3; // i n uA
vi =0.02; // i n V o l t
RC =5; // i n kohm
RL =10; // i n kohm
// P a r t ( i )
Ai = - ic / ib ; // u n i t l e s s
Beta = Ai ; // u n i t l e s s
disp ( Ai , C u r r e n t g a i n : ) ;
// P a r t ( i i )
Rie = vi /( ib *10^ -6) ; // i n Ohm
disp ( Rie *10^ -3 , I n p u t i m p e d e n c e i n kohm : ) ;
// P a r t ( i i i )
Rac = RC * RL /( RC + RL ) ; // i n kohm
disp ( Rac , AC l o a d i n kohm : ) ;
30

22 // P a r t ( i v )
23 Av = - Rac *10^3* Beta / Rie ; // u n i t l e s s
24 disp ( Av , V o l t a g e g a i n : ) ;
25 // P a r t ( v )
26 PowerGain = Av * Ai ; // u n i t l e s s
27 disp ( PowerGain , Power Gain i s : ) ;
28 // Note : Ans o f Av and Power g a i n i s wrong i n t h e

book .

Scilab code Exa 3.2 Gain input and output impedence


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23

// Exa 3 . 2
clc ;
clear ;
close ;
// Given d a t a
RL =10; // i n kohm
RS =1; // i n kohm
hie =1.1; // i n kOhm
hre =2.5*10^ -4; // u n i t l e s s
hfe =50; // u n i t l e s s
hoe =25; // i n u mho
Aie = - hfe /(1+ hoe *10^ -6* RL *10^3) ; // u n i t l e s s
Zie = hie + hre * Aie * RL ; // i n kOhm
Zie = round ( Zie ) ;
Ave = Aie * RL / Zie ; // u n i t l e s s
Avs_e = Ave * Zie /( Zie + RS ) ; //
deltah = hoe *10^ -6* hie *10^3 - hfe * hre ;
Zoe =( hie *10^3+ RS *10^3) /( hoe *10^ -6* RS *10^3+ deltah ) ;
Ais_e = Aie * RS /( Zie + RS ) ;
Ape = Ave * Aie ;
Aps_e = Avs_e * Ais_e ;
disp ( Aie , C u r r e n t g a i n : ) ;
disp ( Ais_e , C u r r e n t g a i n w i t h s o u r c e r e s i s t a n c e : )
;
31

24
25
26
27
28
29

disp ( Ave , V o l t a g e g a i n : ) ;
disp ( Avs_e , V o l t a g e g a i n w i t h s o u r c e r e s i s t a n c e : )
;
disp ( Ape , Power g a i n : ) ;
disp ( Aps_e , Power g a i n w i t h s o u r c e r e s i s t a n c e : ) ;
disp ( Zie , I n p u t i m p e d e n c e i n kohm : ) ;
disp ( Zoe /10^3 , Output i m p e d e n c e i n kohm : ) ;

Scilab code Exa 3.3 Input Output impedence and output voltage
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22

// Exa 3 . 3
clc ;
clear ;
close ;
// Given d a t a :
InputVoltage =1; // i n mV
RL =5.6; // i n kohm
RS =600; // i n ohm
hre =6.5*10^ -4; // u n i t l e s s
hie =1.7; // i n kOhm
hfe =125; // u n i t l e s s
hoe =80; // i n uA/V
deltah = hoe *10^ -6* hie *10^3 - hfe * hre ;
Zie =( hie *10^3+ RL *10^3* deltah ) /(1+ hoe *10^ -6* RL *10^3) ;
// i n Ohm
Zoe =( hie *10^3+ RS ) /( hoe *10^ -6* RS + deltah ) ; // i n Ohm
Ave = -( hfe * RL *10^3) /( hie *10^3+ RL *10^3* deltah ) ; //
unitless
Avs_e = Ave * Zie /( Zie + RS ) ; //
OutputVoltage = Avs_e * InputVoltage ; // i n
disp ( Zie /1000 , I n p u t i m p e d e n c e i n kohm : ) ;
disp ( Zoe /10^3 , Output i m p e d e n c e i n kohm : ) ;
disp ( Ave , V o l t a g e g a i n : ) ;
disp ( Avs_e , V o l t a g e g a i n w i t h s o u r c e r e s i s t a n c e : )
;
32

23
24

disp ( OutputVoltage , Output V o l t a g e i n mV : ) ;


// Note : Ans o f o u t p u t i m p e d e n c e i s wrong i n t h e
book .

Scilab code Exa 3.4 Net voltage gain in dB


// Exa 3 . 4
clc ;
clear ;
close ;
// Given d a t a :
A1 =100; // u n i t l e s s
A2 =200; // u n i t l e s s
A3 =400; // u n i t l e s s
A1 =20* log10 ( A1 ) ; // i n dB
A2 =20* log10 ( A2 ) ; // i n dB
A3 =20* log10 ( A3 ) ; // i n dB
NetVoltageGain = A1 + A2 + A3 ; // i n dB
disp ( NetVoltageGain , Net V o l t a g e Gain i n d e c i b e l s :
);
14 // Note : Answer i n t h e book i s wrong .

1
2
3
4
5
6
7
8
9
10
11
12
13

Scilab code Exa 3.5 Bandwidth and cut off frequencies


1 // Exa 3 . 5
2 clc ;
3 clear ;
4 close ;
5 // Given d a t a :
6 MaxGain =1000; // u n i t l e s s ( a t 2 kHz )
7 f1 =50; // i n Hz
8 f2 =10; // i n KHz

33

disp ( Bandwidth i s from + string ( f1 ) + Hz t o + string


( f2 ) + kHz ) ;
10 disp ( Lower c u t o f f f r e q u e n c y + string ( f1 ) + Hz ) ;
11 disp ( Upper c u t o f f f r e q u e n c y + string ( f2 ) + kHz ) ;
9

Scilab code Exa 3.6 Overall voltage gain


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17

// Exa 3 . 6
clc ;
clear ;
close ;
// Given d a t a :
RC =10; // i n kohm
hfe =330; // u n i t l e s s
hie =4.5; // i n kOhm
//RS<<h i e
AVM = hfe * RC *10^3/( hie *10^3+ RC *10^3) ; // u n i t l e s s
AVM1 = AVM ; // Gain o f 1 s t s t a g e
AVM2 = AVM ; // Gain o f 2 nd s t a g e
AVM3 = hfe * RC *10^3/( hie *10^3) ; // u n i t l e s s ( / / Gain o f 3 r d
stage )
OverallGain = AVM1 * AVM2 * AVM3 ; // u n i t l e s s
disp ( AVM , Gain i n mid f r e q u e n y r a n g e : ) ;
disp ( T h i s i s t h e g a i n o f 1 s t and 2 nd s t a g e . )
disp ( OverallGain , O v e r a l l V o l t a g e g a i n f o r mid
f r e q u e n c y range : );

Scilab code Exa 3.7 Couopling capacitor


1 // Exa 3 . 7
2 clc ;
3 clear ;
4 close ;

34

5
6
7
8
9
10
11
12

// Given d a t a :
RC =5.5; // i n kohm
hfe =330; // u n i t l e s s
hie =4.5; // i n kohm
f1 =30; // i n Hz
// Formula : f 1 =1/(2 %pi C ( h i e+RC) )
C =1/(2* %pi * f1 *( hie *10^3+ RC *10^3) ) ; // i n F
disp ( C *10^6 , V a l u e o f c o u p l i n g c a p a c i t o r i n m i c r o
f a r a d : );

Scilab code Exa 3.8 Voltage gain


1
2
3
4
5
6
7
8
9
10
11
12

// Exa 3 . 8
clc ;
clear ;
close ;
// Given d a t a :
RC =10; // i n kohm
Rin =1; // i n kohm
Beta =100; // u n i t l e s s
RL =100; // i n ohm
RCdash = RC *10^3* RL /( RC *10^3+ RL ) ; // i n ohm
VoltageGain = Beta * RCdash /( Rin *10^3) ; // i n v o l t
disp ( VoltageGain , V o l t a g e Gain : ) ;

Scilab code Exa 3.9 Inductance of primary and secondary


1 // Exa 3 . 9
2 clc ;
3 clear ;
4 close ;
5 // Given d a t a :
6 Rout =10; // i n kohm

35

7
8
9
10
11
12
13
14

Rin =2.5; // i n kohm


f =200; // i n Hz
// Formula : Rout=omega Lp=2%pi f Lp
Lp = Rout *10^3/(2* %pi * f ) ; // i n H
disp ( round ( Lp ) , I n d u c t a n c e o f p r i m a r y i n Henry : ) ;
// Formula : Rin=omega Ls =2%pi f Ls
Ls = Rin *10^3/(2* %pi * f ) ; // i n H
disp ( round ( Ls ) , I n d u c t a n c e o f s e o n d a r y i n Henry : )
;

Scilab code Exa 3.10 Turn ratio of transformer


1
2
3
4
5
6
7
8
9
10

// Exa 3 . 1 0
clc ;
clear ;
close ;
// Given d a t a :
ZL =10; // i n ohm
ZP =1000; // i n ohm
// For max power : ZP=n 2 ZL
n = sqrt ( ZP / ZL ) ; // t u r n r a t i o
disp (n , Turn r a t i o : ) ;

Scilab code Exa 3.11 Collector efficieny and power rating


1 // Exa 3 . 1 1
2 clc ;
3 clear ;
4 close ;
5 // Given d a t a :
6 Po_dc =10; // i n w a t t
7 Po_ac =3.5; // i n w a t t
8 // P a r t ( i ) :

36

ETAcollector = Po_ac / Po_dc ; // u n i t l e s s


ETAcollector = ETAcollector *100; // c o l l e c t o r e f f i c i e n c y
in %
11 disp ( ETAcollector , C o l l e c t o r E f f i c i e n c y ( i n %) : ) ;
12 // P a r t ( i i )
13 disp ( Po_dc , Z e r o s i g n a l c o n d i t i o n r e p r e s e n t s maximum
power l o s s . T h e r e f o r e , a l l t h e 10 W power i s
d i s s i p a t e d by i t . Hence Powe R a t i n g o f t r a n s i s t o r
i n Watt : )

9
10

Scilab code Exa 3.12 Power and effiiency


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20

// Exa 3 . 1 2
clc ;
clear ;
close ;
// Given d a t a :
VCC =20; // i n v o l t
RC =20; // i n ohm
VCEQ =10; // i n v o l t
ICQ =500; // i n mA
// p a r t ( i ) :
Pin_dc = VCC * ICQ *10^ -3; // i n w a t t
disp ( Pin_dc , T o t a l dc power t a k e n by t h e c i r c u i t i n
Watt : ) ;
// p a r t ( i i ) :
PRc_dc = ICQ ^2*10^ -6* RC ; // i n w a t t
disp ( PRc_dc , dc power d i s s i p a t e d by t h e c o l l e c t o r
l o a d i n Watt : ) ;
// p a r t ( i i i ) :
Io =250; // i n mA( maximum v a l u e o f o u t p u t a c c u r r e n t )
Irms = Io / sqrt (2) ; // i n mA
Po_ac = Irms ^2*10^ -6* RC ; // i n w a t t
disp ( Po_ac , Power d e v e l o p e d a c r o s s t h e l o a d i n Watt
: );
37

21
22
23
24
25
26
27
28
29
30
31
32

// p a r t ( i v ) :
Ptr_dc = Pin_dc - PRc_dc ; // i n w a t t
disp ( Ptr_dc , dc power d i s s i p a t e d by t h e c o l l e c t o r
l o a d i n Watt : ) ;
// p a r t ( v ) :
PC_dc = Pin_dc - PRc_dc - Po_ac ; // i n w a t t
disp ( PC_dc , dc power d i s s i p a t e d by t h e c o l l e c t o r
l o a d i n Watt : ) ;
// p a r t ( v i ) :
ETAoverall = Po_ac *100/ Pin_dc ; // O v e r a l l E f f i c i e n c y ( i n
%)
disp ( ETAoverall , O v e r a l l E f f i c i e n c y ( i n %) : ) ;
// p a r t ( v i i ) :
ETAcollector = Po_ac *100/ PRc_dc ; // C o l l e c t o r E f f i c i e n c y
( i n %)
disp ( ETAcollector , C o l l e c t o r E f f i c i e n c y ( i n %) : ) ;

Scilab code Exa 3.13 Maximum ac power output


1
2
3
4
5
6
7
8
9
10
11

// Exa 3 . 1 3
clc ;
clear ;
close ;
// Given d a t a :
n =10; // t u r n r a t i o
RL =100; // i n ohm
ICQ =100; // i n mA
RLdash = n ^2* RL ; // i n ohm
MaxPowerOut =( ICQ *10^ -3) ^2* RLdash /2; // i n w a t t
disp ( MaxPowerOut , Maximum Power o u t p u t i n w a t t : ) ;

Scilab code Exa 3.14 Maximum permissible power dissipation


38

1 // Exa 3 . 1 4
2 clc ;
3 clear ;
4 close ;
5 // Given d a t a :
6 // P a r t ( i ) : w i t h o u t h e a t s i n k
7 ThetaMax =90; // i n d e g r e e C
8 Theta_o =30; // i n d e g r e e C
9 R =300; // i n d e g r e e C/W
10 Pr =( ThetaMax - Theta_o ) / R ; // i n w a t t
11 disp ( Pr , Without h e a t s i n k , Maximum p e r m i s s i b l e

power d i s s i p a t i o i n w a t t : ) ;
12 // P a r t ( i i ) : w i t h h e a t s i n k
13 ThetaMax =90; // i n d e g r e e C
14 Theta_o =30; // i n d e g r e e C
15 R =60; // i n d e g r e e C/W
16 Pr =( ThetaMax - Theta_o ) / R ; // i n w a t t
17 disp ( Pr , With h e a t s i n k , Maximum p e r m i s s i b l e power

d i s s i p a t i o i n watt : );

39

Chapter 4
Frequency Response

Scilab code Exa 4.1 3dB Frequeny


1 // Exa 4 . 1
2 clc ;
3 clear ;
4 close ;
5 // Given d a t a
6 Omega_Z1 =0; // i n Radian / s e c
7 Omega_Z2 =10; // i n Radian / s e c
8 Omega_P1 =100; // i n Radian / s e c
9 Omega_P2 =25; // i n Radian / s e c
10 WL = sqrt ( Omega_P1 ^2+ Omega_P2 ^2 -2* Omega_Z1 ^2 -2*

Omega_Z2 ^2) ; // i n r a d i a n / s e c
11 disp ( WL , Approximate v a l u e o f l o w e r 3dB F r e q u e n c y i n
r a d i a n / s e c : );

Scilab code Exa 4.2 Upper 3dB Frequency


1 // Exa 4 . 2
2 clc ;

40

3
4
5
6
7
8
9

clear ;
close ;
// Given d a t a
Omega_P1 =10^4; // i n Radian / s e c
Omega_P2 =2*10^4; // i n Radian / s e c
Omega_Z1 =10^5; // i n Radian / s e c
omegaH =1/ sqrt (1/ Omega_P1 ^2+1/ Omega_P2 ^2 -2/ Omega_Z1
^2) ; // i n r a d i a n / s e c
10 disp ( round ( omegaH ) , Approximate v a l u e o f l o w e r 3dB
Frequency i n r a d i a n / s e c : );

41

Chapter 5
Feed Back

Scilab code Exa 5.1 Percentage of output which is fed back


1 // Exa 5 . 1
2 clc ;
3 clear ;
4 close ;
5 // Given d a t a :
6 A =50; // g a i n ( u n i t l e s s )
7 Af =10; // g a i n ( u n i t l e s s )
8 // Formula : Af=A/(1+A Beta )
9 Beta =( A / Af -1) / A ; // f e e d b a c k r a t i o ( u n i t l e s s )
10 disp ( Beta *100 , P e r c e n t a g e o f o u t p u t f e d back (%) : )

Scilab code Exa 5.2 Voltage gain and reduction in voltage


1 // Exa 5 . 2
2 clc ;
3 clear ;
4 close ;

42

5 // Given d a t a :
6 A =1000; // g a i n W i t h o u t F e e d b a c k ( u n i t l e s s )
7 // P a r t ( i ) :
8 disp ( At n o r m a l c o l l e c t o r s u p p l y : ) ;
9 disp ( w i t h f e e d b a c k g a i n r e d u c e s by a f a c t o r 0 . 4 0 ) ;
10 Af =A - A *0.40; // g a i n W i t h F e e d b a c k ( u n i t l e s s )
11 disp ( Af , At n o r m a l c o l l e c t o r s u p p l y , Gain w i t h
12
13
14
15
16
17
18
19
20
21
22
23

f e e d b a c k : );
// Formula : Af=A/(1+A Beta )
Beta =( A / Af -1) / A ; // f e e d b a c k f a c t o r ( u n i t l e s s )
disp ( At r e d u c e d power s u p p l y : ) ;
Adash =800; // g a i n W i t h o u t F e e d b a c k ( u n i t l e s s )
Af_dash = Adash /(1+ Adash * Beta )
disp ( round ( Af_dash ) , At Reduced c o l l e c t o r s u p p l y ,
Gain w i t h f e e d b a c k : ) ;
// P a r t ( i i )
Reduction =(( A - Adash ) / A ) *100; //% r e d u c t i o n w i t h o u t
feedback
disp ( Reduction , p e r c e n t a g e r e d u c t i o n i n g a i n w i t h o u t
f e e d b a c k (%) : ) ;
Reduction1 =(( Af - Af_dash ) / Af ) *100; //% r e d u c t i o n
without feedback
disp ( round ( Reduction1 ) , p e r c e n t a g e r e d u c t i o n i n g a i n
w i t h f e e d b a c k (%) : ) ;
// Note : a n s w e r o f Af i s wrong i n t h e book .

Scilab code Exa 5.3 Gain with feedback factor and feedback voltage
1 // Exa 5 . 3
2 clc ;
3 clear ;
4 close ;
5 // Given d a t a :
6 A =100; // g a i n w i t h o u t f e e d b a c k ( u n i t l e s s )
7 Beta =1/25; // f e e d b a c k r a t i o ( u n i t l e s s )

43

8 Vi =50; // i n mV
9 // P a r t ( i ) :
10 Af = A /(1+ A * Beta ) ; // g a i n w i t h f e e d b a c k ( u n i t l e s s )
11 disp ( Af , ( i ) Gain w i t h f e e d b a c k : ) ;
12 // P a r t ( i i ) :
13 FeedbackFactor = Beta * A ; // u n i t l e s s
14 disp ( FeedbackFactor , ( i i ) Feedb ack F a c t o r : ) ;
15 // P a r t ( i i i ) :
16 Vo_dash = Af * Vi *10^ -3; // i n v o l t
17 disp ( Vo_dash , ( i i i ) Output V o l t a g e i n v o l t s : ) ;
18 // P a r t ( i v ) :
19 FeedbackVoltage = Beta * Vo_dash ; // i n v o l t
20 disp ( FeedbackVoltage , ( i v ) Fee dback V o l t a g e i n v o l t s
21
22
23

: );
// P a r t ( v ) :
Vi_dash = Vi *(1+ Beta * A ) ; // i n mv
disp ( Vi_dash , ( v ) New I n c r e a s e d I n p u t V o l t a g e i n
m i l l i v o l t s : );

Scilab code Exa 5.4 Bandwidth with negative feedback


// Exa 5 . 4
clc ;
clear ;
close ;
// Given d a t a :
BW =200; // i n kHz
A =40; // g a i n w i t h o u t f e e d b a c k ( i n dB )
Beta =5; // n e g a t i v e f e e d b a c k i n %
Beta = Beta /100; // f e e d b a c k f a c t o r
// Formula : Af=A/(1+A Beta )
Af = A /(1+ A * Beta ) ; // g a i n w i t h f e e d b a c k ( i n dB )
disp ( S i n c e g a i n bandwidth p r o d u c t r e m a i n s c o n s t a n t ,
ABW=Af BW dash ) ;
13 BW_dash = A * BW / Af ; // i n kHz

1
2
3
4
5
6
7
8
9
10
11
12

44

14

disp ( BW_dash , New Bandwidth i n kHz : ) ;

Scilab code Exa 5.5 Fraction of output fed back


1 // Exa 5 . 5
2 clc ;
3 clear ;
4 close ;
5 // Given d a t a :
6 A =140; // g a i n w i t h o u t f e e d b a c k ( u n i t l e s s )
7 Af =17.5; // g a i n w i t h f e e d b a c k ( u n i t l e s s )
8 // Formula : Af=A/(1+A Beta )
9 Beta =( A / Af -1) / A ; // f e e d b a c k r a t i o ( u n i t l e s s )
10 disp ( F r a c t i o n o f o u t p u t f e d back t o i n p u t : +

string ( Beta ) + o r 1 / 2 0 ) ;

Scilab code Exa 5.6 Small Change in gain


1 // Exa 5 . 6
2 clc ;
3 clear ;
4 close ;
5 // Given d a t a :
6 A =200; // g a i n w i t h o u t f e e d b a c k ( u n i t l e s s )
7 Beta =0.25; // f r a c t i o n r a t i o ( u n i t l e s s )
8 disp ( We have , Af=A/(1+ Beta A)
eqn ( 1 ) ) ;
9 disp ( D i f f e r e n t i a t i n g i t w i t h r e s p e c t t o A, we g e t )

;
disp ( dAf /dA=((1+ Beta A)Beta A) /(1+ Beta A) 2=1/(1+
Beta A) 2 ) ;
11 disp ( dAf=dA/(1+ Beta A) 2
eqn ( 2 ) ) ;
12 disp ( D i v i d i n g eqn ( 2 ) by eqn ( 1 ) , ) ;

10

45

13
14
15
16
17

disp ( dAf / Af=(dA/((1+ Beta A) 2 ) ) ((1+ Beta A) /A)


=(1/(1+ Beta A) ) ( dA/A) ) ;
// Given : Normal g a i n c h a n g e s by 10 %, i t means dA/A
=10/100
dABYA =10/100; // c h a n g e i n g a i n
dAfBYAf =(1/(1+ Beta * A ) ) *( dABYA ) ; // c h a n g e i n g a i n
disp ( dAfBYAf , Change i n g a i n : ) ;

Scilab code Exa 5.7 New gain distortion and input voltage
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19

// Exa 5 . 7
clc ;
clear ;
close ;
// Given d a t a :
A =200; // g a i n w i t h o u t f e e d b a c k ( u n i t l e s s )
Dn =10; // D i s t o r t i o n i n %
Vi =0.5; // I n i t i a l i n p u t v o l t a g e i n v o l t
Beta =0.05; // f e e d b a c k r a t i o ( u n i t l e s s )
// Formula : Af=A/(1+A Beta )
Af = A /(1+ A * Beta ) ; // g a i n w i t h f e e d b a c k ( u n i t l e s s )
disp ( Af , New g a i n : ) ;
Dn_dash = Dn /(1+ A * Beta ) ; // new d i s t o r t i o n i n %
disp ( Dn_dash , D i s t o r t i o n w i t h n e g a t i v e f e e d b a c k i n %
: );
InitialOutputVoltage = A * Vi ; // i n V o l t
disp ( InitialOutputVoltage , I n i t i a l Output V o l t a g e i n
v o l t : );
NewInputVoltage = InitialOutputVoltage / Af ; // i n v o l t
disp ( NewInputVoltage , New I n p u t V o l t a g e i n v o l t s : )
;
// Note : Ans o f Af and N e w I n p u t V o l t a g e i s n o t
a c u r a t e i n t h e book .

46

Scilab code Exa 5.8 Feedback rction voltage and impedence


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27

// Exa 5 . 8
clc ;
clear ;
close ;
// Given d a t a :
A =10000; // g a i n w i t h o u t f e e d b a c k ( u n i t l e s s )
Zi =10; // i n kOhm
Zo =100; // i n Ohm
R1 =2; // i n Ohm
R2 =18; // i n Ohm
// P a r t ( i ) :
Beta = R1 /( R1 + R2 ) ; // f e e d b a c k f r a c t i o n ( u n i t l e s s )
disp ( Beta , ( i ) F eedback F r a c t i o n : ) ;
// P a r t ( i i ) :
Af = A /(1+ A * Beta ) ; // Gain w i t h n e g a t i v e f e e d b a c k (
unitless )
disp ( round ( Af ) , ( i i ) Gain w i t h n e g a t i v e f e e d b a c k : )
;
// P a r t ( i i i ) :
inputVoltge =0.5; // i n mV
outputVoltge = Af * inputVoltge ; // i n mV
disp ( round ( outputVoltge ) , ( i i i ) Output V o l t a g e i n
m i l l i v o l t s : );
// P a r t ( i v ) :
Zif = Zi *(1+ Beta * A ) ; // i n kOhm
disp ( Zif *10^ -3 , ( i v ) I n p u t i m p e d a n c e o f f e e d b a c k
a m p l i f i e r i n Mohm : ) ;
// P a r t ( v ) :
Zof = Zo /(1+ Beta * A ) ; // i n kOhm
format ( v ,4) ;
disp ( Zof , ( v ) Output i m p e d a n c e w i t h f e e d b a c k i n Ohm
: );
47

Scilab code Exa 5.9 Voltage gain input and output resistance
// Exa 5 . 9
clc ;
clear ;
close ;
// Given d a t a :
A =200; // g a i n w i t h o u t f e e d b a c k ( u n i t l e s s )
Ri =2; // i n kOhm
Ro =12; // i n kOhm
Beta =0.02; // f e e d b a k r a t i o ( u n i t l e s s )
// P a r t ( i ) :
Af = A /(1+ A * Beta ) ; // g a i n w i t h f e e d b a c k ( u n i t l e s s )
disp ( Af , ( i ) Gain w i t h N e g a t i v e Feedb ack : ) ;
// P a r t ( i i ) :
Rif = Ri *(1+ A * Beta ) ; // i n kOhm
disp ( Rif , ( i i ) I n p u t r e s i s t a n c e w i t h f e e d b a c k i n
kOhm : ) ;
16 // P a r t ( i i ) :
17 Rof = Ro /(1+ A * Beta ) ; // i n kOhm
18 disp ( Rof , ( i i ) Output r e s i s t a n c e w i t h f e e d b a c k i n
kOhm : ) ;

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15

Scilab code Exa 5.10 Gain wih feedbck in dB


1 // Exa 5 . 1 0
2 clc ;
3 clear ;
4 close ;
5 // Given d a t a :
6 format ( v ,5) ;
7 A =1000; // g a i n ( u n i t l e s s )

48

8 Beta =1/20; // f e e d b a c k r a t i o ( u n i t l e s s )
9 // Formula : Af=A/(1+A Beta )
10 Af = A /(1+ A * Beta ) ; // g a i n w i t h f e e d b a c k ( u n i t l e s s )
11 Af =20* log10 ( Af ) ; // i n dB
12 disp ( Af , Gain w i t h f e e d b a c k i n dB : ) ;

Scilab code Exa 5.11 Bandwidth after feedback


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18

// Exa 5 . 1 1
clc ;
clear ;
close ;
// Given d a t a :
A =800; // g a i n ( u n i t l e s s )
f1 =40; // i n Hz
f2 =16; // i n kHz
Beta =2/100; // f e e d b a c k f a t o r ( u n i t l e s s )
// Formula : Af=A/(1+A Beta )
Af = A /(1+ A * Beta ) ; // g a i n w i t h f e e d b a c k ( u n i t l e s s )
disp ( Af , V o l t a g e g i n w i t h f e e d b a c k : ) ;
BW = f2 *10^3 - f1 ; // Bandwidth o f a m p l i f i e r i n Hz
disp ( BW *10^ -3 , Bandwidth o f a m p l i f i e r i n kHz : ) ;
f1_f = f1 /(1+ A * Beta ) ; // i n Hz
f2_f = f2 *(1+ A * Beta ) ; // i n kHz
BW_f = f2_f *10^3 - f1_f ; // Bandwith a f t e r f e e d b a c k i n Hz
disp ( round ( BW_f *10^ -3) , Bandwith a f t e r f e e d b a c k i n
KHz : ) ;

Scilab code Exa 5.12 Gain and new bandwidth


1 // Exa 5 . 1 2
2 clc ;
3 clear ;

49

4 close ;
5 // Given d a t a :
6 A =100; // g a i n ( u n i t l e s s )
7 BW =10; // i n Hz
8 Beta =5; // i n %
9 // P a r t ( i ) :
10 // Formula : Af=A/(1+A Beta )
11 Af = A /(1+ A * Beta /100) ; // g a i n w i t h f e e d b a c k ( u n i t l e s s )
12 disp ( Af , V o l t a g e g i n w i t h f e e d b a c k : ) ;
13 // P a r t ( i i )
14 BW_f = BW *(1+ A * Beta /100) ; // Bandwith a f t e r f e e d b a c k i n
15

Hz
disp ( BW_f , Bandwith w i t h n e g a t i v e f e e d b a c k i n KHz :
);

Scilab code Exa 5.13 Input resistance and voltage gain


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17

// Exa 5 . 1 3
clc ;
clear ;
close ;
// Given d a t a :
hfe =50; // u n i t l e s s
hie =1.1; // i n kOhm
hoe =0; // u n i t l e s s
hre =0; // u n i t l e s s
RL =4; // i n kOhm
Rs =10; // i n kOhm
RB =40; // i n kOhm
RLdash = RB * RL /( RB + RL ) ; // i n Kohm
AV = - hfe * RLdash / hie ; // u n i t l e s s
// P a r t ( i ) ;
Rif = hie *( RB /(1 - AV ) ) /( hie +( RB /(1 - AV ) ) ) ; // i n kOhm
disp ( round ( Rif *1000) , I n p u t r e s i s t a n c e w i t h f e e d b a c k
i n Ohm : ) ;
50

18 // P a r t ( i i ) :
19 AVf = AV *( Rif /( Rs + Rif ) ) ; // u n i t l e s s
20 disp ( AVf , V o l t a g e g i n w i t h f e e d b a c k

51

: );

Chapter 6
Field Effect Transistors and
MOSFETS

Scilab code Exa 6.1 Value of Transconductance


1
2
3
4
5
6
7
8
9
10
11
12
13

// Exa 6 . 1
clc ;
clear ;
close ;
// g i v e n d a t a
VGS1 = -3.1; // i n V o l t
VGS2 = -3; // i n V o l t
ID1 =1; // i n mA
ID2 =1.3; // i n mA
delVGS = VGS2 - VGS1 ; // i n V o l t s
delID = ID2 - ID1 ; // i n mA
gm = delID *10^ -3/ delVGS ; // i n mhos
disp ( gm , T r a n s c o n d u c t a n c e i n mhos : ) ;

Scilab code Exa 6.2 AC drain resistance transconductance and amplification factor
52

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24

// Exa 6 . 2
clc ;
clear ;
close ;
// g i v e n d a t a
VGS1 =0; // i n V o l t
VGS2 =0; // i n V o l t
VGS3 = -0.2; // i n V o l t
VDS1 =7; // i n V o l t
VDS2 =15; // i n V o l t
VDS3 =15; // i n V o l t
ID1 =10; // i n mA
ID2 =10.25; // i n mA
ID3 =9.65; // i n mA
delVDS = VDS2 - VDS1 ; // i n V o l t s
delID = ID2 - ID1 ; // i n mA
rd = delVDS / delID ; // i n Kohm
disp ( rd , AC d r a i n r e s i s t a n c e i n Kohm : ) ;
delVGS = VGS3 - VGS2 ; // i n V o l t s
delID = ID3 - ID2 ; // i n mA
gm = delID *10^ -3/ delVGS ; // i n mhos
disp ( gm , T r a n s c o n d u c t a n c e i n mhos : ) ;
mu = rd *10^3* gm ; // u n i t l e s s
disp ( mu , A m p l i f i c a t i o n f a c t o r : ) ;

Scilab code Exa 6.5 Voltage Amplification


1 // Exa 6 . 5
2 clc ;
3 clear ;
4 close ;
5 // g i v e n d a t a
6 gm =2; // i n m i l l i mho
7 RL =10; // i n Kohm
8 disp ( a s s u m i n g rd>>RL ) ;

53

9 Av = gm *10^ -3* RL *10^3; // u n i t l e s s


10 disp ( Av , V o l t a g e a m p l i f i c a t i o n

: );

Scilab code Exa 6.6 Output voltage of amplifier


// Exa 6 . 6
clc ;
clear ;
close ;
// g i v e n d a t a
RL =20; // i n Kohm
RS =1; // i n Kohm
RG =1; // i n Mohm
Cs =25; // i n uF
mu =20; // u n i t l e s s
rd =100; // i n Kohm
Vs =2; // i n V o l t
f =1; // i n KHz
Xc =1/(2* %pi * f * Cs ) ; // i n Ohm
disp ( Xc , Xc i n Ohm : ) ;
disp ( As Xc<<Rs , t h e r e f o r e Cs b y p a s s e s a l l a c
c o m p o n e n ts . ) ;
17 Av = mu * RL /( rd + RL ) ; // u n i t l e s s
18 Vo = Av * Vs ; // i n V o l t
19 disp ( Vo , Output v o l t a g e i n v o l t : ) ;

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16

Scilab code Exa 6.7 IDQ VGSQ VD VS VDS VDG


1 // Exa 6 . 7
2 clc ;
3 clear ;
4 close ;
5 // g i v e n d a t a

54

6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43

R1 =2.1; // i n Mohm
R2 =270; // i n Kohm
RD =4.7; // i n Kohm
RS =1.5; // i n Kohm
VDD =20; // i n V o l t
VP = -4; // i n V o l t
IDSS =8; // i n mA
// s t e p 1 : Find VGS :
VG = R2 *10^3* VDD /( R1 *10^6+ R2 *10^3) ; // i n V o l t
disp ( VS=ID RSVGS V o l t ) ;
disp ( VGS=VGVS=2.28 1.5 ID )
// s t e p 2 : Find ID :
disp ( ID=IDSS [1 VGS/VP] 2 mA ) ;
disp ( ID = 8 [ 1 ( 2 . 2 8 1 . 5 ID ) / 4 ] 2 mA ) ;
disp ( 2 ID = 3 9 . 4 4 1 8 . 8 4 ID +2. 25 ID 2 ) ;
disp ( 2 . 2 5 ID 2 20.84 ID39 .44=0 )
disp ( ID =6.6mA o r 2 . 6 5mA ) ;
disp ( For ID =6.6mA VDS=ve ) ;
disp ( So d i s c a r d t h e v a l u e s o IDQ = 2 . 6 5mA. ) ;
ID =2.65; // i n mA
// s t e p 3 : Find VGSQ :
IDQ = ID ; // i n mA
VGS =2.28; // i n V o l t
VGSQ = VGS -1.5* IDQ ; // / i n V o l t
// s t e p 4 : Find VDSQ :
VDSQ = VDD - IDQ *( RD + RS ) ; // i n V o l t
// s t e p 5 : Find VD, VS and VDG :
VDS = VDSQ ; // i n V o l t
VG = VGS ; // i n V o l t
VS = ID * RS ; // i n V o l t
VD = VS + VDS // i n V o l t
VDG = VD - VG ; // i n V o l t
disp ( IDQ , IDQ i n mA : ) ;
disp ( VGSQ , VGSQ i n V o l t : ) ;
disp ( VD , VD i n V o l t : ) ;
disp ( VS , VS i n V o l t : ) ;
disp ( VDS , VDS i n V o l t : ) ;
disp ( VDG , VDG i n V o l t : ) ;
55

Scilab code Exa 6.8 Pinch off voltage


1
2
3
4
5
6
7
8
9
10
11
12
13
14

// Exa 6 . 8
clc ;
clear ;
close ;
// g i v e n d a t a
a =5.6*10^ -6/2; // i n m e t e r
k =12; // u n i t l e s s
epsilon_o =8.86*10^ -12; // i n F/m
epsilon = k * epsilon_o ; // i n F/m
ND =10^15; // i n cm3
ND =10^15*10^6; // i n m3
e =1.6*10^ -19; // i n Coulamb
VP = e * ND * a ^2/(2* epsilon ) ; // i n V o l t
disp ( VP , P i n c h o f f v o l t a g e i n v o l t s : ) ;

Scilab code Exa 6.10 Plot gm VS IDSS


1 // Exa 6 . 1 0
2 clc ;
3 clear ;
4 close ;
5 // g i v e n d a t a
6 VP = -6; // i n V o l t
7 IDSS =8; // i n mA
8 disp ( We have ID=IDSS [1 VGS/VP] 2 ) ;
9 disp ( Mutual c o n d u c t a n c e , gm=( d e l I D / delVGS )=IDSS

2[1 VGS/VP]( 1/VP) =(2IDSS /VP) [1 VGS/VP ] ) ;


10 // For VGS=0
11 VGS =0; // i n V o l t

56

12 IDSS =1:8; // i n mA
13 for i =1:8
14
gm ( i ) = -2* IDSS ( i ) / VP
15 end
16 title ( gm v e r s u s IDSS ) ;
17 xlabel ( gm( i n mS) ) ;
18 ylabel ( IDSS ( i n mA) ) ;
19 plot2d ( gm , IDSS ) ;
20 disp ( C l e a r l y t h e p l o t o f gm v s IDSS f o r VD=6V,

IDSS=8mA i s a s t r a i g h t l i n e o f s l o p e =2/VP
=(2/6)=1/3 ) ;

Scilab code Exa 6.11 Channel width W


// Exa 6 . 1 1
clc ;
clear ;
close ;
// g i v e n d a t a
L =1.25; // i n um
mu_n =0.065; // i n m2/Vs
Cox =6.9*10^ -4; // i n F/m2
VT =0.65 // i n V o l t
ID_sat =4; // i n mA
VGS =5; // i n V o l t
// Formula : I D s a t=W mu n Cox (VGSVT) 2 / ( 2 L )
W = ID_sat *10^ -3*2* L *10^ -6/( mu_n * Cox *( VGS - VT ) ^2) ; // i n
meter
14 disp ( W *10^6 , Channel Width i n m i c r o m e t e r : ) ;

1
2
3
4
5
6
7
8
9
10
11
12
13

57

Chapter 7
Magnetic Materials

Scilab code Exa 7.1 Horizontal component of magnetic Intensity


1 // Exa 7 . 1
2 clc ;
3 clear ;
4 close ;
5 // Given d a t a
6 Bo =1.7*10^ -5; // i n weber /m2
7 meu_o =4* %pi *10^ -7; // p e r m e a b i l i t y

of f r e e space in
weber /ampm e t e r
8 H = Bo / meu_o ; // i n A/m
9 disp (H , H o r i z o n t a l component o f m a g n e t i c f i l e d
i n t e n s i t y i n A/m : ) ;

Scilab code Exa 7.2 Current through solenoid


1 // Exa 7 . 2
2 clc ;
3 clear ;
4 close ;

58

5
6
7
8
9
10
11
12
13

// Given d a t a
H =5*10^3; // i n Amperet u r n s /m
l =10; // i n cm
l = l *10^ -2; // i n m e t e r
N =50; // no . o f t u r n s
n = N / l ; // no . o f t u r n s p e r u n i t l e n g t h
// Formula : H=n i
i = H / n ; // i n Ampere
disp (i , C u r r e n t s h o u l d be s e n t t h r o u g h s o l e n o i d i n
Ampere : ) ;

Scilab code Exa 7.3 Magnetic moment of rod


1
2
3
4
5
6
7
8
9
10
11
12
13

// Exa 7 . 3
clc ;
clear ;
close ;
// Given d a t a
meu_r =1000; // r e l a t i v e p e r m e a b i l i t y
n =5; // t u r n s /cm
n = n *10^2; // t u r n s / m e t e r
i =0.5; // i n Ampere
Volume =10^ -4; // i n m3
I =( meu_r -1) * n * i ; // i n Ampere
MagneticMoment = I * Volume ; // i n Ameter 2
disp ( round ( MagneticMoment ) , M a g n e t i c moment o f t h e
r o d i n Amperem e t e r 2 : ) ;

Scilab code Exa 7.4 Flux density magnetic intensity and permeability
1 // Exa 7 . 4
2 clc ;
3 clear ;

59

4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22

close ;
// Given d a t a
l =30; // i n cm
l = l *10^ -2; // i n m e t e r
A =1; // i n cm2
A = A *10^ -4; // i n m e t e r 2
N =300; // t u r n s o f w i r e
i =0.032; // i n Ampere
FI_B =2*10^ -6; // i n weber
meu_o =4* %pi *10^ -7; // p e r m e a b i l i t y o f f r e e s p a c e i n
weber /ampm e t e r
B = FI_B / A ; // i n weber / m e t e r 2
disp (B , Flux D e n s i t y i n weber / m e t e r 2 : ) ;
H = N * i / l ; // i n ampt u r n / m e t e r
disp (H , m a g n e t i c I n t e n s i t y i n ampt u r n / m e t e r : ) ;
meu = B / H ; // i n weber /Ampm e t e r
disp ( meu , P e r m e a b i l i t y i n weber /ampm e t e r : ) ;
meu_r = meu / meu_o ; // R e l a t i v e P e r m e a b i l i t y
disp ( meu_r , R e l a t i v e P e r m e a b i l i t y : ) ;
// Answer o f r e l a t i v e p e r m e a b i l i t y i s wrong i n t h e
book .

Scilab code Exa 7.5 Relative Permeability


1 // Exa 7 . 5
2 clc ;
3 clear ;
4 close ;
5 // Given d a t a
6 format ( v ,15) ;
7 Xci_m =9.48*10^ -9; // u s c e p t i b i l i t y o f medium ( u n i t l e s s )
8 meu_r =1+ Xci_m ; // r e l a t i v e p e r m e a b i l i t y ( u n i t l e s s )
9 disp ( meu_r , R e l a t i v e P e r m e a b i l i t y : ) ;
10 disp ( i . e , R e l a t i v e P e r m e a b i l i t y i s s l i g t l y g r e a t e r

than 1 . );
60

Scilab code Exa 7.6 Magnetising Force and material magnetisation


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17

// Exa 7 . 6
clc ;
clear ;
close ;
// Given d a t a
n =10; // t u r n s /cm
n = n *10^2; // t u r n s / m e t e r
i =2; // i n Ampere
B =1; // i n weber / m e t e r 2
meu_o =4* %pi *10^ -7; // p e r m e a b i l i t y o f f r e e s p a c e i n
weber /ampm e t e r
H = n * i ; // i n ampt u r n / m e t e r
disp (H , M a g n e t i s i n g F o r c e i n ampt u r n / m e t e r : ) ;0
// Formula : B=meu o (H+I )
I = B / meu_o - H ; // i n ampt u r n / m e t e r
disp (I , M a g n e t i s a t i o n o f m a t e r i a l i n ampt u r n / m e t e r
: );
meu_r = B /( meu_o * H ) ; // r e l a t i v e p e r m e a b i l i t y ( u n i t l e s s )
disp ( meu_r , R e l a t i v e P e r m e a b i l i t y : ) ;

61

Chapter 8
Oscillators

Scilab code Exa 8.m.1 Value of L1


1
2
3
4
5
6
7
8
9
10
11

// Exa Misc 8 . 1
clc ;
clear ;
close ;
// g i v e n d a t a
format ( v ,5) ;
L2 =0.4; // i n mH
C =0.004; // i n
F
f =120; // i n KHz
L1 =1/(4* %pi ^2*( f *10^3) ^2* C *10^ -6) - L2 *10^ -3; // i n H
disp ( L1 *10^3 , V a l u e o f L1 ( i n mH) : ) ;

Scilab code Exa 8.m.2 Value of C and hfe


1 // Exa Misc 8 . 2
2 clc ;
3 clear ;
4 close ;

62

5
6
7
8
9
10
11
12
13
14
15
16

// g i v e n d a t a
format ( v ,6) ;
fo =10; // i n KHz
R1 =25; // i n kohm
R2 =60; // i n kohm
Rc =40; // i n kohm
R =7.1; // i n kohm
hie =1.8; // i n kohm
C =1/(2* %pi * fo *10^3* R *10^3* sqrt (6+4* Rc / R ) ) ; // i n F
disp ( C *10^9 , V a l u e o f C a p a c i t o r ( i n nF ) : ) ;
hfe =23+29* R / Rc +4* Rc / R ; // u n i t l e s s
disp ( V a l u e o f h f e i s
+ string ( hfe ) ) ;

Scilab code Exa 8.m.3 Value of Capacitor


1
2
3
4
5
6
7
8
9
10

// Exa Misc 8 . 3
clc ;
clear ;
close ;
// g i v e n d a t a
format ( v ,5) ;
R =100; // i n kohm
fo =10; // i n KHz
C =1/(2* %pi * fo *10^3* R *10^3) ; // i n F
disp ( C *10^12 , V a l u e o f C a p a c i t o r ( i n pF ) : ) ;

Scilab code Exa 8.m.4 Various parameter of colpitt oscillator


1 // Exa Misc 8 . 4
2 clc ;
3 clear ;
4 close ;
5 // g i v e n d a t a

63

6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22

format ( v ,5) ;
L =40; // i n mH
C1 =100; // i n pF
C2 =500; // i n pF
Vout =10; // i n v o l t
fo =1/(2* %pi * sqrt ( L *10^ -3* C1 *10^ -12* C2 *10^ -12/( C1
*10^ -12+ C2 *10^ -12) ) )
disp ( fo *10^ -3 , F r e q u e n c y o f o s c i l l a t i o n ( i n KHz) : )
;
Vf = Vout * C1 / C2 ; // i n v o l t
disp ( Vf , Feed back v o l t a g e i n v o l t : ) ;
Gain = C2 / C1 ; // u n i t l e s s
disp ( Gain , Minimum Gain i s ) ;
// i f Gain =10
Gain =10; // g i v e n
C1 = C2 / Gain ; // i n pF
disp ( C1 , For a g a i n o f 10 C1 i n pF i s : ) ;
fo =1/(2* %pi * sqrt ( L *10^ -3* C1 *10^ -12* C2 *10^ -12/( C1
*10^ -12+ C2 *10^ -12) ) )
disp ( fo *10^ -3 , New f r e q u e n c y o f o s c i l l a t i o n ( i n KHz)
: );

Scilab code Exa 8.m.5 Resonant frequencies and Q factor


1
2
3
4
5
6
7
8
9
10
11

// Exa Misc 8 . 5
clc ;
clear ;
close ;
// g i v e n d a t a
format ( v ,6) ;
L =0.5; // i n H
Cs =0.06; // i n pF
Cp =1; // i n pF
R =5; // i n Kohm
fs =1/(2* %pi * sqrt ( L * Cs *10^ -12) ) ; // i n Hz
64

12 Q =2* %pi * fs * L /( R *10^3) ; //Qf a c t o r


13 disp ( fs /10^3 , S e i e s r e s o n a n c e f r e q u e n c y ( i n KHz) )
14 disp ( round ( Q ) ,Qf a c t o r f t h e c r y s t a l a t f s i s ) ;
15 fp =(1/(2* %pi ) ) * sqrt (( Cs *10^ -12+ Cp *10^ -12) /( L * Cs

*10^ -12* Cp *10^ -12) ) ; // i n Hz


16 Q =2* %pi * fp * L /( R *10^3) ; //Qf a c t o r
17 disp ( fp /10^3 , S e i e s r e s o n a n c e f r e q u e n c y ( i n KHz) )
18 disp ( round ( Q ) ,Qf a c t o r f t h e c r y s t a l a t f s i s ) ;

Scilab code Exa 8.1 feed bck factor


1 // Exa 8 . 1
2 clc ;
3 clear ;
4 close ;
5 // Given d a t a
6 A =50; // u n i t l e s s
7 disp ( B a r k h a u s e n

criterion for oscillator

: Beta A=1

);
8 Beta =1/ A ; // u n i t l e s s
9 disp ( Beta , Feed back F a c t o r t o make o s c i l l a t o r

Scilab code Exa 8.2 Range of variable capacitor


1
2
3
4
5
6
7
8
9

// Exa 8 . 2
clc ;
clear ;
close ;
// Given d a t a
format ( v ,5) ;
L =100; // i n uH
L = L *10^ -6; // i n H
f1 =500; // i n kHz
65

: );

10
11
12
13
14
15
16

f1 = f1 *10^3; // i n Hz
f2 =1500; // i n kHz
f2 = f2 *10^3; // i n Hz
// Formula : f =1/(2 %pi s q r t ( LC) )
C1 =1/(4* %pi ^2* f1 ^2* L ) ; // i n F
C2 =1/(4* %pi ^2* f2 ^2* L ) ; // i n F
disp ( Range o f c a p a c i t o r : + string ( C2 *10^12) + pF
t o + string ( C1 *10^12) + pF ) ;

Scilab code Exa 8.3 C2 of colpitt oscilator


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18

// Exa 8 . 3
clc ;
clear ;
close ;
// Given d a t a
format ( v ,9) ;
L =100; // i n mH
L = L *10^ -3; // i n H
C1 =0.1; // i n uF
C1 = C1 *10^ -6; // i n F
f =100; // i n kHz
f = f *10^3; // i n Hz
// Formula : f =1/(2 %pi s q r t ( LC) )
C =1/(4* %pi ^2* f ^2* L ) ; // i n F
// Formula : C=C1C2 / ( C1+C2 )
C2 = C * C1 /( C1 - C ) ;
disp ( C2 , C2 i n m i c r o f a r a d : ) ;
// Note : Answer i n t h e book i s wrong .

Scilab code Exa 8.4 Frequency of oscillation


1

// Exa 8 . 4
66

2
3
4
5
6
7
8
9
10
11
12

clc ;
clear ;
close ;
// Given d a t a
R =100; // i n kOhm
R = R *10^3; // i n Ohm
C =0.01; // i n uF
C = C *10^ -6; // i n F
fo = sqrt (6) /(2* %pi * R * C ) ; // i n Hz
disp ( fo , F r e q u e n c y o f o s c i l l a t i o n i n Hz : ) ;
// Note : Answer i n t h e book i s n o t a c c u r a t e .

Scilab code Exa 8.5 Amplifier voltage gain


1 // Exa 8 . 5
2 clc ;
3 clear ;
4 close ;
5 // Given d a t a
6 disp ( Put a l f a =s q r t ( 6 ) t o f i n d t h e g a i n ) ;
7 alfa = sqrt (6) ; // u n i t l e s s
8 Beta =1/(1 -5* alfa ^2) ;
9 // B a r k h a u s e n c r i t e r a : A | Beta |>=1
10 Beta = - Beta ; //
11 A =1/ Beta ; // u n i t l e s s
12 disp (A , Minimum Gain o f A m p l i f i e r must be
: );

Scilab code Exa 8.6 Frequency of oscillation and min current gain
1 // Exa 8 . 6
2 clc ;
3 clear ;
4 close ;

67

5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20

// Given d a t a :
R1 =50; // i n kohm
R1 = R1 *10^3; // i n ohm
C1 =0.001; // i n uF
C1 = C1 *10^ -6; // i n F
R2 =1; // i n kohm
R2 = R2 *10^3; // i n ohm
C2 =0.01; // i n uF
C2 = C2 *10^ -6; // i n F
// P a r t ( i )
// Formula : f =1/(2 %pi s q r t ( C1C2R1R2 ) )
f =1/(2* %pi * sqrt ( C1 * C2 * R1 * R2 ) ) ; // i n Hz
disp ( f /1000 , F r e q u e n c y o f o s c i l l a t i o n s i n kHz : ) ;
// P a r t ( i i )
CurrentGain =1+ C2 / C1 + R1 / R2 ; // u n i t l e s s
disp ( CurrentGain , C u r r e n t Gain : ) ;

Scilab code Exa 8.7 Resistnce to cover frequency range


1 // Exa 8 . 7
2 clc ;
3 clear ;
4 close ;
5 // Given d a t a :
6 fmin =20; // i n Hz
7 fmax =20; // i n kHz
8 Cmin =30; // i n pF
9 Cmax =300; // i n pF
10 // Formula : f o =1/(2 %pi RC) )
11 disp ( Minimum Fequeny c o r r e s p o n d t o maximum

c a p a c i t a n c e . )
12 R =1/(2* %pi * fmin * Cmax *10^ -12)
13 disp ( R /10^6 , R e q u i r e d r e s i s t a n c e

68

i n Mohm : ) ;

Scilab code Exa 8.8 Resonant Frequency


// Exa 8 . 8
clc ;
clear ;
close ;
// Given d a t a :
f =500; // i n kHz
T1 =50; // i n d e g r e e C
T2 =60; // i n d e g r e e C
TC = -20; // i n ppm/ d e g r e e C
ChangeInFreq = TC *( f *10^ -3) *( T1 - T2 ) ; // i n Hz
ResonantFreq = f *1000 - ChangeInFreq ; // i n Hz
disp ( ResonantFreq /1000 , R e s o n a n t f r e q u e n c y i n kHz :
);
13 // Note : a n s w e r i n t h e book i s wrong .
1
2
3
4
5
6
7
8
9
10
11
12

Scilab code Exa 8.9 Resonant Frequency


// Exa 8 . 9
clc ;
clear ;
close ;
// Given d a t a :
f =450; // i n kHz
T1 =30; // i n d e g r e e C
T2 =50; // i n d e g r e e C
TC = -10; // i n ppm/ d e g r e e C
PercentChange = - TC *100/10^6; // i n %
TotalChangeInFreq =( PercentChange /100) *( f *10^3) *( T2 T1 ) ; // i n Hz
12 ResonantFreq = f *1000 - TotalChangeInFreq ; // i n Hz

1
2
3
4
5
6
7
8
9
10
11

69

disp ( ResonantFreq /1000 , R e s o n a n t f r e q u e n c y i n kHz :


);
14 // Note : a n s w e r i n t h e book i s wrong .
13

Scilab code Exa 8.10 Parallel and series resonant frequencies


// Exa 8 . 1 0
clc ;
clear ;
close ;
// Given d a t a :
L =0.5; // i n H
C =0.05; // i n pF
R =1; // i n kohm
Cm =1; // i n pF
fs =1/(2* %pi * sqrt ( L * C *10^ -12) ) ; // i n Hz
disp ( fs /10^6 , S e r i e s r e s o n a n t f r e q u e n c y i n MHz : ) ;
fp =1/(2* %pi * sqrt (( L * C *10^ -12* Cm *10^ -12) /( C *10^ -12+ Cm
*10^ -12) ) ) ; // i n Hz
13 disp ( fp /10^6 , P a r a l l e l r e s o n a n t f r e q u e n c y i n MHz : )
;

1
2
3
4
5
6
7
8
9
10
11
12

70

Chapter 9
Unijunction Transistor

Scilab code Exa 9.1 Stand off voltage and peak point Voltage
// Exa 9 . 1
clc ;
clear ;
close ;
// Given d a t a :
VBB =20; // i n v o l t
VB =0.7; // i n v o l t ( For S i )
ETA =0.6; // i n t r i n s i c s t a n d o f f r a t i o
// P a r t ( i )
StandOffVoltage = ETA * VBB ; // i n v o l t
disp ( StandOffVoltage , Stand O f f V o l t a g e i n v o l t s : )
;
12 // P a r t ( i i )
13 VP = ETA * VBB + VB ; // i n v o l t s
14 disp ( VP , Peak p o i n t V o l t a g e i n v o l t s : ) ;
1
2
3
4
5
6
7
8
9
10
11

Scilab code Exa 9.2 Time period of sawtooth waveform

71

1
2
3
4
5
6
7
8
9
10
11
12

// Exa 9 . 2
clc ;
clear ;
close ;
// Given d a t a :
VP =10; // i n v o l t
R =100; // i n Kohm
C =1000; // i n pF
VBB =20; // i n V o l t s
ETA = VP / VBB ; // i n t r i n s i c s t a n d o f f r a t i o
T = R *10^3* C *10^ -12* log (1/(1 - ETA ) ) ; // i n s e c
disp ( T *10^6 , Time p e r i o d o f s a w t o o t h wave i n m i r o
seconds : )

Scilab code Exa 9.3 Resistances RB1 and RB2


1
2
3
4
5
6
7
8
9
10
11

// Exa 9 . 3
clc ;
clear ;
close ;
// Given d a t a :
RBB =10; // i n Kohm
ETA =0.6; // i n t r i n s i c s t a n d o f f r a t i o
RB1 = ETA * RBB ; // i n Kohm
RB2 = RBB - RB1 ; // i n Kohm
disp ( RB1 , R e s i s t a n c e RB1 i n Kohm : ) ;
disp ( RB2 , R e s i s t a n c e RB2 i n Kohm : ) ;

72

Chapter 11
Multivibrators

Scilab code Exa 11.1 Frequency of Oscillators


1
2
3
4
5
6
7
8
9
10
11
12
13
14

// Exa 1 1 . 1
clc ;
clear ;
close ;
// Given d a t a
R1 =15; // i n kohm
R2 =15; // i n kohm
C1 =0.005; // i n uF
C2 =0.005; // i n uF
R = R1 ; // i n Kohm
C = C1 ; // i n uF
T =0.69*( R *10^3* C *10^ -6+ R *10^3* C *10^ -6) ; // i n s e c o n d
f =1/ T ; // i n Hz
disp ( f *10^ -3 , F r e q u e n c y o f o s c i l l a t o r s i n KHz : ) ;

73

You might also like