0% found this document useful (0 votes)
2K views152 pages

Electronics Fundamentals and Applications D Chattopadhyay and P C Rakshit

This document provides a textbook companion for the textbook "Electronics Fundamentals and Applications" by D. Chattopadhyay and P. C. Rakshit. It includes over 150 Scilab codes with explanations and examples corresponding to sections and examples from the textbook. The codes cover topics such as basic ideas of energy bands in solids, electron emission from solids, properties of semiconductors, diode circuits, junction transistors, amplifiers, oscillators, and more. The document lists the Scilab codes and provides context for their use and relation to the textbook examples and sections they supplement.

Uploaded by

Bidyut Roy
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2K views152 pages

Electronics Fundamentals and Applications D Chattopadhyay and P C Rakshit

This document provides a textbook companion for the textbook "Electronics Fundamentals and Applications" by D. Chattopadhyay and P. C. Rakshit. It includes over 150 Scilab codes with explanations and examples corresponding to sections and examples from the textbook. The codes cover topics such as basic ideas of energy bands in solids, electron emission from solids, properties of semiconductors, diode circuits, junction transistors, amplifiers, oscillators, and more. The document lists the Scilab codes and provides context for their use and relation to the textbook examples and sections they supplement.

Uploaded by

Bidyut Roy
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 152

Scilab Textbook Companion for

Electronics Fundamentals and Applications


by D. Chattopadhyay and P. C. Rakshit 1

Created by
Shreeja Lakhlani
B.Tech
Others
Dharamsinh Desai University
College Teacher
Prof. Prarthan. D. Mehta
Cross-Checked by
Bhavani Jalkrish

June 2, 2016

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: Electronics Fundamentals and Applications

Author: D. Chattopadhyay and P. C. Rakshit

Publisher: New Age International, New Delhi

Edition: 8

Year: 2007

ISBN: 81-224-2093-1

1
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.

2
Contents

List of Scilab Codes 4

1 Basic Ideas Energy Bands In Solids 5

2 Electron Emission from Solid 7

3 PROPERTIES OF SEMICONDUCTORS 11

4 Metal Semiconductor Contacts 17

5 Semiconductor Junction Diodes 21

6 Diode Circuits 3
0
7 Junction Transistor Characteristics 37

8 Junction Transistors Biasing and Amplification 45

9Basic Voltage and Power Amplifiers 6


4
10 Feedback In Amplifiers 73

11 Sinusoidal Oscillators and Multivibrators 78

12 Modulation and Demodulation 8


3
13 Field Effect Transistors 8
8
14 Integrated Circuits and Operational Amplifiers 102

3
15 Active Filters 110

16 Special Devices 115

17 Number Systems Boolean Algebra and Digital Circuits 116

19 VLSI Technology and Circuits 125

20 Cathode Ray Oscilloscope 130

21 Communication Systems 135

23 Lasers Fibre Optics and Holography 138

4
List of Scilab Codes

Exa 1.7.1 To find the final velocity of electron . . . . . . . . . . 5


Exa 1.7.2 To find the velocity and kinetic energy of ion . . . . . to 5
Exa 2.7.1 calculate the number of electrons emitted per u n i t area
per second . . . . . . . . . . . . . . . . . . . . . . To 7
Exa 2.7.2 find the percentage change in emission current . . 8
Exa 2.7.3 difference between thermionic work function of the t w o
emitters . . . . . . . . . . . . . . . . . . . . . . . . . . 8
Exa 2.7.4 to find the anode voltage . . . . . . . . . . . . . . . . 9
Exa 3.11.1 To find the conductivity and resistivity . . . . . . . . . 11
Exa 3.11.2 To find Concentration of donor atoms . . . . . . . . . 12
Exa 3.11.4 To find intrinsic conductivity and resistance required . 12
Exa 3.11.5 To find the conductivity and current density of doped
sample . . . . . . . . . . . . . . . . . . . . . . . . . . 13
E x a 3.11.6 To find the electron and hole concentration and conduc- tivity
of doped sample . . . . . . . . . . . . . . . . . . 14
Exa 3.11.7 To find the required wavelength . . . . . . . . . . . . . 15
Exa 3.11.8 To find the magnetic and hall field . . . . . . . . . . . 15
Exa 4.7.1 to find barrier height and depletion region width and
maximum electric field . . . . . . . . . . . . . . . . . 17
Exa 4.7.2 to find the barrier height and concentration . . . . . . to 18
Exa 4.7.3 calculate barrier lowering and the position of the
maximum barrier height . . . . . . . . . . . . . . . . . 18
Exa 4.7.4 to determine the effective richardson constant . . . . . 19
Exa 4.7.5 to calculate current in a Schottky diode . . . . . . . . 20
Exa 5.7.1 To find the voltage to be applied across the junction . 21 To
Exa 5.7.2 calculate the ratio of current for forward bias to that
of reverse bias . . . . . . . . . . . . . . . . . . . . . . 22

5
Exa 5.7.3 To determine the static and dynamic resistance of the diode
. . . . . . . . . . . . . . . . . . . . . . . . . . . 22
Exa 5.7.4 T o calculate the increase in the bias voltage . . . . . . 23
Exa 5.7.5 To find the bias voltage of pn junction diode . . . . . 24
Exa 5.7.6 To calculate the rise in temperature . . . . . . . . . . 24
Exa 5.7.7 To calculate the maximum permissible battery voltage 25 To
Exa 5.7.8 calculate series resistance and the range over which
load resistance can be varied . . . . . . . . . . . . . . 25
Exa 5.7.9 To determine the limits between which the supply volt-
age can vary . . . . . . . . . . . . . . . . . . . . . . . 26
Exa 5.7.10 To find whether power dissipated exceeds the maximum power
limit . . . . . . . . . . . . . . . . . . . . . . . . 27
Exa 5.7.11 To determine the range of variation of the output voltage 28
Exa 5.7.12 To find the value of resistance R . . . . . . . . . . . . 29
Exa 6.11.1 To find various currents voltages power conversion effi-
ciency and percentage regulation . . . . . . . . . . . . 30
Exa 6.11.2 To find various currents power ripple voltage percentage
reg ulati on and effiiciency of rectification . . . . . . . . 31
Exa 6.11.3 To calculate the dc load voltage ripple voltage and the
percentage regulation . . . . . . . . . . . . . . . . . . 32
Exa 6.11.4 To calculate ripple voltage and the percentage ripple . 33
Exa 6.11.5 To design a full wave rectifier with L type LC filter . 34 Exa
7.13.1 To find the voltage gain and power gain of a transistor 37 Exa
7.13.2 To find the base and collector current of a given transistor 38 Exa
7.13.3 To calculate the emitter and collector current of a given
transistor . . . . . . . . . . . . . . . . . . . . . .
. . . 38
Exa 7.13.4 To calculate the voltage between collector and e m i t t e r
terminals . . . . . . . . . . . . . . . . . . . . . . . . . 39
Exa 7.13.5 To check what happens if resistance Rc is i n d e f i n i t e l y
increased . . . . . . . . . . . . . . . . . . . . . . . . . 40
Exa 7.13.6 To check whether transistor is operating in the satura-
tion region for the given hFE . . . . . . . . . . . . . . 41
Exa 7.13.7 To calculate the output resistance along with the current
gain . . . . . . . . . . . . . . . . . . . . . . . . .
. . . 42
Exa 7.13.8 To find the resistance R1 R2 and the range of RL
. . . 43 Exa 8.14.1 To find the Q point and stability factors . . . . . . .
. 45 Exa 8.14.2 To find the resistances R1 R2 and Re . . . . . . . . .
46 6
Exa 8.14.3 To calculate the input and output resistances and cur-
rent voltage and power gain . . . . . . . . . . . . . . . 47
Exa 8.14.4 To find the input and output resistance . . . . . . . . 48
Exa 8.14.5 To find the current amplification and voltage and power
gains . . . . . . . . . . . . . . . . . . . . . . . .
. . . 49
E x a 8.14.6 To determine the current and voltage gain as well as the input
and output resistances . . . . . . . . . . . . . . 50
Exa 8.14.7 To determine the input and output resistances as well
as the voltage gain and Q point . . . . . . . . . . . . . 51
Exa 8.14.8 To design a CE transistor amplifier . . . . . . . . . . . 52
Exa 8.14.9 To find the resistance R1 . . . . . . . . . . . . . . . . 55
Exa 8.14.10To find the quiescent values of IE and VCE . . . . . . 56
Exa 8.14.11To calculate the quiescent values of IB IC IE and VCE 57 Exa
8.14.12To determine the operating point . . . . . . . . . . . . 59 Exa
8.14.13To determine the operating point . . . . . . . . . . . . 60 Exa
8.14.14To determine the ac as well as dc load line and the
amplitude of the output voltage . . . . . . . . . . . . . 61
Exa 9.12.1 To determine the lower and upper half power frequencies 64
Exa 9.12.2 To determine the lower and upper half power frequencies 65
Exa 9.12.3 To find the gain relative to the mid frequency gain . . 66 Exa
9.12.4 To calculate the output power . . . . . . . . . . . . . 67 Exa
9.12.5 To calculate dc input and ac output power along with
the collector dissipation and the efficiency . . . . . . . 68
Exa 9.12.6 To determine the maximum dc power and the maximum
output power along with the efficiency . . . . . . . . . 68
Exa 9.12.7 To calculate the resonant frequency along with the band-
width and the maximum voltage gain . . . . . . . . . 69
Exa 9.12.8 To find out the decibel change in the output power level 70 Exa
9.12.9 To find the rms output voltage and rms input voltage
a lo n g with the output power in the midband region . . 71
Exa 10.7.1 To find the voltage gain with feedback the amount of
feedback in dB the output voltage of the feedback
am- plifier the feedback factor the feedback voltage . . . .
73
Ex a 10.7.2 To find the minimum value of the feedback ratio and
the open loop gain . . . . . . . . . . . . . . . . . . . . 74
Exa 10.7.3 To find the reverse transmission factor . . . . . . . . . 74
Exa 10.7.4 To find voltages current and power dissipation of a given
transistor circuit
7
. . . . . . . . . . . . . . . . . . . . . 75
Exa 10.7.5 To calculate the voltage gain and input output resis-
tances . . . . . . . . . . . . . . . . . . . . . . . . . . . 76
Exa 11.12.1To calculate the frequency of oscillation and mutual i n - ductance
. . . . . . . . . . . . . . . . . . . . . . . . . 78
Exa 11.12.2To find the values of the inductances . . . . . . . . . . 79
Exa 11.12.3To calculate the frequency of oscillation . . . . . . . . 80
Exa 11.12.4To determine the frequency of oscillation . . . . . . . 80
Exa 11.12.5To find the resistances needed to span the frequency
range and to find the ratio of the resistances . . . . . 81
Exa 11.12.6To find the quality factor of the crystal . . . . . . . . 82
Exa 12.9.1 To find the percentage modulation and the amplitude
of the unmodulated carrier . . . . . . . . . . . . . . . 83
Exa 12.9.2 To find the frequency span of each sideband and max-
imum upper and minimum lower side frequency
along
with the channelwidth . . . . . . . . . . . . . . . . . . 84
Exa 12.9.3 To calculate the power developed by an AM wave . . . 84 Exa
12.9.4 To determine the necessary audio power . . . . . . . . 85 Exa
12.9.5 To find the modulation index three pairs of side fre-
quency and the channelwidth . . . . . . . . . . . . . . 85
Exa 12.9.6 To find the highest modulation frequency . . . . . . . 86
Exa 12.9.7 To find the depth of modulation and the total radiated
power . . . . . . . . . . . . . . . . . . . . . . . .
. . . 87
Exa 13.16.1To find the pinch off voltage and the saturation
voltage 88 Exa 13.16.2To find the resistance RS
. . . . . . . . . . . . . . . . 89 Exa 13.16.3To find the
transconductance of the F ET along with the
amplification factor . . . . . . . . . . . . . . . . . . .
89 Exa 13.16.4To calculate the voltage gain and the output resistance 90
Exa 13.16.5To find the drain current and the pinch off voltage . . 90
Exa 13.16.6To determine drain current along with drain source volt-
ag e along with gate source voltage . . . . . . . . . . . 91
Exa 13.16.7To calculate the drain current . . . . . . . . . . . . . 93
Exa 13.16.8To find the saturation drain current and the minimum
value of drain source voltage . . . . . . . . . . . . . . 94
Exa 13.16.9To determine gate source voltage and the transconduc-
tance . . . . . . . . . . . . . . . . . . . . . . . .
. . . 95
Exa 13.16.10To find the8gate source voltage . . . . . . . . . . .
. . 96 Exa 13.16.11To calculate Rs and the channel resistance
. . . . . . . 96 Exa 13.16.12To find the saturation drain current
. . . . . . . . . . 97
Exa 13.16.13To calculate drain current along with gate source voltage
and drain source voltage . . . . . . . . . . . . . . . . . 98
Exa 13.16.14To calculate K along with drain current and drain source
voltage . . . . . . . . . . . . . . . . . . . . . . .
. . . 99
Exa 13.16.15To calculate the voltage gain and the output
resistance 100 Exa 13.16.16To find the small signal voltage gain . . . . . .
. . . . 100 Exa 14.12.1To determine the output voltage along with input
resis-
tance and the input current . . . . . . . . . . . . .
. . 102
Exa 14.12.2To calculate the voltage gain
. . . . . . . . . . . . . . 103 Exa 14.12.3To calculate the voltage
gains for difference and common
mode signals along with CMRR . . . . . . . . . . . . . 103
Exa 14.12.4To find the output voltage of the three input summing
amplifier . . . . . . . . . . . . . . . . . . . . . .
. . . 105
Exa 14.12.5To find the voltage gain along with the output voltage
105 Exa 14.12.6To find the output voltage of the differentiator . . . .
106 Exa 14.12.8To calculate the output voltage . . . . . . . . . . . . .
107 Exa 14.12.9To find the differential mode gain . . . . . . . . . . . .
108 Exa 15.7.1 To design a Butterworth low pass filter . . . . . . . . .
110 Exa 15.7.2 To design a first order Butterworth active High Pass filter
111 Exa 15.7.3 To design a second order band pass Butterworth filter 112
Exa 15.7.4 To design a notch filter . . . . . . . . . . . . . . . . . 113
Exa 16.10.1To determine the time period of the sawtooth voltage
across capacitor C . . . . . . . . . . . . . . . . . . . . 115
Exa 17.17.1To determine the binary equivalents . . . . . . . . . . 116
Exa 17.17.2To determine the decimal equivalent . . . . . . . . . . 116
Exa 17.17.3To convert from binary system to decimal system . . . 117
Exa 17.17.4To convert from decimal system to binary system . . . 118
Exa 17.17.5To find the equivalent of given number in a code base 5 119 Exa
17.17.6To perform binary addition corresponding to decimal
addition
. . . . . . . . . . . . . . . . . . . . . . . . . . 120
Exa 17.17.7To perform binary addition and also to show the c o r r e -
sponding decimal addition . . . . . . . . . . . . . . . . 120
Exa 17.17.8To perform the binary subtraction . . . . . . . . . . . 121
Exa 17.17.9To obtain the output levels 9 of a silicon transistor for
given input levels and to show that circuit has performed
NOT operation using positive logic . . . . . . . . . . . 122
Exa 17.17.10To solve the Boolean expression . . . . . . . . . . . . . 123
Exa 19.29.1To find the value of inverse of aspect ratio along with power
dissipated and load resistance . . . . . . . . . . 125
Exa 19.29.2To find the pull up and pull down aspect ratio . . . . 126 Exa
19.29.3To find the value of inverse of aspect ratio of the PMOS
transistor for a symmetrical inverter . . . . . . . . . . 126
Exa 19.29.4To determine the maximum permissible number of fan
outs . . . . . . . . . . . . . . . . . . . . . . . . .
. . . 127
Exa 19.29.5To calculate the channel transit time
. . . . . . . . . . 128 Exa 19.29.6To calculate the required metal line
width . . . . . . . 128 Exa 20.9.1 To determine the transit time along
with transverse ac-
celeration and spot deflection . . . . . . . . . . . . . . 130
Exa 20.9.2 To calculate the highest frequency of the deflecting volt-
age . . . . . . . . . . . . . . . . . . . . . . . . .
. . . 131
E x a 20.9.3 To find the deflection of the spot and the magnetic d e - flection
sensitivity . . . . . . . . . . . . . . . . . . . . 132
Exa 20.9.4 To calculate the frequency of the signal . . . . . . . . 132
Exa 20.9.5 To find the frequency of the vertical signal . . . . . . . 133
Exa 20.9.6 To find the phase difference between the voltages . . . 134
Exa 21.13.1To calculate the critical frequencies and the maximum
frequencies . . . . . . . . . . . . . . . . . . . . . . . . 135
Exa 21.13.2To find the maximum distance between the transmitting
and receiving points . . . . . . . . . . . . . . . . . . . 136
Exa 21.13.3To find the height of the point above the ground from
which the wave is reflected back . . . . . . . . . . . . 137
Exa 23.31.1To calculate the number of photons emitted per second 138
Exa 23.31.2To calculate the coherence time and the longitudinal
coherence length . . . . . . . . . . . . . . . . . . . . . 139
Exa 23.31.3To calculate the minimum difference between two arms
of a Michelson interferometer . . . . . . . . . . . . . . 139
Exa 23.31.4To show that emission for a normal optical source is
predominantly due to spontaneous transitions . . . . . 140
Exa 23.31.5To determine coherence time and the coherence length 141
Exa 23.31.6To find the line width and the coherence length . . . . 141
Exa 23.31.7To find the radius along with the power density of the
image and the coherence length . . . . . . . . . . . . . 142
Exa 23.31.8To find the amount of pumping energy required for tran-
sition from 3s to 2p . 10. . . . . . . . . . . . . . . . . . 143
Exa 23.31.9To calculate the probability of stimulated emission . . 143
Exa 23.31.10To calculate the NA and the acceptance angle along
with number of reflections per metre . . . . . . . . . .

144

11
Chapter 1

Basic Ideas Energy Bands In


Solids

Scilab code Exa 1.7.1 To find the final velocity of electron

1
2 // scila b 5.4.1
3 / / w ind ow s 7 o p e r a t i n g system
4 / / c hapte r 1 : B a s i c I d e a s : E n e r g y B a n d s In S o l i d s
5 clc
6 clear
7 // given
8 Ek = 1 . 6 * ( 1 0 ^ - 1 9 ) * 1 0 0 ; / / Ek= f i n a l k i n e t i c energy
ofelect r on in J ou les
9 m0 = 9 . 1 1 * ( 1 0 ^ - 3 1 ) ; / / m 0 = r e s t mass o f t h e e l e c t r o
n i n kg
10 / / s o l v i n g f i n a l v e l o c i t y o f the e l e c t r o n
11 v= s q r t ( ( 2 * Ek ) / m0 ) / / v = f i n a l v e l o c i t y o f the e l e
ct ron
12 d i s p ( ”m/ s ” , v , ” v= ”)

Scilab code Exa 1.7.2 To find the velocity and kinetic energy of ion

12
1
2 // scilab 5.4.1
3 / / win dow s 7 o p e r a t i n g system
4 / / c hapte r 1 : B a s i c I d e a s : E n e r g y B a n d s In S o l i d
s
5 clc
6 clear
7 // given data
8 m = 7 3 6 0 * 9 . 1 1 * ( 1 0 ^ - 3 1 ) ; / / m = m a s s o f t h e i o n i n kg
9 q = 2 * 1 . 6 * ( 1 0 ^ - 1 9 ) ; / / q =c h a r g e o f the i o n i n
Coulomb
10 V =2 0 0 0 ; / / V = p o t e n t i a l d i f f e r e n c e i n Volt
11 // solvin g v e l o c i t y & k i n e t i ce n e r g y o f t h e i o
n
12 v= s q r t ( ( 2 * q* V) / m) / / v = v e l o c i t y o f t h e i o n
13 d i s p ( ”m/ s ” , v , ” v= ”)
14 Ek =( 1/ 2) * m* ( v ^ 2 ) / / E k = k i n e t i c energy o f the i o
n
15 d i s p ( ” J ” , Ek , ”Ek= ”)

13
Chapter 2

Electron Emission from


Solid

Scilab code Exa 2.7.1 to calculate the number of electrons emitted per
unit area per second

1
2 // scila b 5.4.1
3 / / w ind ow s 7 o p e r a t i n g system
4 / / c hapte r 2 : E l e c t r o n E m i s s i o n from S o l i d s
5 clc
6 clear
7 // given
8 A = 6. 02 *(10 ^5) // A= t h e rm i o n i c e m i s s i o n c o n s tan t i n
A(m
ˆ ( −2) ) ( K ˆ ( −2) )
9 Ew =4 . 5 4 / / E w = w o r k f u n c t i o n i n eV
10 T =2500 / / T = t e m p e r a t u r e i n K e l vi n
11 kB = 1 . 3 8 * 1 0 ^ ( - 2 3 ) / / k B = B o l t z m a n n ’ s c o n s tan t i n J/K
12 e= 1 . 6 * 1 0 ^ ( - 1 9 ) / / e=c h a r g e o f a n e l e c t r o ni n C
13 b = ( e * Ew) / kB / / b = t h e r m i o n i c e m i s s i o n c o n s t a n t i n K
14 d i s p ( ”K” , b , ” b= ”)
15 J x =A* ( T ^ 2 ) * e x p ( - b / T) / / J x = e m i s s i o n current
d e n s i t y i n A/mˆ( 2 )
16 d i s p ( ”A/ ( mˆ 2 ) ” , J x , ” J x = ”)
17 n =J x / e / / n = n u m b e r o f e l e c t r o n s e m i t t e d per unit
are a per second in (mˆ−2) ( s ˆ−1)
14
18 d i s p ( ” (mˆ −2) ( s ˆ −1) ” , n , ” n= ”)

Scilab code Exa 2.7.2 To find the percentage change in emission current

1
2 // scilab 5.4.1
3 / / win dow s 7 o p e r a t i n g system
4 / / c hapte r 2 : E l e c t r o n E m i s s i o n from S o l i d s
5 clc
6 clear
7 // given
8 T =2673 / / T = t e m p e r a t u r e i n K e l vi n
9 dT =10 / / d T = c h a n g e i n t e m p e r a t u r e i n K e l vi n
10 Ew =4 . 5 4 / / Ew = w o r k f u n c t i o n i n eV
11 e = 1 . 6 * 1 0 ^ ( - 1 9 ) / / e = c h a r g e o f a n e l e c t r o ni n C
12 kB = 1 . 3 8 * 1 0 ^ ( - 2 3 ) / / k B = B o l t z m a n n ’ s c o n s tan t i n J/K
13 / / I = ( S ∗A∗ ( T ˆ 2 ) ) ∗ e xp ( − ( ( e ∗Ew) / ( kB∗T) ) / / I = e m i s s i o n
c u r r e n t , S=s u r f a c e a re a o f the f i l am e n t , d
I = c h a n g e i ne m i s s i o n c u r r e n t
14 d = ( ( 2 * dT) / T ) + ( ( ( e * Ew) / ( kB * ( T ^ 2 ) ) * dT) ) / /
d=change i n e m i s s i o n current
15 d i s p ( ” ” , d , ” d= ”)
16 d*100 / / p e rc e n t change i n e m i s s i o n c u r r e n t
17 d i s p ( ”%” , d * 1 0 0 , ” d ∗100= ”)

Scilab code Exa 2.7.3 difference between thermionic work function of the
two emitters

1
2 // scila b 5.4.1
3 / / w indo ws 7 o p e r a t i n g system
4 / / c hapte r 2 : E l e c t ro n Emis s ion from Solid s
5 clc

15
6 clear
7 // given
8 kB = 1 . 3 8 * 1 0 ^ ( - 2 3 ) / / k B = B o l t z m a n n ’ s c o n s tan t i n J/K
9 / / A = 6 . 0 2 ∗ ( 1 0 ˆ5 ) / / A = t h e rm i o n i c e m i s s i o n c o n s t a n t i
n A ( mˆ( −2) ) ( K ˆ ( −2) )
10 / / E w 1 , Ew 2 = t h e r m i o n i c work f u n c t i o n o f 2 e m i t t e r
s i n eV
11 e= 1 . 6 * 1 0 ^ ( - 1 9 ) / / e=c h a r g e o f a n e l e c t r o ni n C
12 T =2000 / / T = t e m p e r a t u r e i n K e l vi n
13 / / Jx1=A∗ ( T ˆ 2 ) ∗ exp ( −( a / ( kB∗T) ) ) / / J x = e m i s s i o n c u r
r e n t d e n s i t y i n A/mˆ( 2 )
14 / / Jx2=A∗ ( T ˆ 2 ) ∗ e xp ( −(b / ( kB∗T) ) )
15 / / ( J x 1 / J x 2 ) =2
16 / / ( J x 1 / J x 2 ) = e x p ( ( Ew2−Ew1 ) / ( kB∗T) )
17 / / e xp ( ( Ew2−Ew1 ) / ( kB∗T) ) =2
18 d = ( kB* T* l o g ( 2 ) ) / / d=(Ew2−Ew1 ) = d i f f e r e n
ce i n t h e r m i o n i c work f u n c t i o n s o f 2
em it t ers
19 d i s p ( ” J ” , d , ” d= ”)
20 d/ e
21 d i s p ( ” eV ” , d / e , ” d / e= ”)

Scilab code Exa 2.7.4 to find the anode voltage

1
2// scilab 5.4.1
/ / win dow s 7 o p e r a t i n g
3 system
/ / c hapte r
4 2 : E l e c t r o n E m i s s i o n from S o l i d s
clc
5
clear
6
// given
7
/ / I a =(K∗ ( V a ˆ ( 3 / 2 ) ) ) ; I a = s p a c e
8 c harg e l i m i t e d c u r
rent
, Va=anode v o l t a g e , K=p r o p o r t i o n a l i t y c o n
s tan t
9 I a 1 =300 / / I a 1 = s p a c e c harg e l i m i t e d c u r r e n t o f
1 s t anode in A
10 I a 2 =200 / / I a 2 = s p a c e c harg e l i m i t e d c u r r e n t o f
2 nd 16
anode in A
11 Va1 =200 / / V a = a n o d e v o l t a g e o f 1 s t a no d e in V
12 Va2 = ( Va1 * ( ( I a 2 / I a 1 ) ^ ( 2 / 3 ) ) ) / / V a 2 = a n o d e volt a ge
o f 2 nd a n o d e in V
13 d i s p ( ”V” , Va 2 , ” Va 2= ”)

17
Chapter 3

PROPERTIES OF
SEMICONDUCTORS

Scilab code Exa 3.11.1 To find the conductivity and resistivity

1
2 // scila b 5.4.1
3 //WINDOWS 7 O p e r a t i n g System
4 / / c hapte r 3 PROPERTIES OF SEMICONDUCTORS
5 / / example 1
6
7 clc
8 / / Given d a t a
9 T =3 0 0 ; //K
10 ni = 1.5* 10^16; // In t rin sic carrier concen t a rt i
p e r mˆ3 on
11 yn = 0 . 1 3 ; / / E l e c t r o n m o b i l i t y i n m ˆ 2 / ( V∗ s
12 yp = 0 . 0 5 ; / /) Hole m o b i l i t y i n m ˆ 2 / ( V∗ s
13 e =1 . 6 * 1 0 ^ - 1 )9 ; / / Charge o f e l e c t r o n i n
C
14
15 / / R e q u i r e d Formula // Int rinsic conduct ivi
16 Gi =e * n i * ( yn +yp ) ; ty
17
18 Ri =1 / Gi ; // Int rinsic resist ivit y
18
19
20d i s p ( ’ S / m ’ , Gi , ’ I n t r i n s i c c o n d u c t i v i t y=
’);
21
22 d i s p ( ’ ohm∗ m e t e r ’ , Ri , ’ I n t r i n s i c resist i
vit y= ’);
23 / / End

Scilab code Exa 3.11.2 To find Concentration of donor atoms

1
2 // scilab 5.4.1
3 //WINDOWS 7 O p e r a t i n g Systems
4 / / c h a p t e r 3 PROPERTIES OF SEMICONDUCTORS
5
6 / / example 2
7 clc
8 / / Given d a t a
9 Sn =4 8 0 ; / / C o n d u c t i v i t y i n S /m
10 yn = 0 . 3 8 ; / / E l e c t r o n m o b i l i t y i n m ˆ 2 / ( V∗ s
11 e =1 . 6 * 1 0 ^ - 1 9 ); / / Charge o f e l e c t r o n i n C
12
13 / / R e q u i re d Formula
14 Nd=Sn / ( e * y n ) ; / / Co nc e n t r a t i o n o f donor per m
atoms
15 d i ˆ3
s p ( ’mˆ −3 ’ , Nd , ’ C o n c e n t r a t i o n o f d o n o r
atoms ’ ) ;
16 / / End

Scilab code Exa 3.11.4 To find intrinsic conductivity and resistance re-
quired

1
2 // scila b 5.4.1
3 //OS−WINDOWS 7
4 / / c h a p t e r 3 PROPERTIES OF SEMICONDUCTORS

19
5 / / example 4
6
7 clc
8 / / Given d a t a
9 T =3 0 0 ; //K
10 ni = 1.5* // In t rin sic carrier concen t a rt i
10^16; on
11 yn =p 0e r. 1 mˆ3
3; / / E l e c t r o n m o b i l i t y i n m ˆ 2 / ( V∗ s
12 yp = 0 . 0 5 ; / /) Hole m o b i l i t y i n m ˆ 2 / ( V∗ s )
13 e =1 . 6 * 1 0 ^ - 1 9 ; / / Charge o f e l e c t r o n i n
14 l =0. 01; / / l e n Cg t h i n m
15 a = 1 0 ^ - 6 ; / / c r o s s s e c t i o n a l are a i n
16 mˆ2
17 / / R e q u i r e d F o r m u l a
18 Gi =e * n i * ( yn +yp ) ; // Int rinsic conduct ivi
19 ty
20 Ri =l / ( Gi * a ) ; / / Required r e s i s t a n c e
21
22 d i s p ( ’ S / m ’ , Gi , ’ I n t r i n s i c conduct i
v i t y= ’ ) ;
23
24 d i s p ( ’ ohm ’ , Ri , ’ r e q u i r e d r e s i s t a n c e
’);
25 / / End

Scilab code Exa 3.11.5 To find the conductivity and current density of
doped sample

1
2 // scila b 5.4.1
3 / / w indo ws 7 o p e r a t i n g system
4 / / c hapte r 3 : P r o p e r t i e so f S e m i c o n d u c t o r s
5 clc
6 clear
7 // given
8 z =( 100/ 60) ; / / z = c o n d u c t i a r r i e r concent rat ion in
/(m
ˆ3 )
20
9 ni = 2.5* 1 0 ^ ( 1 9 ) ; / / ni=i n t r i n s i c conduct ivi
t y o f i n t r i n s i c m a t e r i a l i n S/m
10 / / ( P / N ) = ( 1 / 2 ) ; / / ( P / N ) = r a t i o of hole m ob ilit y
( P ) t o e l e c t r o n m o b i l i t y (N)
11 e = 1 . 6 * ( 1 0 ^ - 1 9 ) ; / / e = c h a r g e of elect ron in
Coulomb
12 N=( z / ( e * n i *( 1+( 1/ 2) ) ) )
13 d i s p ( ” ( m ˆ 2 ) / ( V . s ) ” , N, ”N= ” )
14 P = ( N / 2 )
15 d i s p ( ” ( m ˆ 2 ) / ( V . s ) ” , P , ”P= ” )
16 //Nd+p=Na+n ; n=e l e c t r o n c o n c e n t r a t i o n ;
p=h o l e c o n c e n t r a t i o n
17 / / n p = ( n i ˆ 2 )
18 Nd = ( 1 0 ^ 2 0 ) / / N d = d ono r concent ra t ion i
n /(mˆ3 )
19 Na = 5 * ( 1 0 ^ 1 9 ) / / N a = a c c e p t o r concent rat io
n in /(mˆ3 )
20 n =( 1/ 2) * ( ( Nd - Na ) + s q r t ( ( ( Nd - Na ) ^ 2 )
+(4*( n i ^ 2 ) ) ) )
21 d i s p ( ” / (m ˆ 3 ) ” , n , ” n= ”)
22 p = ( n i ^ 2 ) / n
23 d i s p ( ” / (m ˆ 3 ) ” , p , ” p= ”)
24 Z = e * ( ( n* N) + ( p* P ) ) / / Z = c o n d u c t i v i t y of
doped sample i n S /m
25 d i s p ( ” S / m” , Z, ”Z= ”)
26 F =200 / / F = a p p l i e d e l e c t r i c f i e l d i n V/cm
27 J = Z* F / / J = t o t a l c o nduc t i o n c u r r e n t d e n s i t y i n
A/(mˆ2 )
28 Scilab code
d i s p ( ”A / (mExa
ˆ 2 )3.11.6
” , J , To ” Jfind
= ”)the electron and hole concentration and
conductivity of doped sample

1
2 // scila b 5.4.1
3 / / w indo ws 7 o p e r a t i n g system
4 / / c hapte r 3 : P r o p e r t i e so f S e m i c o n d u c t o r s
5 clc
6 clear
7 // given

21
8 ni = 2.5* 1 0 ^ ( 1 9 ) ; / / ni=i n t r i n s i c conduct ivi
t y o f i n t r i n s i c m a t e r i a l i n S/m
9 Nd = 5 * ( 1 0 ^ 1 9 ) / / N d = d onor con cen t rat ion i
n /(mˆ3 )
10 n =( 1/ 2) * ( Nd+ s q r t ( ( Nd ^ 2 ) + ( 4 * ( n i ^ 2 ) ) ) ) / / n = e l e
ct ronconcent rat ion
11 d i s p ( ” / (m ˆ 3 ) ” , n , ” n= ”)
12 p=( n i ^ 2 ) / n / / p=h o l e c o n c e n t r a t i o n
13 d i s p ( ” / (m ˆ 3 ) ” , p , ” p= ”)
14 N =0 . 3 8 / / N = e l e c t r o n m o b i l i t y i n (mˆ2 ) / ( V . s )
15 P =0 . 1 8 / / P = h o l e m o b i l i t y i n (mˆ2 ) / ( V . s )
16 e= 1 . 6 * ( 1 0 ^ - 1 9 ) / / e=e l e c t r o n i c c harg e i n
Coulomb
17 Z = e * ( ( n* N) + ( p* P ) ) / / Z = c o n d u c t i v i t y o f d o p e d s a m p l e
i n S /m
18 d i s p ( ” S / m” , Z, ”Z= ”)

Scilab code Exa 3.11.7 To find the required wavelength

1
2 // scila b 5.4.1
3 / / w ind ow s 8 o p e r a t i n g system
4 / / c hapte r 3 : P r o p e r t i e so f S e m i c o n d u c t o r s
5 clc
6 clear
7 // given
8 c= 3 * ( 1 0 ^ 8 ) ; / / c=v e l o c i t y o f l i g h t i n vacuum in
m/ s
9 h = 6 . 6* ( 1 0^ - 3 4 ) ; / / h=Planck ’ s c o n s tan t i n J . s
10 Eg = 1 . 9 8 * 1 . 6 * ( 1 0 ^ - 1 9 ) / / Eg = b a n d gap i n J
11 / / c a l c u l a t i n g Y=r e q u i r e d w a v e l e n g t h
12 Y = ( ( c * h ) / Eg ) / ( 10^ - 9 )
13 d i s p ( ”nm” , Y, ”Y= ” )

Scilab code Exa 3.11.8 To find the magnetic and hall field

22
1
2 // scila b 5.4.1
3 / / w ind ow s 7 o p e r a t i n g system
4 / / c hapte r 3 : P r o p e r t i e so f S e m i c o n d u c
tors
5 clc
6 clear
7 // given
8 RH = ( 1 0 ^ - 2 ) ; / / R H = H a l l c o e f f i c i e n t i n (mˆ3
) /C
9 VH = ( 1 0 ^ - 3 ) ; / / V H = H a l l Vol tage i n V
10 b =2*(10^ - 3 ) ; / / b=width i n m
11 I=(10^ - 3 ) ; / / I=c u r r e n t i n A
12 / / RH= (VH∗ b ) / ( I ∗B)
13 B=( VH* b ) / ( I * RH) / / B= m a g n e t i c f i e l d
14 d i s p ( ”T ” , B, ”B= ” )
15 t =( 10 ^ - 3 ) / / t = t h i c k n e s s in m
16 FH = ( VH/ t ) / / F H = H a l l field
17 d i s p ( ”V/ m” , FH , ”FH= ” )

23
Chapter 4

Metal Semiconductor Contacts

Scilab code Exa 4.7.1 to find barrier height and depletion region width
and maximum electric field

1
2 // scilab 5.4.1
3 / / win dow s 7 o p e r a t i n g system
4 / / c hapte r 4 : Metal −Semiconductor C o n t a c t s
5 clc
6 clear
7 // given
8 Qm =4 . 5 5 //Qm=work f u n c t i o n o f t u n g s t e n i n eV
9 X =4 . 0 1 / / X = e l e c t r o n a f f i n i t y o f s i l i c o n i n eV
10 eQb = ( Qm - X) / / e Q b = b a r r i e r h e i g h t as s e e n from
the metal
11 d i s p ( ” eV” , e Qb , ” eQb= ”)
12 a =0 . 2 1 / / a=(Ec −Ef ) = f o r b i d d e n gap i n eV
13 e Vb i =e Qb - a / / e V b i = b a r r i e r h e i g h t from s e m i c o
nduc to r s i d e
14 d i s p ( ” eV” , e Vbi , ” e V b i= ”)
15 Es = 1 1 . 7 * 8 . 8 5 4 * ( 1 0 ^ - 1 2 ) / / E s = p e r m i t t i v i t y of
s e mi c o n d u c to r ; 1 1 . 7 = d i e l e c t r i c c o n s tan t o f
silicon
16 e= 1 . 6 * 1 0 ^ ( - 1 9 ) / / e=c h a r g e o f an e l e c t r o n
17 Nd = 1 0 ^ 2 2 / / N d = d ono r concent rat ion i n mˆ−3
24
18 W = ( ( 2 * Es * e Vbi ) / ( e * Nd ) ) ^ ( 1 / 2 ) / / W = w i d t h
of the d e p l e t i o n r e g i o n
19 d i s p ( ”m” , W, ”W= ” )
20 Fm = ( ( e * Nd* W) / Es ) / / Fm= maximum e l e c t r i c fie
l d i n V/m
21 d i s p ( ”V/ m” , Fm , ”Fm= ” )

Scilab code Exa 4.7.2 to find the barrier height and concentration

1
2 // scilab 5.4.
1 7 o p e r a t i n g system
3 / / windows 4 : M e t a l − S e m i c o n d u c t o r C o n t a c t s
4 / / c hapte r
5 clc
6 clear
7 // given g i v e n data b a r r i e r h e i g h t =Vbi=i n t e r c e
8 / / on as Vr paexpr it s = 0 . 4 V
9 Es = 1 1 . 7 * 8 . 8 5 4 * ( 1 0 ^ - 1 2 ) / / E s = p e r m i t t i v i t y of
s e mi c o n d u c to r ; 1 1 . 7 = d i e l e c t r i c c o n s t a sn i tl ioc o
f n
10 e= 1 . 6 * 1 0 ^ ( - 1 9 ) / / e=c h a r g e o f an e l e c t r o n
11 m = S4 c. 4h*o t1t 0k ^y ( 1 5 ) / / m =cs ol no tpaec t i on f( c( m1 ˆ/ 4C )ˆ 2( F) ˆ −2
vs )Vr p lot
(Vˆ−1)
12 o/ /fm a= 2 / ( e ∗ Es ∗Nd)
13 Nd = ( 2 * 1 0 ^ 8 ) / ( e * Es * m) / / Nd= d ono r concent r
a t ion i n s i l i c o n i n mˆ−3
14 d i s p ( ”mˆ −3 ” , Nd , ”Nd= ”)

Scilab code Exa 4.7.3 to calculate barrier lowering and the position of the
maximum barrier height

1
2 // scila b 5.4.1
3 / / wi ndo ws 7 o p e r a t i n gs y s t e m

25
4 / / c hapte r 4 : Metal −Semiconductor C o n t a c t s
5 clc
6 clear
7 // given
8 e =1 . 6 * 1 0 ^ - 19 / / e = c h a r g e o f an e l e c t r o n i n C
9 Fa = 7 * 1 0 ^ 6 / / F a = r e v e r s e b i a s f i e l d i n V/m
10 Es = 1 3 . 1 * 8 . 8 5 4 * 1 0 ^ - 12 / / ( E s / E o ) = 1 3 . 1 ; Eo= 8. 854 ∗ 10 ˆ −
12
11 dQ = ( ( e * F a ) / ( 4 * %p i * E s ) ) ^ ( 1 / 2 ) / / d Q = b a r r i e r l o w e r i n
g inV
12 d i s p ( ”V” , dQ , ”dQ= ” )
13 Xm = ( dQ) / ( 2 * F a ) / / X m = p o s i t i o n o f t h e maximum b a r
rierheight
14 d i s p ( ”m” , Xm , ”Xm= ” )

Scilab code Exa 4.7.4 to determine the effective richardson constant

1
2 // scilab 5.4.1
3 / / win dow s 7 o p e r a t i n g system
4 / / c hapte r 4 : Metal −Semiconductor C o n t a c t s
5 clc
6 clear
7 // given
8 / / Js=A∗ ( T ˆ 2 ) ∗ e xp ( − ( ( e ∗Qbn) / ( kB∗T) ) )
9 kB = 1 . 3 8 * 1 0 ^ ( - 2 3 ) / / k B = B o l t z m a n n ’ s c o n s tan t i n J/K
10 T =300 / / T = t e m p e r a t u r e i n K e l vi n
11 e =1 . 6 * 1 0 ^ - 19 / / e = c h a r g e o f an e l e c t r o n i n C
12 J s = 6*1 0^ - 5 / / J s = e m i s s i o n c u r r e n t d e n s i t y i n A/cmˆ2
13 Qbn =0 . 6 6 8 / / Q b n = b a r r i e r height in V
14 A=( J s / ( T ^ 2 ) ) * e x p ( ( e * Qbn ) / ( kB* T) ) / / A= R i
chardson c o n s tan t
15 d i s p ( ” ( cmˆ−2) ( Kˆ −2) ” , A, ”A= ”)

26
Scilab code Exa 4.7.5 to calculate current in a Schottky diode

1
2 // scila b 5.4.1
3 / / w ind ow s 7 o p e r a t i n g system
4 / / c hapte r 4 : Metal −Semiconductor C o n t a c t s
5 clc
6 clear
7 // given
8 e =1 . 6 * 1 0 ^ - 19 / / e = c h a r g e o f an e l e c t r o n i n C
9 V =0 . 3 2 / / V = a p p l i e d f orward b i a s i n V
10 kB = 1 . 3 8 * 1 0 ^ ( - 2 3 ) / / k B = B o l t z m a n n ’ s c o n s tan t i n J/K
11 T =300 / / T = T e m p e r a t u r e i n K e l vi n
12 J s =0 . 6 1 / / J s = r e v e r s e sa t u r a t ioncu r r en t d en sit y i
n A / mˆ2
13 J = J s * ( e x p ( ( e * V) / ( kB* T ) ) - 1 ) / / J = c u r r e n t d e n s i t y i n
A/m
ˆ2
14 d i s p ( ”A/ mˆ 2 ” , J , ” J = ”)
15 A =4* 10^ - 8 / / A = c r o s s s e c t i o n a l a r e a i n mˆ2
16 I = ( J * A) * 1 0 ^ 3 / / I = c u r r e n t
17 d i s p ( ”mA” , I , ” I= ”)

27
Chapter 5

Semiconductor Junction
Diodes

Scilab code Exa 5.7.1 To find the voltage to be applied across the junction

1
2 // scilab 5.4.1
3 / / win dow s 7 o p e r a t i n g system
4 / / Chapter 5 : Se mic on d u c t o r J u n c t i o n Diodes
5 clc
6 clear
7 / / I = I s ∗ ( e xp ( ( e ∗V) / kB∗T ) −1)
8 I=50*10^( - 3) / / I=Forward c u r r e n t i n ampere
9 I s =5*10^( - 6) / / I s=Reverse sa t u r a t ioncu r r en
t i n ampere
10 e= 1 . 6 * 1 0 ^ ( - 1 9 ) / / e=c h a r g e of elect ron in
coulomb
11 //V=v o l t a g e
12 kB = 1 . 3 8 * 1 0 ^ ( - 2 3 ) / / k B = B o l t z m a n n ’ s c o n s tan t i n Jo
ul e / k e l v i n
13 T =300 / / T = T e m p e r a t u r e in kelvin
14 a = ( I / I s ) +1
15 / / exp ( ( e ∗V) / kB∗T ) = a
16 V = ( ( kB* T) / e ) * l o g ( 1 0 ^ 4 )
17 d i s p ( ”V” , V, ”V= ” )

28
Scilab code Exa 5.7.2 To calculate the ratio of current for forward bias to
that of reverse bias

1
2 // scilab 5.4.1
3 / / win dow s 7 o p e r a t i n g system
4 / / c hapte r 5 : Se mic on d u c t o r J u n c t i o n Diodes
5 clc
6 clear
7 // given
8 e =1 . 6 * 1 0 ^ - 19 / / e= c h a r g e o f an e l e c t r o n i n C
9 V1 =0 . 0 6 / / V 1 = a p p l i e d f orward b i a s i n V
10 V2 = ( - 0 . 0 6 ) / / V 2 = a p p l i e d reverse bias in V
11 kB = 1 . 3 8 * 1 0 ^ ( - 2 3 ) / / k B = B o l t z m a n n ’ s c o n s tan t i n J/K
12 T =300 / / T = T e m p e r a t u r e i n K e l vi n
13 / / I s = r e v e r s e sa t u r a t ioncu r r en t in A
14 / / I 1 = I s ∗ ( ex p ( ( e ∗V1 ) / ( kB∗T) ) − 1 ) / / I 1 = c u r r e
nt f o r f orward bias
15 / / I 2 = I s ∗ ( exp ( ( e ∗V2 ) / ( kB∗T) ) − 1 ) / / I 2 = c u r r e
nt forreverse bias
16 a = ( ( e x p ( ( e * V1 ) / ( kB* T ) ) - 1 ) ) / ( ( e x p ( ( e * V2
) / ( kB* T ) ) - 1 ) )
/ / a=( I 1 / I 2 )
17 di s p ( ” ” ,
a b s ( a ) , ” a ”)

Scilab code Exa 5.7.3 To determine the static and dynamic resistance of
the diode

1
2 // scila b 5.4.1
3 / / w indo ws 7 o p e r a t i n g system
4 / / Chapter 5 : Se m ic o n d u c t o r J u n c t i o n Diodes
5 clc

29
6 clear
7 V =0. 9 / / V = f o r w a r d b ia s volt age
8 I=60*10^( - 3) / / I=Current i n ampere
9 r d c = ( V/ I ) / / r d c = s t a t i c r e s i s t a n c e i n ohm
10 n=2 / / n = e m i s s i o n coefficien t
11 r a c = ( ( 2 6 * n * 1 0 ^ ( - 3 ) ) / I ) / / r a c = d y n a m i c resist
ance
12 d i s p ( ”ohm ” , r d c , ” r d c= ”)
13 d i s p ( ”ohm ” , r a c , ” r a c= ”)

Scilab code Exa 5.7.4 To calculate the increase in the bias voltage

1
2 // scilab 5.4.1
3 / / win dow s 7 o p e r a t i n g system
4 / / c hapte r 5 : Se mic on d u c t o r J u n c t i o n Diodes
5 clc
6 clear
7 e= 1 . 6 * 1 0 ^ ( - 1 9 ) / / e=c h a r g e o f an e l e c t r o n i n C
8 kB = 1 . 3 8 * 1 0 ^ ( - 2 3 ) / / k B = B o l t z m a n n ’ s c o n s tan t i n J/K
9 / / V , V1=f o r w a r d bias volt agesin V
10 n=2 / / n = e m i s s i o n c o e f f i c i e n t f o r s i l i c o n pn j u n c
t i o n d i o de
11 T =300 / / T = T e m p e r a t u r e in kelvin
12 / / I s=Reverse sa t u r a t ioncu r r en t in A
13 / / I = I s ∗ ( ex p ( ( e ∗V) / ( n∗kB∗T) ) ) / / I = c u r r e n t for f
orward b i a s v o l t a g e V
14 / / 2 I = I s ∗ ( exp ( ( e ∗V1 ) / ( n∗kB∗T) ) ) / / 2 I = c u r r e n t
f o r f o r w a r d b i a s v o l t a g e V1
15 / / exp ( ( e ∗ ( V1−V) / ( n∗kB∗T) ) ) =2
16 a = ( ( ( n* kB* T) / e ) * l o g ( 2 ) ) * 1 0 ^ 3 / / a=(V1−V)=i n c r e a
se i n the b i a s v o l t a g e i n V
17 d i s p ( ”mV” , a , ”V1−V”)

30
Scilab code Exa 5.7.5 To find the bias voltage of pn junction diode

1
2 // scilab 5.4.1
3 / / win dow s 7 o p e r a t i n g system
4 / / c hapte r 5 : Se mic on d u c t o r J u n c t i o n Diodes
5 clc
6 clear
7 e= 1 . 6 * 1 0 ^ ( - 1 9 ) / / e=c h a r g e o f an e l e c t r o n i n C
8 kB = 1 . 3 8 * 1 0 ^ ( - 2 3 ) / / k B = B o l t z m a n n ’ s c o n s tan t i n J/K
9 n=2 / / n = e m i s s i o n c o e f f i c i e n t f o r s i l i c o n pn j u n c
t i o n d i o de
10 T =300 / / T = T e m p e r a t u r e in kelvin
11 / / I s=Reverse sa t u r a t ioncu r r en t in A
12 //V=b i a s volt age in V
13 / / I = I s ∗ ( ex p ( ( e ∗V) / ( n∗kB∗T) ) − 1 ) / / I = r e v e r s e curren
t inA
14 / / I = ( −( I s / 2 ) )
15 a = ( ( ( n* kB* T) / e ) * l o g ( 1 / 2 ) ) * 1 0 ^ 3 / / a = b i a s for rev
e r s e c u r r e n t i n s i l i c o n pn j u n c t i o n d i o de
16 d i s p ( ”mV” , a , ”V”)
17 d i s p ( ” The n e g a t i v e s i g n s u g g e s t s d i o de i n r e v
e r s e b i a s ”)

Scilab code Exa 5.7.6 To calculate the rise in temperature

1
2 // scila b 5.4.1
3 / / w indo ws 7 o p e r a t i n g system
4 / / c hapte r 5 : Se m ic o n d u c t o r J u n c t i o n Diodes
5 clc
6 clear
7 / / T 1 , T2=Temperature in kelvin
8 / / I s 1=Reverse s a t u r a t i o n c u r r e n t at te mpe ra tu re
T1 i n ampere

31
9 / / I s 2=Reverse s a t u r a t i o n current at te
m p e r a t u r e T2 i n a m p e r e
10 / / I s 2 = I s 1 ∗ 2 ˆ ( ( T2−T1 ) / 10 )
11 / / ( ( T2−T1 ) / 10 ) ∗ l o g ( 2 ) = l o g ( I s 2 / I s 1 )
12 / / b=( I s 2 / I s 1 )
13 b=50
14 a = ( ( 1 0 * l o g ( b ) ) / l o g ( 2 ) ) / / a=(T2−T1 ) = r i s
e i n te mpe rature i n de g re e celc
ius
15 d i s p ( ”C” , a , ”T 2−T 1 ”)

Scilab code Exa 5.7.7 To calculate the maximum permissible battery volt-
age

1
2 // scila b 5.4.1
3 / / w ind ow s 7 o p e r a t i n g system
4 / / c hapte r 5 : Se mi c o n d u c t o r J u n c t i o n Diodes
5 clc
6 clear
7 V =0. 6 / / V = c u t i n volt age in V
8 r=150 / / r=f orw ard r e s i s t a n c e i n ohm
9 P = 2 0 0 * ( 1 0 ^ - 3 ) / / P = m a x i m u m power i n Watt
10 / / P = ( i ˆ 2 ) ∗ r where i=maximum s a f e di o de c u r r e n t
11 i =( s q r t ( P / r ) ) * 1 0 ^ 3
12 d i s p ( ”mA” , i , ” i = ”)
13 / / i = ( ( V b / 3 )−V) / 3 by a p p l y i n g KCL
14 Vb = ( ( 3 * i ) +V) *3 //Vb =m axim um p e r m i s s i b l e bat
te r y v o l t a g e
15 d i s p ( ”V” , Vb , ”Vb= ” )

Scilab code Exa 5.7.8 To calculate series resistance and the range over
which load resistance can be varied

32
1
2 // scilab 5.4.1
3 / / win dow s 7 o p e r a t i n g system
4 / / c hapte r 5 : Se mic on d u c t o r J u n c t i o n Diodes
5 clc
6 clear
7 V =15 / / V = s u p p l y volt age
8 Vz=12 / / V z = Ze n e r volt age
9 P =0 . 3 6 / / P = p o w e r o f Z e n e r d i o de
10 / / P= Vz ∗ I
11 I = ( P / Vz ) / / I=maximum a l l o w a b l e Zener c u r r e n t
12 d i s p ( ”A” , I , ” I= ”)
13 Vr =V- Vz / / V r = v o l t a g e drop a c r o s s s e r i e s r e s i s t a n
ce R
14 d i s p ( ”V” , Vr , ” Vr= ”)
15 R=Vr / I / / R= s e r i e s resist a nce
16 d i s p ( ”ohm ” , R, ”R= ” )
17 / / I=I z+I l
18 I z = 2 * ( 1 0 ^ - 3 ) / / I z=minimum d i o de current
19 I l =I - I z / / I l = c u r r e n t t h r o u g h l o a d r e s i s t a n c e Rl
20 d i s p ( ”A” , I l , ” I l = ”)
21 Rl m =Vz / I l / / R l m = m i n i m u m v a l ue o f Rl
22 d i s p ( ”ohm ” , Rl m , ”Rlm= ”)
23 d i s p ( ” The a l l o w a b l e r a n g e o f v a r i a t i o n o f
Rl i s 4 2 8 . 6 ohm<=Rl< i n f i n i t e ”)

Scilab code Exa 5.7.9 To determine the limits between which the supply
voltage can vary

1
2 // scila b 5.4.1
3 / / w indo ws 7 o p e r a t i n g system
4 / / c hapte r 5 : Se m ic o n d u c t o r J u n c t i o n Diodes
5 clc
6 clear
7 V =15 / / V = s u p p l y volt age

33
8 Vz=12 / / V z = Zen e r volt age
9 P =0 . 3 6 / / P = p o w e r o f Ze n e r d i o de
10 / / P= Vz∗ I
11 I = ( P / Vz ) / / I=maximum a l l o w a b l e Ze n e r cur
rent
12 d i s p ( ”A” , I , ” I= ”) by t h e z e n e
13 I z = 2 * 1 0 ^ ( - 3 ) / / I z=minimum v a l ue atta r
inedcurrent
14 Rl =1000 / / R l = l o a d resist an ce
15 i =Vz / Rl / / i = l o a d current
16 d i s p ( ”A” , i , ” i = ”) v a l ue o f c u r r e n
17 I mi n =I z +i / / I m in = m in i m u m a l l o w a b l et
18 R =100 / / R = s e r i e s resist ance
19 Vr = I mi n * R / / V r = v o l t a g e d r o p a c r o s s R
20 d i s p ( ”V” , Vr , ” Vr= ”) v a l ue o f
21 Vmi n =Vz +Vr / / Vmin=minimum V
22 d i s p ( ”V” , Vmi n , ”Vmin= ”)
23 I 1 =I +i
24 d i s p ( ”A” , I 1 , ” I 1= ”)
25 VR=I 1 * R
26 d i s p ( ”V” , VR , ”VR= ” ) v a l ue o f V
27 Vmax=Vz+VR //Vmax=maximum
28 d i s p ( ”V” , Vmax , ”Vmax= ” Vmin ) &
29 d i s p ( ”V c a n v a r y b e t w e e n Vmax”)

Scilab code Exa 5.7.10 To find whether power dissipated exceeds the max-
imum power limit

1
2 // scilab 5.4.1
3 / / win dow s 7 o p e r a t i n g system
4 / / c hapte r 5 : Se mi c o n d u c t o r J u n c t i o n Diodes
5 clc
6 clear
7 Vz=3 / / V z = b r e a k d o w n v o l t a g e o f z e n e r d i o de
8 Vi =1 2 / / V i = i n p u t volt a ge

34
9 V =[ 12; - 3 ] / / V= [ Vi: −Vz ]
10 R1 =1000
11 R2 =1000
12 R3 =500 / / R 1 , R2 , R 3 = r e s i s t a n c e s
13 R=[ R1 +R2 - R2 ; - R2 R2 +R3 ]
14 I 1 = i n v ( R) * V / / s o l v i n g t h i s m a t r i x on t h e b a s i
s o f a p p l i c a t i o n o f KCL & KVL , we g e t t h e v a
l u e s o f b r a n ch c u r r e n t s I & I z a s I 1 = [ I ; I z ]
15 d i s p ( ”A” , I 1 ( 1 ) , ” I = ”)
16 d i s p ( ”A” , I 1 ( 2 ) , ” I z= ”)
17 Pz=Vz* I 1 ( 2 ) / / P z = p o w e r d i s s i p a t e d i n z e n e r d i o
de
18 d i s p ( ”W” , Pz , ” P z= ”)
19 d i s p ( ” P ower d i s s i p a t e d d oes n ot ex ceed t h e
maximum p o w e r l i m i t o f 20mW” )

Scilab code Exa 5.7.11 To determine the range of variation of the output
voltage

1
2 // scilab 5.4.1
3 / / win dow s 7 o p e r a t i n g system
4 / / c hapte r 5 : Se mic on d u c t o r J u n c t i o n Diodes
5 clc
6 clear
7 Vs1 =15
8 Vs2 =30 / / V s = s u p p l y v o l t a g e v a r y i ng from 15
( Vs1 ) t o 30 ( Vs2 ) Volt
9 Vzo =9 / / Vzo=knee volt age
10 rZ =5 / / r Z = d y n a m i c r e s i s t a n c e i n ohms
11 R =800 / / R = s e r i e s r e s i s t a n c e i n ohms
12 I z mi n = ( Vs1 - Vz o ) / ( R+r Z) / / I z m i n = c u r r e n t t h r o u g h z
e n e r d i o d e when Vs i s 15 V
13 d i s p ( ”A” , I z mi n , ” I z m i n = ”)
14 Vo mi n = ( r Z * I z mi n ) + Vzo / / Vomin=c o r r e s p o n d i n g
minimum o u t p u t v o l t a g e

35
15 d i s p ( ”V” , Vo mi n , ” Vomin= ”)
16 I z ma x = ( Vs2 - Vz o ) / ( R+r Z) / / I z m a x = c u r r e n t t h r o u g h z
e n e r d i o de when Vs i s 30 V
17 d i s p ( ”A” , I z ma x , ” I zm a x= ”)
18 Vomax = ( r Z * I z ma x ) + Vzo / / V o m a x = c o r r e s p o n d i n g
maximum o u t p u t v o l t a g e
19 d i s p ( ”V” , Vomax , ”Vomax= ”)
20 d i s p ( ” O u t p u t v o l t a g e Vo v a r i e si n t h e r a n g e
Vomin to Vomax ”)

Scilab code Exa 5.7.12 To find the value of resistance R

1
2 // scilab 5.4.1
3 / / win dow s 7 o p e r a t i n g system
4 / / c hapte r 5 : Semiconductor Junc t i o n
Diodes
5 clc
6 clear
7 V =35 / / V = s u p p l y volt age
8 I z = 2 5 * 1 0 ^ ( - 3 ) / / I z = d i o de current
9 I l =5*10^( - 3 ) / / I l =l o ad current
10 Vzo =7 / / Vzo=knee v o l t a g e o f z e n e r d i o de
11 rZ =6 / / r Z = d y n a m i c r e s i s t a n c e i n ohms
12 Vz= Vzo + ( r Z * I z ) / / Vz=z e n e r volt age
13 d i s p ( ”V” , Vz , ” Vz= ”)
14 I =I z +I l / / I = c u r r e n t through r e s i s t a n c e
R
15 d i s p ( ”A” , I , ” I= ”)
16 R=( V- Vz ) / I
17 d i s p ( ”ohm ” , R, ”R= ” )

36
Chapter 6

Diode Circuits

Scilab code Exa 6.11.1 To find various currents voltages power conversion
efficiency and percentage regulation

1
2 // scila b 5.4.1
3 / / w ind ow s 7 o p e r a t i n g system
4 / / c hapte r 6 : Diode C i r c u i t s
5 clc;
6 clear;
7 // given data
8Vr ms =2 0 ; // in volt s
9 Vm = 2 0 * 1 . 4 1 ; / / i n v o l
t s 10 Rf =5 0 ; / / f o r w a r d r e s i s t a n c e i n ohms
11 RL = 1 2 0 0 ; / / l o ad resist a nce in
12 ohms
13 I m=Vm / ( Rf +RL) ; //
pe ak lo
ad c u r r e n t
14 f o r ma t ( ” v” , 7 )
15 d i s p ( ’A ’ , I m , ’ Im=
’);
16
17 I dc =I m/ %pi ; //
dc l o a d cu
rrent
37
18 f o r ma t ( ” v” , 8 ) / / t o s e t the c u r r e n t p r i n t i n g f
orma t with the s p e c i f i e d p a r a m e t e r type
19 d i s p ( ’A ’ , I d c , ’ I d c = ’ ) ;
20
21 I r ms =I m / 2 ; / / rms l o a d current
22 I r ms 1 = s q r t ( ( I r ms ^ 2 ) - ( I d c ^ 2 ) ) / / rms ac l o ad c u r
rent
23 f o r ma t ( ” v” , 8 )
24 d i s p ( ’A ’ , I r ms 1 , ’ rms ac l o a d c u r r e n t i s = ’ ) ;
25 / / Dc v o l t a g e a c r o s s t h e d i o de
26 Vdc= I d c * Rf ;
27 f o r ma t ( ” v” , 6 ) v o l t a g e a c r o s s t h e di o d e = ’ ) ;
28 d i s p ( ’V ’ , Vdc , ’ Dc
29 / / Dc o u t p u t power
30 Pdc= I d c * I d c * RL;
31 f o r ma t ( ” v” , 6 ) o u t p u t power=
32 d i s p ( ’W ’ , Pdc , ’’Dc) ;
33
34 n = 40. 6/ ( 1+( Rf / RL) ) ; / / c o n v e r s i o ne f f i c i e n
cy
35 f o r ma t ( ” v” , 5 )
36 d i s p ( ’% ’ , n , ’ c o n v e r s i o n e ffi c i e n c y= ’ );
37
38 s =Rf * 1 0 0 / RL; / / Pe r tc e n tag e r e g u l a t i o n
39 f o r ma t ( ” v” , 5 )
40 d i s p ( ’% ’ , s , ’ P e r t c e n t a g e r e g u l a t i o n = ’ ) ;
41
42 / / end

Scilab code Exa 6.11.2 To find various currents power ripple voltage per-
centage regulation and effiiciency of rectification

1
2 // scila b 5.4.1
3 / / w indo ws 7 o p e r a t i n g system
4 / / c hapte r 6 : Diode C i r c u i t s
5 clc;
6 clear;
7 // given data
8 Rf =1 0 0 ; / / f o r w a r d r e s i s t a n c e i n ohms

38
9 Rl = 1 0 0 0 ; / / l o a d r e s i s t a n c e i n ohms
10 n =1 0 ; / / P ri m a r y to s e c o n d a r y t u r n s r a t i o
11 Vp =2 4 0 ; / / P r i m a r y i n p u t V( rms )
12
13 Vm = 2 4 * ( 2 ^ ( 1 / 2 ) ) / 2 ; / / s e c o n d a r y pe ak v o l t a g e
from c e n re tap
14 Vs =Vp / n ; / / Secondary i nput v o l t a g e
15 I m=Vm / ( Rf +Rl ) ; / / p eak c u r r e n t t h r o u g h
the r e s i s t a n c e i n A
16 I d c = ( 2 * I m) / %pi ; / / D C Load c u r r e n t i n
A
17 f o r ma t ( ” v” , 8 )
18 d i s p ( ’A ’ , I d c , ’DC l o a d c u r r e n t I d c = ’ , ) ;
19 I= Idc / 2 ; / / D i r e c t c u r r e n t s u p p l i e d by e a c h d i
o de i n A
20 f o r ma t ( ” v” , 7 )
21 d i s p ( ’A ’ , I , ’ D i r e c t c u r r e n t s u p p l i e d by e a c h d i
o de I d c = ’ , ) ;
22 Pdc= I d c * I d c * Rl ; / / D C p ow er o u t p u t
23 f o r ma t ( ” v” , 6 )
24 d i s p ( ’W ’ , Pdc , ’ P d c = ’ ) ;
25 I r ms =I m / ( 2 ^ ( 1 / 2 ) ) ; / / Ri ppl
26 Vr p = s q r t ( ( I r ms * I r ms ) - ( I d c * I d c ) ) * Rl ; e
volt a ge in V
27 f o r ma t ( ” v” , 7 )
28 d i s p ( ’V ’ , Vr p , ’ R i p p l ev o l t a g e V r p = ’ ) ;
29
30
31 M=( Rf * 1 0 0 ) / Rl ; / / p e rc e n t a g e r e g u l a t i o n
32 d i s p ( ’% ’ , M, ’ P e r c e n t a g e r e g u l a t i o n= ’ ) ;
33 n = 81. 2/ ( 1+( Rf / Rl ) ) ; // E fficien cy of rect ific
a t ion
34 f o r ma t ( ” v” , 5 )
35 d i s p ( ’% ’ , n , ’ E f f i c i e n c y of rect ificat ion
’);
36
37 / / end

39
Scilab code Exa 6.11.3 To calculate the dc load voltage ripple voltage and
the percentage regulation

1
2 // scilab 5.4.1
3 / / win dow s 7 o p e r a t i n g system
4 / / c hapte r 6 : Diode C i r c u i t s
5 clc;
6 clear;
7 // given data
8 Rf =50; / / f o r w a r d r e s i s t a n c e i n ohms
9 Rl = 2 5 0 0 ; / / l o a d r e s i s t a n c e i n ohms
10 Vp =30 ; / / P r i m a r y i n p u t V( rms )
11 Vm =30* s q r t ( 2 ) ;
12
13 I m=Vm / ( 2 * Rf +Rl ) ; / / pea k l o a d c u r r e n t i
n A
14 I d c =2* I m/ %pi ;
15
16 Vdc= I d c * Rl ; / /D C l o ad v o l t a g e
17 d i s p ( ’V ’ , Vdc , ’ Vdc= ’ ) ;
18 I r ms =I m/ s q r t ( 2 ) ; / / Ri ppl
19 Vr p =Rl * s q r t ( ( ( I r ms * I r ms ) - ( I d c * I d c ) ) ) ; e
volt a ge in V
20 d i s p ( ’V ’ , Vr p , ’ R i p p l ev o l t a g e V r p = ’ ) ;
21
22 M = ( 2 * Rf / Rl ) *100 ; / / P e rc e n t a g e r e g u l a t
ion
23 d i s p ( ’% ’ , M, ’ P e r c e n t a g e r e g u l a t i o n=
’);
24
25 / / end

Scilab code Exa 6.11.4 To calculate ripple voltage and the percentage rip-
ple

1
2 // scila b 5.4.1

40
3 / / w ind ow s 7 o p e r a t i n g system
4 / / c hapte r 6 : Diode C i r c u i t s
5 clc;
6 clear;
7 // given data
8
9 Vdc =20; / / D C v a l ue i n V
10 Vpp =1; / / P e a k t o pea k r i p p l e v o l t a g e i n
11 V
12 Vp= Vpp / 2 ; / / Pe ak r i p p l e v o l t a g e i
n V / / Vrms v o l t a g e
13 Vr ms =Vp / s q r t ( 2 ) ;
14 S= Vr ms / Vdc ; in V
15 f o r ma t ( ” v” , 7 ) / / R i p p l e F a c t o r
16 di s p ( S, ’ R i p p l e f a c t o r= ’ )
17 T=S * 1 0 0 ;
18 f o r ma t ( ” v” , 5 )
19 d i s p ( ”%” , T, ’ P e rc e n t a g e R i p p l e = ’ )
20 / / end

Scilab code Exa 6.11.5 To design a full wave rectifier with L type LC
filter

1 // scila b 5.4.1
2 / / Windows 7 o p e r a t i n g system
3 / / c h a p t e r 6 Diode C ircuit s
4 clc
5 clear
6 / / For a f uwave
ll rect ifier
7 / / L − t y p e LC f i l t e r
8 f= 50 / / f= l i n e f re q u e n c y i n
9 w =2* %p i * f Hz
10 Vdc =10 / / Vdc=dc o u t p u t volt age
11 I d c = 1 0 0 * 1 0 ^ - 3 / / I d c = l o a d current in
Amperes
12 y =0 . 0 2 / / y = a l l o w a b l e rip ple fact or
13 / / y = s q r t ( 2 ) / ( 1 2 ∗ ( w ˆ 2 ) ∗L∗C)
41
14 / / L e t L∗C=a . . . . . . . . . . . . . . . ( 1 )
15 a= s q r t ( 2 ) / ( y * 1 2 * ( w ^ 2 ) )
16 RL= Vd c / I d c / / R L = l o a d resist a nce
17 / / Lc = c r i t i c a l i nduc tanc e
18 / / Lc=R L/ ( 3 ∗w)
19 / / For l i n e f r e q u e n c y o f 50 Hz , Lc= RL/ ( 300 ∗ %pi )
20 / / Lc=RL/ 950
21 Lc=RL / 9 5 0
22 f o r ma t ( ” v” , 4 )
23 L =0. 1 / / Ass umed i n d u c t a n c e i n henry
24 C=a / L / / C = c a p a c i t a n c e c a l c u l a t e d from e q u a t i o n
(1)
25 f o r ma t ( ” v” , 4 )
26 L1 =1 / / As sumed i n d u c t a n c e i n henry
27 C1 =a / L1 / / C 1 = c a p a c i t a n c e c a l c u l a t e d from e q u a t i o n
(1)
28 f o r ma t ( ” v” , 4 )
29 Rb =950* L1 / / R b = b l e e d e r r e s i s t a n c e f o r good v o l
t a ger egu la t ion
31 d i s p ( ”ohm
30 ” The”d, eRL s i, g”
n eThe
d vl oa al du er se os fi s t hae n cc eo mRL
p o n ie sn t s f o
r ”)a f u l l
= wave r e c t i f i e r w i t h L−type LC f i l t e r
32 d a ri es ”)
p ( ”H” , Lc , ” The c r i t i c a l i n d u c t a n c e Lc i s
= ”) c a p a c i t a n c e C i s ”) / / C
33 d i s p ( ”H” , L, ” The i n d u c t ai sn m c ei c Lr o fi as =r a”)
d
34 di s p ( ” F ” , C/ 10^ - a p p r o x i m a t e l y t a k e n as
6 , ” The c o n v e r t e d i 600
n terms o f
35 / / Int h e v a l u e = ”) t e i nduc tanc e L d e s i g n e di
x t b o37o k F957 ” , C1 / 1 0F^ - 6 , i” tsh e C will o
d si Fs p ( ” f
c a p a c i t a n c e v a l ue be of
36 d i s m pt h(ie”H”
c r=o”)f a,r/L1 , ”iBs ut i fc o n v e r t e d i n
a/dC1 terms o f
38 dt hi es p ( ” So , a s t a n d a r d v a l ue c a n be u s e d i
of 50 F p r a c t i c e ”) n
39 d i s p ( ”ohm ” , Rb , ” The b l e e d e r resist ance
Rb f o r good v o l t a g e regulat ion i s = ”)
40 d i s p ( ” As i s much g r e a t e r t h a n RL, l i t t l e
Rb power i s Rb . T h i s r e f l e c t s t h e advantage
wasted of
i n s L>Lc ”)
elect ing 42
43
Chapter 7

Junction Transistor
Characteristics

Scilab code Exa 7.13.1 To find the voltage gain and power gain of a tran-
sistor

1
2 // scila b 5.4.1
3 / / w indo ws 7 o p e r a t i n g system
4 / / c hapte r 7 : Junc t i o n T r a n s i s t o rC h a r a c t e r i s t i c s
5 clc;
6 clear;
7 // given data
8 a =0 . 9 9; / / a = f r a c t i o n o f the e m i t t e r c u r r e n t
c o n t r i b u t e d by t h e c a r r i e r s i n j e c t e d i n t o the
b a s e and r e a c h i n g t h e c o l l e c t o r
9 Rl = 4 5 0 0 ; / / Load r e s i s t a n c e i n ohms
10 r d =50; / / dynamic r e s i s t a n c e i n
11 ohms
12 Av=a* Rl / r d ; / / V ol t a g e
g ai n
13 Ap=a* Av ; / / Pow er g a i n
14
15 d i s p ( Av , ’ Av= ’ ) ;
16 d i s p ( Ap , ’ Ap= ’ ) ;
44
Scilab code Exa 7.13.2 To find the base and collector current of a given
transistor

1
2 // scila b 5.4.1
3 / / w ind ow s 7 o p e r a t i n g system
4 / / c hapte r 7 : Junc t i o n T r a n s i s t o rC h a r a c t e r i s t i c s
5 clc;
6 clear;
7 // given data
8 a =0 . 9 8 ; / / a = f r a c t i o n o f the e m i t t e r c u r r e n t
c o n t r i b u t e d by t h e carriers in ject ed i
n t o t h e b a s e and r e a c h i n g the collect or
9 Ie = 0.003; // em it t er current in A
10 I c o = 1 0 * 1 0 ^ - 6 ; // reverse sa t ura t ioncu r r en
t in A
11
12 Ic=a* Ie+ Ic o ; // collect or cu rrent in A
13 f o r ma t ( ” v” , 8 )
14 d i s p ( ’mA ’ , I c / 1 0 ^ - 3 , ’ I c = ’ ) ; / / I c i s c o nv
e rte d i n t e r m s o f mA
15
16 Ib=Ie - I c ; / / base c u r r e n t i n A
17 f o r ma t ( ” v” , 8 )
18 disp( ’ A ’ , I b / 1 0 ^ - 6 , ’ I b = ’ ) ; / / Ib
is c o nv e rte d i n terms
of A

Scilab code Exa 7.13.3 To calculate the emitter and collector current of
a given transistor

1
2 // scila b 5.4.1

45
3 / / win dow s 7 o p e r a t i n g
system T ransist orC haract erist i
4 / / c hapte r 7 : J u n c t i oc ns
5 clc;
6 clear;
7 // given data o f the e m i t t e r c u r r e n t
8 a= 0 . 9 7 5 ; / / a=f r a c t i o c a r r i e r s i n j e c t e d i n t o
n c o n t r i b u t e d by the the collect or
9 t hI ec ob =
a s1e0 * 1and
0 ^ - 6 ; r e /a/ crheiv e r s e s a t u r a t i o n c u r r e n t i n
10 nI bg = 2 5 0 * 1 0 ^ - 6 ; A
11 / / base c u r r e n t i n A
12 b =a / ( 1 - a ) ; / / t r a n s i s t o r g ai n
13 d i s p ( b , ’ g ai n B= ’ ) ;
14 Ic=b* Ib +( b+1)* I c o ; // collect or cu rrent in
15 f o r ma t ( ” v” , 5 ) A
16 d i s p ( ’mA ’ , I c / 1 0 ^ - 3 , ’ I c = ’ ) ; / / I c i s c o nv
e rte d i n t e r m s o f mA
17 Ie=( Ic - I c o ) / a; // em it t er cu rrent in A
18 f o r ma t ( ” v” , 5 )
19 d i s p ( ’mA ’ , I e / 1 0 ^ - 3 , ’ I e = ’ ) ; / / I e i s c o nv
e rte d i n t e r m s o f mA

Scilab code Exa 7.13.4 To calculate the voltage between collector and
emitter terminals

1
2 // scila b 5.4.1
3 / / w indo ws 7 o p e r a t i n g system
4 / / c hapte r 7 : Junc t i o n T r a n s i s t o rC h a r a c t e r i s t i c s
5 clc;
6 clear;
7 // given data
8 b =1 2 5 ; / / b=f o r w a r d c u r r e n t t r a n s f e r r a t i o or
dc c u r r e n t g ai n
9 Vbe =0. 6; / / base to em it t er volt age in V

46
10
11 I b = ( 1 0 - Vb e ) / ( 3 1 0 * 1 0 ^ 3 ) ; / / base current in
A
12 d i s p ( ’mA ’ , I b * 1 0 ^3 , ’ I b = ’ ) ;
13 Ic=b* I b ; // collect or current in A
14 d i s p ( ’mA ’ , I c * 1 0 ^ 3 , ’ I/c/ =c’
o l)l ;e c t o r t o e m i t t e
15 Vce =20 - ( I c * 5 0 0 0 ) ; r
volt a ge
16 d i s p ( ’V ’ , Vc e , ’ Vce= ’ ) ;

Scilab code Exa 7.13.5 To check what happens if resistance Rc is indefi-


nitely increased

1 // scilab 5.4.1
2 / / Windows 7 o p e r a t i n g system
3 / / c hapte r 7 Junc t i o n T r a n sist orC h a r a c t e r ist ic s
4 clc
5 clear
6 d i s p ( ” As t h e b a s e i s f o r w a r d bi a s e d , t r a n s i s t
o r i s not c u t o f f . ”)
7 di s p ( ” Assuming the t ran sist or in act ive regio
n ”)
8 VBB =5 / / V B B = b ase b ia s volt age
9 VBE =0. 7 / / V B E = v o l t a g e b e t w e e n b a s e and e m i
t t ert erm inal
10 RB =220 / / R B = b as e circu it resist or in kilo
ohms
11 I B = ( VBB - VBE ) / RB / / I B = b a s e c u r r e n t i n mA( By a p p l
y i ng K i rc h h o f f ’ s v o l t a g e law )
12 f o r ma t ( ” v” , 7 )
13 d i s p ( ”mA” , I B , ” I B= ”)
14 d i s p ( ” Ico <<IB ”) / / I c o = r e v e r s e s a t u r a t i o n c u r r e n t
and i s g i v e n as 22nA
15 B =100 / / B = d c c u r r e n t g ai n
16 I C=B* I B
17 f o r ma t ( ” v” , 5 )
18 d i s p ( ”mA” , I C , ” I C= ”)
19 Vcc =12 / / V c c = c o l l e c t o r supply v o l t a g e
47
20 Rc =3. 3 / / R c = c o l l e c t o r circu it resist or in kilo
ohms
21 VCB =Vcc - ( I C* Rc ) - VBE / / V C B = v o l t a g e b e t w e e n c o l l e
c t o r and base t e r m i n a l ( by a p p l y i ng K i r c h h o f f ’ s
volt a ge law to t h e c o l l e c t o r c i r c u i t )
22 d i s p ( ”V” , VCB , ”VCB= ” )
23 d i s p ( ”A p o s i t i v e v a l ue o f VCB i m p l i e s t h a t f o r
n−p−n b i at sr ea dn s ai nsdt o hr e n, tche e c o l l te rcat no sr i s t journ icst i ao cnt ius a lr leyv ie r s e
t h e a c t i v e r e g i o n ”) n
24 IE = - ( I B+I C) / / I E = e m i t t
er current
25 d i s p ( ”mA” , I E , ”
I E = ”) i n d i c a t e s t h a t IE act u
26 f o r ma t ( ” v” , 7 ) a l l y d i r e c t i o n . ”)
27
28 d i s p ( ” The IB a nnde gIC a t ido v e n o st d e p e n d the c o l l e c t o r
on i g n cfilrocwu si t ri en s it hs et a on pc pe R c . So i f is i n c re a s e d ,
o s i it t e o n e s t a g e VCB b e c o m e s n e g a a t and t
t ivegoes in t o sa t u r a t ion r ra nsist or
e g i o n ”)

Scilab code Exa 7.13.6 To check whether transistor is operating in the


saturation region for the given hFE

1 // scilab 5.4.1
2 / / Windows 7 o p e r a t i n g system
3 / / c hapte r 7 Junc t i o n T r a n sist orC h a r a c t e r ist ic s
4 clc
5 clear
6 d i s p ( ” A p p l y i n g K i r c h h o f f v o l t a g e law t o t h e
b a s e & c o l l e c t o r c i r c u i t r e s p e c t i v e l y ”)
7 / / ( R1∗ IB )+VBE+(RE∗ ( I c + I B ) )=VBB . . . . . . . . . . ( 1 )
8 / / ( R2∗ I c )+VCE+(RE∗ ( I c + I B ) )= Vc c . . . . . . . . . . ( 2 )
9 R1 =47 / / R 1 = v a l ue o f base c i r c u i t r e s i s t a n c e i n
k i l o ohms
10 RE =2. 2 / / R E = e m i t t e r circuit resist a nce in kilo
ohms
11 R2 =3. 3 / / R 2 = c o l l e c t o r circu it resist a nce in kil
o ohms
48
12 VBE =0 . 8 5 / / V B E = v o l t a g e b e t w e e n b a s e and e m i
t t ert erm inals
13 VBB =5 / / V B B = b ase supply v o l t a g e
14 Vcc=9 / / V c c= c o l l e c t o r supply v o l t a g e
15 VCE =0 . 2 2 / / V C E = v o l t a g e b e t w e e n c o l l e c t o r and e m i
t t ert erm inals
16 R = [ ( R1 +RE) RE; RE ( R2 +RE) ] ;
17 V = [ ( VBB - VBE ) ; ( Vcc - VCE ) ] ;
18 I = i n v ( R) * V
19 d i s p ( ”mA” , I ( 1 ) , ” IB= ”)
20 d i s p ( ”mA” , I ( 2 ) , ” IC= ”)
21 hFE =110 / / h F E = d c c u r r e n t g ai n
22 d i s p ( ” The minimum b a s e current required
f o r s a t u r a t i o ni s ”)
23 I Bmi n =I ( 2) / hFE
24 d i s p ( ”mA” , I Bmi n , ” I B m in= ”)
25 i f ( I ( 1 ) <I Bmi n ) t h e n
26 d i s p ( ” As IB<IBmin t ransit or is
not in the
sa t ura t ion r e g i o n . I t m u s t be in the
a c t i v e r e g i o n . ”)
27 end

Scilab code Exa 7.13.7 To calculate the output resistance along with the
current gain

1 // scila b 5.4.1
2 / / Windows 7 o p e r a t i n g s y s t e m
3 / / c hapte r 7 Junc t i o n T r a n s is t o rC h a r a c t er is t i cs
4 clc
5 clear
6 I B =(30*10^ - 3 ) / / IB=base c u r r e n t ( i n mA) o f t r a n s i s
t o r i n CE mode
7 I C1 =3. 5
8 I C2 =3. 7
9 VCE1 =7. 5

49
10 VCE2 =1 2 . 5 / / IC1 a n d IC2 a r e t h e c h a n g e f o u n d i n
collect or current i n mA when colle em it t e
IC v o l t a g e VCE c t o r f r o m VCE1 t o rvolt
changes VCE2 ( i n s)
11 VCE =VCE2 - VCE1
12 I C=I C2 - I C1 i s ”)
13 di s p ( ” Output resist
ance output r e s i s t a n c e i s
14 Ro= VCE / I C = ”)
15 di s p ( ” k i l o
ohm ” , Ro , ” The
16 b= I C2 / I B / / b=f o r w a r d c u r r e n t t r a n s f e r r a t i o or
dc c u r r e n t g ai n
17 d i s p ( b , ” b= ”)
18
19 a/ =b
/ b/=(a b/ (+11 −
) / a/ )a =Hence
f r a c t iao= bn o f the e m i t t e r c u r r e n t
/( b + 1 ) c o n t r i b u t e d by t h e ca rriers inject ed i
20 d i snp t( oa , ”t h ea=b”)
a s e and r e a c h i n g the collect or

Scilab code Exa 7.13.8 To find the resistance R1 R2 and the range of RL

1 // scilab 5.4.1
2 / / Windows 7 o p e r a t i n g system
3 / / c hapte r 7 Junc t i o n T r a n sist orC h a r a c t e r ist ic s
4 clc
5 clear
6 b =10 0 / / b=f o r w a r d c u r r e n t t r a n s f e r r a t i o or
dc c u r r e n t g ai n
7 Vz=4 / / V z = Zen e r d i o de v o l t a g e
8 IL =2 / / I L = l o a d c u r r e n t i n mA
9 Iz=5 / / I z=Zener c u r r e n t i n mA
10 VCC =12 / / V C C = c o l l e c t o r supply v o l t a g e
11 VEB1 =0. 7
12 VEB2 = VEB1 / / V E B 1 , VEB2=e m i t t e r −to −bas e volt age
f o r b o t h t r a n s i s t o r s Q1 a n d Q2 r e s p e c t i v e l y
13 // Since IL i s t h e c o l l e c t o r c u r r e n t o f t r a n s
i s t o r Q1
14 I B=I L/ b / / I B = b a s e c u r r e n t o f t r a n s i s t o r Q1
50
15 I E=I B+I L / / I E = e m i t t e r c u r r e n t o f t r a n s i s t o r Q1
16 VR1 =VCC - VEB2 - Vz / / V R 1 = v o l t a g e drop a c r o s s r e s i s t o
r R1
17 R1 = VR1 / ( I B+I z )
18 f o r ma t ( ” v” , 5 ) R1 i s = ”)
19 d i s p ( ” k i l o ohm ” , R1 , ” The r e s i s t a naccer o s s r e s i s t o
20 VR2 = VEB2 +Vz - VEB1 / / V R 2 = v o l t a g e r
d r o p R2
21 R2 = VR2 / IE
22 f o r ma t ( ” v” , 5 ) R2 i s
23 d i s p ( ” k i l o ohm ” , R2 , ” The r e s i s t = ”)
a n cveo l t a g e d r o p f o r t r a n s i s t o r Q1
24 //VBC=VCC−VR2−VEB1−(
25 / / V B C = 7 . 3 −(2∗RL) IL w h∗RL) w h e or ea d
e r e RL=l resist a
VBC=b n c easef −o rct or lal ne cs it so tr o r Q1 i n terms o f kil
26 d oi s ohmp ( ” Q1 t o r e m a i n i n t h e a c t i v e re g i o n , V B C
For 0 ,
i . e . ”) (7.3/ 2) kilo
27 d i s p ( ” R ohm ”) 3 . 6 5 kil
L o ohm ”)
28 d i s p ( ” R
L
29 d i s p ( ” So t h e r a n g e o f RL f o r Q1 t o remain i n
the a c t i v e r e g i o n i s 0 R L 3 . 6 5 k i l o ohm ”)

51
Chapter
8
Junction Transistors Biasing
and Amplification

Scilab code Exa 8.14.1 To find the Q point and stability factors

1
2 // scila b 5.4.1
3 / / w ind ow s 7 o p e r a t i n g system
4 / / c hapte r 8 : Junc t i o n T r a n s i s t o r s : B i a s i
n g and A m p l i f i c a t i o n
5 clc;
6 clear;
7 // given data
8 b =99;
9 Vbe =0. 7; / / V o l a t g e b e t w e e n b a s e and e m i t t e r i n V
10 Vcc =12; / / Vol atge s o u rc e a p p l i e d at c o l l e c t o r i
V4 n
11 Rl = 2 * 1 0 ^ 3 ; / / l o a d r e s i s t a n c e i n ohms
12 Rb = 1 0 0 * 1 0 ^ 3 ; // R esist a nce at base i n
13 I b = ( 1 2 - 0 . 7 ) / ( ( 1 0 0 * Rl ) +Rb ) ;
ohms / / Bas e c u r r e n t i
m i c r o Ampere n
14 f o r ma t ( ” v” , 7 )
15 d i s p ( ’mA ’ , I b * 1 0 ^3 , ’ I b = ’ ) ;
16

52
17 Ic=b* I b ;
18 f o r ma t ( ” v” , 7 )
19 d i s p ( ’mA ’ , I c * 1 0 ^ 3 , ’ I c = ’ ) ;
20 Vce =4. 47; / / Vol tage between collect or
and e m i t t e r in V
21
22 S = ( b + 1 ) / ( 1 + b* // st a bilt y fa ct or
Rl /( Rl+Rb)); 1
23 d i s p ( S , ’ S= ’ ) ;
24 S1 = b / ( R b + R l * ( 1 + b ) ) ; // st ab ilt y fa ct or 2 i n A/V
25 d i s p ( ’A/V ’ , S 1 , ’ S 1=
’);
st ab ilit y f a c t o rR l *(1+ b ) ) ; //
26 S2 = ( Vcc - Vbe - ( I c *
3 in A
R l ) ) / ( Rb+
27 d i s p ( ’A ’ , S2 , ’ S 2 = ’ ) ;

Scilab code Exa 8.14.2 To find the resistances R1 R2 and Re

1
2 // scila b 5.4.1
3 / / w indo ws 7 o p e r a t i n g system
4 / / c hapte r 8 : Junc t i o n T r a n s i s t o r s : B i a s i n
g and A m p l i f i c a t i o n
5 clc;
6 clear;
7 // given data
8 b =4 9 ; / / b=dc c u r r e n t g ai n o f t h e common e m i t
t ert ransist or
9 Vbe / / V o l a t g e b e t w e e n b a s e and e m i t t e r i n V
=0. 2; / / Vol atge s o u rc e a p p l i e d at c o l l e c t o r i
10 Vcc =10; n
V4 / / C o l l e c t o r to e m i t t e r v o l t a g e i n
11 Vce =5; V
12 I c / / c o l l e c t o r c u r r e n t i n mA
=4. 9; 13 / / l o a d r e s i s t a n c e i n k i l o ohms
Rl =1; // st ab ilit y fact or
14 S =10; / / base c u r r e n t i n
15 mA
16 I b =I c /
53
b;
17 Re =( ( Vcc - Vce - ( I c * Rl ) ) / ( I c +I b ) ) *1000 ; //
R esist a nce a t e m i t t e r i n ohms
18 d i s p ( ’ ohms ’ , Re , ’ Re = ’ ) ;
19 / / S = ( ( 1 + b ) ∗ (1 + ( R T / R e ) ) ) / ( 1 + b + ( R T / R e ) )
20 RT = ( ( S - 1 ) * Re ) / ( 1 - ( S / ( 1+ b ) ) ) / / R T = T h e v e n i n resis
t a n c e =(R1∗R2 ) / ( R1+R2 )
21 VT = ( I b * ( 1 0 ^ - 3 ) * RT) + Vbe + ( ( I b + I c ) * ( 1 0 ^ - 3 ) *
Re ) / / VT=
Thevenin v o l t a g e =(R2∗ Vcc ) / ( R1+R2 )
22 / / R2 / ( R1+R2 )= VT/ Vcc
23 R1 = ( RT* Vc c ) / VT
24 f o r ma t ( ” v” , 6 )
25 d i s p ( ” k i l o ohm ” , R1 / 1 0 ^ 3 , ”R1= ”)
26 R2 = ( ( VT/ Vc c ) * R1 ) / ( 1 - ( VT/ Vc c ) )
27 d i s p ( ”ohm ” , R2 , ”R2= ”)

Scilab code Exa 8.14.3 To calculate the input and output resistances and
current voltage and power gain

1
2 // scila b 5.4.1
3 / / w indo ws 7 o p e r a t i n g system
4 / / c hapte r 8 : Junc t i o n T r a n s i s t o r s : B i a s i n
g and A m p l i f i c a t i o n
5 clc;
6 clear;
7 / / g i v e n data
8 hib =30; / / h parameter o f CB a t r a n s i s t o r
9 h r b =4*10^ - 4 ; / / h parameter o f CB a t r a n
sist or
11
10 hob
h f b =0
= -. 09.*9190; ^ - 6 ; / / h /p/a hr a m
p ae rt ea rm e t e r o fo fCBCBa t r a n s i s t
t ra nsist or S o ri n a
12 Rl = 6 * 1 0 ^ 3 ; / / Load r e s i s t a n c e i n
13 ohms
14 AI =- h f b / ( 1+( h o b * Rl ) ) ; / / Current
g ai n
15 d i s p ( AI , ’ A I = ’ ) ;
54
16
17 Ri =hi b - ( ( h f b * h r b * Rl ) / ( 1+( h o b * / / Input
Rl ) ) ) ;
resist ance i n ohms
18 d i s p ( ’ ohms ’ , Ri , ’ R i = ’ ) ;
19 / / Output
20 Ro= h i b / ( ( h i b * h o b ) - ( h f b * h r b ) ) ;
R esist ance i n kohms
21 d i s p ( ’ k i l o ohms ’ , Ro * 1 0 ^ - 3 , ’
Ro= ’ ) ;
22
23 AV=AI * Rl / Ri ; / / Vol tage g
ai n
24 d i s p ( AV , ’AV= ’ ) ;
25
26 AP=AI * AV; / / Pow er g a i n
27 d i s p ( AP , ’AP= ’ ) ;

Scilab code Exa 8.14.4 To find the input and output resistance

1
2 // scila b 5.4.1
3 / / w ind ow s 7 o p e r a t i n g system
4 / / c hapte r 8 : Junc t i o n T r a n s i s t o r s : B i a s i
n g and A m p l i f i c a t i o n
5 clc;
6 clear;
7 // given data
8 Rg = 1 * 1 0 ^ 3 ; / / i n t e r n a l r e s i s t a n c e i n ohms
9 Rl = 2 0 * 1 0 ^ 3 ; / / Load r e s i s t a n c e i n ohms
10 h i e = 1 * 1 0 ^ 3 ; / / h pa ram ete r o f the t r a n s i s t o r i
terms ohmso fn
11 h r e =2 . 5 * 1 0 ^ - 4 ; / / h parametero f the t ransist
12 h f e =1 5 0 ; // o r parameter of the tra
h n s i s t /o/ r p a r a m e t e r o f
13 h o e = 1 / ( 4 0 * h terms t h e mho
1140 ^ 3 ) ; of
15 AI =( t r- ahfn es )i s/ t( o1+(
r hoe* / / C u r r e n t g ai
Rl ) ) ; n
in
55
16 d i s p ( AI , ’ A I = ’ ) ;
17
18 Ri = hi e +( AI * h r e * Rl ) ; / / i n p u t r e s i s t a n c e i n ohms
19 d i s p ( ’ ohms ’ , Ri , ’ R i = ’ ) ;
20 Ro = ( Rg+ h i e ) / ( ( Rg* h o e ) + ( h i e * h o e ) - ( h f e * //
hre));
output r e s i s t a n c e i n ohms
21 d i s p ( ’ k i l o ohms ’ , Ro * 1 0 ^ - 3 , ’ Ro= ’ ) ;

Scilab code Exa 8.14.5 To find the current amplification and voltage and
power gains

1
2 // scilab 5.4.1
3 / / win dow s 7 o p e r a t i n g system
4 / / c hapte r 8 : Junc t i o n T r a n s i s t o r s : B i a s i n
g and A m p l i f i c a t i o n
5 clc;
6 clear;
7 // given data
8 Rl = 5 * 1 0 ^ 3 ; / / Load r e s i s t a n c e i n ohms
9 hi e = 1*10^3; / / h parameter o f the t r a n s i s t
terms ofor in
10 h r e = 5* 1 0 ^ - 4 ;ohms / / h p a r a m e t e r o f the t r a n s i s
11 h f e =1 0 0 ; t or
12 hoe =25*10^ - 6 ; / / h p a r a m e t e r o f the t r a n s i s t o r
in t e r m s o f/ / mho h parameter o f the t r a
13 Rg = 1 * 1 0 ^ 3 ; / / s no su irsc t eo r e i s t a n c e i n ohms
14
15 AI =( - hf e ) / ( 1+( h o e * Rl ) ) ; / / Current g ai n
16 d i s p ( AI , ’ A I = ’ ) ;
17
18 Ri = hi e +( AI * h r e * Rl ) ; / / i nput resist an ce in
ohms
19 d i s p ( ’ ohms ’ , Ri , ’ R i = ’ ) ;
20
21 AVo =AI * Rl / ( Rg +Ri ) ; / / O v e ra l l v o l t a g e g ai n
56
in clud in g s o u rc e r e s i s t a n c e
22 d i s p ( AVo , ’ AVo= ’ ) ;
23
24 APo= AVo* AI ; / / O v e r a l l v o l t a g e g ai n i n c l u
d i n g s o u rc e r e s i s t a n c e
25 d i s p ( APo , ’ APo= ’ ) ;

Scilab code Exa 8.14.6 To determine the current and voltage gain as well
as the input and output resistances

1
2 // scila b 5.4.1
3 / / w indo ws 7 o p e r a t i n g system
4 / / c hapte r 8 : Junc t i o n T r a n s i s t o r s : B i a s i n
g and A m p l i f i c a t i o n
5 clc;
6 clear;
7 / / g i v e n data
8 hoe =25*10^ - 6 ; / / h p a r a m e t e r i n A/V
9 hie =4000; / / h paramater i n ohms
10 hfe =135; / / h paramater of t ransist or
11 h r e =7*10^ - 4 ; / / h paramater o f t r a n s i s t
12 Re =1 0 0 ; / / e m i t t eo rr r e s i s t a n c e i n ohms
13 Rl = 3 * 1 0 ^ 3 ; / / Load resist a nce in
14 ohms
15 / / H e re hoe ∗ Rl i s less t h a n 0 . 1 . So
we c a n s i m p l i f y the circuit and
a c c o rd i n g to it the current g ai n i s
AI=I c / Ib . h e re I c=−h f e ∗ I b .
16
17 AI =- h f e ; / / c u r r e n t g ai n
18 d i s p ( AI , ’ A I = ’ ) ;
19
20 Ri = h i e + ( 1 + h f e ) * Re ; / / i nput r e s i s t a n c e i n
ohms
21 d i s p ( ’ k i l o ohms ’ , Ri * 10 ^ - 3 , ’ R i = ’ ) ;
22
57
23 AV=AI * Rl / Ri ; / / v o l t a g e g ai
24 d i s p ( AV , ’AV= ’ ) ; n
25
26 d i s p ( ” The o u t p u t r e s i s t a n c e o f the t r a n s i
s t o r e x c l u d i n g RL i s i n f i n i t e . ”)
27 d i s p ( ” k i l o ohm ” , Rl / 10^ 3 , ” The o u t p u t r e s i s t a n c
e o f the t r a n s i s t o r i n c l u d i n g RL i s = . ”)

Scilab code Exa 8.14.7 To determine the input and output resistances as
well as the voltage gain and Q point

1
2 // scilab 5.4.1
3 / / win dow s 7 o p e r a t i n g system
4 / / c hapte r 8 : Junc t i o n T r a n s i s t o r s : B i a s i
n g and A m p l i f i c a t i o n
5 clc;
6 clear;
7 // given data
8
9 h f e =1 0 0 ; // h parameter o f t r a n s i s t o r
10 h i e =5 6 0 ; // h p a r a m e t e r o f t r a n s i s t o r i n ohms
11 Rc = 2 * 1 0 ^ 3 ; // c o l l e c t o r r e s i s t a n c e i n ohms
12 Re = 1 0 ^ 3 ; // e m i t t e r r e s i s t a n c e i n ohms
13 Rb = 6 0 0 * 1 0 ^ 3 ; / / Bas e r e s i s t a n c e i n ohms
14
15 // Since hoe i s n e g us e the sim
l e c t e d we can e q u i v a l e n tc i r p l i f i e d Ri i s
c u i t hence the
16 r e s i s t a n c e i n ohms
17 Ri = h i e + ( 1 + h f e ) * Re ; //
Input
18 d i s p ( ’ k i l o ohms ’ , Ri *10 ^ - 3 ,
’ Ri= ’ ) ;
19
20 Ri b = ( Ri * Rb ) / ( Ri +Rb ) ; / / Input r e s i s t
a n c e i n c l u d i n g Rb i n ohms
58
21 d i s p ( ’ k i l o ohms ’ , Ri b * 1 0 ^ - 3 , ’ I n p u t
resist ance (
i n c l u d i n g Rb)= ’ ) ;
22
23 d i s p ( ” The o u t p u t r e s i s t a n c e e x c l u d i n gl o
a d i s i n f i n i t a ”)
24 Ro =Rc ;
25 d i s p ( ” k i l o ohms” , Ro * 1 0 ^ - 3 , ” O u t p u t r e s i s
t a n c e i n c l u d i n g l o a d = ”)
26
27 AV = - ( h f e * Ro ) / ( h i e + ( ( 1 + h f e ) * Re ) ) ; // volt ag
g ai n e
28 d i s p ( AV , ’AV= ’ ) ;
29 d i s p ( ” S m a l l signals are used , s i n c
e ot herwise t h e o u t p u t wa vefo rm will
be d i s t o r t e d . Also , t h e
equivalent c i r c u i t w i l l not h o l d . ”)
30
31 / / T a k i n g DC e m i t t e r current and collect
or c u r r e n t n e a r l y e q ual
32
33 I b =2 0/ ( Rb+Re * 1 0 1 ) ; / / b a s e c u r r e n t i n mA
34 d i s p ( ’mA ’ , I b * 1 0 ^3 , ’ I b = ’ ) ;
35
36 d i s p ( ” The Q−p o i n t i s d e f i n e d b y ”)
37 Ic= hfe* I b ; / / c o l l e c t o r c u r r e n t i n mA
38 d i s p ( ’mA ’ , I c * 1 0 ^ 3 , ’ I c = ’ ) ;
39
40 VCE =20 - ( 3 * I c * 1 0 ^ 3 )
41 d i s p ( ’V ’ , VCE , ’VCE= ’ ) ;

Scilab code Exa 8.14.8 To design a CE transistor amplifier

1 // scilab 5.4.1
2 / / Windows 7 o p e r a t i n g s y s t e m
3 / / c hapte r 8 Junc t i o n T ra n sist ors :Biasin
g and A m p l i f i c a t i o n
4 clc

59
5 clear
6 / / F o r a CE t r a n s i s t o r a m p l i f i e r c i r with s e l f
cuit b ia s −
7 f= 10 00 / / f=f re q u e n c y i n Hz
8 AV = - 200 / / A V = v o l t a g e g ai n
9 h f e =100 / / h f e = c u r r e n t g ai n
10 hi e =1 / / h i e = i n p u t impedance i n k i l o
ohms d issipa t io
11 Pcmax = 7 5 * 1 0 ^ - 3 / / Pcmax=maximum c o l l e c t n
o r i n Watt
12 / / h r e a n d hoe a r e t o be n e g l e c t e d
13 VCC =12 / / V C C = c o l l e c t o r supply v o l t a g
e
14 //AV= −( h f e ∗RL) / h i e w h e r e RL i s t h e l
o ad r e s i s t a n c e
15 RL = - ( AV* h i e ) / h f e
16 f o r ma t ( ” v” , 5 )
17 d i s p ( ” The d e s i g n e d t o vbe a l ul iens eoaf r t,hteh e c o m p qo nueinet s c eo nf t pa
CE t r a n s i s t o r a m p ol i nf it ei rn a r e : t”)
he middle of
18 d i s p ( ” k i l o ohm ” , RL , ” The l o a d r
t h e DC l o a d e s i s t a n c e RL is
= ”) c o l l e c t o r to ground v o l t a g
19 / / For the a m p l i f ie e r
i s chosen to
lielin e
20 VCG = VCC / 2
//VCG=DC
21 / / V C C = ( I C ∗RL)+VCG
w h e r e IC=DC c o l l e c t
27 o/ /r Pc=VCE∗
c u r r e nIC t
22
28 IPcC =1 = ( 4VCC
. 5 - VCG ) / RL
23
29 f o r ma
VCE =Pct /( I”C v” //VC , 5E)= c o l l e c t o r −to −e m i t t e r v o l t a g e d r o p
24
30 df io rs pma( ”mA”
t ( ” v” , I, 4C), ”
31 I h e =VCG
VEG DC c- oVCE l l e //VEG=DC
ct or volt age drop a c r o s s r e s i s t
a n cceuRe rrent
32 I E=I C /=/ ”)
i s IE=e m i t t e r current
25
33 P r = (VEG
Re= I C /^(2 )I *C)RL / /
34 P
d ir =s ppo( w”ohm
e r ” , Re*1000 , ” The r e s i s t a n c e Re i s
= ”) / / sRe
d i s i p ai st ci o n v e r t e d i n terms o f ohms
i n RL
26 / / Pc=the collect or d60i s s i p a t i o n i s s e t at
1 4 . 5 mW w h ic h is below t h e v a l ue o f
Pcmax
35 P e = ( I C ^ 2 ) * Re / / P e = p o w e r d i s s i p a t i o n i n Re
36 VBE =0. 7 / / V B E = a s s u m e d DC b a s e −to −e m i t t e r volt a ge
drop
37 VBG = VBE + ( I E * Re ) / / VBG=DC v o l t a g e a c r o s s r e s i s t a n c
e R2
38 / / VT= (VCC∗R2 ) / ( R1+R2 ) w h e r e VT=Th e v e n i n equiv
a lent volt a ge
39 / / RT= ( R1∗R2 ) / ( R1+R2 ) . . . . . . . . . . . . . ( 1 ) w h e r e RT=
Thevenin equ iva len tr esist a n ce
40 //VBG=VT−(IB ∗RT)
41 / / VBG= ( ( VCC∗R2 ) / ( R1+R2 ) ) −(IB ∗ ( ( R1∗R2 ) / ( R1+R2 ) ) )
..................(2)
42 / / Let ( R2 / ( R1+R2 ) )=x . . . . . . . . . . . . . . ( 3 )
43 x= VBG / VCC / / n e g l e c t i n g t h e second term
on t h e r i g h t h and s i d e o f e q uati o n ( 2 )
44 a=(1 - x ) / x / / a = R 1/ R 2
45
46 / / S = (h( e1n+cbe ) ∗(
/ / b>>1 S =1+( hRT/ Re1+
f e ∗( ) )RT/
/(1+
Reb +) () R/ (T1/+Rbe+)( )R T / R e ) )
47 / / Fwo hr e rgood
e S= s t a b i l i t y wef a cc ht oo or s e Sa=n hd f be =/ 2c 0u r r e
48 RT =n( t( h f eg -ai2 0n)=/h1 f9 e) * Re
49 R1 =RT/ x / / from e q u a t i o n ( 1 ) and ( 3 )
50 f o r ma t ( ” v” , 5 )
51 d i s p ( ” k i l o ohm ” , R1 , ” The r e s i s t a n c e i R1
52 R2 =R1 / 5 . 3 3 s = ”)
53 f o r ma t ( ” v” , 4 )
54 d i s p ( ” k i l o ohm ” , R2 , ” The r e s i s t a n c e i R2 s
55 P r 2 = ( VBG ^ 2 ) / R2 / / P r 2 = p o w e r d i s s i p a t i=o”) n
56 P r 1 = ( ( VCC - VBG ) ^ 2 ) / R1 / / P r 1 = p o w e r d i isns i R2
pat ion in
R1
57 Ce = 1 / ( 2 * %p i * f * ( ( Re * 1 0 0 0 ) / 1 0 ) ) / / C e = b y p a s s c a p a c i t o
r
58 f o r ma t ( ” v” , 2 )
59 di s p ( ” micro f a r a d ” , Ce / 10^ - 6 , ” The b y p a s s
c a p a c i t a n c e Ce i s = ”) / / Ce i s c o n v e r t e d in
terms o f micro
f a ra d
60 C1 = 2 / ( 2 * %p i * f * 1 0 0 ) / / C 1 = c o u p l i n g c a p a c i t o r
61 f o r ma t ( ” v” , 4 )
62 di s p ( ” micro f a r a d ” , C1 / 1 0 ^ - 6 , ” The c o u p l i n g
c a p a c i t a n c e C1 i s = ”) / / C1 i s c o nv e rte d i n
terms o f m i c r o f a r a61d
63 Ri n = 2 0 * 1 0 0 0 / / R i n = a s s u m e d i nput impedance i n
ohms
64 C2 = 1 / ( 2 * %p i * f * 0 . 1 * Ri n ) / / C2= c o u p l i n g c a p a c
it or
65 f o r ma t ( ” v” , 4 )
66 d i s p ( ” m i c r o f a r a d ” , C2 / 1 0 ^ - 6 , ” The c o u p t e r m s
ling
c a p a c i t a n c e C2 i s = ”) / / C2 i s c o nv e
r t e d i n o f micro f a ra d

Scilab code Exa 8.14.9 To find the resistance R1

1 // scilab 5.4.1
2 / / Windows 7 o p e r a t i n g system
3 / / c hapte r 8 Junc t i o n T ransist ors :Bia si
n g and A m p l i f i c a t i o n
4 clc
5 clear
6 VCC =12 / / V C C = c o l l e c t o r supply v o l t a g e
7 a =0 . 9 8 / / a=dc c u r r e n t g ai n o f t h e common
base t r a n s i s t o r
8 VBE =0. 7 / / V B E = b ase em it t er volt age
9 IE =2 / / I E = e m i t t e r c u r r e n t i n mA
10 // Ico i s t o be n e g l e c t e d
11 b =a / ( 1 - a ) / / b=dc c u r r e n t g a i n o f t h e common e m i
t t ert ransist or
12 / / IC=b∗ IB w h e r e I C = c o l l e c t o r c u r r e n t and
IB=base c u r r e n t
13 / / IE= I C + I B
14 / / I E = ( b + 1 ) ∗ IB
15 I B=I E / ( b + 1 )
16 I C=b * I B
17 RE =0. 1 / / R E = r e s i s t a n c e i n k i l o ohms c o n n e c t e d t o
the e m i t t e r te r m i n a l
18 R2 =20 / / R 2 = r e s i s t a n c e i n k i l o ohms
19 RC =3. 3 / / R C = r e s i s t a n c e i n k i l o ohms c o n n e c t e d t o
the c o l l e c t o r t e r m i n a l
20 / / Let I be t h e c u r r e n t i n t h e r e s i s t a n c e R2
21 / / Applying Ki rc h h o f f ’ s volt a ge law i
n the base −

62
em it t er circuit
22 / / VBE+ (RE∗ IE )=R2∗ I
23 I =( 1/ R2 ) * ( VBE + ( RE* I E ) )
24 / / Applying Ki rc h h o f f ’ s v o l t a g e law
25 / / ( ( I + I B + I C ) ∗RC) + ( ( I + I B ) ∗R1 ) + ( I ∗R2 )=VCC
26 R1 = ( VCC - ( ( I +I B+I C) * RC) - ( I * R2 ) ) / ( I +I B)
27 f o r ma t ( ” v” , 5 )
28 d i s p ( ” k i l o ohm ” , R1 , ” The r e s i s t a n c e R1 i s
= ”)

Scilab code Exa 8.14.10 To find the quiescent values of IE and VCE

1 // scilab 5.4.1
2 / / Windows 7 o p e r a t i n g s y s t e m
3 / / c hapte r 8 Junc t i o n T ra n sist ors :Biasin
g and A m p l i f i c a t i o n
4 clc
5 clear
6 VBE =0. 7 / / V B E = b ase em it t er volt age
7 b=90 / / b=dc c u r r e n t g a i n o f t h e common e m i t
t ert ransist or
8 VCC =10 / / V C C = c o l l e c t supply v o l t a g e
or i n k i l o ohms c o n n e c t e t o the
9 RE =1. 2 / / R E = r e s i s t a n d
ceem it t er te r m i n to the
al i n k i l o ohms c o n n e c t e
10 RC =4. 7 / / R C = r e s i s t a n to the
cecollect or t e r m d i n k i l o ohms c o n n e c t e
12 i/ n/ aA lp p l y i n g Ki rc h h o f f ’ s v o l t a g e law
11
13 RB =250 (RB∗
/ / VCE= / / R B =IBr e)+VBE
s i s t awn h e rde VCE= c o l l e c t o r emi
ct te eb ar sve o l t a g te e r m i n a l
14 / / A l s o VCC=(( I B + I C ) ∗RC)+VCE+( IE ∗RE)
15 / / IC=b∗ IB w h e r e I C = c o l l e c t o r c u r r e n t and
IB=base c u r r e n t
16 / / IE=IC+IB where IE=e m i t t e r current
17 / / IE=(b+1) ∗
IB
63
18 I B = ( VCC - VBE ) / ( ( ( b + 1 ) * ( RC+RE) ) +RB)
19 f o r ma t ( ” v” , 6 )
20 IE = ( b + 1 ) * I B
21 f o r ma t ( ” v” , 5 )
22 VCE = ( RB* I B) + VBE
23 f o r ma t ( ” v” , 5 )
24 I C=b * I B
25 f o r ma t ( ” v” , 5 )
26 d i s p ( ”mA” , I E , ” The q u i e s c e n t v a l ue o f IE
i s = ”)
27 d i s p ( ”V” , VCE , ” The q u i e s c e n t v a l ue o f VCE
i s = ”)
28 d i s p ( ”mA” , I C , ”When dc c u r r e n t g a i n = 9 0 , I C= ”)
29 / / bi s increased by 50%
30 b1 = ( ( 5 0 * b ) / 1 0 0 ) +b
31 I B1 = ( VCC - VBE ) / ( ( ( b1 + 1 ) * ( RC+RE) ) +RB)
32 I C1 =b1 * I B1
33 d i s p ( ”mA” , I C1 , ”When dc c u r r e n t g ai n i s i n c r e a s e
d by 50%, I C= ”)
34
35 xd i= s( p( (I ”%”
C1 - I C)
, x/, ”
I C)T *h 1e 0 0i n/ /c xr =e ia ns ce ri ena st he e icno l tlhee c uo lr lr ee n t
c t o r ci su r =r ”)
ent IC
36 d i s p ( ” The p e r c e n t a g e i n c r e a s e o f IC b e l e s s
i ng t h a t o f t h e dc c u r r e n t g a i n , t h e c i r than p r o
c u i t some st ab ilizat ion a g a i n s t the vides
changes c u r r e n t g a i n . ”) i n t h e dc
37 d i s p ( ”VCE d oes n o t d e p e n d on dc c u r r e n t g ai n and
hence i t is not a f f e c t e d when t h e dc cur
r e n t g ai n c h a n g e s . ”)

Scilab code Exa 8.14.11 To calculate the quiescent values of IB IC IE and


VCE

1 // scila b 5.4.1
2 / / Windows 7 o p e r a t i n gs y s t e m
3 / / c hapte r 8 Junc t i o n T r a n s i s t o r s : B i a s i n g
a nd
64
Am p lificat i
4 clc o n
5 clear
6 VBE =0. 7 / / V B E = b ase em it t er volt age
7 b=99 / / b=dc c u r r e n t g ai n o f t h e common e m i
t t ert ransist or
8 VCC =15 / / V C C = c o l l e c t o r supply v o l t a g e
9 RE =7 / / R E = r e s i s t a n c e k i l o ohms c o n n e c t e d t o
i n e m i t t e r te r m i n a the
l
10 RC =4 / / R C = r e s i s t a n c e k i l o oh m s c o n n e c t e d t o
incollect or t erm i
nal t h e k i l o oh m s c o n n e c t e d
11 RB =5 / / R B = r e s i s t a n c e
i n base t e r m i n a l t o t he su p p l y v o l t a g e
12 VEE = ( - 1 5 ) / / V E E = e m i t t v o l t a g e law i n t h e b a s e
14 e/ /r −VEE= (RB∗ IB )+VBE + ( IE ∗RE)
13
15 // A p p l y i IB
IC=b∗ n g w h e rK e i Ir C
c =h hc oo l l e c t o r c u r and IB=base
rf fe n’
ct us er rme int tt e r l o o p
16 / / IE=IC+IB where IE=e m i t t e r c u r r e n t
17 / / I E = ( b + 1 ) ∗ IB
18 I B = ( - VEE - VBE ) / ( RB + ( ( b + 1 ) * RE) )
19 f o r ma t ( ” v” , 7 )
20 d i s p ( ”mA” , I B , ” The q u i e s c e n t v a l ue o f IB i s
21 I C=b * I B = ”)
22 f o r ma t ( ” v” , 5 )
23 d i s p ( ”mA” , I C , ” The q u i e s c e n t v a l ue o f IC i s
24 IE = ( b + 1 ) * I B = ”)
25 f o r ma t ( ” v” , 5 )
26 d i s p ( ”mA” , I E , ” The q u i e s c e n t v a l ue o f IE i s
27 / / Applying K i r c =h ”)ho f f ’ s volt age law
in the output c i r c u i t
28 / / ( IC ∗RC)+VCE+( IE ∗RE)=VCC−VEE
29 VCE = ( VCC - VEE ) - ( I E * RE) - ( I C* RC)
30 f o r ma t ( ” v” , 5 )
31 d i s p ( ”V” , VCE , ” The q u i e s c e n t v a l ue o f
VCE i s = ”)
32 / / bi s increa sed by 20%
33 b1 = ( ( 2 0 * b ) / 1 0 0 ) +b
65
34 I B1 = ( - VEE - VBE ) / ( RB + ( ( b1 + 1 ) * RE) )
35 f o r ma t ( ” v” , 1 0 )
36 I C1 =b1 * I B1
37 f o r ma t ( ” v” , 6 )
38 d i s p ( ”mA” , I C1 , ”When dc c u r r e n t g ai n i s i n c r e a s e
d by 20%, I C= ”)
39 x = ( ( I C1 - I C) / I C) * 1 0 0 / / x = i n c r e a s e i n t h e c o l l e
ct orcurrent
40 d i s p ( ”%” , x , ” T h e i n c r e a s e i n t h e c o l l e c t o r c u r r e n
t IC i s = ”)
41 d i s p ( ” S i n c e a 20% i n c r e a s e i n c u r r e n t g a i n p r o
d u c e s a mere 0 . 2 8 4% e n h a n c e m e n t o f IC , t h e c i r c u i t
provides a st a biliza t ion a ga inst changes
good i n the t h e g ai n ”)
c u r r e n t i n c r e a s e i n the c o l l e c t o r c u r r e n
42 / / Ini s t e xgt bi vo eonk t h e as 0 . 5% which i s a c t u a l t as
ly co ming 0 . 2 8 4% a p p r o x i m a t e l y

Scilab code Exa 8.14.12 To determine the operating point

1 // scila b 5.4.1
2 / / Windows 7 o p e r a t i n g s y s t e m
3 / / c hapte r 8 Junc t i o n T ransist ors :Biasin
g and A m p l i f i c a t i o n
4 clc
5 clear
6 / / For a s e l f −b i a s c i r c u i t
7 VBE =0. 7 / / V B E = b ase em it t er volt a ge
8 b=1 00 / / b=dc c u r r e n t g ai n o f t h e common e m i t
t ert ransist or
9 VCC =22 / / V C C = c o l l e c t o r s u p p lvyo l t a g
10 R1 =82 / / R 1 = r e s i s t a n c e i n k iel ohms
o
11 R2 =16 / / R 2 = r e s i s t a n c e i n k iohmslo
12 RL =2. 2 / / R L = l o a d r e s i s t a n c e i n k i l o ohms
13 Re = 0 . 7 5 0 / / R e = r e s i s t a n c e i n k i l o ohms c o n n e c t e
d to
66
the em it t er t erm in al
14 //ICO i s t o be n e g l e c t e d
15 VT = ( R2 * VCC ) / ( R1 +R2 ) / / V T = T h e v e n i n eq u iv a len tv ol
t age
16 RT = ( R1 * R2 ) / ( R1 +R2 ) / / R T = T h e v e n i n equiv
a lent resist a nce
17 / / Applying Ki rc h h o f f ’ s volt age
law t o the base c i r c u i t
18 / / ( IB ∗ (RT+Re ) ) + ( I C ∗Re )=VT−VBE
19 / / IC=b∗ IB
20 I B = ( VT - VBE ) / ( RT+Re +( b* Re ) ) / / I B = b a s e curren
t
21 I C=b * I B / / I C = c o l l e c t o r current
22 f o r ma t ( ” v” , 8 )
23 / / Applying Ki rc h h o f f ’ s volt age law
to the collect orcircu it
24 / / ( IC ∗ (RL+Re ) ) + ( I B ∗Re )+VCE=VCC
25 VCE =VCC - ( ( I C * ( RL+Re ) ) + ( I B* Re ) ) / / VCE= c o l l e c
t orem it t er volt age
26 f o r ma t ( ” v” , 5 )
27 d i s p ( ” The o p e r a t i n g p o i n t i s s p e c i f i e d
b y ”)
28 d i s p ( ”mA” , I C , ” I C= ”)
29 d i s p ( ”V” , VCE , ”VCE= ” )

Scilab code Exa 8.14.13 To determine the operating point

1 // scila b 5.4.1
2 / / Windows 7 o p e r a t i n g s y s t e m
3 / / c hapte r 8 Junc t i o n T ransist ors :Biasin
g and A m p l i f i c a t i o n
4 clc
5 clear
6 RE = 0 . 6 8 0 / / R E = r e s i s t a n c e i n k i l o ohms c o n n e c t e
d to t h e em it t er t erm inal
7 RC =2. 7 / / R C = r e s i s t a n c e i n k i l o ohms c o n n e c t e d t o
the c o l l e c t o r t erm inal
8 //RB= r e s i s t a n c e c o n ne c te d to the base t e r m i n a l

67
9 VCE =7. 3 / / V C E = c o l l e c t o r em it t er volt a ge
10 VBE =0. 7 / / V B E = b ase em it t er volt age
11 Vr e =2. 1 / / V r e = v o l t a g e a c r o s s RE r e s i s t a n c e
12 I B =0 . 0 2 / / I B = b a s e c u r r e n t i n mA
13 IE= Vr e / RE / / I E = e m i t t e r c u r r e n t i n mA
14 I C=I E - I B / / I C = c o l l e c t o r c u r r e n t i n mA
15 b =I C/ I B / / b = c u r r e n t g ai n
16 f o r ma t ( ” v” , 6 )
17 d i s p ( b , ” The c u r r e n t g ai n i s = ”)
18 VCC = ( I C* RC) + VCE + Vr e / / V C C = c o l l e c t o r s u p p l y v o l t a g
e
19 f o r ma t ( ” v” , 5 )
20 d i s p ( ”V” , VCC , ” The c o l l e c t o r s u p p l y v o l t a g e VCC i
s =”
)
21 / / V ol t a g e a c r o s s RB ( Vrb ) r e s i s t a n c e i sg i v e n
by
22 Vr b =VCC - ( VBE + Vr e )
23 RB= Vr b / I B
24 f o r ma t ( ” v” , 5 )
25 d i s p ( ” k i l o ohm ” , RB , ” The r e s i s t a n c e RB i s = ”)
26 / / T o dr a w t h e DC l o a d l i n e , we n e g l e c t t h e
base c u r r e n t i n RE r e s i s t a n c e
27 / / Equation f o r DC l o a d l i n e i s :
28 //VCE=VCC−(RC+RE) ∗ IC
29 d i s p ( ” F o r t h e DC l o a d l i n e ”)
30 d i s lpi(n”V” e on , tVCC h e ,IC” The a x i s i(Y−a
n t e rx ci se p it s =o”)
f the l o ad l i n
32 e d)on i s pt h( e”VCE−a The DC x i sl o(X−a
a d xl i ns )e i s s ti sr a=i ”) gh t line join in
31 d i s p ( ”mA” t h e a, b VCC
o v e / (twoRC+RE) i n ,t ”
e rThe
c gin t er cep t o f the
33 led ipo sat pds (. ””)The co−o r d i n a t e s o f the operat ing
p o i n t Q on t h e l o a d l i n e a r e ( 7 . 3 V, 3 . 0
7mA) ”)

Scilab code Exa 8.14.14 To determine the ac as well as dc load line and
the amplitude of the output voltage

68
1 // scilab 5.4.1
2 / / Windows 7 o p e r a t i n g system
3 / / c hapte r 8 Junc t i o n T ransist ors :Bia si
n g and A m p l i f i c a t i o n
4 clc
5 clear
6 VBE =0. 7 / / V B E = b ase em it t er volt age
7 b =12 0 / / b=dc c u r r e n t g ai n o f t h e common e m i
t t ert ransist or
8 VCC =15 / / V C C = c o l l e c t o r supply v o l t a g e
9 R1 =72 / / R 1 = r e s i s t a n c e i n k i l o ohms
10 R2 =8 / / R 2 = r e s i s t a n c e i n k i l o ohms
11 RL =2 / / R L = l o a d r e s i s t a n c e i n k i l o ohms
12 Re = 0 . 7 0 0 / / R e = r e s i s t a n c e i n k i l o ohms c o n n e c t e
d to t h e em it t er t erm inal
13 RC =2 / / R C = r e s i s t a n c e i n k i l o ohms c o n n e c t e d to
the c o l l e c t o r t e r m i n a l
14 Ri n =1. 5 / / R i n = i n p u t r e s i s t a n c e i n k i l o ohms o f
the a m p l i f i e r
15 vi =1 / / v i = a m p l i t u d e o f t h e ac i n p u t s i g n a l i n
mV
16 VT = ( R2 * VCC ) / ( R1 +R2 ) / / V T = T h e v e n i n eq u iv a len tv
olt a ge
17 RT = ( R1 * R2 ) / ( R1 +R2 ) / / R T = T h e v e n i n equiv
a lent resist a nce
18 / / Applying Ki rc h h o f f ’ s volt age
law t o the base c i r c u i t
19 / / ( IB ∗ (RT+Re ) ) + ( I C ∗Re )=VT−VBE
20 / / IC=b∗ IB
21 I B = ( VT - VBE ) / ( RT+Re +( b* Re ) ) / / I B = b a s e curren
t
22 I C=b * I B / / I C = c o l l e c t o r current
23 f o r ma t ( ” v” , 5 )
24 / / Applying Ki rc h h o f f ’ s volt age law
to the collect orcircu it
25 / / ( IC ∗ (RL+Re ) ) + ( I B ∗Re )+VCE=VCC
26 VCE =VCC - ( ( I C * ( RL+Re ) ) ) / / VCE= c o l l e c t o r e m i
t t e r v o l t a g e ( n e g l e c t i n g s m a l l t e r m IB ∗RE)
27 f o r ma t ( ” v” , 5 )
28 / / Equation f o r DC l o a d69l i n e i s :
29 //VCE=VCC−(RL+Re ) ∗ IC
30 di s p( ” 1 . F o r t h e DC l o a d l i n e ”)
31 di s p ( ” The o p e r a t i n g p o i n t Q i s s p e c i f i e d b y ”)
32 di s p ( ”mA” , I C , ” I C= ”)
33 di s p ( ”V” , VCE , ”VCE= ” )
34 di s p ( ”V” , VCC , ” The i n t e r c e p t of t h e dc
l o ad l i n e on t h e VCE−a x i s (X−a
xis) i s = ”)
35 d i s p ( ”mA” , VCC / ( RC+Re ) , ” The i n t e r c e p t of
36 dt hi es p dc
( ” The lDC o a dl ol iand e on l i n teh ei s ICt h e s at xr ai si g(Y−a h t x i jso)i n i n i
ls i n= e”)a b o v e two i n t e r c e p t s . ”) g
37 Ra c =( RL* RC) / ( RL+RC) / / R a c = a c l o ad r e s i s t
ance
38 di s p ( ” 2 . F o r t h e AC l o a d l i n e ”) ac l o
39 d i s lpi(n”V”e , VCEon + ( It hC*
e Ra c ) , ”x The
VCE−a i s (X−a i n xt ie sr )c ei sp t= ”) a d
40 d i s po (f ” The l i n e j o i n i n g t h e a b o v e i n t e trhce e p t a n d
the
o p e r a t i n gp o i n t Q e x t e n d e d t o m e e t t h e IC a x i s
(Y− a x i s ) g i v e s t h e AC l o a d l i n e ”)
41 AV = - ( b* Ra c ) / Ri n / / A V = v o l t a g e g ai n o f the a m p l i f i e
r
42 vo= a b s ( AV) * v i / / v o = a m p l i t u d e o f the o u tp u t v o l
t a gesign a l
43 d i s p ( ”mV” , v o , ” 3 . The
amplitude o f the output v o l
t age vo i s = ”)

70
Chapter
9
Basic Voltage and Power
Amplifiers

Scilab code Exa 9.12.1 To determine the lower and upper half power fre-
quencies

1 // scila b 5.4.1
2 / / Windows 7 o p e r a t i n g s y s t e m
3 / / c hapte r 9 Bas i c V o l t a g e a n d Power A m p l i f
iers
4 clc
5 c l e a=120
AVm r //AVm=mid−band g ai n o f an RC−c o u p l e d
6 am plifier
7 f m =100 / / fm=f r e q u e n c y i n c o r re s p o n d i n g
Hz b a n d g a i n
8 AVl =60 / / A V l = r e d u c e d g ai t o
n
9 AVh= AVl t h e c mid−
Hz orresponding to
10 f = 100*10^3 / / f=f re q u e n c y the
11 / / | iAVl
n r e |d u=c (e d|AVm|
g a )i /n s q r t ( 1 + ( f l / fm ) ˆ 2 ) w here f l = l
o w e r h a l f power f r e q u e n c y
12 f l = s q r t ( ( a b s ( AVm ) / a b s ( AVl ) ) ^2 - 1 ) * f m
13 f o r ma t ( ” v” , 6 )
14 d i s p ( ” Hz” , f l , ” The l o w e r h a l f −power f r e q u e n c
y i s = ”)
71
15 / / | AVh | = ( |AVm| ) / s q r t ( 1 + ( f / f h ) ˆ 2 ) wh ere f h = u p p e r
h a l f power f re q u e n c y
16 f h =f / s q r t ( ( a b s ( AVm ) / a b s ( AVh ) ) ^2 - 1 )
17 f o r ma t ( ” v” , 5 )
18 d i s p ( ” kHz” , f h / 1 0 ^ 3 , ” The u p p e r h a l f −power f r e q u
e n c y i s = ”) / / f h i s c o n v e r t e d i n t e r m s o f kHz

Scilab code Exa 9.12.2 To determine the lower and upper half power fre-
quencies

1 // scilab 5.4.
1 7 o p e r a t i n g system
2 / / Windows 9 B a s i c V o l t a g e a n d Power A m p l i f i e
3 / / c hapte r r s
4 clc
5 clear i d e n t i c a l t r a n s i s t o r s e m p l o y e d by an
6 / / Fcoor u ptwo
l e d RC− a m p lifier
7 h f e =100 / / h f e = c u r r e n t g ai n
8 h i e = 2*10^3 / / h i e=i n p u t i m p e d a n c e i n ohm
9 Cob = 2 * 10 ^ - 12 / / Cob=c a p a c i t a n c e i n f a r a d q u o t e d by
the t r a n s i s t o r m a n u f a c t u r e rs
10 C =0 . 4 * 1 0 ^ - 6 / / C = c o u p l i n g ca pacit a nce i nf a r a d
11 RL = 8 * 1 0 ^ 3 / / R L = l o a d r e s i s t a n c e i n ohms f o r
each t r a n s i s t o r
12 CW = 1 0 * 1 0 ^ - 12 //CW=w i r i n g ca pacit a nce i nf a
ra d
13 f l = 1 / ( 2 * %p i * C* ( hi e +RL) ) / / f l = l o w e r h a l f
power f r e q u e n c y
14 f o r ma t ( ” v” , 5 )
15 d i s p ( ” Hz” , f l , ” The l o w e r h a l f −power f r e q u
ency i s = ”)
16 h f b = - h f e / ( 1+ h f e ) / / h f b = c u r r e n t g a i n f o r common
base t r a n s i s t o r
17 Coc= Cob / ( 1+ h f b ) / / C o c = t r a n s i s t o r colle
c t o r c a p a c i t a n c e i n f a ra d
18 Cs= Coc +CW / / C s = s h u n t ca pa cit ance in
f a ra d
72
19 Ro = ( h i e * RL) / ( hi e +RL) / / Ro= e q u i v a l e n t r
esist ance o
f
the p a r a l l e l c o m b i n a t i o n o f h i e a n d RL
20 f h = 1 / ( 2 * %p i * Cs* Ro ) / / f h = u p p e r h a l f power f r e q u e
ncy
21 f o r ma t ( ” v” , 5 )
22 d i s p ( ” kHz” , f h / 1 0 ^ 3 , ” The u p p e r h a l f −power f r e q u
e n c y i s = ”) / / f h i s c o n v e r t e d i n t e r m s o f kHz

Scilab code Exa 9.12.3 To find the gain relative to the mid frequency gain

1 // scila b 5.4.1
2 / / Windows 7 o p e r a t i n g system
3 / / c ha pte r 9 Bas i c V ol t a g e a n d Power A m p l i f i e r
s
4 clc
5 clear
6 //AVm=mid−band g ai n o f an RC−c o u p l e d a m p l i f mid− ier
7 f m =60 / / fm=f r e q u e n c y i n Hz c o r r e s p o n d i n g
to t h e b a n d g ai n
8 / / AVl=reduced g ai n
9 //AVh=AVl
10 f = 600*10^3 / / f=f re q u e n c y i n Hz c o r r e s p o n d i n g
11 to / / f l = T h e t lhoe wr eedru c e dh a l f g−power
f l =30 ai n f r e q u e n c y i n Hz
12 f h = 300* 10^3 / / f h=The upper h a l f −power f r e q u e n c y i n
Hz
13 / / | AVl | = ( |AVm| ) / s q r t ( 1 + ( f l / fm ) ˆ 2 )
14 / / Suppose ( AVl/AVm)=a=l ow f r e q u e n c y g ai n
with r e s p e c t t o t h e mid f r e q u e n c y g ai n
15 / / a = 1 / s q r t ( 1 + ( f l / fm ) ˆ 2 ) / / a = m a g n i t u d e o f the
low f r e q u e n c yg ai n
16 a =1/ s q r t ( 1 + ( f l / f m) ^ 2 )
17 f o r ma t ( ” v” , 5 )
18 o= a t a n d ( f l / f m) / / o = p h a s e a n g l e i n de g re e o f the
low f r e q u e n c yg ai n
19 f o r ma t ( ” v” , 5 )
20 di s p ( ” For the low f r e q u e n c y g ai n w i t h r e s p e c t t o
t h e mid f r e q u e n c y g a i n ”)
21 d i s p ( a , ” Ma gn i t u d e= ”)
73
22 d i s p ( ” d e g r e e ” , o , ” P h a s e a n g l e= ”)
23 / / | AVh | = ( |AVm| ) / s q r t ( 1 + ( f / f h ) ˆ 2 )
24 / / Suppose (AVh/AVm)=b=h i gh f r e q u e n c y g a i n
with r e s p e c t t o t h e mid f r e q u e n c y g ai n
25 / / b =1 / s q r t (1 +( f / f h ) ˆ2 ) / / b=magnitude o f the
h i g h f r e q u e n c y g ai n
26 b =1 / s q r t ( 1 + ( f / f h ) ^ 2 )
27 f o r ma t ( ” v” , 6 )
28 O=- a t a n d ( f / f h ) / / O = p h a s e a n g l e i n de g re e o f high
t h e f r e q u e n c yg ai n
29 f o r ma t ( ” v” , 6 )
30 di s p ( ” For the high f re q u e n c y g ai n with r e s p e c
t to t h e mid f r e q u e n c y g a i n ”)
31 d i s p ( b , ” Ma gn i t u d e= ”)
32 d i s p ( ” d e g re e ” , O, ” P h a s e a n g l e= ”)

Scilab code Exa 9.12.4 To calculate the output power

1 // scila b 5.4.1
2 / / Windows 7 o p e r a t i n g s y s t e m
3 / / c h a p t e r 9 B a s i c V o l t a g e a n d Power A m p l i f i e
4 clc rs
5 clear
6 / / I n a CE c l a s s A power a m p l i f i e
7 RL =12 / / R L = rl o a d r e s i s t a n c e i n ohms
8 n=8 / / n = p r i m a r y −to −s e c o n d a r y turns r a t i o o
f at r a n sfor m er
9 / / Peak−to −peak s w i n g o f the s i g n a l c u r r e n t i s
250mA
10 I m = ( 2 5 0 * 1 0 ^ - 3 ) / 2 / / Im=ac collect or current in
Ampere
11 RL1 = ( n ^ 2 ) * RL / / RL1= RL’= r e s i s t a n c e r e f l e c t e d to
the primary f o r t h e r e s i s t a n c e RL i n p r e s e n c e o
f an ac signal
12 / / P a c = ( 1 / 2 ) ∗Vm∗Im w h e r e P a c = a c o u t p u t power
13 / / P a c = ( 1 / 2 ) ∗ ( Im ˆ 2 ) ∗RL1
14 P a c =( 1/ 2) * ( I m ^ 2 ) * RL1
74
15 d i s p ( ”W” , Pa c , ” The o u t p u t power i
s = ”)

Scilab code Exa 9.12.5 To calculate dc input and ac output power along
with the collector dissipation and the efficiency

1 // scila b 5.4.1
2 / / Windows 7 o p e r a t i n g system
3 / / c ha pte r 9 Bas i c V ol t a g e a n d Power A m p l i f i e r s
4 clc
5 clear
6 VCQ =6 / / V C Q = q u i e s c e n t collect or volt a ge
7 I CQ = 5 0 * 1 0 ^ - 3 / / I C Q = q u i e s c e n t collect or curren t
8 VCmi n =1
9 VCmax =11 / / V C m i n , VCmax=o u t p u t sign al vol
t a gev a r ia t ion
10 I Cmi n = 1 0 * 1 0 ^ - 3
11 I Cma x = 9 0 * 1 0 ^ - 3 / / ICmin , I C m a x = o u t p u t signal cur
r e n t v a r i a t i o n i n Ampere
12 Ps = VCQ * I CQ / / P s = d c i n p u t power to the t r a n s i s t
or
13 d i s p ( ”W” , Ps , ” The dc i n p u t power i s = ”)
14 P a c =( 1/ 8) * ( I Cma x - I Cmi n ) * ( VCmax - VCmi n ) / / P a c = a c
o u t p u t power d e l i v e r e d t o t h e l o a d
15 d i s p ( ”W” , Pa c , ” The ac o u t p u t power i s = ”)
16 PT = ( VCQ * I CQ ) - P a c / / P T = t he collect or dissipat ion
17 d i s p ( ”W” , PT , ” The c o l l e c t o r d i s s i p a t i o n i s = ”)
18 n=( P a c / Ps)*100 / / n=the e f f i c i e n c y o f the a c
t iv ed ev ice
19 f o r ma t ( ” v” , 5 )
20 d i s p ( ”%” , n , ” T h e e f f i c i e n c y i s = ”)

Scilab code Exa 9.12.6 To determine the maximum dc power and the
maximum output power along with the efficiency

75
1 // scila b 5.4.1
2 / / Windows 7 o p e r a t i n g system
3 / / c ha pte r 9 Bas i c V ol t a g e a n d Power A m p l i f i e r s
4 clc
5 clear
6 / / In a c l a s s B push p u l l c i r c u i t
7 / / Transformer w i n d i n g r e s i s t a n c e s a r e t o be i g n o
re d
8 n=3 / / n = p r i m a r y −to −s e c o n d a r y turns r a t i o
of at ra nsform er
9 RL =9 / / R L = l o a d r e s i s t a n c e i n ohms
10 VCC =15 / / V C C = c o l l e c t o r supply v o l t a g e
11 RL1 = ( ( n / 2 ) ^ 2 ) * RL / / R L 1 = r e f l e c t e d l o ad r e s i s t a n c e
f o r one t r a n s i s t o r
12 P a c t o t = ( VCC ^ 2 ) / ( 2 * RL1 ) / / P a c t o t = m a x i m u m o u t p u t
power
13 f o r ma t ( ” v” , 5 )
14 d i s p ( ”W” , P a c t o t , ” The maximum o u t p u t power i s
= ”)
15 P s t o t = ( 2 * VCC ^ 2) / ( %pi * RL1 ) / / P s t o t = t h e maximum
dc power s u p p l i e d t o t h e two t r a n s i s t o r s
16 f o r ma t ( ” v” , 5 )
17 d i s p ( ”W” , P s t o t , ” The maximum dc power s u p p l i
e d i s = ”)
18 n=( P a c t o t / P s t o t ) * 1 0 0 / / n=e f f i c i e n c y
19 f o r ma t ( ” v” , 5 )
20 d i s p ( ”%” , n , ” T h e e f f i c i e n c y i s = ”)
Scilab code Exa 9.12.7 To calculate the resonant frequency along with
the bandwidth and the maximum voltage gain

1 // scila b 5.4.1
2 / / Windows 7 o p e r a t i n g system
3 / / c hapte r 9 Bas i c V o l t a g e a n d Power A m p l i f i e r s
4 clc
5 clear
6 / / In a s i n g l e tuned a m p l i f i e r
7 L =120*10^ - 6 / / L = i n d u c t a n c e i n henry
8 C = 1 0 0 * 1 0 ^ - 12 / / C = c a p a c i t a n c e i n f a r a d

76
9 R =10 / / R = r e s i s t a n c e i n ohms
10 h o e = 5 0 * 1 0 ^ - 6 / / h o e = o u t p u t i m p e d a n c e i n mho( or S )
11 h f e =100 / / h f e = c u r r e n t g ai n
12 h i e = 2 . 5 * 1 0 ^ 3 / / h i e = i n p u t i m p e d a n c e i n ohm
13 RT = 1 0 * 1 0 ^ 3 / / R T = e q u i v a l e n t r e s i s t a n c e o f RB a n d
Ri i n p a r a l l e l
14 f o = 1 / ( 2 * %p i * s q r t ( L* C) ) / / f o = r e s o n a n t f r e q u e n c y
15 f o r ma t ( ” v” , 5 )
16 d i s p ( ”MHz” , f o / 1 0 ^ 6 , ” The r e s o n a n t f re q
uency i s = ”) / / f o i s c o n v e r t e d i n terms
o f MHz
17 Qo =( 1/ R) * s qr t ( L/ C) / / Qo=Q− f a c t o r o f t h e r e s o
n a n t f re q u e n c y
18 Ro = ( Qo ^ 2 ) * R // R o = m a x im u m i m p e d a n c e Zm
19 Rp =1/ ( h o e +( 1/ Ro ) +( 1/ RT) ) / / Rp= e q u i v a l e n t resist
a n ceof t h e p a r a l l e l c o m b i n a t i o n o f Ro , ro a n d RT
20 Qe =( Qo* Rp ) / Ro / / Q e = e f f e c t i v e Q− f a c t o r
21 B=f o / Qe / / B = b a n d w i d t h
22 f o r ma t ( ” v” , 6 )
23 d i s p ( ” kHz” , B / 1 0 ^ 3 , ” The b a n d w i d t h i s
= ”) / / B i s c o n v e r t e d in terms
o f kHz
24 AVm = - ( h f e * Rp ) / h i e //AVm=maximum v o l t a g e g
ai n
25 f o r ma t ( ” v” , 6 )
26 d i s p ( AVm , ” The maximum v o l t a g e g a i n i s = ”)

Scilab code Exa 9.12.8 To find out the decibel change in the output power
level

1 // scila b 5.4.1
2 / / Windows 7 o p e r a t i n g system
3 / / c hapte r 9 Bas i c V o l t a g e a n d Power A m p l i f i e r s
4 clc
5 clear
6 V =10 / / V = v o l t a g e a t f r e q u e n c y 5 kHz
7 Vr =7 . 0 7 / / V r = v o l t a g e a t f r e q u e n c y 25 kHz
8 / / x=10∗ l o g 1 0 ( P / P r ) w h e r e x = c h a n g e i n d e c i b e l ( dB) o
f
77
p o w e r P f ro m some s t a n d a r d power Pr
9 / / P = V ˆ 2 / R = I ˆ 2 ∗R
10 / / A l s o P r = V r ˆ 2 / R = I r ˆ 2 ∗R
11 / / x = 1 0 ∗ ( l o g 1 0 ( V / Vr ) ) ˆ2=20 ∗ l o g 1 0 ( V / Vr )
12 x= 20* l o g 1 0 ( V/ Vr ) / / x = c h a n g e i n d e c i b e l ( dB) of vol
t a g e V fr o m some s t a n d a r d v o l t a g e Vr
13 f o r ma t ( ” v” , 4 )
14 d i s p ( ”dB ” , x , ” T h e d e c i b e l c h a n g e i n t h e o u t p u t
p o w e r l e v e l i s = ”)

Scilab code Exa 9.12.9 To find the rms output voltage and rms input
voltage along with the output power in the midband region

1 // scila b 5.4.1
2 / / Windows 7 o p e r a t i n g s y s t e m
3 / / c hapte r 9 Bas i c V o l t a g e a n d Power A m p l i f i e r s
4 clc
5 clear
6 Vo r ms =2 / / Vorms =rms o u t p u t v o l t a g e i n the
midband r e g i o n o f an a m plifier
7 Pa = 42 / / P a = p o w e r g ai n i n dB
8 P o l =0. 4 / / P o l = p o w e r o u t p u t i n W at the l o w e r
c u t f−r eo qf fu e n c y 100 Hz
9 Ri =1 0^3 / / R i = i n p u t r e s i s t a n c e i n ohms
10 VOr ms =2/ s q r t ( 2 ) / / V O r m s = r m s o u t p u t v o l t aagt e 100 Hz
11 f o r ma t ( ” v” , 6 )
12 d i s p ( ”V” , VOr ms , ” 1 . The rms o u t p u t v o l a t 100 Hz ,
t a g e which i s t h e l o w e r c u t o f f f re q u e n c = ”)
y , is region
13 Po =2* P o l / / P o = o u t p u t power i n the
midband
14 d i s p ( ”W” , Po , ” 2 . The o u t p u t power i n t h e
midband r e g i o n i s = ”)
15 / / Let Pi=i n p u t power
16 / / 10 ∗ l o g 1 0 ( P o / P i ) = P a
17 Pi =Po / ( 1 0 ^ ( Pa / 1 0 ) )
18 / / P i = ( Vi ˆ 2 ) / Ri w h e r e V i= r m s i n p u t v o l t a g e
78
19 Vi = s q r t ( P i * Ri )
20 f o r ma t ( ” v” , 7 )
21 d i s p ( ”V” , Vi , ” 3 . The rms i n p u t v o l t a g e i s
= ”)

79
Chapter 10

Feedback In
Amplifiers

Scilab code Exa 10.7.1 To find the voltage gain with feedback the amount
of feedback in dB the output voltage of the feedback amplifier the feedback
factor the feedback voltage

1 // scila b 5.4.1
2 / / w ind ow s 7 o p e r a t i n g system
3 / / c hapte r 1 0 : F e e d b a c k In A m p l i f i e r s
4 clc
5 clear
6 A =( - 100) / / A = v o l t a g e g ai n o f an a m p l i f i e r
7 B =( - 0 . 0 4 ) / / B = f e e d b a c k rat io
8 Af =A / ( 1+( A* B) ) / / A f = v o l t a g e g aiwni t h f e e d b a c k
9 d i s p ( ” ” , Af , ” 1 . V ol t a g e g ai n w i tf he e d b a c k
10 F =20* l o g 1 0 ( a b s ( Af / A) ) / / F= a mou n t Af= ”) o f f e e
11 f o r ma t ( ” v” , 6 ) dbac k
12 d i s p ( ”dB ” , F, ” 2 . Amount o f f e e d b a c k F= ”)
13 Vi = 4 0 * ( 1 0 ^ - 3 ) / / V i = i n p u t volt age
14 Vo =Af * Vi / / V o = o u t p u t volt a ge
15 d i s p ( ”V” , Vo , ” 3 . O u t p u t v o l t a g e Vo= ”)
16 f = ( - A* B) / / f = f e e d b a c k fa ct or
17 d i s p ( ” ” , f , ” 4 . F e e d b a c k f a c t o r f= ”)
18 Vf =B* Vo / / Vf=f e e d b a c k volt a ge
19 d i s p ( ”mV” , Vf / 10^ - 3 , ” 5 . F e e d b a c k v o l t a g e i s
Vf= ”) / / Vf
80
i s c o nv e rte d i n terms of
mV

Scilab code Exa 10.7.2 To find the minimum value of the feedback ratio
and the open loop gain

1 // scilab 5.4.1
2 / / win dow s 7 o p e r a t i n g system
3 / / c hapte r 1 0 : F e e d b a c k In A m p l i f i e r s
4 clc
5 clear
6 d i s p ( ” Ne g a t i ve f e e d b a c k h as t o be a p p l i e d f o r
g a i n s t a b i l i t y ”)
7 //A=open l o o p g ai n o f an a m p l i f i e r
8 //B=f e e dbac k rat io
9 Af =1 0 / / A f = v o l t a g e g ai n with f e e d b a c k
10 / / dAf / Af = ( 1/ ( 1+ ( A∗B ) ) ) ∗ ( dA/ A)
11 y=2 / / ( dAf / Af ) = y = p e r c e n t change o f g ai n t h a t
isa llowa b le
12 x=20 / / ( d A / A ) = x = p e r c e n t c h a n g e i n open l o o p g ai
n o f an a m p l i f i e r
13 a = ( x / y ) / / (1+ (A ∗B) ) = a
14 d i s p ( ” ” , a , ” ( 1 + (A∗B ) ) = ”)
15 / / Af= A/ ( ( 1 + (A ∗ B) ) )
16 A=( Af * a )
17 d i s p ( ” ” , A, ” Open l o o p g ai n A= ” )
18 / / 1+(A∗B)=a
19 B=( a - 1 ) / A
20 d i s p ( ” ” , B, ”Minimum v a l ue o f f e e dbac kr a t i
o B= ” )

Scilab code Exa 10.7.3 To find the reverse transmission factor

1 // scila b 5.4.1
2 / / wi ndo ws 7 o p e r a t i n gs y s t e m

81
3 / / c hapte r 1 0 : F e e d b a c k In A m p l i f i e r s
4 clc
5 clear
6 VD =0. 1 / / V D = o u t p u t d i s t o r t i o n v o l t a g e
7 VDf =0 . 0 5 / / V D f = o u t p u t dist ort ion volt age
with f e e d b a c k
8 A= - 80 / / A = o p e n l o o p g ai n o f an a m p l i f i e r
9 / / VDf=VD/(1 +(A∗B) )
10 B = ( ( VD/ VDf ) - 1 ) / A / / B = r e v e r s e t r a n s m i s s i o
n fa ct or
11 f o r ma t ( ” v” , 1 0 )
12 d i s p ( ” ” , B, ” R e v e r s e t r a n s m i s s i o n fact
o r B= ” )

Scilab code Exa 10.7.4 To find voltages current and power dissipation of
a given transistor circuit

1 // scila b 5.4.1
2 / / w indo ws 7 o p e r a t i n g system
3 / / c hapte r 1 0 : F e e d b a c k In A m p l i f i e r s
4 clc
5 clear
6 B =50 / / B = r e v e r s e t ransm ission fact or
for s i l i c o n t r a n s i s t o r T1
7 VB = ( ( 6 4 0 ) * 1 0 ) / ( 6 4 0 + 3 6 0 ) / / c a l c u l a v o l t a g e a t
t i n g p o i n t B i . e VB by a p p l y i ng d ivid er ru l
v o l t a g e i n the given circ e
uit
8 f o r ma t ( ” v” , 4 )
9 d i s p ( ”V” , VB , ”VB= ” ) drop f o
10 VBE =VB - 5 . 6 / / V B E = b ase em it t er volt r
11 ad igseps( i”V”
l i c o n, VBEt , r ”VBE=
a n s i s t”o )r s T1 a n d T2
12 b o t=10
VA h - 0 . 8 //VA=v o l t a g e at p o i n t A i n the g
ivencircuit
13 d i s p ( ”V” , VA , ”VA= ” )
14 I 1 = 10/ ( 360+ 64 0) / / I 1=c u r r e n t through r e s i s t o r o f
360 ohm

82
15 f o r ma t ( ” v” , 5 )
16 d i s p ( ”A” , I 1 , ” I 1= ”)
17 I E 1 = I 1 +1 / / I E 1 = e m i t t e r current of t ra nsist or
T1
18 f o r ma t ( ” v” , 5 )
19 d i s p ( ”A” , I E1 , ” I E 1= ”)
20 / / IC1=−IB1+IE1
21 I B1 = I E1 / ( B + 1 ) / / I B 1 = b a s e current of t ransist o
r T1
22 Id2i s=p( 2( 0”mA”
23 - VA) /, 3I0B1 0 / / 1I02^=-c3 u, r” r eI nB1=
t ”) t h /r o/ uIB1
g h r ie ss i s t o r o f
c o nohm
300 v e rte d i n terms
24 d i s po (f ”mA”
mA , I 2 / 1 0 ^ - 3 , ” I 2= ”) / / I 2 i s c o nv
e rte d i n t e r m s o f mA
25 I C2 = I 2 - I B1 / / I C 2 = c o l l e c t o r current of t ransist or
T2
26 d i s p ( ”mA” , I C2 / 1 0 ^ - 3 , ” I C2= ”) / / IC2 is
c o nv e rte d i n terms T2 i s
o f mA
27 / / A s s u m i n g t h e b a s e c u r r e n t IB2 o f t r a n s i
st ornegligibly sm all
28 I E 2 = I C2 / / I E 2 = e m i t t e r current of t ra nsist o
r T2
29 d i s p ( ”mA” , I E 2 / 1 0 ^ - 3 , ” I E 2= ”) / / IE2 is
31 d i s cp o( ”mA”
n v e r t e ,d I 3 / 1 0 ^ - 3 , ” I i s c o nivnet retremds i n t e r m s
o
3= ”) / / I 3 f mA
30 oI 3f =mA( 2 0 - 5 . 6 ) / 1 0 0 0 / / I 3 = c u r r e zn ettnher or udgiho de
32 I Z =1000
I 3 + I E2 ohm / / r IeZs=ics ut or r e n t i s c o nv e rte d i n terms
through
d i s p=20
33 VCE
34 ( ”mA”
- 10 / / V, CIZ E =/ 1c0o^l -l 3e ,c t”o r e m i t t e r v o l t a g e drop
I Z= ”) /f /o IZ r t r a n s i s t o r T1
35 d i s op f( ”V”mA , VCE , ”VCE= ” )
36 I C1 =B* I B1
37 P= VCE * I C1 / / P = p o w e r d issipa t ion in t ra nsist or
T1
38 d i s p ( ”W” , P , ”P= ” )

83
Scilab code Exa 10.7.5 To calculate the voltage gain and input output
resistances

1 // scila b 5.4.1
2 / / w ind ow s 7 o p e r a t i n g system
3 / / c hapte r 1 0 : F e e d b a c k In A m p l i f i e r s
4 clc
5 clear
6 A =50 / / A = v o l t a g e g ai n o f t r a n s i s t o r a m p l i f i e r
7 Ri =1000 / / R i = i n p u t resist ance of t ransist or a m p l
i f i e r without f e e dbac k
8 Ro = 4 0 * 1 0 0 0 / / R o = o u t p u t resist a nce of t ransi
s t o r a m p l i f i e r f e e dbac k
9 / / Vf = 0 .1 ∗ Vo ( g i v e n ) w h e r e Vf=f e e d b a c k v o l t
a g ea n d Vo
=output volt a ge
10 B =0. 1 / / B = ( V f / V o ) = f e e d b a c k fra ct ion
11 Af =A / ( 1+( A* B) ) / / Af=g ai n o f the f e e dbac k a
m plifier
12 f o r ma t ( ” v” , 5 )
13 d i s p ( ” ” , Af , ” Gain o f f e e d b a c k a m p l i f i e r
Af= ”)
14 Ri f =Ri * ( 1 + ( A* B) ) / / R i f = i n p u t resist ance of
the f e e dbac k a m p l i f i e r
15 Ro f =Ro / ( 1+( A* B) ) / / R o f = o u t p u t resist ance of
the f e e dbac k a m p l i f i e r
16 f o r ma t ( ” v” , 5 )
17 d i s p ( ” k i l o ohm ” , Ri f / 1 0 ^ 3 , ” I n p u t r e s i s t a n c e
with f e e d b a c k R i f= ”) / / R i f i s c o n v e r t e d i n t e r m s
o f k i l o ohm
18 d i s p ( ” k i l o ohm ” , Ro f / 1 0 ^ 3 , ” O u t 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 R o f= ”) / / R of i s c o n v e r t e d i n
t e r m s o f k i l o ohm

84
Chapter 11

Sinusoidal Oscillators
and Multivibrators

Scilab code Exa 11.12.1 To calculate the frequency of oscillation and mu-
tual inductance

1 // scilab 5.4.1
2 / / Windows 7 o p e r a t i n g system
3 / / c hapte r 11 S i n u s o i d a l o s c i l l a t o r
and m u l t i v i b r a t o r s
4 clc
5 clear
6 L =50*10^ - 3 / / L = p r i m a r y i nduc tanc e o f a t r a n s f o r m
e r i n henry
7 C =(200*10^ - 12) / /C = c a p a c i t o r c o nne c te d a c
r o s s t r a n s f o r m e r i n f a ra d
8 R =50 / / dc r e s i s t a n c e o f primary c o i l i n
ohm
9 h i e =2000 / / h i e = i n p u t i m p e d a n c e i n ohm
10 h re =10^( - 4 ) / / h re =r e v e r s e volt a ge a m p lific
a t ionfa ct or
11 h f e =98 / / h f e = c u r r e n t g ai n
12 h o e =( 0 . 5 * 1 0 ^ ( - 4 ) ) / / h o e = o u t p u t impedance i n
mho
13 RB = 5 0 0 0 0 / / R B = r e s i s t a n c e
14 f =1/ ( 2* %p i * s q r t ( L* C) ) / / f = f r e q u e n c y o f o s c i
85
lla t ion
15 f o r ma t ( ” v” , 5 )
16 g = ( ( h i e * hoe) - ( hfe * h r e ) ) / / g=dhe=d e l t a he
17 //M=mutual i nd uc t a n c e i n henry between the
t ransform er p ri m a ry and the s e c o n d a r y c o i l s f o r
s u s t a i n e do s c i l l a t i o n s
18 M = ( ( RB/ h f e ) * ( ( C* R) + ( h o e * L ) ) ) + ( ( C* R* h i e ) / h f e ) +
( ( L* g ) / h f e )
19 f o r ma t ( ” v” , 5 )
20 d i s p ( ” kHz” , f / 1 0 ^ 3 , ” F r e q u e n c y o f o s c i l l a t i o n i s
= ”) / / f i s c o n v e r t e d i n t e r m s o f kHz
21 d i s p ( ”mH” , M/ 10^ - 3 , ” M u t u a l i n d u c t a n c e i s
= ”) / / M i s c o n v e r t e d in terms o f mH

Scilab code Exa 11.12.2 To find the values of the inductances

1 // scilab 5.4.1
2 / / Windows 7 o p e r a t i n g system
3 / / c hapte r 11 S i n u s o i d a l o s c i l l a t o r
and m u l t i v i b r a t o r s
4 clc
5 clear
6 / / L1 a n d L2=i n d u c t a n c e s in i n a H artl e
henry o s c i l l a t o r y
7 / / S u p p o s e L1=a
8 / / L2=b
9 f = 60*10^3 / / f=f re q u e n c y i n Hz
10 C = 4 0 0 * 1 0 ^ ( - 1 2 ) / / C = c a p a c i t a n c e F a r a d
in fr o m 100 pF t o 400
11 / / Als o t u n i ng capacit a
12 / / fn=c1/ e ( 2∗v a %pi
r ie∗ s pF
s q r t ( ( L1+L2 ) ∗C) ) whe re f=f
re q u e n H c ya r t l e y o s c i l l a t o r which v a r i oe sf a f r om
60 kHz 120 kHz to
13 / / d=L1+L2=a+b
14 / / d = 1 / ( ( ( 2 ∗ %pi ∗ f ) ˆ 2 ) ∗C)
15 d = 1 / ( ( ( 2 * %p i * f ) ^ 2 ) * C) / / . . . . . . . ( 1 )

86
16 f o r ma t ( ” v” , 1 0 )
17 / / e=L2 / L1 = h f e / dhe
18 h f e =90 / / h f e = c u r r e n t g ai n
19 d h e =0. 2 / / d h e = d e l t a he
20 e= h f e / d h e / / . . . . . . . . . . ( 2 )
21 / / From e q u a t i o n ( 1 ) and ( 2 )
22 / / L∗ x=y
23 x=[1 1 ; e - 1]
24 y=[ d ; 0]
25 L= i n v ( x ) * y
26 f o r ma t ( ” v” , 6 )
27 d i s p ( ” m i c r o H e n r y ” , ( L ( 1 ) ) / 1 0 ^ - 6 , ” I n d u c t a n c e L1 i s
=”
)// convert ing L(1) i n t e r m s o f m i c r o H enr y
28 d i s p ( ”mH” , ( L ( 2 ) ) / 1 0 ^ - 3 , ” I n d u c t a n c e L2
i s = ”) / / c o n v e r t i n g L ( 2 ) in
t e r m s o f mH

Scilab code Exa 11.12.3 To calculate the frequency of oscillation

1 // scilab 5.4.1
2 / / Windows 7 o p e r a t i n g system
3 / / c hapte r 11 S i n u s o i d a l o s c i l l a t o r
and m u l t i v i b r a t o r s
4 clc
5 clear
6 L =20*10^ - 3 / / L = i n d u c t a n c e i n henry
7 C1 = ( 2 0 0 * 1 0 ^ ( - 1 2 ) ) / / C 1 = c a p a c i t a n c e i
n f a ra d
8 C2 = ( 3 0 0 * 1 0 ^ ( - 1 2 ) ) / / C 2 = c a p a c i t a n c e i
n f a ra d
9 Cs =( ( C1 * C2 ) / ( C1 +C2 ) ) is
10 f =1/ ( 2* %p i * s q r t ( L* Cs ) ) = ”) / /
11 d i s p ( ” kHz” , f / 1 0 ^ 3 , ” F r e q u e n c y of o
scilla t ioncon vert in g f in terms o
f kHz
Scilab code Exa 11.12.4 To determine the frequency of oscillation

87
1 // scilab 5.4.1
2 / / Windows 7 o p e r a t i n g s y s t e m
3 / / c hapte r 11 S i n u s o i d a l o s c i l l a t o r
a nd m u l t i v i b r a t o r s
4 clc
5 clear
6 R =4700 / / R = r e s i s t a n c e i n a p h a s e − s h i f t o s c i l l a t o r
i n ohm
7 C =( 0 . 0 1 * 1 0 ^ ( - 6 ) ) / / C = c a p a c i t a n c e i n a p h a s e − s
h i f t o s c i l l a t o r i n f a ra d
8 f =1/ ( 2* %p i * s q r t ( 1 0 ) * R* C)
9 d i s p ( ” kHz” , f / 1 0 ^ 3 , ” F r e q u e n c y o f osc
illa t ion f i s = ”)
// convert ing f i n t e r m s o f kHz

Scilab code Exa 11.12.5 To find the resistances needed to span the fre-
quency range and to find the ratio of the resistances

1 // scilab 5.4.1
2 / / Windows 7 o p e r a t i n g system
3 / / c hapte r 11 S i n u s o i d a l o s c i l l a t o r
and m u l t i v i b r a t o r s
4 clc
5 clear
6 f= 30 / / f=f re q u e n c y o f o s c i l l a t i o n o f a Wien−b r
id geoscilla t or i n Hz
7 C =(500*10^( - 1 2 ) ) / / C = c a p a c i t a n c e i n f a ra d
8 / / f = 1/ 2∗ %pi ∗R∗C/ / R= r e s i s t a n c e i n ohm
9 R =1 / ( 2 * %p i * f * C)
10 d i s p ( ” Mega oh m s ” , R / 1 0 ^ 6 , ” R e s i s t a n c e n e e d e d
t o s p a n t h e f r e q u e n c y r a n g e , R= ” ) / / c o n v e r t i n g R
i n t e r m s o f Mega oh m s
11 / / C 1 = 5 0 p F C2= 500 pF w h e r e C1 , C2 a r e va riab
leca p a cit a n ces i n a Wien b r i d g e o s c i l l a
t or
12 // rat io of c a p a ci t a n c e =( 1: 10 )
13 / / f re q u e n c y r a n g e i s 30 Hz t o 300 Hz
with R=10 . 6
88
Megaohms
14 // for t h e n e x t f r e q u e n c y r a n g e fr o m 300 Hz t o 3
kHz
, new R = ( 1 0 . 6 / 1 0 ) = 1 .06 Megaohm
15 // for f r e q u e n c y r a n g e 3 kHz t o 30 kHz , R = 1 .06
/ 1 0 = 1 0 6 K i l o −ohm
16 / / So , t h r e e v a l u e s o f R a r e 1 0 . 6 Megaohm , 1 . 0 6
Megaohm
,106 K i l o ohm
17 A=6 / / A = g ai n of a m p lifier
18 / / R 2 / ( R1+R2 ) = ( 1 / 3 ) −(1/A) = ( 1 / 3 ) − ( 1 / 6 )
19 / / 1 + ( R 1 / R 2 ) =6
20 / / Hence R 1 / R 2 = 5
21 //R3=(R1/R2 )
22 R3 =” 5 : 1 ”
23 d i s p ( R3 , ” The r a t i o of the resist a nces
in the o t h e r arms o f the bri dg e , R1/R2
i s = ”)

Scilab code Exa 11.12.6 To find the quality factor of the crystal

1 // scilab 5.4.1
2 / / Windows 7 o p e r a t i n g system
3 / / c hapte r 11 S i n u s o i d a l o s c i l l a t o r
and m u l t i v i b r a t o r s
4 clc
5 clear
6 / / Q = Q ual i ty fa ct or
7 L =3. 5 / / L = i n d u c t a n c e i n henry
8 f = 450000 / / f=f re q u e n c y i n Hz
9 R =9050 / / R = r e s i s t a n c e i n ohm
10 Q = ( 2 * %p i * f * L) / R
11 f o r ma t ( ” v” , 5 ) / / f o r m a t ( ) s e t s t h e c u r r e n t p r i n
t i n g format
12 d i s p ( Q, ” Q u a l i t y f a c t o r i s ”)

89
Chapter 12

Modulation and Demodulation

Scilab code Exa 12.9.1 To find the percentage modulation and the am-
plitude of the unmodulated carrier

1 // scila b 5.4.1
2 / / Windows 7 o p e r a t i n g system
3 / / c hapte r 12 M o d u l a t i o n a n d D e m o d u l a t i o n
4 clc
5 clear
6 Vmax =8 //Vmax=maximum p e a k t o p eak v a l ue o f an
AM v o l t a g e
7 Vmi n =2 / / Vmin=minimum p e a k t o pe ak v a l ue o f an
AM v o l t a g e
8 ma =( Vmax - Vmi n ) / ( Vmax+ Vmi n ) / / ma= p e r c e n t a g e
modulation m o d u l a t i o n ma= ” )
9 d i s p ( ”%” , ( ma * 1 0 0 ) , ” P e r c e n t VC=a ag e mplitude of
10 //ma=(Vmax−Vmin
u n m o d u l a t e d ) / ( 2 ∗VC)
c a r rwi hee rre the
11 VC = ( Vmax - Vmi n ) / ( 2 * ma )
12 d i s p ( ”V” , VC , ” A m p l i t u d e o f u n m o d u l a t e d c a r r i e r i
t h e VC= ” ) s
13 di s p ( ” In t h e t e x t b o o k a n swer g i v e n i s i n c o r r e c
t a s t h ey h a ve f u r t h e r d i v i d e d by 2 wh ich i s
n o t t h e p a r t o f g i v e n f o r m u l a . ”)

90
Scilab code Exa 12.9.2 To find the frequency span of each sideband and
maximum upper and minimum lower side frequency along with the channel-
width

1 // scila b 5.4.1
2 / / Windows 7 o p e r a t i n g system
3 / / c hapte r 12 M o d u l a t i o n a n d D e m o d u l a t i o n
4 clc
5 clear
6 f c = 1 0 0 0 * ( 1 0 ^ 3 ) / / f c=f re q u e n c y o f the c a r r i e r
wave i n Hz ( h e r t z )
7 f mi n =400
8 f ma x =1 6 0 0 / / fm i n a n d fm a x r e p r e s e t h e f r e q u e n c y
n t r a n ge o f a u d io s i g n a l s b y t h e c a r r i e r wave
wh ich i s a m p lit u d e m od u la t ed .
9 f s =f ma x - f mi n / / f s = f r e q u e n c y s p a n e a c h s i d e
of band
10 d i s)p ( ” Hz” , f s , ” 1 . F r e q u e n c y s p a n
11 f ou fmaexa=c (h f cs+i df emab xa )n d/ 1 0i0s0 /”/ fumax=maximum u p p e r
s i d e f re q u e n c y
12 d i s p ( ” kHz” , f u ma x , ” 2 . The maximum u p p e r s i d e
f re q u e n c y i s ”)
13 f l mi n = ( f c - f ma x ) / 1 0 0 0 / / f l m i n=minimum l o w e r
s i d e f re q u e n c y
14 d i s p ( ” kHz” , f l mi n , ” 3 . The minimum l o w e r
side f re q u e n c y i s ”)
15 Wc = f u ma x - f l mi n / / W c = c h a n n e l w i d t h
16 d i s p ( ” kHz” , Wc , ” 4 . The c h a n n e l w i d t h i s
”)

Scilab code Exa 12.9.3 To calculate the power developed by an AM wave

1 // scila b 5.4.1

91
2 / / Windows 7 o p e r a t i n g system
3 / / c hapte r 12 M o d u l a t i o n a n d D e m o d u l a t i o n
4 clc
5 clear
6 R =100 / / R = l o a d r e s i s t a n c e i n ohms
7 Vc =100 / / Vc=peak v o l t a g e o f the c a r r i e r i n v o l t s
8 ma =0. 4 / / m a = m o d u l a t i o n fact or
9 P c = ( Vc ^ 2 ) / ( 2 * R) / / P c = u n m o d u l a t e d carrier
power d e ve l o p e d by a n AM wave
10 d i s p ( ”W” , Pc , ” The u n m o d u l a t e d c a r r i e r power
is P c = ”)
11 Pt =Pc * ( 1 + ( ( ma ^ 2 ) / 2 ) ) / / P t = t o t a l power d e ve
l o pe d
12 d i s p ( ”W” , Pt , ” The t o t a l power d e ve l o pe d by
t h e AM wave i s P t = ”)

Scilab code Exa 12.9.4 To determine the necessary audio power

1 // scila b 5.4.1
2 / / Windows 7 o p e r a t i n g system
3 / / c hapte r 12 M o d u l a t i o n a n d D e m o d u l a t i o n
4 clc
5 clear
6 ma =0. 5 / / m a = m o d u l a t i o n fact or
7 Pc =20 / / P c = u n m o d u l a t e d c a r r i e r power i n k i l o w a t t s
(kW)
8 Ps =( 1/ 2) * ( ma ^ 2 ) * Pc / / P s = t o t a l s i d e b a n d power
9 d i s p ( ”kW” , Ps , ” The t o t a l s i d e b a n d power i s P s= ”)
10 / / modulator s y s t e m e f f i c i e n c y i s g i v e n as 70
per c e n t
11 P a = P s / 0 . 7 / / P a = a u d i o power n e c e s s a r y to ampl i
tude modulate a g i v e n c a r r i e r wave
12 f o r ma t ( ” v” , 5 )
13 d i s p ( ”kW” , Pa , ” The r e q u i r e da u d i o power i s
”)

92
Scilab code Exa 12.9.5 To find the modulation index three pairs of side
frequency and the channelwidth

1 // scilab 5.4.1
2 / / Windows 7 o p e r a t i n g system
3 / / c hapte r 12 M o d u l a t i o n a n d D e m o d u l a t i o n
4 clc
5 clear
6 d f = 3 0 / / df=maximum f r e q u e n c y deviat ionin kilohe
r t z ( kHz )
7 f m =15 / / f m = m o d u l a t i o n f re q u e n c y o f a s i n u s o i d a l
audio s i g n a l i n k i l o h e r t z ( kHz )
8 mf =df / f m / / mf=f r e q u e n c y m o d u l a t i o n i n d e x
9 d i s p ( mf , ” 1 . The m o d u l a t i o n i n d e x i s mf= ”)
10 f c =100 / / f c = c a r r i e r wave f r e q u e n c y i n m e g a h e r t z
(MHz)
11 d i s p ( ” 2 . The t h r e e sign ifican t pa irs of side
frequencies are 100MHz+−15kHz ( f c+−fm ) ; 1 0
0MHz+−30 kHz ( f c +−2fm ) ; 1 0 0MHz+−45kHz ( f c +−3fm ) ”)
12 wc =mf * 3 * f m / / wc=c h a n n e l w i d t h required for 3
above me n t io n e d s i d e f re q u e n c y p a i r s
13 d i s p ( ” kHz” , wc , ” 3 . The r e q u i r e d c
hanne l w i dth is
”)

Scilab code Exa 12.9.6 To find the highest modulation frequency

1 // scilab 5.4.1
2 / / Windows 7 o p e r a t i n g system
3 / / c hapte r 12 M o d u l a t i o n a n d D e m o d u l a t i o n
4 clc
5 clear
6 R = 0 . 2 * ( 1 0 ^ 6 ) / / R = l o ad r e s i s t a n c e i n ohms i n a d i
o de d e t e c t o r
7 C = 1 5 0 * (1 0 ^ - 1 2 ) / / C = c a p a c i t a n c e i n f a ra d i n a di
o de d e t e c t o r
8 / / fmh=wmh/ ( 2 ∗ %pi ) w h e r e f m h = h i g h e s t m o d u l a t i o n
f r e q u e n c y t h a t c a n be d e t e c t e d w i t h t o l e r a b l e

93
d ist ort ion a n d wmh=c o r r e s p o n d i n g
a n g ul ar f re q u e n c y
9 ma =0. 5 / / m a = m o d u l a t i o n f a c t o r or d e p t h o f
modulation
10 f mh =( 1/ ( 2* %p i * ma* R* C) ) / 10 0 0
11 f o r ma t ( ” v” , 6 )
12 d i s p ( ” kHz” , f mh , ” The r e q u i r e d
f re q u e n c y is
fmh= ”)

Scilab code Exa 12.9.7 To find the depth of modulation and the total
radiated power

1 // scilab 5.4.1
2 / / Windows 7 o p e r a t i n g system
3 / / c hapte r 12 M o d u l a t i o n a n d D e m o d u l a t i o n
4 clc
5 clear
6 P c =1 0 / / P c = u n m o d u l a t e d c a r r i e r power i n k i l o w a t t s
(kW)
7 P t =1 2 . 5 / / P t = t o t a l power i n k i l o w a t t s (kW)
8 / / Pt=Pc ∗ ( 1 +((ma ˆ2 ) / 2 ) )
9 ma= s q r t ( 2 * ( ( P t / P c ) - 1 ) ) / / m a = d e p t h o f modulation
o f the first sign a l
10 d i s p ( ma , ” The d e p t h o f m o d u l a t i o n i s ma= ” )
11 mb =0. 6 / / m b = d e p t h o f modulation o f the second
signa l
12 PT=Pc * ( 1 + ( ( ma ^ 2 ) / 2 ) + ( ( mb ^ 2 ) / 2 ) ) / / P T = t he
t o t a l r a d i a t e d power
13 d i s p ( ”kW” , PT , ” The t ot al radia t ed
power i s PT= ” )

94
Chapter 13

Field Effect Transistors

Scilab code Exa 13.16.1 To find the pinch off voltage and the saturation
voltage

1 // scila b 5.4.1
2 / / Windows 7 o p e r a t i n g s y s t e m
3 / / c hapte r 13 F i e l d − E f f e c t T r a n s i s t o r s
4 clc
5 clear
6 ND = 2 * 1 0 ^ 2 1 / / N D = d ono r c o n c e n t r a t i o n i n mˆ−3 o f a n
n− c h a n n e l s i l i c o n JFET
7 e =1 . 6 * 1 0 ^ - 19 / / e = c h a r g e o f an e l e c t r o
n of the mat
8 E = 1 2 * 8 . 8 5 4 * 1 0 ^ - 12 / / E = p e r m i t t i e r i a l s i l i c o n
9 a = v( 4i *t 1y0w^ h-e6r e) / 212=
/ / d2∗i eal=ec chtarnince cl wo ind st h i n( g m
i ve et rne )s a n d 2∗
a tan t o f
=4∗10ˆ−6
10 Vp = ( e * ND * ( a ^ 2 ) ) / ( 2 * E)
11 f o r ma t ( ” v” , 5 )
12 d i s p ( ”V” , Vp , ” The p i n c h − o f fv o l t a g e i s = ”)
13 VGS = - 2 / / V G S = g a t e s o u rc e v o l t a g e
14 //Vp=VDsat −VGS w h e r e V D s a t = s a t u r a t i o n volt age
15 VDs a t =Vp + VGS
16 f o r ma t ( ” v” , 5 )
17 d i s p ( ”V” , VDs a t , ” The s a t u r a t i o n volt a ge
i s = ”) 95
Scilab code Exa 13.16.2 To find the resistance RS

1 // scilab 5.4.1
2 / / Windows 7 o p e r a t i n g s y s t e m
3 / / c hapte r 13 F i e l d − E f f e c t T r a n s i s t o r s
4 clc
5 clear
6 VGS = - 1 . 5 / / V G S = g a t e −to −s o u r c e v o l t a g e o f a JFET
7 I Ds a t =5 *10 ^ - 3 / / I D s a t = d r a i n sa t u r a t ioncu r r en
t i n Ampere
8 RS = ( a b s ( VGS ) ) / ( a b s ( I Ds a t ) ) / / RS= r e s i s t a n c e t o
be c a l c u l a t e d = |VGS | / | IDsat |
9 d i s p ( ”ohm ” , RS , ” R e s i s t a n c e t o be c
a lculat ed i s = ”)

Scilab code Exa 13.16.3 To find the transconductance of the F ET along


with the amplification factor

1 // scilab 5.4.1
2 / / Windows 7 o p e r a t i n g system
3 / / c hapte r 13 F i e l d − E f f e c t T ra n sist ors
4 clc
5 clear
6 VGS1 = - 1
7 VGS2 = - 1 . 5 / / V G S 1 , VGS2=c h a n g e i n VGS( g a t e −to −s o u r c e
v o l t a g e ) f ro m VGS1 t o VGS2 k e e p i n g VDS( d r a i n
−to − s o u r c e v o l t a g e ) c o n s tan t
8 I D1 =7 *10 ^ - 3
9 I D2 = 5*1 0^ - 3 / / ID1 , I D 2 = c h a n g e i n ID ( d r a i n c u r r e n t
) i n Ampere f ro m ID1 t o ID2
10 / / g m = ( i d / vgs ) | VDS=c o n s t a n t w h e r e gm=t r a n s c o n d u c
tanc e
11 i d =I D1 - I D2

96
12 vgs=VGS1 - VGS2
13 gm=i d / v gs
14 d i s p ( ”mA/ V” , gm t r a n s c o n d u c t a n c eo f t h e FET
* 1 0 ^3 , ” The i s = ”)
15 r d = 2 0 0 * 1 0 ^ 3 / / r d = a c d r a i resist ance in
n ohms f a c t o r
16 u = r d * gm / / u = a m p l i f i c a t i
on
17 d i s p ( u , ” The a m p l i f i c a
t ion
fact or
Scilabo f code Exa 13.16.4 To calculate the voltage gain and the output re-
sistance
t h e FET i s = ”)
1 // scilab 5.4.1
2 / / Windows 7 o p e r a t i n g system
3 / / c hapte r 13 F i e l d − E f f e c t T ra n sist ors
4 clc
5 clear
6 RL = 2 5 0 * 1 0 ^ 3 / / R L = l o a d r e s i s t a n c e i n ohms i n a
FET a m p l i f i e r
7 r d = 100* 10^3 / / rd=ac d r a i n r e s i s t a n c e i n ohms
8 gm =0 . 5 * 1 0 ^ - 3 / / g m = t r a n s c o n d u c t a n c e i n A/V
9 u = r d * gm / / u = a m p l i f i c a t i o n fa ct or
10 AV = - ( u* RL) / ( r d +RL) / / AV= v o l t a g e g ai n
11 d i s p ( AV , ” The v o l t a g e g ai n o f FET a m p l i f i e r i s
= ”)
12 d i s p ( ” k i l o ohm ” , r d / 1 0 0 0 , ” The o u t p u t r e s i s t
a n c e e x c l u d i n g RL i s r d= ”)
13 r o = ( r d * RL) / ( r d +RL) / / r o = o u t p u t resist ance inclu
d i n g RL
14 d i s p ( ” k i l o ohm ” , r o / 1 0 0 0 , ” I n c l u d i n g RL, t h e
output r e s i s t a n c e i
s = ”)

Scilab code Exa 13.16.5 To find the drain current and the pinch off volt-
age

97
1 // scila b 5.4.1
2 / / Windows 7 o p e r a t i n g system
3 / / c hapte r 13 F i e l d − E f f e c t T ra nsist ors
4 clc
5 clear
6 / / F o r n−c h a n n e l JFET
7 I DSS = 1 2 * 1 0 ^ - 3 / / ID SS= s a t u r a t i o n d rai n c u r r e n
t i n Ampere when VGS( g a t e −to −s o u r c e v o l t a g e )
=0V
8 Vp =- 4 / / V p = p i n c h − o f f volt a ge
9 VGS = - 2 / / V G S = g a t e −to −s o u r c e volt age
10 / / B y Shockley ’ s e q uati o n
11 I DS = I DSS * ( 1 - ( VGS / Vp ) ) ^2 / / I D S = s a t u r a t i o n d
rai n
current t o be c a l c u l a t e d f o r g i v e n v a l
ue o f VGS
12 d i s p ( ”mA” , I DS / 1 0 ^ - 3 , ” The d r a i nc u r r e n t f o r g
i v e n v a l ue o f VGS i s = ”)
13 gmo =4* 10^ - 3 / / g m o = t r a n s c o n d u c t a n c e i n A/V o f a
JFET when VGS=0V
14 / / gmo= −( 2∗I DSS ) / V p
15 Vp = - ( 2 * I DSS ) / gmo / / V p = p i n c h − o f f v o l t a g e t o be
calculat ed f o r g i v e n v a l ue o f t r a n s c o n d
uc t a n c e
16 d i s p ( ”V” , Vp , ” The p i n c h − o f fv o l t a g e f o r g i v e n v
a l ue o f gmo i s = ”)
Scilab code Exa 13.16.6 To determine drain current along with drain source
voltage along with gate source voltage

1 // scila b 5.4.1
2 / / Windows 7 o p e r a t i n g s y s t e m
3 / / c hapte r 13 F i e l d − E f f e c t T r a n s i s t o r s
4 clc
5 clear
6 I DSS = 1 2 * 1 0 ^ - 3 / / ID SS= s a t u r a t i o n d r a i n c u r r e n
t i n Ampere when VGS( g a t e −to −s o u r c e v o l t a g e )
=0V
7 Vp =- 4 / / V p = p i n c h − o f f volt age
8 VDD =30 //VDD=d r a i n suppl y v o l t a g e
98
9 RL = 5 * 1 0 ^ 3 / / R L = l o a d r e s i s t a n c e i n ohms
10 Rs =600 / / R s = r e s i s t a n c e c o n n e c t e d to s o u r c e t e r m
i n a l i n ohms
11 Rg = 1 . 5 * 1 0 ^ 6 / / R g = r e s i s t a n c e c o n n e c t e d to
g a t e t e r m i n a l i n ohms
12 / / B y S h o c k l e y ’ s e q uati o n
13 / / IDS=IDSS ∗(1 −(VGS/Vp) ) ˆ 2 w h e r e I D S = s a t u r a t i o n d r a i
ncurrent t o be c a l c u l a t e d f o r g i v e n v a l ue o f
VGS
14 / / S u b s t i t u t i n g VGS=(−ID ∗ Rs ) we g e t ID=IDS
15 / / ID=IDSS ∗ ( 1 + ( ( ID ∗ Rs ) / V p ) ) ˆ2
16 / / ID = 12 ∗ ( 1 + ( ( 0 . 6 ∗ ID ) / −4) ) ˆ 2 w h e r e ID is
o b t a i n e d i n mA
17 / / ( 0 . 2 7 ∗ ID ˆ 2 ) − (4 . 6 ∗ ID ) + 1 2 = 0 . . . . . . . . . ( 1 )
18 I D1 =( 4 . 6 + s q r t ( ( 4 . 6 ^ 2 ) - ( 4 8 * 0 . 2 7 ) ) ) / ( 2 * 0 . 2 7 )
19 f o r ma t ( ” v” , 5 )
20 I D2a=( r e 4. 6 - s q r t h(e( 4 2. 6 ^r 2o )o t-th(se4 o8 fa* b0o. v2e7 ) )e )q/ u( 2a *t i 0o.n2 7 ) / / ID1 ,
ID2 f o r ma t ( ” v” , 5 )
21 (1)
22 d i s p ( ”mA” , I D1 , ” I D1= ”)
23 d i s p ( ”mA” , I D2 , ” I D2= ”)
24 i f ( I D1 > ( I DSS / 1 0 ^ - 3 ) ) t h e n / / IDSS i s c o n v e r t e d i
terms o f mA n
25 d i s p ( ”mA” , I D1 , ID1>IDSS , t h e v a l ue r e j e c t e
” As i s d
I D1= ”)
26 end t h e n / / IDSS i s c o n v e r t e d i
27 i f ( I D2 > ( I DSS / 1 0 ^ - n
328) ) ID2>IDSS , t h e v a l ue r e j e c t e
terms o f mA d
d i s p ( ”mA” , I D2 ,
” As i s
I D2= ”)
29 end
30 d i s p ( ”mA” , I D2 , ”
T h eVDS re f oi re
s =, ”)
the
34 VGS d=r-aIi D* n Rs / / V G S = g a t e −to −s o u r c e volt age
35 d i s pc (u ”V” r r e n t, VGS , ” The v a l ue o f g a t e −to −s o u r c e v o l
i s
t a g e VGS = ”)i s = ”)
31 I D= I D2 * 1 0 ^ - 3 / / c o n v e
rt ing 99
ID2 i n
terms
o f Ampere
32 VDS =VDD - I D
* ( RL+Rs ) / / VDS= d r a i n
−to −s o u r c e
36 i f ( Vp <0 & VDS > ( VGS -
Vp ) ) d i s p ( ” As Vp=(−4)<VGS<0V a n d VDS=12V>(VGS−Vp ) , i
37 t
is verified t h a t t h e J FET i
s in the s a t u r a t i o n r e g i o n
38 end of the d rai n
c h a r a c t e r i s t i c s ”)

Scilab code Exa 13.16.7 To calculate the drain current

1 // scila b 5.4.1
2 / / Windows 7 o p e r a t i n g s y s t e m
3 / / c hapte r 13 F i e l d − E f f e c t T r a n s i s t o r s
4 clc
5 clear
6 I DSS = 1 0 * 1 0 ^ - 3 / / ID SS= s a t u r a t i o n d r a i n c u r r e n
t i n Ampere when VGS( g a t e −to −s o u r c e v o l t a g e )
=0V=- 2 / / V p = p i n c h − o f f
7 Vp volt a ge
8 VDD =20 //VDD=d r a i n suppl y v o l t a g e
9 RL = 1 * 1 0 ^ 3 / / R L = l o a d r e s i s t a n c e i n ohms
10 Rs = 2 * 1 0 0 0 / / R s = r e s i s t a n c e c o n n e c t e d to s o
u r c e t e r m i n a l i n ohms
11 R1 = 1 2 * 1 0 ^ 6 / / R 1 = r e s i s t a n c e i n the v o l t a g e d i v
i d e r network i n ohms
12 R2 = 8 * 1 0 ^ 6 / / R 2 = r e s i s t a n c e i n the v o l t a g e d i v
i d e r network i n ohms
13 VT = ( R2 / ( R1 +R2 ) ) * VDD / / V T = T h e v e n i n volt age
14 //VGS=VT−(ID ∗ Rs )
15 / / B y S h o c k l e y ’ s e q uati o n
16 / / IDS=IDSS ∗(1 −(VGS/Vp) ) ˆ 2 w h e r e ID S= s a t u r a t i o d r a i n
n c u r r e n t t o be c a l c u l a t e d f o r g i v e n v a l ue o VGS
17 / / S uf b s t i t u t i n g VGS=(VGS−ID ∗ Rs ) we g e t
ID=IDS
/ / ( 10 ∗ ID ˆ 2 ) −(101∗ ID ) + 2 5 0 = 0 . . . . . . . . . ( 1 ) w h e r e ID
18 o b t a i ne d i n mA i
19 sI D1 = ( 1 0 1 + s q r t ( ( 1 0 1 ^ 2 ) - ( 4 0 * 2 5 0 ) ) ) / ( 2 * 1 0 )
20 f o r ma t ( ” v” , 5 )

100
21 I D2 = ( 1 0 1 - s q r t ( ( 1 0 1 ^ 2 ) - ( 4 0 * 2 5 0 ) ) ) / ( 2 * 1 0 ) / / ID1 , ID2
are
the 2 r o o t s o f t h e a bo v e e q u a t i o n ( 1 )
22 f o r ma t ( ” v” , 5 )
23 d i s p ( ”mA” , I D1 , ” I D1= ”)
24 d i s p ( ”mA” , I D2 , ” I D2= ”)
25 / / F o r ID1
26 VGS =VT - ( I D1 * Rs ) / / VGS= g a t e −to −s o u r c e v o l
t a g e c a l c u l a t e d f o r ID1
27 i f ( Vp > VGS ) t h e n
28 d i s p ( ”mA” , I D1 , ” As Vp>(VGS c a l c u l a t e d us i
29 end n g ID1 ) , t h e v a l ue r e j e c t e d i s I D1= ”)
30 d i s p ( ”mA” , I D2 , ” T h e re f o re , dt hr ae i n c u r r e n t i s
31 I D= I D2 * 10 ^ - 3 / / c o n v e r t i n g ID2 = ”) i n t e r m s o f
32 VGS =VT - ( I D* Rs ) / / VGS= g a t e −to −s Amperes
o u rc e v o l t a g e
33 d i s p ( ”V” , VGS , ”VGS= ” )
34 VDS =VDD - ( I D * ( RL+Rs ) ) / / VDS= d r a i n −to −s o u r c e v o l
t age
35 f o r ma t ( ” v” , 2 )
36 d i s p ( ”V” , VDS , ”VDS= ” )
37 i f ( Vpd i<s VGS
p ( ”&As VDS > ( VGS - Vp ) ) −0.68V) a n d
Vp=(−2)<(VGS=
38 VDS=7V>(VGS−Vp
) ,it is checked t h a t t h e J F ET o p e r a t e s
39 end in the s a t u r a t i o n r e g i o n ”)

Scilab code Exa 13.16.8 To find the saturation drain current and the min-
imum value of drain source voltage

1 // scila b 5.4.1
2 / / Windows 7 o p e r a t i n g s y s t e m
3 / / c hapte r 13 F i e l d − E f f e c t T r a n s i s t o r s
4 clc
5 clear
6 / / F o r a n−c h a n n e l JFET
7 I DSS = 1 0 * 1 0 ^ - 3 / / IDS S= s a t u r a t i o n d r a i n c u r r e n t i n

101
Ampere when VGS( g a t e −to −s o u r c e v o l t a g e ) =0V
8 Vp = ( - 4 ) / / V p = p i n c h − o f f volt age
9 VGS = ( - 2 . 5 ) / / V G S = g a t e −to −s o u r c e volt a ge
10 / / B y Shockley ’ s e q uati o n
11 I DS = I DSS * ( 1 - ( VGS / Vp ) ) ^2 / / I D S = s a t u r a t i o n d r a i n
current t o be c a l c u l a t e d f o r g i v e n v a l ue o f
VGS
12 f o r ma t ( ” v” , 5 )
13 d i s p ( ”mA” , I DS / 1 0 ^ - 3 , ” The d r a i nc u r r e n t f o r g i v e n
v a l ue o f VGS i s = ”) / / c o n v e r t i n g IDS i n
terms o f mA
14 VDSmi n =VGS - Vp / / VDSmin= m inim um v a l u e o f d r a i n
−t o − s o u r c e v o l t a g e f o r t h e o n s e t o f t h e s a t
urat ion region
15 f o r ma t ( ” v” , 5 )
16 d i s p ( ”V” , VDSmi n , ” The minimum v a l ue o f VDS
forsa t ura t ion i s = ”)

Scilab code Exa 13.16.9 To determine gate source voltage and the transcon-
ductance

1 // scilab 5.4.1
2 / / Windows 7 o p e r a t i n g system
3 / / c hapte r 13 F i e l d − E f f e c t T ra n sist ors
4 clc
5 clear
6 VDD =20 //VDD=d r a i n suppl y v o l t a g e
7 I DS =0. 9 / / I D S = d r a i n s a t u r a t i o n c u r r e n t i n terms o f
mA
8 Vp =- 3 / / V p = p i n c h − o f f volt age
9 I DSS =8 / / IDS S= s a t u r a t i o n d r a i n c u r r e n t i n mA when
VGS ( g a t e −to −s o u r c e v o l t a g e ) =0V
10 / / B y Shockley ’ s e q uati o n
11 / / IDS=IDSS ∗(1 −(VGS/Vp) ) ˆ2
12 VGS =Vp * ( 1 - s q r t ( I DS / I DSS ) ) / / V G S = g a t e −to −s o u
rc e v o l t a g e
13 d i s p ( ”V” , VGS , ” The g a t e −to −s o u r c ev o l t a g e
VGS i s = ”)
14 / / g m = ( d I D S / d V G S ) | VDS=c o n s t a n t w h e r e gm=
102
t ran s c o n du c tanc e
15 gm = - ( ( 2 * I DSS ) / Vp ) * ( 1 - ( VGS / Vp ) )
16 f o r ma t ( ” v” , 5 )
17 d i s p ( ”mS” , gm , ” The v a l ue o f t r a n s c o n d u c t a n c e
i s = ”)

Scilab code Exa 13.16.10 To find the gate source voltage

1 // scilab 5.4.1
2 / / Windows 7 o p e r a t i n g system
3 / / c hapte r 13 F i e l d − E f f e c t T ra n sist ors
4 clc
5 clear
6 I DS = - 15 / / I D S = d r a i n s a t u r a t i o n c u r r e n t i n terms of
mA
7 Vp =5 / / V p = p i n c h − o f f volt age
8 I DSS = - 40 / / ID SS= s a t u r a t i o n d r a i n c u r r e n t i n mA
when VGS( g a t e −to −s o u r c e v o l t a g e ) =0V
9 / / B y Shockley ’ s e q uati o n
10 / / IDS=IDSS ∗(1 −(VGS/Vp) ) ˆ2
11 VGS =Vp * ( 1 - s q r t ( I DS / I DSS ) ) / / V G S = g a t e −to −s o u
rc e v o l t a g e
12 d i s p ( ”V” , VGS , ” The g a t e −to −s o u r c ev o l t a g e
VGS i s = ”)

Scilab code Exa 13.16.11 To calculate Rs and the channel resistance

1 // scila b 5.4.1
2 / / Windows 7 o p e r a t i n g s y s t e m
3 / / c hapte r 13 F i e l d − E f f e c t T r a n s i s t o r s
4 clc
5 clear
6 I DSS = 1 0 * 1 0 ^ - 3 / / ID SS= s a t u r a t i o n d r a i n c u r r e n
t i n Ampere when VGS( g a t e −to −s o u r c e v o l t a g e )
=0V
78 Vp
VDD =-=24
5 / / //VDD=d
V p = p i n c rha −
i no sf uf p p lvyo lvt oa lgt ea g
e
103
9 VDS =8 / / V D S = d r a i n −to −s o u r c e vol
t age Ampere
10 I D =4* 10^ - 3 / / I D = d r a i n c u r r e n t vi o l t a g e d i v i d e
n r
11 R1 = 2 * 1 0 ^ 6 / / R 1 = r e s i s t a n c e in volt a ge d ivid e
t h e n e t w o r k i n ohms r
12
13 R2 = (1 *R2
VT 1 0/ ^( 6R1//R +R22 =)r) e* sVDD
i s t /a/ nV cT e= T h ie nv e n i n volt age
14 / / B yt h eS hn oe tcw
k loeryk ’ i ns ohms e q uati o n
15 / / ID=IDS=IDSS ∗(1 −(VGS/Vp) ) ˆ2
16 VGS =Vp * ( 1 - s q r t ( I D/ I DSS ) ) / / V G S = g a t e −to −s o u r c e v o l
t age
17 //VGS=VT−(ID
the ∗s Rs
o u )r c w e hteer er mRisn= ar le s i s t a n c e c o nne c te d at
18 Rs =( VT - VGS ) / I D
19 d i s p ( ” k i l o ohm ” , Rs / 1 0^ 3 , ” The v a l Rs
ue co of n v e r t i n g Rs i n terms o f = ”) / /
20 Rch= VDS / I D / / R ch= c h akninl eo l−ohmr e s i s t a n c e a t t h e Q−p
o i nt r e s i s t a n c e at
21 d i s tph(e ”Q−p k i l o i nohm
t ” , i Rch s = ”) / 1 0/ ^/ 3c ,o ”
n vThe
e r t icnhga n Rch
ne l i n
terms of
k i l o −ohm

Scilab code Exa 13.16.12 To find the saturation drain current

1 // scilab 5.4.1
2 / / Windows 7 o p e r a t i n g system
3 / / c hapte r 13 F i e l d − E f f e c t T ra n sist ors
4 clc
5 clear
6 I D =5 / / I D = s a t u r a t i o n d rai n c u r r e n t i n terms o f
mA i n an n−c h a n n e l e n h a n c e m e n t mode MOSFET
7 VGS =8 / / V G S = g a t e −to −s o u r c e volt age
8 VT =4 / / V T = T h r e s h o l d volt age
9 VGS2 =10 / / V G S 2 = g a t e −to −s o u r c e volt a ge for
w h i c h s a t u r a t i o n d r a i n c u r r e n t i s t o be c a l c u l
at ed
10 / / ID=K∗
− o f f (VGS−VT)
v o l t a g eˆ 2, I DwShSe=r de r aKi =(ID
n s aSSt u/ (r V
a pt ˆi 2o )n )c u arnrde n t f o r
Vp=p inc h
104
VGS=0 V
11 K=I D / ( ( VGS - VT) ^ 2 )
12 I D1 =K* ( VGS2 - VT) ^2 / / ID1 =The s a t u r a t i o n d r a i n c u r
rent for g a t e −s o u r c e v o l t a g e o f 10V i e VGS2
13 d i s p ( ”mA” , I D1 , ” The s a t u r a t i o n drai n cur
rent for gate
−s o u r c e v o l t a g e o f 10V i s = ”)

Scilab code Exa 13.16.13 To calculate drain current along with gate source
voltage and drain source voltage

1 // scila b 5.4.1
2 / / Windows 7 o p e r a t i n g system
3 / / c hapte r 13 F i e l d − E f f e c t T ra nsist ors
4 clc
5 clear
6 / / F o r n−c h a n n e l e n h a n c e m e n t mode MOSFET o p e r a t i n
g inact ive region
7 VT =2 / / V T = T h r e s h o l d volt a ge
8 K =0. 5 / / K = ( I D S S / ( V p ˆ 2 ) ) i n t e r m s o f mA/Vˆ2
9 VDD =15 //VDD=d r a i n suppl y v o l t a g e
10 RL =1 / / R L = l o a d r e s i s t a n c e i n k i l o ohm
11 R1 = 2 0 0 * 1 0 ^ 3 / / R 1 = r e s i s t a n c e i n the v o l t a g e d i v
i d e r network i n t e r m s o f ohms
12 R2 = 1 0 0 * 1 0 ^ 3 / / R 2 = r e s i s t a n c e i n the v o l t a g e d i v
i d e r network i n t e r m s o f ohms
13 VGS = ( R2 / ( R1 +R2 ) ) * VDD / / V G S = g a t e −to −s o u r c e v o l t
age
14 d i s p ( ”V” , VT , ” T h r e s h o l d v o l t a g e i s = ”)
15 d i s p ( ”V” , VGS , ” The g a t e −to −s o u r c ev o l t a g e VGS
i s = ”)
16 I D=K* ( VGS - VT) ^2 / / I D = d r a i n c u r r e n t i n mA
17 d i s p ( ”mA” , I D , ” The v a l ue of drai n c
u r r e n t ID i s = ”)
18 VDS =VDD - ( I D* RL) / / VDS= d r a i n −to −s o u r c e v o l t a g e
19 d i s p ( ”V” , VDS , ” The v a l ue o f d r a i n −to −s o u r c e v o l
t a g e VDS i s = ”)
20 i f ( VDS > ( VGS - VT) ) t h e n
21 d i s p ( ” As VDS>(VGS−VT) 105, ( i . e . 10.5 > (5 − 2) ) , t h e
operat ion i s i nde e d i n the a ct iv
e region ”)
22 end

Scilab code Exa 13.16.14 To calculate K along with drain current and
drain source voltage

1 // scila b 5.4.1
2 / / Windows 7 o p e r a t i n g system
3 / / c hapte r 13 F i e l d − E f f e c t T ra nsist ors
4 clc
5 clear
6 / / F o r n−c h a n n e l MOSFET o p e r a t i n g i n the d e p l e
t i o n mode
7 VDD =18 //VDD=d r a i n suppl y v o l t a g e
8 VGS =0 / / V G S = g a t e −to −s o u r c e volt age
9 RL =600 / / R L = l o a d r e s i s t a n c e i n ohms
10 I DSS =18 / / I D S S = d r a i n s a t u r a t i o n c u r r e n t i n mA
f o r g a t e −to −s o u r c e v o l t a g e (VGS) =0V
11 Vp =- 5 / / V p = p i n c h − o f f volt age
12 / / A s s um i n g t h a t the o p e r a i s i n the a c t i v
t ionregion e
13 / / ID=IDS=IDSS ∗(1 −(VGS/Vp) ) ˆ2
14 / / I D = ( I D S S / V p ˆ 2 ) (VGS−Vp ) ˆ2
15 K= I DSS / ( Vp ^ 2 )
16 d i s p ( ”mA/ Vˆ 2 ” , K, ” The v a l K i s
ue o f = ”)
17 I D= I DSS / / I D = d r a i n c u r r e n t v a l ue o f ID=IDSS i
18 d i s p ( ”mA” , I D , ” S i n c e s = ”)
VGS=0 and , t h e a l s o c o n v e r t i n g RL i n terms
19 VDSo=VDD f - ( I D *k( iRL
l o ohm
20 /d1i 0s ^p3( )”V”
) / / V D, SVDS
= d r, a”i n The
−to −s v aol uuer coef VDS i s = ”)
21 d i s pv (o ”V”
l t a g e, Vp , ” P i n c h o f f v o l t a g e Vp i s = ”)
22 d i s p ( ”V” , VGS , ” G a t e t o s o u r c e v o l t a g e VGS i s
= ”)d i s p ( ” As VDS>(VGS−Vp ) , ( i . e .7.5 > (0 − ( −
23 i f ( 5) VDS )>,(t VGS
)MOSFET h e - iVps ) a) c t hue an l l y i n t h e a c t i v e r e g i o n
24 ”)
106
25 end

Scilab code Exa 13.16.15 To calculate the voltage gain and the output
resistance

1 // scilab 5.4.
1 7 o p e r a t i n g system
2 / / Windows 13 F i e l d − E f f e c t T ransi
3 / / c hapte r s t o r s
4 clc
5 clear i n t e x t b o o k i s t a k e n as rd a f t e r w a r d
6 / / r Henceg i vr =esrnd.
7 r d = 100* 10^3 / / r d = d r a i n r e s i s t a n c e i n ohms
8 gm = 3 5 0 0 * 1 0 ^ - 6 / / g m = t r a n s c o n d u c t a n c e i n terms o f
A / V ( or S )
9 RL = 5 * 1 0 ^ 3 / / R L = l o a d r e s i s t a n c e i n ohms
10 u = r d * gm / / u = a m p l i f i c a t i o n fa ct or
11 AV = ( u* RL) / ( ( ( u + 1 ) * RL) + r d ) / / A V = v o l t a g e g a i n
12 f o r ma t ( ” v” , 6 )
13 d i s p ( AV , ” The v o l t a g e g ai n i s = ”)
14 Ro =r d / ( u + 1 ) / / R o = o u t p u t r e s i s t a n c e e x c l u d i n g RL
15 f o r ma t ( ” v” , 5 )
16 d i s p ( ”ohm ” , Ro , ” The o u t p u t r e s i s t a n c e e x c l u d i n g
RL i s
= ”)
17 Ro1 = ( r d * RL) / ( r d + ( ( u + 1 ) * RL) ) / / R o1= Ro’=
output r e s i s t a n c e i n c l u d i n g RL
18 f o r ma t ( ” v” , 6 )
19 d i s p ( ”ohm ” , f l o o r ( Ro1 ) , ” The o u t p u t r e s i s
t ance
i n c l u d i n g RL i s = ”) / / f l o o r f u n c t i o n i s
u s e d t o r o u n d down t h e v a l ue

Scilab code Exa 13.16.16 To find the small signal voltage gain

107
1 // scila b 5.4.1
2 / / Windows 7 o p e r a t i n g system
3 / / c hapte r 13 F i e l d − E f f e c t T ra nsist ors
4 clc
5 clear
6 / / I n a FET u s e d i n a CS a m p l i f i e r
7 I DSS =4 / / ID S S = d r a i n s a t u r a t i o n c u r r e n t i n mA f o r
gate
−to −s o u r c e v o l t a g e (VGS) =0V
8 Vp =- 3 / / V p = p i n c h − o f f volt a ge
9 RL =10 / / R L = l o a d r e s i s t a n c e i n k i l o ohms
10 VGS = - 0 . 7 / / V G S = g a t e −to −s o u r c e volt age
11 gmo = - ( 2 * I DSS ) / Vp / / g m o = t r a n s c o n d u c t a n c e i n A / V
12 o f agmo
gm= J F ET
* ( 1 when
- ( VGSVGS=0V
/ Vp ) ) / / gm= t r a n s c o n d u c
tan c e g ai n
13 AV=- gm* RL / / A V = t he s m a l l s i g n a l v o l t ai s = ”)
ge i n te xtbo o
14 d i s pi s( AV i n, c”o rThe
r e c ts as
m a 2l l. 0 4s ∗
i g1n0a=l 2v 0o.l4t aagn ed g nko t
2a i0n. 0 4 .
15 / / Decimal term i n the answer d i s p l a y
ed

108
Chapter 14

Integrated Circuits and


Operational Amplifiers

Scilab code Exa 14.12.1 To determine the output voltage along with in-
put resistance and the input current

1 // scila b 5.4.1
2 / / Windows 7 o p e r a t i n g s y s t e m
3 / / c hapte r 14 I n t e g r a t e d C i r c u i t s O p e r a t i o n
and A m p l i f i e r s al
4 clc
5 clear
6 R1 =1000 / / R 1 = i n p u t resist a nce in i n the
ohmsi n v e r t i n g am p circu it
lifier r e s i s t a n c e i n ohms
7 Rf = 3 * 1 0 0 0 / / Rf= f e e d b a c i n t h e i n v e r t i n g t e r m i n a l o
k f
89 vv1o ==2- (/ Rf/ v/1 =R1
i n) p* uv1
t / / v oo=l ot u t p u t volt a ge
10 ad igsepan ( ”V” a m, vpol ,i f”i eOr u t pc ui tr v o l t a g e i s = ”)
11 cd iu si pt ( ” O u t p u t v o l t a g e is negat ive i s the
as i t c i r c u i t o f i n v e r t i n g a m p l i f i e r
12 d”)i s p ( ” k i l o ohm ” , R1 / 1 0 0 0 , ” I n p u t r e s i s t a n c e
Rin=R1 i s
= ”)
13 i =v1 / R1 / / i = i n p u t current
109
14 d i s p ( ”mA” , i * 1 0 0 0 , ” The i n p u t currr
e n t i s = ”)

Scilab code Exa 14.12.2 To calculate the voltage gain

1 // scila b 5.4.1
2 / / Windows 7 o p e r a t i n g s y s t e m
3 / / c hapte r 14 I n t e g r a t e d C i r c u i t s a n d O p e r a t i
on a lA m p lifier s
4 clc
5 clear
6 R1 = 2 * 1 0 0 0 / / R 1 = i n p u t r e s i s t a n c e i n ohms i n t h e
non− i n v e r t i n g a m p l i f i e r c i r c u i t
7 Rf = 5 * 1 0 0 0 / / R f=f e e d b a c k r e s i s t a n c e i n ohms
8 AV = 1 + ( Rf / R1 ) / / A V = v o l t a g e g ai n o f t h e non− i n v e r
t in ga m p lifier cir cu it
9 d i s p ( AV , ” The v o l t a g e g ai n o f t h e g i v e n non− i n v e
r t i n g a m p l i f i e r c i r c u i t i s = ”)

Scilab code Exa 14.12.3 To calculate the voltage gains for difference and
common mode signals along with CMRR

1 // scila b 5.4.1
2 / / Windows 7 o p e r a t i n g s y s t e m
3 / / c hapte r 14 I n t e g r a t e d C i r c u i t s a n d O p e r a t i
on a lA m p lifier s
4 clc
5 clear
6 // F irst c as e
7 v1 = 4 0 * 1 0 ^ - 6 / / v 1 = v o l t a g e a p p l i e d t o t h e non− i n v e r
t i n g i nput t erm ina l
8 v2 = - 4 0 * 1 0 ^ - 6 / / v 2 = v o l t a g e a p p l i e d t o t h e i n v e r t
i n g i nput t erm ina l

110
9 vo = 1 0 0 * 1 0 ^ - 3 / / v o l t a g e f o r the above i n p u t
v o = o u t p u t v1 a n d v2 s
10 / / Second c as e
11 V1 = 4 0 * 1 0 ^ - 6 / / V 1 = v o a p p l i e d to t h e non− i n v e r t i
l t a g e i nput t er ng
minal a pp lie
12 V2 = 4 0 * 1 0 ^ - 6 / / V 2 = v o l d to the i n v e
t a g e i nput t e r m i n a l v o l t a g e rf to ir n tgh e a b o v e i n p u t
13 Vo =0 . 4 * 1 0 ^ - 3 s
/ / V o = o u t p u t V1 a n d
V2 signal volt a g
14 d i s p ( ” In f i r s t c as e
e : ”)
15 vd=v1 - v2 / / v d = d i f f e r e n
ce
16 di s p ( ” V ” v o, l vd
t a /g1e0 i^s- vo=(Ad∗ vd ) +(Ac∗ vc ) w h e r e Ad
6, ” v d= Ac ”) a r e and t h e v o l t a g e g a i n s f o r the
17 v c = ( v1 +v2 d i )f/f2e /r /tehne c ecommon−mode
signal ands i g n a l , r e s p e c t i v e
21 vc=common
Ad =v o / vd / / mode A d cl yas li cg un laal t e d i n f i r s t c a s e a s common
v o
mode s i g n a ll t a g e vc=0
18
22 df oi sr pma t ( ,””v”
( Ad V o, l5t)a g e g ai n f o r the d i f f e r e n c e s i g n a
19 ld i s ip s( Ad” V= ”) ” , vc/10^-
6,
23 ”
d i vsc= p (”)” In s e c o n d c a s e : ”)
20
24 / / O u t-p uV2
Vd=V1 t //Vd= d i f f e r e n c e signal volt age
25 d i s p ( ” V ” , Vd / 1 0 ^ - 6 , ”Vd= ” )
26 Vc =( V1 +V2 ) / 2 / / Vc=common mode s i g n a l volt age
27 f o r ma t ( ” v” , 5 )
28 d i s p ( ” V ” , Vc / 10^ - 6 , ” Vc= ”)
29 Ac =Vo / Vc / / Ac c a l c u l a t e d i n s e c o n d c a s e as d i f f e r
e n c e s i g n a l Vc=0
30 d i s p ( Ac , ” V o l t a g e g a i n f o r t h e common−mode s i g n a
l i s Ac = ”)
31 CMRR = a b s ( Ad / Ac ) / / CMRR= Common Mode R e j e c t i o n
R a t i o = | A d/ A c |
32 d i s p ( CMRR , ”Common Mode R e j e c t i o n R a t i o i s
CMRR= ” )

111
Scilab code Exa 14.12.4 To find the output voltage of the three input
summing amplifier

1 // scila b 5.4.1
2 / / Windows 7 o p e r a t i n g s y s t e m
3 / / c hapte r 14 I n t e g r a t e d C i r c u i t s a n d O p e r a t i
on a lA m p lifier s
4 clc
5 clear
6 R1 = 1 * 1 0 0 0 / / R 1 = i n p u t resist a nce in in
ohms i n v e r t i n g t e r m i n a l o f t h e a m p l i f t h e c i r
ier cuit
7 R2 =200 / / R 2 = i n p u t r e s i s t a n c e i n ohms t h e i n
int erminal o f t h e a m p l i f i e r c i r c u tvhee r t ii nn v e r t i n
it g
R3 =400
89 Rf =500 / //RR3f=f = i nepeudtb a c kr e s i rs et sa ins ct e i inn ohms
ohms
ai nn ct ee r m i n a l o f t h e a m p l i f i e ri nc vi recr ut i n gt e r m i n a l o
10 v1 i t = - 5 / / v1=i n p u t v olt a ge in fr esist or
11 t hv2 e =3
an / / av m 2=pi l ivfoi le tr a g i n c it rh e i n v e r t i n gt e r m i n
cuit n p u t e c i r ac tu iR1a l o f a t R2 r e s i s t o r
an a m p l i f i e r t v o l t a i n the i n v e r t i n gt e r m i n
12 v3 =4 / / v 3= i g e c i r c al o f a t R3 r e s i s t o r
13 n p u t u i t
vo = - ( ( ( Rf / R1 ) * v1 ) + ( ( Rf / R2 ) * v2 ) + ( ( Rf / R3 ) * v3
an) ) /a/ mvo=
p l iofuitepru t v o l t a g e f o r i n v e r t i n g s umming
summing
am plifier circu it
14 d i s ap m ( ”V”
p l i f i, ev ro c, i”
r cOu ui ttp ui ts = ”) v o l t a g e o f t h e 3− i
n15p u t summing
d i s p ( ” O u t p u t v o l t a n e g a t i v e as it the c
ge i s o f i n v e r t i n g i r c u i t a m p l i f i e r ”)
summing

Scilab code Exa 14.12.5 To find the voltage gain along with the output
voltage

112
1 // scila b 5.4.1
2 / / Windows 7 o p e r a t i n g s y s t e m
3 / / c hapte r 14 I n t e g r a t e d C i r c u i t s a n d O p e r a t i
on a lA m p lifier s
4 clc
5 clear
6 R1 = 1 * 1 0 0 0 / / R 1 = i n p u t r e s i s t a n c e i n ohms i n
the i n v e r t i n g am plifier circuit
7 Rf = 5 0 * 1 0 0 0 / / R f=f e e d b a c k r e s i s t a n c e i n ohms
8 A=- ( Rf / R1 ) / / A V = v o l t a g e g ai n o f t h e i n v e r t i
n ga m p l i f i e r c i r c u i t
9 d i s p ( A, ” v o l t a g e g ai n o f the given
The in v er t in gcir cu it is
10 / / avimn p=l0i f.5i e∗ rs i =n ”)
( 100 ∗ %pi ∗ t )
11 / / vout=A∗ vi n = −50∗0.5∗ s i n ( 100 ∗ %pi ∗ t ) =−25∗ s i n
( 100 ∗ %pi ∗ t )
12 d i s p ( ” I f t h e o p e r a t i o n were e n t i r e l y l i n e a r , t h e
o u t p u t v o l t a g e w o u ld h a v e b e e n −25∗ s i n ( 100 ∗ %pi ∗
”) t)
13 s i n c e t h e v o l t a g e s u p p l y i s +−12V , t h e op−
d i s p ( s a t u r a t e d when | v o u t | atta
” B ut
14 / / Let a t t i m n es t = t o , vout=−12V 12V”)
amp i s i n ( 100 ∗ %pi ∗ t o )
15 / / −12=−25∗
16 t o =( 1 / ( 1s0 0 * %pi ) ) * a s i n ( 1 2 / 2 5 )
17 f o r ma t ( ” v” , 8 )
18 d i s p ( ” s ” , t o , ” t o= ”)
19 d i s p ( ” T h u s o v e r t h e e n t i r e c y c l e , ”)
20 d i s p ( ” vout=−25∗ s i n ( 100 ∗ %pi ∗ t ) V when 0<=t<=t o
”)
21 d i s p ( ” vout=−12V when to<=t <=(0.01 − t o ) ”)
22 d i s p ( ” vout=−25∗ s i n ( 100 ∗ %pi ∗ t ) V when (0 . 01 − t o
)<=t
< = ( 0 . 0 1 + t o ) ”)
23 d i s p ( ” v o u t = + 1 2 V when ( 0 . 01 + t o )<=t <=(0.02 − t o )
”)
24 d i s p ( ” vout=−25∗ s i n ( 100 ∗ %pi ∗ t ) V when (0 . 02 − t o
)<=t
<=0.02 s e c o n d s ”)

113
Scilab code Exa 14.12.6 To find the output voltage of the differentiator

1 // scila b 5.4.1
2 / / Windows 7 o p e r a t i n g s y s t e m
3 / / c hapte r 14 I n t e g r a t e d C i r c u i t s a n d O p e r a t i
on a lA m p lifier s
4 clc
5 clear
6 R = 2*1000 / / R = f e e d b a c k r e s i s t a n c e i n ohms i n
the d i f f e r e n t i a t o r circu it
7 C =0 . 0 1 * 1 0 ^ - 6 / / C = i n p u t c a p a c i t a n c f a ra d i n the
e indifferen t ia t or circu it
8 / / d v i / d t = 1 . 5 V / 1 ms f o r 0<t <1ms ( g i v r a m p i n p u t
ensignal)
9 / / output volt a ge of a d ifferent i i s g i v e n a s vo
a t o=−RC(
r dvi / dt )
10 d =1 . 5 / ( 1 0 ^ - 3 ) / / d = d v i / d t = 1 . 5 V / 1 ms
11 v o = - R* C* d
12 d i s p ( ”V” , v o , ” O u t p u t v o l t a g e o f a d i f f e r e n t i a t o r i
s ”
)
13 d i s p ( ” Hence f o r <t <1 ms , v o = −0.03V=−30mV. O t h e r w i s e
, vo
= 0V”)

Scilab code Exa 14.12.8 To calculate the output voltage

1 // scila b 5.4.1
2 / / Windows 7 o p e r a t i n g s y s t e m
3 / / c hapte r 14 I n t e g r a t e d C i r c u i t s a n d O p e r a t i
on a lA m p lifier s
4 clc
5 clear
6 R1 = 5 * 1 0 0 0 / / R 1 = i n p u t r e s i s t a n c e i n ohms i n t h e g i
v e n op−amp c i r c u i t
7 Rf = 1 0 * 1 0 0 0 / / R f=f e e d b a c k r e s i s t a n c e i n ohms
8 vi =5 / / v i = i n p u t v o l t a g e at the i n v e r t i n g t e r m i n a
l of
114
a n op−amp
9 V=4 / / V = v o l t a g ea t t h e non− i n v e r t i n g t e r m i n a
l o f an op−amp
10 / / B y a p p l y i ng s u p e r p o s i t i o n theorem
11 Vo = ( ( 1 + ( Rf / R1 ) ) * V) + ( - ( Rf / R1 ) * v i )
12 d i s p ( ”V” , Vo , ” O u t p u t volt a ge is
Vo o f the circuit = ”)

Scilab code Exa 14.12.9 To find the differential mode gain

1 // scila b 5.4.1
2 / / Windows 7 o p e r a t i n g s y s t e m
3 / / c hapte r 14 I n t e g r a t e d C i r c u i t s a n d O p e r a t i
on a lA m p lifier s
4 clc
5 clear
6 R1 = 1 0 * 1 0 0 0 / / R 1 = r e s i s t a n c e i n ohms
7 R2 =100 / / R 2 = r e s i s t a n c e i n ohms
8 R3 = 1 0 * 1 0 0 0 / / R 3 = r e s i s t a n c i n ohms
e
9 R4 = 1 0 * 1 0 0 0 / / R 4 = r e s i s t a n c i n ohms
e
10 R5 = 1 0 * 1 0 0 0 / / R 5 = r e s i s t a n c i n ohms
i n f i n i t e , the v o l t a g ee s o f the point s X
11 / / Sa ni dn cYe tihne t h ev o l t aggi ev ge an i n o f i gt huer eOP AMPs
a r e V1
are and
V2 r e s p e c t i v e l y s
12 / / Applying Ki rc h h o f f ’ s current law a t
X
13 / / ( V 1 / R 1 ) +((V1−V) / R 3 ) +((V1−V2 ) / R 2 ) =0
14 / / Applying Ki rc h h o f f ’ s current law a t
Y
15 / / ( ( V2−V) / R 4 ) +((V2−V1 ) / R 2 ) +((V2−Vo) / R 5 ) =0
16 / / E l i m i n a t i n g V from the a b o ve e q u a t i o n s
17 / / V 2 ∗ ( ( 1 / R2 ) + ( 1 / R 4 ) + ( 1 / R 5 ) + ( R 3 / ( R2∗R4 ) ) )−V1 ∗ (
( 1 / R2 )
+ ( 1 / R 4 ) + ( ( R 3 / R 4 ) ∗ ( ( 1 / R1 ) + ( 1 / R 2 ) ) ) )= V o / R 5
18 / / V2∗R−V1∗ r = V o / R 5 . . . . . . . . . . . . . . . . . . . ( 1 )
19 R =( ( 1/ R2 ) +( 1/ R4 ) +( 1/ R5 ) + ( R3 / ( R2 * R4 ) ) )
20 r =( ( 1/ R2 ) +( 1/ R4 ) + ( ( R3 / R4 ) * ( ( 1 / R1 ) +( 1/ R2 ) ) ) )
115
21 d i s p ( R, ”R= ” )
22 di s p ( r , ” r = ”)
23 / / R = r f ro m a b o v e c a l c u l a t i o n and i t s
answer d i s p l a y e d
24 / / Hence from t h e a b o v e e q u a t i o n ( 1 ) A=Vo
/ ( V1−V2 ) =−( R5∗R) =−(R5∗ r )
25 d i s p ( - R5 * r , ” D i f f e r e n t i a l mode g ai n
A = V o / ( V1−V2 ) = ”)

116
Chapter 15

Active Filters

Scilab code Exa 15.7.1 To design a Butterworth low pass filter

1 // scila b 5.4.1
2 / / Windows 7 o p e r a t i n g system
3 / / c hapte r 15 Ac t i ve F i l t e r s
4 clc
5 clear
6 f c =1000 / / f c = g i v e n c u t − o f f f r e q u e n c y i n Hz
7 A= - 56 / / A = r e q u i r e d g ai n t o be d r o p p e d by t h i s
much a m o u n t i n dB
8 / / Als o , A=n o r m a l i z e d g ai n o f B u t t e r w o r t h f i l t e r
= |A( jw
) /Ao |
9 f = 1n0o* r1m 0 0a0l i/ z/ ef =d ggi ai
v en n i s fdrreoqp up eedn cby
y i ng iHz
v e w ahere
m o u ntth e
10 / / | A( jw ) / A o | = ( −20) ∗ n∗ l o g 1 0 n n=o rd e r o
( w / w c )t h e filt er w here f
11 / / | A( jw ) / A o | = ( −20) ∗ n∗ l o g 1 0 ( f / f c )
12 n=A / ( ( - 2 0 ) * l o g 1 0 ( f / f c ) ) / / n = o r d e r o f
B u t t e r w o r t h low− p a s s filt er
13 d i s p ( c e i l ( n ) , ” O r d e r o f g i v e n f i l t e r to d e s i g n e
be i s ( n ) = ”) d
14 / / As n = 3 ( fr o m a b o v e c a l c u l a t i o n ) we cascadi
ne ed o f f i r s t −o r d e r s e c t i o n a n d s e c o n d −o n g s e c t i
rd e r on
117
15 / / F o r n=3
16 k =0 . 5 / / k = d a m p i n g fact or
17 Ao =3 - ( 2 * k ) / / A o = D C g a i n f o r e a c h op−amp i n a g
i v eB nu t t e r w o r t h F i l t e r t o be d e s i g n e d
18 R1 = 1 0 * 1 0 0 0 / / R 1 = A s s u m e d r e s i s t a n c e i n ohms
19 //Ao=(R1+R2 ) /R1
20 R2 = ( Ao* R1 ) - R1
21 / / f c = 1/ ( 2∗ %pi ∗R∗C)
22 R =1000 / / R = A s s u m e d r e s i s t a n c e i n ohms
23 C =1 / ( 2 * %p i * R* f c )
24 f o r ma t ( ” v” , 5 )
25 d i s p ( ” The d e s i g n e d v a l u e s ro ef s i s t a n c e and
c a p a c i t a n c ef o r a low −pas B u t t e r w o r t h filt er
s: ”) are
26 d i s p ( ” k i l oohm ” , R1
27 d i s p ( ” k i l o/ 1 0 0 0 , ”R1= ”)
28 d i s p ( ” k i l oohm ” , R2
29 d i s p ( ” m i c r o/ 1 0F0a0r a, d”R2= ”)10^ -
” , C/
6 , ”C= ” ) ohm ” , R
/ 1 0 0 0 , ”R= ” )

Scilab code Exa 15.7.2 To design a first order Butterworth active High
Pass filter

1 // scila b 5.4.1
2 / / Windows 7 o p e r a t i n g system
3 / / c hapte r 15 Ac t i ve F i l t e r s
4 clc
5 clear
6 Ao =5 / / A o = h i g h f r e q u e n c y g ai n o f a g i v e n f i r s t −o
rd e r Bu tte rw o rth a c t i v e HP f i l t e r
7 //Ao=(R1+R2 ) /R1
8 R1 =1000 / / R 1 = A s s u m e d r e s i s t a n c e i n ohms
9 R2 = ( Ao* R1 ) - R1
10 f c =200 / / f c = g i v e n c u t − o f f f r e q u e n c y i n Hz
11 / / f c = 1/ ( 2∗ %pi ∗R∗C)
12 R = 5 * 1 0 0 0 / / R = A s s u m e d r e s i s t a n c e i n ohms

118
13 C =1 / ( 2 * %p i * R* f c )
14 d i s p ( ” The d e s i g n e d values of re
sist a n ce and
ac rae p: a”)
cit ance f o r a high −pas s B u t t e r w o r t h
15 d i s p ( ” k i l oohm ” , R1 f i l t e r
16 d i s p ( ” k i l o/ 1 0 0 0 , ”R1= ”)
17 d i s p ( ” k i l oohm ” , R2
18 d i s p ( ” m i c r o/ 1 0F0a0r a, d”R2=
” , C/
”)10^ -
6 , ”C= ” ) ohm ” , R
/ 1 0 0 0 , ”R= ” )

Scilab code Exa 15.7.3 To design a second order band pass Butterworth
filter

1 // scilab 5.4.1
2 / / Windows 7 o p e r a t i n g system
3 / / c hapte r 15 Ac t i ve F i l t e r s
4 clc
5 clear
6 f o =1000 / / f o = c e n t r e f r e q u e n c y i n Hz
7 f=100 / / f=bandwidth i n Hz
8 //Q=wo/w=Q ual i ty fa ct or
9 Q = ( 2 * %p i * f o ) / ( 2 * %p i * f )
10 C1 =0 . 0 2 * 1 0 ^ - 6
11 C2 =0 . 0 2 * 1 0 ^ - 6 / / C 1 = C 2 = A s s u m e d C a p a c i t a n c e s i n Farad
12 Ao =2 / / A o = g ai n at the c e n t r e f re q u e n c y
13 / / R1∗C1=Q/ ( wo∗Ao) f o r a c t i v e band pas s
Butterworth f i l t e r
14 wo =2* %p i * f o
15 R1 =Q/ ( Ao* wo* C1 )
16 R3 =Q/ ( wo * ( ( C1 * C2 ) / ( C1 +C2 ) ) )
17 Rp =1/ ( ( wo ^ 2 ) * R3 * C1 * C2 )
18 R2 = ( R1 * Rp ) / ( R1 - Rp )
19 di s p ( ” T he d e s i g n e d v a l u e s o f r e s i s t a n c
e and c a p a c i t a n c e f o r a secon d o r d e r
b a n d −p a s s B u t t e r w o r t h f i l t e r a r e : ”)
20 d i s p ( ” k i l o ohm ” , c e i l ( R1 / 1 0 0 0 ) , ”R1= ”) / /
floor ()
and
119
c e i l ( ) f u n c t i o n s a r e u s e d i n o r d e r to g e
t runc ate d f l o a t i n g v a l u e s as re q ui re me
per the nt
21 d i s p ( ”ohm ” , f l o o r ( R2 ) , ”R2= ”)
22 d i s p ( ” k i l o ohm ” , c e i l ( R3
/ 1 0 0 0 ) , ”R3= ”)
23 d i s p ( ” m i c r o F a r a d ” , C1 / 1 0 ^ - 6 , ”C1= ”)
24 d i s p ( ” m i c r o F a r a d ” , C2 / 1 0 ^ - 6 , ”C2= ”)

Scilab code Exa 15.7.4 To design a notch filter

1 // scila b 5.4.1
2 / / Windows 7 o p e r a t i n g system
3 / / c hapte r 15 Ac t i ve F i l t e r s
4 clc
5 clear
6 f o =400 / / f o = c e n t r e f r e q u e ni nc y Hz
7 Q =10 / / Q = w o / w = Q u a l i t y fa ct or
8 C1 =0 . 1 * 1 0 ^ - 6
9 C2 =0 . 1 * 1 0 ^ - 6 / / C 1 = C 2 = A s s u m e d C a p a c i t a n c e s i n
10 Ao =2 / / A o = g a i n a t t h e c e n tFraer a d f r e q u e n c y
11 / / R1∗C1=Q/ ( wo∗Ao) f o r a c t i v e band pas s
B u t ft ei rl w
t eo r t h
12 wo =2* %p i * f o
13 R1 =Q/ ( Ao* wo* C1 )
14 f o r ma t ( ” v” , 6 )
15 R3 =Q/ ( wo * ( ( C1 * C2 ) / ( C1 +C2 ) ) )
16 Rp =1/ ( ( wo ^ 2 ) * R3 * C1 * C2 )
17 R2 = ( R1 * Rp ) / ( R1 - Rp )
18 / / Assuming a r b i t r a r i l y ( R6/R5 ) =10=a
19 a=10
20 R6 = 1 0 * 1 0 0 0 / / R 6 = A s s u m e d r e s i s t a n c e i n ohms
21 R5 =R6 / a
22 R4 =R5 / Ao
23 d i s p ( ” The d e s i g n e d v a l u e s o f r e s i s t a n c e
and c a p a c i t a n c e for a notch
filt er a r e : ”)
24 d i s p ( ” k i l o ohm ” , ( R1 / 1 0 0 0 ) , ”R1= ”)
120
25 d i s p ( ”ohm ” , ( R2 ) , ”R2= ”)
26 d i s p ( ” k i l o ohm ” , ( R3
/ 1 0 0 0 ) , ”R3= ”)
27 d i s p ( ”ohm ” , R4 , ”R4= ”)
28 d i s p ( ” k i l o ohm ” , ( R5
/ 1 0 0 0 ) , ”R5= ”)
29 d i s p ( ” k i l o ohm ” , ( R6
/ 1 0 0 0 ) , ”R6= ”)
30 d i s p ( ” m i c r o F a r a d ” , C1 / 1 0 ^ -
6 , ”C1= ”)
31 d i s p ( ” m i c r o F a r a d ” , C2 / 1 0 ^ -
6 , ”C2= ”)

121
Chapter 16

Special Devices

Scilab code Exa 16.10.1 To determine the time period of the sawtooth
voltage across capacitor C

1 // scilab 5.4.1
2 / / Windows 7 o p e r a t i n g system
3 / / c hapte r 16 S p e c i a l D e v i c e s
4 clc
5 clear
6 Vp =15 / / V p = f i r i n g v o l t a g e o f a u n i j u n c t i o nt r a n s i
st orin V o l ts
7 VBB =40 //V BB =s o u r c e v o l t a g e i n V o l ts
8 n = ( Vp / VBB ) / / n = i n t r i n s i c stand − o f f r a t i o
9 d i s p ( n , ” The i n t r i n s i c s t a n d − o f f r a t i o i s ”)
10 R = 50*(10^3) //R= r e s i s t a n c e i n ohms
11 C = 2000*(10^ - 1 2 ) / / c=c a p a c i t a n c e i n f a ra d
12 T=( R* C* l o g ( 1 / ( 1 - n ) ) ) * ( 1 0 ^ 6 ) / / T = t ime period of
the sawtooth v o l t a g e a c r o s s C
13 f o r ma t ( ” v” , 7 )
14 d i s p ( ” m i c r o s e c o n d s ” , T, ” The t i m e period
is ”)

122
Chapter 17

Number Systems Boolean


Algebra and Digital Circuits

Scilab code Exa 17.17.1 To determine the binary equivalents

1 // scilab 5.4.1
2 / / Windows 7 o p e r a t i n g s y s t e m
3 / / c h a p t e r 17 Number S y s t e m s , B o o l e a n A l g e b r a , and
Digit al C ircuit s
4 clc
5 clear
6 x=25
7 s= d e c 2 b i n ( x)
8 di s p ( , s , ” 1 B in a r y e q u i v a l e n t o f 25 i s
”)
9 y=576
10 s1 = dec2bin ( y)
11 d i s p ( , s1 , ” 2 Binary e q u i v a l e n t o f 576 i s
”)

Scilab code Exa 17.17.2 To determine the decimal equivalent

1 // scilab 5.4.1

123
2 / / Windows 7 o p e r a t i n g s y s t e m
3 / / c h a p t e 17 Number S y s t e m s , B o o l e a n A l g e b r a , and
r C ircuit s
Digit a l
4 clc
5 clear
6 s = ’ 1111

7 x=
bin2dec( s
)
8 di s p ( , x ,
Scilab
” D e c icodem a l Exa 17.17.3 To convert from binary system to decimal sys-
tem e q u i v a
lent
1 / / osfc i l a b 5 . 4 . 1
2 / / Windows
1111 7 o p e r a t i n g system
3 / / ci sh a p t e r 17 Number S y s t e m s , B o o l e a n A l g e b r a , and
Digit al C ircuit s
”)
4 clc
5 clear
6 p =1;
7 // in it ia lisin gv a r ia b le
8 q =1; s
9 z =0;
10 b =0;
11 w =0;
12 f =0;
13 f or ma t ( ’ v ’ , 1 8 ) ; / / i n c r e a s i n g t h e p recisio
n t o 18 .
14 b i n = 1 1 . 1 1 0 1 ;
15 d= mo d u l o ( b i n , 1 ) ; / / s e p a r a t i n g the de c i mal
p a r t and t h e in t eger part
16 d=d * 1 0 ^ 1 0 ;
17 a= f l o o r ( b i n ) ; / / r e m o v i n g the de c i mal p a r t
18 whi l e ( a >0) / / l o o p to t a k e the bi n a ry b i t s o f i n t
egerint o a matrix
19 r = mo d u l o ( a , 1 0 ) ;
20 b ( 1 , q) =r ;
124
21 a =a / 10;
22 a= f l o o r ( a ) ;
23 q =q +1 ;
24 end
25 f o r m =1: q - 1 / / m u l t i p l y t h e b i t s o f in t eger
in gt h eir p osit ion va with and adding
lues
26 c=m - 1 ;
27 f = f + b ( 1 , m) *( 2^ c ) ;
28 end the bi n a ry b i t s o f de c i
29 whi l e ( d > 0 ) / / l o o p to mal
take i n t o a matrix
30 e= mo d u l o ( d , 2 )
31 w( 1 , p ) =e
32 d=d / 1 0 ;
33 d= f l o o r ( d )
34 p =p +1 ;
35 end the b i t s o f de c i mal
36 f o r n =1: p - 1 / / m u l t i p l y i with and adding
37 nz =z
g t +w(
h e i1r , n ) *p(o0 s. 5i t) i o^n( 1v1 a- n ) ;
38 lend
ues
39 z =z * 1 0 0 0 0 ;
40 / / rounding o f to 4 de c i mal v a l u e s
41 z= r o u n d ( z ) ;
42 z =z / 1 0 0 0 0 ;
43 pr i nt f ( ” The d e c i m a l equivalent of 11.11
01 i s = % f” , f + z )

Scilab code Exa 17.17.4 To convert from decimal system to binary sys-
tem

1 // scilab 5.4.
1 7 o p e r a t i n g system
2 / / Windows 17 Number S y s t e m s , B o o l e a n A l g e b r a , and
3 / / c hapte r C i r c u i t s
Digit al
125
4 clc
5 clear
6 q =0;
7 b =0;
8 s =0;
9 f or ma t ( ’ v ’ , 1 8 ) ; / / i n c r e a s i n g t h e precisio
n t o 18 .
10 a = 4 . 6 2 5 ;
11 d= mo d u l o ( a , 1 ) ; / / s e p a r a t i n g the de c i mal p a r t and
the i n t e g e r part
12 a= f l o o r ( a ) ; / / r e m o v i n g the de c i mal p a r t
13 whi l e ( a >0) / / t a k i n g i n t e g e r part i n t o a matrix
and c o n v e r t i n g i n t o e q u i v a l e n t bi n a ry
14x= mo d u l o ( a , 2 ) ;
15 b=b + ( 1 0 ^ q ) * x ;
16 a =a / 2;
17 a= f l o o r ( a ) ;
18 q =q +1;
19 end
20 f o r i =1: 1 0 / / f o r v a l u e s a f t e r de c i mal p
o i n t c o n v e r t i n g i n t o bi n a ry
21 d =d *2;
22 q= f l o o r ( d ) ;
23 s = s + q / ( 1 0 ^ i ) ;
24 i f d >=1 t h e n
25 d=d - 1 ;
26 end
27 end
28 k =b +s ;
29 p r i n t f ( ” The b i n a r y eq u iv a len tof 4.62
5 i s = % f” , k )
;

Scilab code Exa 17.17.5 To find the equivalent of given number in a code
base 5

1 // scila b 5.4.1

126
2 / / Windows 7 o p e r a t i n g s y s t e m
3 / / c h a p t e 17 Number S y s t e m s , B o o l e a n A l g e b r a , and
r C ircuit s
Digit a l
4 clc
5 clear
6 d e c =263
7 b a s e =5
8 s=
dec2base(
dec , b a s e )
9 di s p ( , s ,
”Eq uiv a
Scilab code Exa 17.17.6 To perform binary addition corresponding to dec-
l e nt
imal addition
of
263
1 // scilab 5.4.1
in a
2 / / Windows 7 o p e r a t i n g s y s t e m
cod e
3 / / c h a p t e r 17 Number S y s t e m s , B o o l e a n A l g e b r a , and
b a se 5
Digit al C ircuit s
is
4 clc
”)
5 clear
6 x=2
7 s=x+x
8 s1 = dec2bin ( s )
9 d i s p ( , s1 , ” Binary a dd it ioncorrespond in g to
d e c i m a l a d d i t i o n 2+2 i s ”)

Scilab code Exa 17.17.7 To perform binary addition and also to show the
corresponding decimal addition

1 // scilab 5.4.
1 7 o p e r a t i n g system
2 / / Windows 17 Number S y s t e m s , B o o l e a n A l g e b r a , and
3 / / c hapte r C i r c u i t s
Digit al
4 clc
127
5 clear
6 x= ’ 11111 ’
7 y= ’ 1011 ’
8 z= ’ 101 ’
9 w= ’ 10 ’
10 v= ’ 1 ’
11 s1 = b i n 2 d e c ( x)
12 s2 = b i n 2 d e c ( y)
13 s3 = b i n 2 d e c ( z )
14 s 4 = b i n 2 d e c ( w)
15 s5 = b i n 2 d e c ( v)
16 a = s 1 + s 2 + s 3 + s 4 +s 5
17 b= d e c 2 b i n ( a )
18 di s p ( , b , ” B i n a r y a d d i t i o n o f 1 1 1 1 1 + 1 0 1 1 + 1 0 1 + 1 0 + 1 is

)
19 di s p ( , a , ” D e c i m a l equivalent correspondi
ng to a b ov e b i n a r y addit ion is ”)

Scilab code Exa 17.17.8 To perform the binary subtraction

1 // scilab 5.4.1
2 / / Windows 7 o p e r a t i n g s y s t e m
3 / / c h a p t e r 17 Number S y s t e m s , B o o l e a n A l g e b r a , and
Digit al C ircuit s
4 clc
5 clear
6 x= ’ 1101 ’
7 y= ’ 111 ’
8 s1 = b i n 2 d e c ( x)
9 s2 = b i n 2 d e c ( y)
10 a=s1 - s2
11 s= d e c 2 b i n ( a )
12 di s p ( , s , ” B in a r y subt ract ion 1101 −111
i s = ”)

128
Scilab code Exa 17.17.9 To obtain the output levels of a silicon transistor
for given input levels and to show that circuit has performed NOT operation
using positive logic

1 // scila b 5.4.1
2 / / Windows 7 o p e r a t i n g s y s t e m
3 / / c h a p t e r 17 Number S y s t e m s , B o o l e a n A l g e b r a , and
Digit a l C ircuit s
4 clc
5 clear
6 hFE =30 / / h F E = d c c u r r e n t g ai n o f g i v e n s i l i
cont ransist or
7 VBE =0. 8 / / V B E = b as e −e m i t t e r v o l t a g e drop at s a t u r a
t ion
8 VCEs=0. a t 2u /r/ aVtCiEo=nc o l l e c t o r −e m i t t e r v o l t a g e d r o p a t
9 R1 = 1 5 * 1 0 0 0 / / r e s i s t a n c e at the base s i d e o f
t h e t r a n s i s t o r i n ohms
10 R2 = 1 0 0 * 1 0 0 0 / / a n o t h e rr e s i s t a n c e at the base s i d
e o f the t r a n s i s t o r i n ohms
11 RL = 2 * 1 0 0 0 / / l o a d r e s i s t a n c e at the c o l l e c t o r s i d
e o f the t ransist or i n ohms
12 VCC =10 / / V C C = c o l l e c t o r supply v o l t a g e
13 VBB = - 10 / / V B B = b ase supply v o l t a g e
14 / / I f t h e i n p u t l e v e l i s 0 v o l t i v ei = 0 , t h e
circuit ed b a s e v o l t a g e i s gopen−
i v e n as
15 VB= VBB * ( R1 / ( R1 +R2 ) )
16 d i s p ( ” For i l e v e l 0 V: ”)
nput o f appro x i mate l y V i s s u f f i c i e n
17 d i s p ( ” As a s0 i l i c o n e m i t t e r j u nt c t i o n , i t f o l l o w
that b i a s ts r a n s i s t o r i s c u t o f f when v i = 0”)
18 d i s to c u t ,o VCC
p ( ”V” f f a , ”When v i = 0 , t h e o u t p u t v o l t a g e i s
vo=VCC
= ”)
19 d i s p ( ” T h i s i n d i c a t e s t h a t the o u t p u t i s i n s t a
t e 1 when t h e i n p u t i s i n s t a t e 0 ”)

129
20 //When the i n p u t l e v e l i s 10 v o l t i e v i = 1 0 , we
h a ve t o show t h a t 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
21 / / The minimum b a s e cu rren t for sa t u ra t ionis g
i v e n by i B ( min ) = i C / h F E
22 i C = ( VCC - VCE ) / RL / / c o l l e c t o r c u r when t h e
rent t ransist or sat urat es
23 i B=i C/ hFE / / i B = i B ( min )=minimum cu rrent fo
b a s e s a t u r a t i o n i n mA r
24 i 1 = ( 1 0 - VBE ) / R1 / / i 1 = c u r r e n t R1 r e s i s t o
t h r ocuognhn e c t e d a t the b a s e s i d e a n d r he re v i
=10 i s t a k e n
25 i 2 = ( VBE - VBB ) / R2 / / i 2 = c u r r e n t t h r o u g h R2 r e s i
s t o r c o nne c te d at the base s i d e
26 i B1 =i 1 - i 2 / / i B 1 = a c t u a l b a s e c u r r e n t
27 d i s p ( ” For i n p u t l e v e l 10 V: ”)
28 i f ( i B1 >i B) t h e n
29 d i s p ( ” S i n c e iB>i B ( min ) , i t is verified
that t h e t r a n s i s t o r i s i n s a t u r a t i o n ”) / / i B i
n d i c a t e s a c t u a l b a s e c u r r e n t & i B ( min )i n d i c
a t e s minimum b a s e current for sa t u ra t ion
30 d i s p ( ”V” , VCE , ”When v i = 1 0 , t h e o u t p u t volt
a g e i s vo=VCE( s a t ) = ”)
31 di s p ( ” This i n d i c a t e s t h a t the o u t p ut i
s in st at e
32 end 0 when t h e i n p ut i s i n s t a t e 1
33 d i s p ( ” O”) vera it h a s been thus v e r i f i e d
ll t h a t the performed t h e NOT
circu it o p e r a t i o n ”)

ha s

Scilab code Exa 17.17.10 To solve the Boolean expression

1 // scilab 5.4.
1 7 o p e r a t i n g system
2 / / Windows 17 Number S y s t e m s , B o o l e a n A l g e b r a , and
3 / / c hapte r C i r c u i t s
Digit al
4 clc
130
5 clear
6 A=0
7 B=0
8 C= bi t or ( A, B) / / b i t w i s e OR o p e r a t i o n is
performed e x p r e s s i o n C=A+B f o r i n p u t s A=0
9 d i s p ( C, ” and
B o o l e a n B=0 is
”)
10 A=1
11 B=0 e x p r e s s i o C=A+B f o r i n p u t s A=1
12 C= bi t or ( A, B) n and
13 d i s p ( C, ”
B o o l e a n B=0 is
”)
14 A=1 e x p r e s s i o C=A+B f o r i n p u t s A=1
15 B=1 n and
16 C= bi t or ( A, B)
17 d i s p ( C, ”
B o o l e a n B=1 is
”)

131
Chapter 19

VLSI Technology and Circuits

Scilab code Exa 19.29.1 To find the value of inverse of aspect ratio along
with power dissipated and load resistance

1 // scilab 5.4.1
2 / / Windows 7 o p e r a t i n g system
3 / / c hapte r 19 VLSI T e c h n o l o g y and C i r c u i t s
4 clc
5 clear
6 I D =50*10^ - 6 / / ID=d ra i n c u r r e n t i n amperes
7 k = 2 5 * 1 0 ^ - 6 / / k = u e / D i n A/Vˆ2
8 VDS =0 . 2 5 / / V D S = d r a i n −to −s o u r c e volt a ge
9 VGS =5 / / V G S = g a t e −to −s o u r c e volt age
10 VTH =1. 5 / / V T H = t h r e s h o l d volt a ge
11 w=I D / ( k * ( VGS - VTH ) * VDS ) / / w = W / L
12 f o r ma t ( ” v” , 5 )
13 di s p ( w, ”W/ L= ” )
14 P= VDS * I D / / P = p o w e r d i s s i p a t e d by t h e t r a n s i s t o r
15 d i s p ( ” m i c r o W a t t ” , P * 1 0^ 6 , ” The d i s s i p a t e d
power i s = ”)
16 VDD =5 //VDD=d r a i n suppl y v o l t a g e o f g i v e n
NMOS t r a n s i s t o r
17 R=( VDD - VDS ) / I D / / R = l o a d r e s i s t o r t o be c o n n e c t e
d i n s e r i e s with the d rai n
18 d i s p ( ” k i l o ohm ” , R / 1 0 0 0 , ” The l o a d r e s i s t a n c e i
s = ”)
132
Scilab code Exa 19.29.2 To find the pull up and pull down aspect ratio

1 // scilab 5.4.1
2 / / Windows 7 o p e r a t i n g system
3 / / c hapte r 19 VLSI T e c h n o l o g y and C i r c u i t s
4 clc
5 clear
6 I D =50*10^ - 6 / / ID=d ra i n c u r r e n t i n amperes
7 k = 2 5 * 1 0 ^ - 6 / / k = u e / D i n A/Vˆ2
8 VDEP =3
9 l =( k * ( ( - VDEP ) ^ 2 ) ) / ( 2 * I D) / / l = ( L / W ) = a s p e c t rati
o o f the p u l l −up
10 d i s p ( l , ” P u l l −u p ( L /W) = ” )
11 VGS =5 / / V G S = g a t e −to −s o u r c e volt age
12 VTH =1 / / V T H = t h r e s h o l d volt age
13 VDs =4 . 7 5 / / V D s = t h e d r a i n s o u rc e v o l t a g e o f
t h e d e p l e t i o n mode p u l l −up i n s a t u r a t i o
n
14 VDD =5 //VDD=d r a i n suppl y v o l t a g e o f g i v e n
NMOS i n v e r t e r
15 / / L / W = ( k ∗ (VGS−VTH) ∗VDS) / ID w h e r e L/W=p u l l
down a s p e c t rat io
16 l 1 = ( k * ( VGS - VTH ) * ( VDD - VDs ) ) / I D / / l 1 =L/W
17 d i s p ( l 1 , ” P u l l −down ( L/ W) = ”)

Scilab code Exa 19.29.3 To find the value of inverse of aspect ratio of the
PMOS transistor for a symmetrical inverter

1 // scila b 5.4.1
2 / / Windows 7 o p e r a t i n g s y s t e m
3 / / c hapte r 19 VLSI T e c h n o l o g y and C ircuit s
4 clc

133
clear
5
6 w =10 / /w = W / L v a l ue o f t h e NMOS t r a n s i s t o r i n a
CMOS i n v e r t e r
7 un =1350 / / u n = e l e c t r o n m o b i l i t y f o r NMOS t r a n s i s t
o r i n cm ˆ2 / V s
8 up =540 / / u p = e l e c t r o n m o b i l i t y f o r PMOS t r a n s i s t o
r i n cm ˆ2 / V s
9 / / (W pu/Lp u ) ∗ up ∗ ( VINV−VDD−VTHP) ˆ 2 = ( W p d / Lpd ) ∗ un ∗
( VINV− VTHN) ˆ2
10 / / F o r a s y m m e t r i c al i n v e r t e r VINV=(VDD/ 2 ) a n d
VTHN
=(−VTHP)
11 / / Also f o r i n p u t v o l t a g e=VDD/2 b o t h t r a n s i s
t o r s o p e ra te in sa t u r a t ionr egion
12 / / T h e re f o re , up ∗ (Wpu/ Lpu ) = u n ∗ (W pd /Lpd )
13 w1 = ( un * w) / up //w 1= Wp u/Lp u= W/ L v a l ue o f t h e PMOS f o
r a s y m m e t r i c al invert er
14 d i s p ( w1 , ”W/ L v a l ue o f t h e PMOS t r a n s i s t o r i n a
CMOS i n v e r t e r i s = ”)

Scilab code Exa 19.29.4 To determine the maximum permissible number


of fan outs

1 // scilab 5.4.1
2 / / Windows 7 o p e r a t i n g system
3 / / c hapte r 19 VLSI T e c h n o l o g y and C i r c u i t s
4 clc
5 clear
6 f = 2*10^9 / / f=c l o c k f r e q u e n c y i n Hz
7 VDD =3 //VDD=d r a i n suppl y v o l t a g e
8 Cl = 1 * 1 0 ^ - 12 / / C 1 = l o a d capa cit ance in Farad
9 P = 5 0 * 1 0 ^ - 3 / / P = m a x i m u m power dissipat ion capab
i l i t y i n W/ s t a g e
10 N=P/ ( f * Cl * VDD ^ 2 ) //N=maximum p e r m i s s i b l e
number o f f an o uts
11 f o r ma t ( ” v” , 5 )

134
12 d i s p ( N, ”N= ” )
13 d i s p ( f l o o r ( N) , ” The maximum p e r m i s s i b l e n u m b e r o f
fan
−o u t s i s ( i n t e g e r j u s t be low a c t u a l v a l u e ) = ”)

Scilab code Exa 19.29.5 To calculate the channel transit time

1 // scila b 5.4.1
2 / / Windows 7 o p e r a t i n g system
3 / / c hapte r 19 VLSI T e c h n o l o g y and C i r c u i t s
4 clc
5 clear
6 L =3* 10^ - 6 / / L = l e n g t h o f a n NMOS p a s s t r a n s i s t o
r i n metres
7 VDS =0. 5 / / V D S = d r a i n −s o u r c e volt age
8 u =1400*10^ - 4 / / u=e l e c t r o n m o b i l i t y i n mˆ2 / V s
9 t =L ^ 2 / ( VDS * u ) / / t = c h a n n e l t r a n s i t time
10 f o r ma t ( ” v” , 5 )
11 d i s p ( ” n a n o s e c o n d s ” , t / 1 0 ^ - 9 , ” The t r a n s i t t i m e i
s = ”)

Scilab code Exa 19.29.6 To calculate the required metal line width

1 // scila b 5.4.1
2 / / Windows 7 o p e r a t i n g system
3 / / c hapte r 19 VLSI T e c h n o l o g y and C i r c u i t s
4 clc
5 clear
6 y=2 / / y = l e n g t h u n i t i n m i c ro m e t r e s
7 W =3* y //W=mimimum m e t a l l i n e w i d t h i n m i c ro m e
tre s
8 d i s p ( ” m i c r o m e t r e s ” , W, ”W= ” )
9 n=80 / / n = n u m b e r o f driven invert ers
10 i =0. 07 / / i = a v e r a g e cu rrent ra t in gs in m illia m
peres
11 I = n * i / / I = t o t a l c u r r r e n t d r a w n by n i n v e r t e r s
12 d i s p ( ”mA” , I , ” I= ”) 135
13 / / 1mA p e r m i c r o m e t r e o a l u m i n i u m l i n e w i d t h is
f maximum s a f e a v e r a g e the c u r r e n t an
ca n c a r r y . a l u m i n i u m w i re
14 di s p ( ” This needs a l i at l e a s t width o f
ne ”)
15 d i s p ( ” m i c ro m e t r e s
17 ” , I )d i s p ( ” Above c a l c u l a t e d minimum m e t a l l i n e
16 i f ( W>I
−w i(W)d) t ht h eins thus the s a f e width o f the
metal l i n e d r i v i n g 80 invert ers
. ”)
18 end
19 f=5 / / f=number o f f ano ut l i n e s
20 w=f * W / / w = r e q u i r e d m e t a l l i n e w i d t h
21 d i s p ( ” m i c ro m e t r e s ” , w, ” The m e t a l line
− w i dt h required
t o s u p p l y a f a n −out o f 5 l i n e s i s = ”)

136
Chapter 20

Cathode Ray Oscilloscope

Scilab code Exa 20.9.1 To determine the transit time along with trans-
verse acceleration and spot deflection

1 // scila b 5.4.1
2 / / Windows 7 o p e r a t i n g system
3 / / c hapte r 20 C a t h o d e Ray O s c i l l o s c o p e
4 clc
5 clear
6 e =1 . 6 * 1 0 ^ - 19 / / e = c h a r g e o f an e l e c t r o n
7 Va =1000 / / V a = p o t e n t i a l d ifference in volt s
8 m =9 . 1 1 * 1 0 ^ - 31 / / m = m a s s o f an e l e c t r o n
9 v= s q r t ( ( 2 * e * Va ) / m) / / v = a x i a l v e l o c i t y o f an e l e c
t ron d eflect in g plat es i
10 l =2 * 1 0 ^ - 2 / / l = a x i a l leng n
th o f metre beam t h r o u g h t h e
11 t =l / v / / t = t r a n s i t t i m e of
the d e f l e c t i n g p l a t e s
12 f o r ma t ( ” v” , 9 ) is
13 d i s p ( ” s ” , t , ” T h e t r a n s i t = ”)
t i m de e f l e c t i n g p l a t e s i n v o l t s
1415 Vds ==20
5 * 1/0/ ^V -d3= /p/ os t=es ne tp iaa rl a t i dbieftfw e e n the plat es in
erence o n a p p l metre t r a v e r s e ac
i e16
d ibmet pt awa=(
re teeend* Vdt o) / t(hse* m)
e l /e /c t hcr eoe lnesrby
a t it oh en d e f l e c t i n
g ta=the
137
volt a ge
17 f o r ma t ( ” v” , 1 0 )
18 d i s p ( ”m/ s ˆ 2 ” , t a , ” T r a v e r s e a c c e l e r a t i o n i s = ”)
19 L =25*10^ - 2 / / L = d i s t a n c e o f the screen from
CRT c e n t r e o f the d e f l e c t i n g p l the i n
at es metre
20 d = ( l * L* Vd ) / ( 2* s * Va ) / / d = d e f l e c t o f t h e s p o t on
i o n CRT s c r e e n the
21 f o r ma t ( ” v” , 1 3 )
22 d i s p ( ”cm ” , d * 1 0 0 , ” S p o t d e f l e c t i o n i s
= ”) / / d i s c o nv e rte d in
terms o f cm
23 S=d / Vd / / S = d e f l e c t i o n sen sit ivit y
24 f o r ma t ( ” v” , 1 0 )
25 d i s p ( ”mm/ V” , S/ 10^ - 3 , ” D e f l e c t i o n s e n s i t i v i t y i s
= ”) / / S i s c o n v e r t e d i n t e r m s o f mm/V

Scilab code Exa 20.9.2 To calculate the highest frequency of the deflect-
ing voltage

1 // scila b 5.4.1
2 / / Windows 7 o p e r a t i n g system
3 / / c hapte r 20 C a t h o d e Ray O s c i l l o s c o p
e
4 clc
5 clear
6 e =1 . 6 * 1 0 ^ - 19 / / e = c h a r g e o f an e l e c t r o n
7 Va =1000 / / V a = p o t e n t i a l d i f ef el er ce tn rcoeni n v
olt s v e l o c i t y o f an ele
8 m =9 . 1 1 * 1 0 ^ - 31 / / m = m a s s o f an c t r o n o f d e f l e c t i n g
9 v= s q r t ( ( 2 * e * Va ) / m) / / v = a x i a l plat es in
10
11 tl =l
=1 ./ 5v*/1/0 t^=- t2 r/ a/ nl =s ai txt iima el l eo f t h e beam t h r o u g h
n g t thh em de ter ef l e c t i n g p l a t e s
12 / / T = t ime p e r i o d o f the s i n u s o i d a l d e f l e c t
i n gv o l t a g e
13 / / tmax=maximum t r a n s i t time
14 / / ( 0 . 1 / 3 6 0 ) ∗T=tmax , s i n c e 1 c y c l e c o r re s p o n d s to
360 d e g r e e s
138
15 T=( t * 3 6 0 ) / 0 . 1
16 f =1/ T / / f = h i g h e s t f re q u e n c y o f the d e f l e c t i n g v o l
t a ge
17 f o r ma t ( ” v” , 5 )
18 d i s p ( ” kHz” , f / 1 0 0 0 , ” The h i g h e s t f r e q u e n c y o f
t h e d e f l e c t i n g v o l t a g e i s = ”)

Scilab code Exa 20.9.3 To find the deflection of the spot and the
magnetic deflection sensitivity

1 // scilab 5.4.1
2 / / Windows 7 o p e r a t i n g system
3 / / c hapte r 20 C a t h o d e Ray O s c i l l o s c o p e
4 clc
5 clear
6 V =1000 / / V = p o t e n t i a l differen ce in volt s
7 //B=150 g aus s (given)
8 B =1 . 5 * 1 0 ^ - 2 / / B = m a g n e t i c field in t esla
9 l =1 * 1 0 ^ - 2 / / l = a x i a l l e n g th o f d e f l e c t i n g p l a t e
s i n metre
10 L1 = 2 0 * 1 0 ^ - 2 / / L 1 = ( L + ( l / 2 ) ) = d i s t a n c e o f the
flu orescent screen from
the cent re of the d e f l e c t i o n system
in metre
11 e =1 . 6 * 1 0 ^ - 19 / / e= c h a r g e o f an e l e c t r o n
12 m =9 . 1 1 * 1 0 ^ - 31 / / m = m a s s o f an e l e c t r o n
13 d=B* s q r t ( e / ( 2 * V* m) ) * l * L1 / / d = d e f l e c t i o n o
f the s
po t
14 f o r ma t ( ” v” , 5 )
15 d i s p ( ”cm ” , d * 1 0 0 , ” The d e f l e c t i o n o f t h e s
p o t i s = ”)
16 Sm=d / B / / S m = m a g n e t i c deflect ion sensit ivi
ty
17 f o r ma t ( ” v” , 5 )
18 d i s p ( ”mm/ g a u s s ” , Sm / 1 0 , ” The m a g n e t i c d
Scilab code Exa
eflect ionsen sit ivit y 20.9.4 To calculate the frequency of the signal
i s = ”)

139
1 // scila b 5.4.1
2 / / Windows 7 o p e r a t i n g system
3 / / c hapte r 20 C a t h o d e Ray O s c i l l o s c o p e
4 clc
5 clear
6 sw =10 / / s w =s wee p w i d t h i n cm
7 n =5 / 2 / / n = n u m b e r o f c y c l e s g i v e n by v e r t
ica ld eflect ion pla t es
8 c =s w/ n / / c = c e n t i m e t r e s o c c u p i e d by one c y c l
e ofsign a l
9 c t =0. 1 / / c t = c a l i b r a t e d t i m e b a s e o f CRO i n
ms /cm
10 t =c t * c / / t = t i m e i n t e r v a l c o r re s p o n d i n g to ce
n t i m e t r e s o c c u p i e d by one c y c l e of signa l
11 T=t / 5 / / T = t ime p e r i o d o f the s i g n a l , s i n c ethe s
ca leis 5 t i me s m ag ni f i e d
12 f =1/ T / / f = f r e q u e n c y o f the s i g n a l
13 d i s p ( ” kHz ” , f , ” T h e f r e q u e n c y o f t h e s i g n a l i s
= ”)

Scilab code Exa 20.9.5 To find the frequency of the vertical signal

1 // scila b 5.4.1
2 / / Windows 7 o p e r a t i n g system
3 / / c hapte r 20 C a t h o d e Ray O s c i l l o s c o p e
4 clc
5 clear
6 / / Let f v = f r e q u e n c yo f t h e v e r t i c a l s i g n a l s i n
kHz
7 / / f h=f re q u e n c y o f the h o r i z o n t a l s i g n a l s
8 / / Number o f h o r i z o n t a l t a n g e n c i e s=nh
9 / / Number o f v e r t i c a l t a n g e n c i e s = nv
10 / / f v / f h = n h / nv
11 f h =1
12 nh =3
13 nv =4
14 fv =( n h / n v )* fh
15 d i s p ( ” Hz” , f v * 100 0 , ” The f r e q u e n c y o f t h e
vert ical
140
signa l is
= ”)

Scilab code Exa 20.9.6 To find the phase difference between the voltages

1 // scilab 5.4.1
2 / / Windows 7 o p e r a t i n g system
3 / / c hapte r 20 C a t h o d e Ray O s c i l l o s c o p e
4 clc
5 clear
6 // slope o f the major a x i s i s n e g a t i v e ( g i v e n )
7 A =2. 6 / / A = T h e maximum y−d i s p l a c e m e n t
8 vyo =1. 1 / / v y o = t h e v e r t i c a l di s p l ac e m e n t
9 s i n o = ( v y o / A) / / o = p h a s e d i f f e r e n c e between the
two v o l t a g e s
10 x= a s i n d ( s i n o )
11 d i s p ( ” As t h e major a x i s o f the e l l i p s e has a
n e g a t i v e s l o pe , p h as e d ifference between
t h e two v o l t a g e s must l i e b e t w e e n 90 d e
g re e a n d 180
d e g re e ”)
12 d i s p ( ” d e g re e ” , 1 8 0 - x , ” T h e re f o re , p h a s e d i f f e r
e n c e between t h e v o l t a g e s i s = ”)

141
Chapter 21

Communication
Systems

Scilab code Exa 21.13.1 To calculate the critical frequencies and the max-
imum frequencies

1 // scila b 5.4.1
2 / / Windows 7 o p e r a t i n g s y s t e m
3 / / c hapte r 21 C o m m u n i c a t i o n S y s t e m s
4 clc
5 clear
6 Npe = 6 * 1 0 ^ 1 0 / / Np e=p eak elect ron con cen t ra t ion
for t h e E l a y e ri n mˆ−3
7 Np f = 1 0 ^ 1 2 / / N p f = p e a k elect ron concent ra t ion fo
r the F l a y e r i n mˆ−3
8 f CE =9* s q r t ( Npe ) / / f C E= c r i t i c f r e q u e n c y f o r t h e E
a lla y er
9 f o r ma t ( ” v” , 5 )
10 d i s p ( ”MHz” , f CE / 1 0 ^ 6 , ” C r i f r e q u e n c y f o r t h e E
t i c a l l a y e r i s = ”)
11 f CF =9* s q r t ( Npf ) / / f C F = c r i t i c f r e q u e n c y f o r t h e F
a lla y er
12 f o r ma t ( ” v” , 5 )
13 d i s p ( ”MHz” , f CF / 1 0 ^ 6 , ” C r i f r e q u e n c y f o r t h e F
t i c a l l a y e r i s = ”)
14 R =6400 / / R = r a d i u s o f t h e e i n km
arth
142
15 He =110 / / He=h e i g h t o f the E l a y e r a b ov e
the e a r t h s u r f a c e i n km
16 i me = a s i n d ( R/ ( R+He ) ) / / i m e = a n corresponding
g l e maximum f r e q u e n c y fmE f o r to l a y e r i
E n degrees
17 f o r ma t ( ” v” , 3 ) f re q u e n c y r e f l e c t e
18 f mE = f CE * s e c d ( i me ) / / d
19 fmE=maximum
d i s p ( ”MHz”from , f mE / 1 0 ^t h6 e, ”
E The
l a y emaximum f r e q u e n c y r e f
rl e c t e d from t h e E l a y e r i s = ”)
20 Hf =250 / / H f = h e i g h t o f t h e F l a y e r above the e
arth s u r f a c e i n km
21 i mf = a s i n d ( R/ ( R+Hf ) ) / / i m f = a n corresponding
g l e maximum f r e q u e n c y fmF f o r to l a y e r i
F n degrees
22 f o r ma t ( ” v” , 3 ) f re q u e n c y r e f l e c t e
23 f mF = f CF * s e c d ( i mf ) / / d
24 fmF=maximum
d i s p ( ”MHz” from , f mFt h/ 1e 0 ^F6 ,l a”y The
e maximum f r e q u e n c y
r r e f l e c t e d from t h e F l a y e r i s = ”)

Scilab code Exa 21.13.2 To find the maximum distance between the
trans- mitting and receiving points

1 // scila b 5.4.1
2 / / Windows 7 o p e r a t i n g system
3 / / c hapte r 21 C o m m u n i c a t i o n S y s t e m s
4 clc
5 clear
6 R =6400 / / R = r a d i u s o f t h e e a r t h i n km
7 He =110 / / He=h e i g h t o f the E l a y e r above the e
arth s u r f a c e i n km
8 i me = a s i n ( R/ ( R+He ) ) / / i m e = a n g l e correspondi
n g to maximum f r e q u e n c y fmE f o r E l a y e ri n
r a di an
9 f o r ma t ( ” v” , 1 0 )
10 o =( %p i / 2 ) - i me / / o = a n g l e made by the i n c i d e n t ray
at the c e n t r e o f the e a r t h i n degrees
143
11 f o r ma t ( ” v” , 5 )
12 L =2* o* R / / L= m a x i m u m d i s t a n c e b e t w e e n t h e t r a n s m i
t t i n g and the receiving point s on t h e e a r t h
fs ou rr f as ci en g l e hop t r a n s m i radiowave
ssion of the r e f l e c t e d from
the E l a y e r
13 f o r ma t ( ” v” , 5 ) s i n g l e hop
14 d it sr pa( n”km”
s m i s s, iL, o n”iThe maximum d i s t a n c
s = ”)
15 e/ / Ans
f o rwer g i v e i n te xtbo o k i s which
n 2459 km i t is a is
i n c o r r e c t as c t u a l l y a r o u n d 2356 km .

Scilab code Exa 21.13.3 To find the height of the point above the ground
from which the wave is reflected back

1 // scilab 5.4.1
2 / / Windows 7 o p e r a t i n g system
3 / / c hapte r 21 C o m m u n i c a t i o n S y s t e m s
4 clc
5 clear
6 / / f c =9∗ s q r t ( Np)
7 f c = 3*10^6 / / f c = c r i t i c a l f r e q u e n c y i n Hz
8 Np = ( f c ^ 2 ) / 8 1 / / N p = e l e c t r o n concent ra t ion
at the r e f l e c t i n g po
int
9 / / h=h e i g h t o f t h e r e f l e c t i n g p o i n t from t h e
bottom o f the l a y e r
10 / / N p = ( 5 ∗ 10 ˆ 1 0 ) + ( 1 0 ˆ 9 ∗ h ) . . . . ( g i v e n )
11 h = ( Np - ( 5 * 1 0 ^ 1 0 ) ) / 1 0 ^ 9
12 H =100 / / H = h e i g h t above the s u r f a c e o f the e a r t h
i n km
13 d i s p ( ”km” , h +H, ” The r e q u i r e d h e i g h t a b ov e t h e
g r o u n d i s = ”)

144
Chapter
23
Lasers Fibre Optics and
Holography

Scilab code Exa 23.31.1 To calculate the number of photons emitted per
second

1 // scila b 5.4.1
2 / / Windows 7 o p e r a t i n g system
3 / / c hapte r 23 L a s e r s , F i b r e O p t i c s , a n d H o l o g r a p h y
4 clc
5 clear
6 y = 6 3 0 * 1 0 ^ ( - 9 ) / / y =e m i t t e d wavelength i n meters
7 c= 3*10^8 / / c=v e l o c i t y o f l i g h t i n f r e e s pac e i n m/
s
8 v =c / y / / v=f r e q u e n c y o f the e mi t t e d r a d i a t i o n
9 f o r ma t ( ” v” , 9 )
10 d i s p ( ” The f r e q u e n c y o f t h e e m i t t e d r a d i a t i o n i s ”)
11 d i s p ( ” Hz” , v , ” v= ”)
12 h = 6. 62*10^ ( - 34) / / h=Planck ’ s c o n s t a n t
13 P = 1 * 1 0 ^ ( - 3 ) / / P = o u t p u t power o f gas l a s e r ( g i v e n )
14 n =P/ ( h* v )
15 f o r ma t ( ” v” , 9 )
16 d i s p ( ” s ˆ −1” , n , ” T h e n u m b er o f p h o t o n s e m i t t e d
p e r s e c o n d i s = ”)

145
Scilab code Exa 23.31.2 To calculate the coherence time and the longi-
tudinal coherence length

1 // scilab 5.4.1
2 / / Windows 7 o p e r a t i n g system
3 / / c hapte r 23 L a s e r s , F i b r e O p t i c s , a n d H o l o g r a p h y
4 clc
5 clear
6 V =500 / / V = b a n d w i d t h o f a He−Ne l a s e r i n Hz
7 t =1/ V / / t = c o h e r e n c e time
8 d i s p ( ”ms ” , ( t * ( 1 0 ^ 3 ) ) , ” The c o h e r e n c e t i m e i s = ”)
9 c= 3*10^8 / / c=v e l o c i t y o f l i g h t i n m/ s
10 Lc =c / V / / Lc = l o n g i t u d i n a l c o h e re nc e l e n g t h
11 d i s p ( ”km” , ( Lc / 1 0 0 0 ) , ” The l o n g i t u d i n a l co
h e re nc e l e n g t h i s = ”)

Scilab code Exa 23.31.3 To calculate the minimum difference between


two arms of a Michelson interferometer

1 // scila b 5.4.1
2 / / Windows 7 o p e r a t i n g s y s t e m
3 / / c hapte r 23 L a s e r s , F i b r e O p t i c s , a n d H o l o g r a p h y
4 clc
5 clear
6 //To o btai n i n t e r f e r e n c e f r i n g e s o f good v i s i b i l i t
y t h e p a t h d i f f e r e n c e f the cent ral
o r be an i n t e g r a l m u l frin ge must o f
t i p l e w ave l e ng t hs . each o f the 2
7 / / 2∗ d = ( n 1 ∗ y1 ) = ( n 2 ∗ y2 ) w h e r e y1 & y2 a r e 2 wave−
len gt hs and d =pa th d i f f e r e n c e a n d n1 a n d n2
are 2 i n t e g e r s

146
8 / / ( 2 ∗ d ) ∗ ( ( 1 / y2 ) −( 1 / y1 ) ) =(n2 −n1 )=m w h e r e m i s
ano the r i n t e g e r
9 / / N o w m=(−2∗d∗Y) / ( y ˆ 2 ) =(2 ∗ d∗V) / ( v ∗ y ) =(2 ∗ d∗V) / c
=(2∗ d )
/ Lc
10 Lc =600 / / Lc=c o h e r e n c e l e n g t h i n km
11 d = ( Lc / 2) / / d=minimum d i f f e r e n c e b e t w e e n t h e 2 arms
o f the Mi c h e l s o n i n t e r f e r o m e t e r
12 d i s p ( ”km ” , d , ” T h e m inim u m d i f f e r e n c e b e t w e e n t h e
t wo a r m s o f t h e M ich el son i n t e r f e r o m e t e r i
s = ”)

Scilab code Exa 23.31.4 To show that emission for a normal optical source
is predominantly due to spontaneous transitions

1 // scilab 5.4.1
2 / / Windows 7 o p e r a t i n g system
3 / / c hapte r 23 L a s e r s , F i b r e O p t i c s , a n d H o l o g r a p h y
4 clc
5 clear
6 h = 6. 62*10^ ( - 34) / / h=Planck ’ s c o n s t a n t
7 v = 3*10^8 / / v=v e l o c i t y o f l i g h t ( as n o r m a l o p t
i c a l s o u rc e i s mentioned ) i n m/ s
8 kB = 1 . 3 8 * 1 0 ^ - 23 / / k B = B o l t z m a n n ’ s c o n s tan t
9 T =1000 / / T = t e m p e r a t u r e i n K e l vi n
10 w =6000 / / w = w a v e l e n g t h i n Armstrong
11 R=( e x p ( ( h* v ) / ( w * ( 1 0 ^ - 1 0 ) * kB* T ) ) ) - 1 / / R = t he r a t
io o f t h e number o f s p o n t a n e o us to st i
m ulat ed
t ransit ions
12
d i s p ( , R,
d i s”R=
p ( ””As) t h e r a t io o f the of spo n t a n e o
13 n ui fm b(erR t o s t i m u l a t e d t r a n s i us i s >> 1 t h e
> 1t )i ot hne ns (R) e m i s s i o n i s t o s p o n t a n e ous
14 pt r eadnosmi it ni ao nnt sl y d u e and i s t h u s i n
15 c o h e r e n t ”)
16 end
147
Scilab code Exa 23.31.5 To determine coherence time and the coherence
length

1 // scila b 5.4.1
2 / / Windows 7 o p e r a t i n g system
3 / / c hapte r 23 L a s e r s , F i b r e O p t i c s , a n d H o l o g r a p h y
4 clc
5 clear
6 u = 8 / ( 1 0 ^ 1 4 ) / / u=(V/ v )=the s h o r t term f re q u e
ncyst a bilit y o f a He−Ne gas l a s e r
7 / / v=c / y w h e r e c = v e l o c i t y of light in a n d y=
vacuum w a v e l e n g t h
8 c= 3*10^8 / / c=v e l o c i t y o f l i g h t i n m/ s
9 y = 1 1 5 3 * 1 0 ^ ( - 9 ) / / y=e m i t t e d wavelength i n
meters
10 V=( u* c ) / y
11 t =1/ V / / t = c o h e r e n c e time
12 d i s p ( ”ms ” , ( t * ( 1 0 ^ 3 ) ) , ” The c o h e r e n c e t i m e
i s = ”)
13 f o r ma t ( ” v” , 9 )
14 Lc =c / V / / Lc=c o h e r e n c e l e n g th
15 d i s p ( ”m” , Lc , ” The c o h e r e n c el e n g t h i s = ”)
16 f o r ma t ( ” v” , 3 )

Scilab code Exa 23.31.6 To find the line width and the coherence length

1 // scila b 5.4.1
2 / / Windows 7 o p e r a t i n g s y s t e m
3 / / c hapte r 23 L a s e r s , F i b r e O p t i c s , a n d H o l o g r a p h y
4 clc
5 clear
6 / / y0 =va cuu m w a v e l e n g t h f o r the f re q u e n c y v
7 / / c = ( v ∗ y0 )

148
8 / / The d e v i a t i o n i n t h e wavelength i s Y 0= ( c ∗V) / ( v
ˆ2 )
9 / / Y 0 = ( ( y0 ˆ 2 ) ∗V) / c
10 / / V b e i ng s p r e a d i n f r e q u e n c y o ve r t h e l i n e w i d t h .
11 / / V = ( 1 / t c )
12 c = 3 * ( 1 0 ^ 8 ) / / c = v e l o c i t y o f l i g h t i n m/ s
13 t c = 1 0 ^ ( - 8 ) / / t c = c o h e r e n c e time i n s e c o nds
14 y0 = 6 5 0 * ( 1 0 ^ ( - 9 ) ) / / y0= vac uum w a v e l e n g t h in m
15 Y0 = ( y0 ^ 2 ) / ( c * t c )
16 f o r ma t ( ” e ” , 9 )
17 d i s p ( ”nm” , Y0 / ( 1 0 ^ - 9 ) , ” Lin e w i d t h i s
= ”) / / Y0 i s c o n v e r t e d in t e r m s o f nm
18 L c = c * t c / / Lc =c o h e r e n c e l e n g th
19 f o r ma t ( ” v” , 5 )
20 d i s p ( ”m” , Lc , ” The c o h e r e n c e leng
t h Lc i s = ”)

Scilab code Exa 23.31.7 To find the radius along with the power density
of the image and the coherence length

1 // scila b 5.4.1
2 / / Windows 7 o p e r a t i n g system
3 / / c hapte r 23 L a s e r s , F i b r e O p t i c s , a n d H o l o g r a p h y
4 clc
5 clear
6 o = 5 * 1 0 ^ - 5 / / o = a n g u l a rs p r e a d in ra
7 f=10 / / f=f o c a l l e n gdt hi a n s i n cm
8 D=f * o / / D = d i a m e t e r tohfe im a g e
9 r = ( D / 2 ) / / r=image radius
10 f o r ma t ( ” v” , 1 5 )
11 d i s p ( ”cm ” , r , ” T h e i m a g e r a d i u s i s = ”)
12 a= %pi *( r ^ 2 ) / / a = c r o s s s e c t i o n a l a re a o f the image
i n cmˆ2
13 P =10*10^ - 3 / / P = p o w e r i n Watts
14 PD=P/ a / / PD= p ower densit y
15 f o r ma t ( ” v” , 1 0 )
16 d i s p ( ”W/ cm ˆ 2 ” , PD , ” Power d e n s i t y i s = ”)

149
17 y =6000*10^ - 8 / / y =w av el eng th i n cm
18 d =y / o / / d = c o h e r e n t width
19 d i s p ( ”cm ” , d , ” T h e l a t e r a l c o h e r e n t w i d t h is
= ”)

Scilab code Exa 23.31.8 To find the amount of pumping energy required
for transition from 3s to 2p

1 // scila b 5.4.1
2 / / Windows 7 o p e r a t i n g system
3 / / c hapte r 23 L a s e r s , F i b r e O p t i c s , a n d
Holography
4 clc
5 clear
6 h =6 . 6 2 * 1 0 ^ - 34 / / h = P l a n c k ’ s c o n s tan t
7 c= 3*10^8 / / c=v e l o c i t y o f l i g h t i n vacuum i n
m/ s
8 y =6 3 2 . 8 * 1 0 ^ - 9 / / y=e m i t t e do f 2 w p a lvee lveen lg tihn iJ no uml e s
9 E=( h* c ) / y / / E = e m i t t e d pr he oqt uo ni r eedn ef rg
o ry t ir na nJ soi ut il oe n from
s He−Ne l a s e
10
12 ed i=1s 5p .( 2”
* 1eV”
0 ^ - 19 / / e = e n e r g y
, P / ( 1 . 6 * 1 0 ^ - 1r 9 ) , ” The d e s i r e d pumping
11 e n e r gP=E+e
y i s /=/”) P= P u mp in g
13 f o r ma e nte (r g”
y v”
3 s , 1t o0 ) 2 p
l e v e li n a

Scilab code Exa 23.31.9 To calculate the probability of stimulated emis-


sion

1 // scila b 5.4.1
2 / / Windows 7 o p e r a t i n g system
3 / / c hapte r 23 L a s e r s , F i b r e O p t i c s , a n d H o l o g r a p h y
4 clc
5 clear
6 h =6 . 6 2 * 1 0 ^ - 34 / / h = P l a n c k ’ s c o n s t a n t
7 v = 2 . 4 * 1 0 ^ 1 5 / / v=f r e q u e n c y o f e m i t t e d r a d i a t i o n i n
Hz
150
8 c= 3*10^8 / / c=v e l o c i t y o f l i g h t i n vacuum i n m/ s
9 A21 = 1 / ( 1 . 6 6 * 1 0 ^ - 8 ) / / A21=mean s p o n t a n e o us life
time
10 B21 = ( ( c ^ 3 ) * A21 ) / ( 8 * %p i * h * ( v ^ 3 ) ) / / B 2 1 = p r o b a b i l
it y ofst im u la t ed em ission
11 d i s p ( ”mˆ 3 / ( J . s ˆ 2 ) ” , B21 , ” The d e s i r e d prob
a bilit y i s = ”)

Scilab code Exa 23.31.10 To calculate the NA and the acceptance angle
along with number of reflections per metre

1 // scila b 5.4.1
2 / / Windows 7 o p e r a t i n g system
3 / / c hapte r 23 L a s e r s , F i b r e O p t i c s , a n d H o l o g r a p h y
4 clc
5 clear
6 u1 =1 . 5 5 / / u 1 = r e f r a c t i v e i n d e x o f t h e c o re o f
the f i b r e
7 u2 =1 . 5 0 / / u 2 = r e f r a c t i v e i ndex o f the c l a d d i n
g
8 oa = a s i n d ( s q r t ( ( u1 ^ 2 ) - ( u2 ^ 2 ) ) ) / / o a = a c c e p t a n c e
an g l e
9 f o r ma t ( ” v” , 5 )
10 d i s p ( ” d e g r e e ” , o a , ” The a c c e p t a n c e an g l
e i s = ”)
11 NA= s i n d ( o a ) / / N A = n u m e r i c al apert ure
12 d i s p ( , NA , ”NA= ” )
13 oc = a s i n d ( u2 / u1 ) / / o c = c r i t i c a l an g l e
14 d i s p ( ” d e g r e e ” , o c , ” C r i t i c a la n g l e= ”)
15 d = 5 0 * 1 0 ^ - 6 / / d = c o re di a m e t e r i n m e t e r s
16 x= d* t a n d ( o c ) / / x = a x i a l d i s t a n c e t r a v e r s e d by t h e
r a y b e t w e e n two c o n s e c u t i v er e f l e c t i o n s
17 n =1 / x / / n = n u m b e r o f r e f l e c t i o n s per metre
18 di s p ( , n , ” The n u m b e r o f r e f l e c t i o n s per metre i s
= ”)

151

You might also like