Professional Documents
Culture Documents
Electronic Circuits
by P. Raja1
Created by
Amit Sexana
B.Tech
Electronics Engineering
UPTU
College Teacher
Mr. Sunil Kumar
Cross-Checked by
Lavitha Pereira
May 26, 2016
1 Funded
Book Description
Title: Electronic Circuits
Author: P. Raja
Publisher: Umesh Publications, Darya Ganj, New Delhi
Edition: 2
Year: 2012
ISBN: 978-93-8017613-0
Scilab numbering policy used in this document and the relation to the
above book.
Exa Example (Solved example)
Eqn Equation (Particular equation of the above book)
AP Appendix to Example(Scilab Code that is an Appednix to a particular
Example of the above book)
For example, Exa 3.51 means solved example 3.51 of this book. Sec 2.3 means
a scilab code whose theory is explained in Section 2.3 of the book.
Contents
List of Scilab Codes
1 Operational Amplifiers
2 MOSFET
23
44
4 Differential Amplifiers
74
5 Feedback Amplifiers
91
6 Oscillators
106
7 Examintion Paper
114
1.1
1.2
1.3
2.3
1.4
1.5
1.6
1.7
1.8
1.10
1.11
1.12
1.13
1.14
1.15
1.16
1.17
1.18
1.19
1.20
1.22
1.24
1.25
1.26
1.27
1.28
2.1
2.2
Value of Rf . . . . . . . . . . .
Output voltage . . . . . . . . .
Inverting amplifier . . . . . . .
Value of ID and VDS . . . . .
Output voltage . . . . . . . . .
Output voltage . . . . . . . . .
Maximum and minimum closed
Output voltage . . . . . . . . .
Voltage gain . . . . . . . . . .
Output voltage . . . . . . . . .
Range of voltage gain . . . . .
Range of output voltage . . . .
The value of R1 and R2 . . . .
Output voltage . . . . . . . . .
Output voltage . . . . . . . . .
Ouptut voltage . . . . . . . . .
Output voltage . . . . . . . . .
Output voltage . . . . . . . . .
Output voltage . . . . . . . . .
Output voltage . . . . . . . . .
Inverting op amp . . . . . . . .
Output voltage . . . . . . . . .
Output voltage . . . . . . . . .
Gain . . . . . . . . . . . . . . .
Value of Ao fb fr . . . . . . . .
3dB frequency and gain . . . .
Device operate region . . . . .
Drain current . . . . . . . . . .
4
. . . . . .
. . . . . .
. . . . . .
. . . . . .
. . . . . .
. . . . . .
loop gain
. . . . . .
. . . . . .
. . . . . .
. . . . . .
. . . . . .
. . . . . .
. . . . . .
. . . . . .
. . . . . .
. . . . . .
. . . . . .
. . . . . .
. . . . . .
. . . . . .
. . . . . .
. . . . . .
. . . . . .
. . . . . .
. . . . . .
. . . . . .
. . . . . .
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
5
5
6
6
7
8
9
9
10
10
11
12
12
13
14
14
15
15
16
17
17
18
18
19
20
21
23
25
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
2.4
2.5
2.6
2.7
2.8
2.9
2.10
2.11
2.12
2.14
2.15
2.16
2.17
2.18
2.19
2.20
2.22
2.23
2.24
3.1
3.2
3.3
3.4
3.5
3.6
3.7
3.8
3.9
3.10
3.11
3.12
3.13
3.14
3.16
3.17
3.18
3.19
3.20
. . .
. . .
. . .
. . .
. . .
. . .
. . .
. . .
. . .
. . .
VDS
. . .
. . .
. . .
. . .
. . .
. . .
. . .
. . .
. . .
. . .
. . .
. . .
. . .
. . .
. . .
. . .
. . .
. . .
. . .
. . .
. . .
. . .
. . .
. . .
. . .
. . .
. . .
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
26
27
27
28
29
30
31
32
33
34
35
36
36
37
38
39
40
42
42
44
45
45
47
47
48
49
50
50
51
52
53
54
55
55
56
57
58
58
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
3.21
3.22
3.23
3.24
3.25
3.27
3.28
3.29
3.30
3.31
3.32
3.33
4.1
4.2
4.3
4.4
4.5
4.6
4.7
4.8
4.9
4.10
4.11
4.12
4.13
4.14
4.15
4.16
5.1
5.2
5.3
5.4
5.5
5.6
5.7
5.8
5.10
5.11
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
60
61
63
64
64
65
66
67
68
68
69
70
74
75
77
78
79
80
81
82
82
84
85
86
86
88
88
89
91
91
92
92
93
93
94
95
95
96
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
Exa
5.12
5.19
5.20
5.21
5.22
5.23
5.24
5.25
5.26
5.28
5.29
6.1
6.2
6.3
6.4
6.5
6.6
6.7
6.8
6.10
6.11
6.12
6.14
1.b
2.a
2.c
3.b
97
98
99
99
100
101
102
103
103
104
105
106
106
107
108
108
109
110
110
111
111
112
113
114
114
115
116
Chapter 1
Operational Amplifiers
// Exa 1 . 1
clc ;
clear ;
close ;
// Given d a t a
G = -100;
R1 = 2.2; // i n kohm
R1 = R1 *10^3; // i n ohm
// Formula G=Rf /R1
Rf = -G * R1 ;
disp ( Rf *10^ -3 , The v a l u e o f Rf i n kohm i s )
5
6
7
8
9
10
11
12
// Given d a t a
Rf = 200; // i n kohm
R1 = 2; // i n kohm
vin =2.5; // i n mV
vin = vin *10^ -3; // i n v o l t
G = - Rf / R1 ;
vo = G * vin ; // i n V
disp ( vo , The o u t p u t v o l t a g e i n v o l t i s : )
// Exa 1 . 3
clc ;
clear ;
close ;
// Given d a t a
G = -10;
Ri = 100; // i n kohm
R1 = Ri ; // i n kohm
R1 = R1 *10^3; // i n ohm
// Formula G=R2/R1
R2 = R1 * abs ( G ) ; // ohm
disp ( R1 *10^ -3 , V a l u e o f R1 i n kohm i s : )
disp ( R2 *10^ -6 , and v a l u e o f R2 i n Mohm i s : )
7 I_D = 100; // i n
A
8 I_D = I_D *10^ -6; // i n A
9 // When
10 V_GS = 1.2; // i n V
11 V_DS = V_GS ; // i n V
12 // At t h i s c o n d i t i o n , d e v i c e
13
14
15
16
17
18
19
20
21
22
23
i s in saturation region
, so
I D= unCox W/ ( 2 L ) ( V GSVT) 2
unCoxWby2L = I_D /( V_GS - Vt ) ^2;
// For
V_DS = 3; // i n V
V_GS = 1.5; // i n V
// I n t h i s c o n d i t i o n , d e v i c e i s i n s a t u r a t i o n r e g i o n
, so
I_D = unCoxWby2L *( V_GS - Vt ) ^2; // i n A
disp ( I_D *10^6 , For V DS= 3V and V GS= 1 . 5 V, The
A i s : )
value of I D in
// For
V_GS = 3.2; // i n V
r_DS = 1/(2* unCoxWby2L *( V_GS - Vt ) ) ; // i n
disp ( r_DS , For V GS = 3 . 2 V, D r a i n t o s o u r c e
r e s i s t a n c e in
i s : )
// Exa 1 . 4
clc ;
clear ;
close ;
// Given d a t a
R1 = 100; // i n kohm
R2 = 500; // i n kohm
V1 = 2; // i n v o l t
Vo = (1+ R2 / R1 ) * V1 ; // i n v o l t
disp ( Vo , Output v o l t a g e f o r n o n i n v e r t i n g a m p l i f i e r
in v o l t )
10
// Exa 1 . 5
clc ;
clear ;
close ;
// Given d a t a
Rf = 1; // i n Mohm
Rf = Rf *10^6; // i n ohm
// P a r t ( a )
V1 =1; // i n v o l t
V2 =2; // i n v o l t
V3 =3; // i n v o l t
R1 = 500; // i n kohm
R1 = R1 *10^3; // i n ohm
R2 = 1; // i n Mohm
R2 = R2 *10^6; // i n ohm
R3 = 1; // i n Mohm
R3 = R3 *10^6; // i n ohm
Vo = - Rf *( V1 / R1 + V2 / R2 + V3 / R3 ) ; // i n v o l t
disp ( Vo , ( a ) Output v o l t a g e i n v o l t i s : )
// P a r t ( b )
V1 = -2; // i n v o l t
V2 =3; // i n v o l t
V3 =1; // i n v o l t
R1 = 200; // i n kohm
R1 = R1 *10^3; // i n ohm
R2 = 500; // i n kohm
R2 = R2 *10^3; // i n ohm
R3 = 1; // i n Mohm
R3 = R3 *10^6; // i n ohm
Vo = - Rf *( V1 / R1 + V2 / R2 + V3 / R3 ) ; // i n v o l t
11
33
disp ( Vo , ( b ) Output v o l t a g e i n v o l t i s : )
Scilab code Exa 1.6 Maximum and minimum closed loop gain
1 // Exa 1 . 6
2 clc ;
3 clear ;
4 close ;
5 // Given d a t a
6 disp ( Minimum c l o s e d
7
8
9
10
11
12
13
14
15
16
17
l o o p v o l t a g e g a i n f o r R2=0 and
R1= 2 kohm )
R2 =0;
R1 =2; // i n kohm
R1 = R1 *10^3; // i n ohm
Av_min = (1+ R2 / R1 )
disp ( Av_min )
disp ( Maximum c l o s e d l o o p v o l t a g e g a i n f o r maximum
v a l u e o f R2=100 kohm and R1= 2 kohm )
R2 =100; // i n kohm
R1 =2; // i n kohm
Av_max = (1+ R2 / R1 )
disp ( Av_max )
V
V
12
8
9
10
11
12
13
14
15
16
17
18
19
20
V1 = V1 *10^ -6; // i n v o l t
V2 = V2 *10^ -6; // i n v o l t
CMRR =80; // i n dB
Av =5*10^5;
// ( i )
// CMRR i n dB= 20 l o g ( Ad/Ac )
Ad = Av ;
Ac = Ad /10^( CMRR /20) ;
// ( i i )
Vo = Ad *( V1 - V2 ) + Ac *( V1 + V2 ) /2;
disp ( Vo , Output v o l t a g e i n v o l t i s : )
// Note : I n t h e book , t h e r e i s c a l c u l a t i o n e r r o r t o
e v a l u a t e t h e v a l u e o f Ac , s o t h e v a l u e o f Ac i s
wrong a n s t o e v a l u a t e t h e o u t p u t v o l t a g e t h e r e i s
also calculation error
// Exa 1 . 8
clc ;
clear ;
close ;
// Given d a t a
R1 = 1; // i n Mohm
Ri = R1 ; // i n Mohm
Rf =1; // i n Mohm
A_VF = - Rf / R1 ;
disp ( A_VF , V o l t a g e g a i n i s : )
// Exa 1 . 1 0
13
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
clc ;
clear ;
close ;
// Given d a t a
V1 =2; // i n V
V2 =3; // i n V
Rf =3; // i n kohm
R1 =1; // i n kohm
disp ( Output v o l t a g e when o n l y 2V v o l t a g e s o u r c e i s
a c t i n g in v o l t )
Vo1 = (1+ Rf / R1 ) * V1 ;
disp ( Vo1 ) ;
disp ( Output v o l t a g e due t o 3V v o l t a g e s o u r c e i n
v o l t )
Vo2 = (1+ Rf / R1 ) * V2 ;
disp ( Vo2 ) ;
Vo = Vo1 + Vo2 ; // i n v o l t s
disp ( Vo , T o t a l o u t p u t v o l t a g e i n v o l t s )
variable r e s i s t o r in
ohm
max_vvs = 10; // maximum v a l u e o f v a r i a b l e r e s i s t o r i n
ohm
Ri_min = 10+ min_vvs ; // i n kohm
Ri_max = 10+ max_vvs ; // i n kohm
// Av= Vo/ Vi= Rf / Ri
disp ( C l o s e d l o o p v o l t a g e g a i n c o r r e s p o n d i n g t o Ri (
14
13
14
15
16
17
18
min ) i s )
Av = - Rf / Ri_min ;
disp ( Av )
disp ( and c l o s e d l o o p v o l t a g e g a i n c o r r e s p o n d i n g t o
Ri ( max ) i s )
Av = - Rf / Ri_max ;
disp ( Av )
disp ( Thus t h e c l o s e d l o o p g a i n o f t h e c i r c u i t can
be a d j u s t e d a t any v a l u e b e t w e e n 25 t o 50 w i t h
the help of v a r i a b l e r e s i s t o r . )
// Exa 1 . 1 2
clc ;
clear ;
close ;
// Given d a t a
Rf =200; // i n kohm
R1 = 20; // i n kohm
// Av= Vo/ Vi= Rf / Ri
Av = - Rf / R1 ;
Vi_min = 0.1; // i n V
Vi_max = 0.5; // i n V
// Vo= Av Vi
Vo_min = Av * Vi_min ; // i n V
Vo_max = Av * Vi_max ; // i n V
disp ( Output v o l t a g e r a n g e s from + string ( Vo_min ) + V
t o + string ( Vo_max ) + V )
// Exa 1 . 1 3
15
2 clc ;
3 clear ;
4 close ;
5 // Given d a t a
6 Rf = 250; // i n kohm
7 // Output v o l t a g e e x p r e s s i o n , Vo= 5Va+3Vb
8 // and we know t h a t f o r a d i f f e r e n c e a m p l i f i e r
9
10
11
12
13
14
15
16
17
18
circuit ,
// Vo= Rf /R1Va + [ R2 / ( R1+R2 ) ] [ 1 + Rf /R1 ] Vb
// Comparing b o t h t h e e x p r e s s i o n , we g e t
// Rf /R1Va= 5Va , o r
R1 = Rf /5; // i n kohm
disp ( R1 , The v a l u e o f R1 i n kohm )
// and
R2 = 3* R1 ^2/( R1 + Rf -3* R1 )
disp ( R2 , The v a l u e o f R2 i n kohm )
// Note : Answer i n t h e book i s wrong
// Exa 1 . 1 4
clc ;
clear ;
close ;
// Given d a t a
Vi_1 = 150; // i n
V
Vi_2 = 140; // i n
V
Vd = Vi_1 - Vi_2 ; // i n
V
Vd = Vd *10^ -6; // i n V
Vc = ( Vi_1 + Vi_2 ) /2; // i n
V
Vc = Vc *10^ -6; // i n V
// Vo= AdVd(1+Vc / (CMRRVd ) )
// ( i ) For Ad=4000 and CMRR= 100
16
15
16
17
18
19
20
21
22
23
24
Ad =4000;
CMRR = 100;
Vo = Ad * Vd *(1+ Vc /( CMRR * Vd ) ) ; // i n v o l t
disp ( Vo *10^3 , Output v o l t a g e i n mV )
// ( i i ) For Ad=4000 and CMRR= 1 0 5
Ad =4000;
CMRR = 10^5;
Vo = Ad * Vd *(1+ Vc /( CMRR * Vd ) ) ; // i n v o l t
disp ( Vo *10^3 , Output v o l t a g e i n mV )
// Exa 1 . 1 5
clc ;
clear ;
close ;
// Given d a t a
Rf =470; // i n kohm
R1 =4.3; // i n kohm
R2 =33; // i n kohm
R3 =33; // i n kohm
Vi = 80; // i n
V
Vi = Vi *10^ -6; // i n v o l t
A1 = 1+ Rf / R1 ;
A2 = - Rf / R2 ;
A3 = - Rf / R3 ;
A = A1 * A2 * A3 ;
Vo = A * Vi ; // i n v o l t
disp ( Vo , Output v o l t a g e i n v o l t s i s : )
1
2
3
4
5
6
7
8
9
10
11
12
13
14
// Exa 1 . 1 6
clc ;
clear ;
close ;
// Given d a t a
R1 = 33; // i n k
R2 = 10; // i n k
R3 = 330; // i n k
V1 = 50mV s i n ( 1 0 0 0 t ) ;
V2 = 10mV s i n ( 3 0 0 0 t ) ;
Vo1 = R3 / R1 *50*10^ -3;
Vo2 = R3 / R2 *10*10^ -3;
// Vo= Vo1Vo2 ;
disp ( Output v o l t a g e i s + string ( - Vo1 ) + s i n ( 1 0 0 0 t
) + string ( - Vo2 ) + s i n ( 3 0 0 0 t ) )
// Exa 1 . 1 7
clc ;
clear ;
close ;
// Given d a t a
R1 =10; // i n kohm
R2 =150; // i n kohm
R3 =10; // i n kohm
R4 =300; // i n kohm
V1 = 1; // i n V
V2 = 2; // i n V
Vo = [(1+ R4 / R2 ) *( R3 * V1 /( R1 + R3 ) ) -( R4 / R2 ) * V2 ];
disp ( Vo , Output v o l t a g e i n v o l t s i s : )
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
// Exa 1 . 1 8
clc ;
clear ;
close ;
// Given d a t a
R1 =12; // i n kohm
Rf =360; // i n kohm
V1 = -0.3; // i n V
Vo = (1+ Rf / R1 ) * V1 ; // i n V
disp ( Vo , Output v o l t a g e r e s u l t i n v o l t s i s : )
// P a r t ( b )
Vo = 2.4; // i n V
// We know , Vo= (1+ Rf /R1 ) V1
V1 = Vo /(1+ Rf / R1 ) ;
disp ( V1 *10^3 , I n p u t v o l t a g e i n mV t o r e s u l t i n an
output of 2. 4 Volt i s )
1
2
3
4
5
6
7
8
9
10
11
12
13
19
// Exa 1 . 2 0
clc ;
clear ;
close ;
// Given d a t a
Rf =100; // i n kohm
R1 =20; // i n kohm
V1 = 1.5; // i n V
Vo1 = V1 ;
Vo = - Rf / R1 * Vo1 ; // i n v o l t s
disp ( Vo , Output v o l t a g e i n v o l t s i s : )
// Exa 1 . 2 2
clc ;
clear ;
close ;
// Given d a t a
vo = -10; // i n V
i_f = 1; // i n mA
i_f = i_f *10^ -3; // i n A
// Formula vo= i f Rf
Rf = - vo / i_f ; // i n
// The o u t p u t v o l t a g e , vo= (v1 +5 v2 )
// vo= Rf /R1 v1 Rf /R2 v2 ;
// Comparing e q u a t i o n s ( i ) and ( 2 )
R1 = Rf /1; // i n
R2 = Rf /5; // i n
20
(i)
( ii )
16
17
18
k
k
k
i s : )
i s : )
i s : )
// Exa 1 . 2 4
clc ;
clear ;
close ;
// Given d a t a
R1 = 9; // i n k
R2 = 1; // i n k
R3 = 2; // i n k
R4 = 3; // i n k
// The o u t p u t v o l t a g e , vo1= (1+R1/R2 ) va
vo1BYva = (1+ R1 / R2 ) ; //
(i)
// V o l t a g e a t node va= R4 v1 / ( R3+R4 )
vaBYv1 = R4 /( R3 + R4 ) ; //
( ii )
// From ( i ) and ( i i )
vo1BYv1 = vo1BYva * vaBYv1 ; //
( iii )
// The o u t p u t v o l t a g e , vo2= (1+R1/R2 ) va
vo2BYva = (1+ R1 / R2 ) ; //
( iv )
// V o l t a g e a t node va= R3 v2 / ( R3+R4 )
vaBYv2 = R3 /( R3 + R4 ) ; //
(v)
// From ( i ) and ( i i )
vo2BYv2 = vo2BYva * vaBYv2 ; //
( iii )
// T o t a l o u t p u t vo= vo1 + vo2
disp ( T o t a l v o l t a g e i s + string ( vo1BYv1 ) + v1 + +
string ( vo2BYv2 ) + v2 )
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
// Exa 1 . 2 5
clc ;
clear ;
close ;
// Given d a t a
R1 = 9; // i n k
R2 = 1; // i n k
R3 = 2; // i n k
R4 = 3; // i n k
// The o u t p u t v o l t a g e , vo1= (1+R1/R2 ) va
vo1BYva = (1+ R1 / R2 ) ; //
(i)
// V o l t a g e a t node va= R4 v1 / ( R3+R4 )
vaBYv1 = R4 /( R3 + R4 ) ; //
( ii )
// From ( i ) and ( i i )
vo1BYv1 = vo1BYva * vaBYv1 ; //
( iii )
// The o u t p u t v o l t a g e , vo2= (1+R1/R2 ) va
vo2BYva = (1+ R1 / R2 ) ; //
( iv )
// V o l t a g e a t node va= R3 v2 / ( R3+R4 )
vaBYv2 = R3 /( R3 + R4 ) ; //
(v)
// From ( i ) and ( i i )
vo2BYv2 = vo2BYva * vaBYv2 ; //
( iii )
// The o u t p u t v o l t a g e , vo3= (R1/R2 ) v3
vo3BYv3 = ( - R1 / R2 ) ; //
(i)
// T o t a l o u t p u t vo= vo1 + vo2 + vo3
disp ( T o t a l v o l t a g e i s + string ( vo1BYv1 ) + v1 + +
string ( vo2BYv2 ) + v2 + string ( vo3BYv3 ) + v3 )
22
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
// o m e g a t= Ao omega b
// 2 %pi f t = Ao2 %pi f b
// f t = Ao f b
// P a r t ( i )
Ao1 = 10^5;
f_b1 = 10^2; // i n Hz
f_t1 = Ao1 * f_b1 ; // i n Hz
// P a r t ( i i )
Ao2 = 10^6;
f_t2 = 10^6; // i n Hz
f_b2 = f_t2 / Ao2 ; // i n Hz
// P a r t ( i i i )
f_b3 = 10^3; // i n Hz
f_t3 = 10^8; // i n Hz
Ao3 = f_t3 / f_b3 ;
// P a r t ( i v )
f_b4 = 10^ -1; // i n Hz
f_t4 = 10^6; // i n Hz
Ao4 = f_t4 / f_b4 ;
// P a r t ( v )
Ao5 = 2*10^5;
f_b5 = 10; // i n Hz
f_t5 = Ao5 * f_b5 ; // i n Hz
disp ( f_t1 , The v a l u e o f f t 1
disp ( f_b2 , The v a l u e o f f b 2
disp ( Ao3 , The v a l u e o f Ao3 i s
disp ( Ao4 , The v a l u e o f Ao4 i s
disp ( f_t5 , The v a l u e o f f t 5
23
in
in
:
:
in
Hz i s : )
Hz i s : )
)
)
Hz i s : )
5
6
7
8
9
10
11
12
13
14
15
16
17
18
// Given d a t a
Ao = 86; // i n dB
A = 40; // i n dB
f =100; // i n kHz
f = f *10^3; // i n Hz
// From 20 l o g ( S ) = 20 l o g ( Ao/A) , where S , s t a n d s
f o r s q r t (1+( f / f b ) 2 )
S = 10^(( Ao - A ) /20) ;
// S= s q r t (1+( f / f b ) 2 )
fb = f / sqrt ( S ^2 -1) ; // i n Hz
Ao = 10^( Ao /20) ;
ft = Ao * fb ; // i n Hz
disp ( Ao , The v a l u e o f Ao i s : )
disp ( fb , The v a l u e o f f b i n Hz i s : )
disp ( round ( ft *10^ -6) , The v a l u e o f f t i n MHz i s : )
loop
a m p l i f i e r i n kHz i s : )
f3dB = 0.1* f3dB ; // i n Hz
voBYvi = - R2byR1 / sqrt (1+(2* %pi * f3dB / omega_3dB ) ^2) ;
voBYvi = abs ( voBYvi ) ; // i n v / v
disp ( voBYvi , Gain i n v / v i s : )
24
25
Chapter 2
MOSFET
// Exa 2 . 1
clc ;
clear ;
close ;
// Given d a t a
V_S = 0; // As s o u r c e i s c o n n e c t e d t o
V_G = 1.5; // i n V
V_D = 0.5; // i n V
Vt = 0.7; // i n V
// P a r t ( a ) V D= 0 . 5 ; / / i n V
V_D = 0.5; // i n V
V_DS = V_D - V_S ; // i n V
V_GS = V_G - V_S ; // i n V
if V_GS < Vt then
disp ( At V D = 0 . 5 , t h e d e v i c e
r e g i o n )
elseif V_DS <= ( V_GS - Vt ) then
disp ( At V D = 0 . 5 , t h e d e v i c e
r e g i o n );
else
disp ( At V D = 0 . 5 , t h e d e v i c e
26
ground
i s in cut o f f
i s in triode
i s in saturation
r e g i o n );
20
21 end
22
23 // P a r t ( b ) V D= 0 . 9 ; / / i n V
24 V_D = 0.9; // i n V
25 V_DS = V_D - V_S ; // i n V
26 V_GS = V_G - V_S ; // i n V
27 if V_GS < Vt then
28
disp ( At V D = 0 . 9 , t h e d e v i c e
29
30
31
32
i s in cut o f f
r e g i o n )
elseif V_DS <= ( V_GS - Vt ) then
disp ( At V D = 0 . 9 , t h e d e v i c e i s i n t r i o d e
r e g i o n );
else
disp ( At V D = 0 . 9 , t h e d e v i c e i s i n s a t u r a t i o n
r e g i o n );
33
34 end
35
36 // P a r t ( c ) V D= 3 ; / / i n V
37 V_D = 3; // i n V
38 V_DS = V_D - V_S ; // i n V
39 V_GS = V_G - V_S ; // i n V
40 if V_GS < Vt then
41
disp ( At V D = 3 , t h e d e v i c e
i s in cut o f f
r e g i o n )
elseif V_DS <= ( V_GS - Vt ) then
disp ( At V D = 3 , t h e d e v i c e i s i n t r i o d e
r e g i o n );
44 else
45
disp ( At V D = 3 , t h e d e v i c e i s i n s a t u r a t i o n
r e g i o n );
42
43
46
47 end
27
19
20
21
22
23
24
25
26
27
// Exa 2 . 2
clc ;
clear ;
close ;
// Given d a t a
unCox = 100; // i n
A /V2
unCox = unCox *10^ -6; // i n A/V2
L = 1; // i n
m
L = L *10^ -6; // i n m
W =10; // i n
m
W = W *10^ -6; // i n m
V_GS = 1.5; // i n V
Vt = 0.7; // i n V
// For V DS= 0 . 5 V
V_DS = 0.5; // i n V
if V_DS <= ( V_GS - Vt ) then
I_D = unCox * W / L *[( V_GS - Vt ) * V_DS - V_DS ^2/2];
disp ( I_D *10^6 , The d e v i c e i s i n t r i o d e r e g i o n .
SO t h e d r a i n c u r r e n t i n t h e t r i o d e r e g i o n i n
A i s : )
else
I_D = unCox * W /(2* L ) *( V_GS - VT ) ^2
disp ( I_D *10^6 , The d e v i c e i s i n s a t u r a t i o n
r e g i o n . SO t h e d r a i n c u r r e n t i n t h e
saturation region in
A i s : )
end
// For V DS= 0 . 9 V
V_DS = 0.9; // i n V
if V_DS <= ( V_GS - Vt ) then
I_D = unCox * W / L *[( V_GS - Vt ) * V_DS - V_DS ^2/2];
disp ( I_D *10^6 , The d e v i c e i s i n t r i o d e r e g i o n .
So t h e d r a i n c u r r e n t i n t h e t r i o d e r e g i o n i n
28
A
28
29
30
i s : )
else
I_D = unCox * W /(2* L ) *( V_GS - Vt ) ^2
disp ( I_D *10^6 , The d e v i c e i s i n s a t u r a t i o n
r e g i o n . So d r a i n c u r r e n t i n t h e s a t u r a t i o n
region in
A i s : )
31 end
// Exa 2 . 4
clc ;
clear ;
close ;
// Given d a t a
I_D = 0.4; // i n mA
I_D = I_D *10^ -3; // i n A
Vt = 0.7; // i n V
V_SS = -2.5; // i n V
V_DD = 2.5; // i n V
unCox = 100; // i n
A /V2
unCox = unCox *10^ -6; // i n A/V2
W = 32; // i n m
L = 1; // i n m
// V GSVt= V OV
// I D= unCox W/ ( 2 L ) (V OV) 2
V_OV = sqrt ( I_D /( unCox * W /(2* L ) ) ) ; // i n V
V_GS = V_OV + Vt ; // i n V
disp ( V_GS , The v a l u e o f V GS i n v o l t i s : )
V_G = 0;
// Formula V GS= V GV S
V_S = V_G - V_GS ; // i n V
R_S = ( V_S - V_SS ) / I_D // i n
disp ( R_S *10^ -3 , The v a l u e o f R S i n k
i s : )
V_D = 0.5; // i n V
29
i s : )
// Exa 2 . 5
clc ;
clear ;
close ;
// Given d a t a
V_DD = 3; // i n V
I_D = 80; // i n
A
I_D = I_D *10^ -6; // i n A
Vt = 0.6; // i n V
unCox = 200; // i n
A /V2
unCox = unCox *10^ -6; // i n A/V2
L = 0.8; // i n
m
L = L *10^ -6; // i n m
W =4; // i n
m
W = W *10^ -6; // i n m
// V GSVt= V OV
// I D= unCox W/ ( 2 L ) (V OV) 2
V_OV = sqrt ( I_D /( unCox * W /(2* L ) ) ) ; // i n V
V_GS = V_OV + Vt ; // i n V
V_D = 1; // i n V
V_G = V_D ; // i n V
R = ( V_DD - V_D ) / I_D ; // i n
disp ( R *10^ -3 , The v a l u e o f R i n k
i s : )
30
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
clear ;
close ;
// Given d a t a
V_DD = 10; // i n V
I_D = 0.4; // i n mA
I_D = I_D *10^ -3; // i n A
Vt = 2; // i n V
unCox = 20; // i n
A /V2
unCox = unCox *10^ -6; // i n A/V2
L = 10; // i n
m
L = L *10^ -6; // i n m
W =100; // i n
m
W = W *10^ -6; // i n m
V_S = 0; // i n V a s s o u r c e i s c o n n e c t e d t o g r o u n d
// I D= unCox W/ ( 2 L ) (V OV) 2
V_OV = sqrt ( I_D /( unCox * W /(2* L ) ) ) ; // i n V
V_GS = V_OV + Vt ; // i n V
V_D = V_GS ; // i n V
R = ( V_DD - V_D ) / I_D ; // i n
disp ( R *10^ -3 , The v a l u e o f R i n k
i s : )
Scilab code Exa 2.7 Effective resistance between drain and source
1 // Exa 2 . 7
2 clc ;
3 clear ;
4 close ;
5 // Given d a t a
6 KnWbyL = 1; // i n mA
7 KnWbyL = KnWbyL *10^ -3; // i n A
8 Vt = 1; // i n V
9 V_DS = 0.1; // i n V
10 V_D = V_DS ; // i n V
11 V_GS = 5; // i n V
12 V_DD = V_GS ; // i n V
31
: )
// Exa 2 . 8
clc ;
clear ;
close ;
// Given d a t a
KnWbyL = 1; // i n mA/V2
KnWbyL = KnWbyL *10^ -3; // i n A/V2
Vt = 1; // i n V
V_DD = 10; // i n V
R_D = 6; // i n k
R_D = R_D *10^3; // i n
R_S = 6; // i n k
R_S = R_S *10^3; // i n
R_G1 = 10; // i n M
R_G1 = R_G1 *10^6; // i n
R_G2 = 10; // i n M
R_G2 = R_G2 *10^6; // i n
V_G = V_DD * R_G2 /( R_G1 + R_G2 ) ; // i n V
// V S= R S I D
// V GS= V GV S= V GR S I D
// Formula I D= KnW/2L ( V GSVt ) 2 , P u t t i n g t h e
v a l u e o f V GS , We g e t
// 18 I D 2 25 I D +8= 0
// I D= 0 . 8 9 mA o r I D= 0 . 5
I_D = 0.5; // i n mA
I_D = I_D *10^ -3; // i n A
V_S = R_S * I_D ; // i n V
32
is
operating in saturation
, a s i n i t i a l l y assumed )
// Exa 2 . 9
clc ;
clear ;
close ;
// Given d a t a
R_D = 20; // i n k
R_D = R_D *10^3; // i n
R1 = 30; // i n k
R1 = R1 *10^3; // i n
R2 = 20; // i n k
R2 = R2 *10^3; // i n
V_DD = 5; // i n V
Vtn = 1; // i n V
Kn = 0.1; // i n mA/V2
Kn = Kn *10^ -3; // i n A/V2
V_GS = R2 * V_DD /( R1 + R2 ) ; // i n V
// I D= 1 /2 n C o x W/L ( V GSVtm) 2
I_D = Kn *( V_GS - Vtn ) ^2 ; // i n mA ( As Kn= 1/2 n C o x
W/L )
V_DS = V_DD - I_D * R_D ; // i n V
disp ( V_GS , The v a l u e o f V GS i n v o l t i s : )
disp ( I_D *10^3 , The v a l u e o f I D i n mA i s : )
disp ( V_DS , The v a l u e o f V DS i n v o l t i s : )
disp ( S i n c e V DS = 3V > V DS ( s a t ) = V GSVtn = 2 1
33
V, t h e t r a n s i s t o r i s i n d e e d b i a s e d i n t h e
s a t u r a t i o n r e g i o n )
// Exa 2 . 1 0
clc ;
clear ;
close ;
// Given d a t a
V_DD = 15; // i n V
Vt = 1; // i n V
V_D = 10; // i n V
V_S = 5; // i n V
KnWbyL = 1; // i n mA/V2
KnWbyL = KnWbyL *10^ -3; // i n A/V2
R_G1 = 8; // i n M
R_G1 = R_G1 *10^6; // i n
I_D = 0.5; // i n mA
I_D = I_D *10^ -3; // i n A
R_D = ( V_DD - V_D ) / I_D ; // i n
R_S = V_S / I_D ; // i n
// Formul I D= 1 /2 KnWbyL (V OV) 2
V_OV = sqrt (2* I_D / KnWbyL ) ; // i n V
// Formula V OV= V GSVt
V_GS = V_OV + Vt ; // i n V
V_G = V_GS + V_S ; // i n V
// Formul V G= R G2V DD/ ( R G1+R G2 )
R_G2 = R_G1 * V_G /( V_DD - V_G ) ; // i n
disp ( R_D *10^ -3 , The v a l u e o f R D i n k
is
disp ( R_S *10^ -3 , The v a l u e o f R S i n k
is
disp ( V_OV , The v a l u e o f V OV i n v o l t s i s :
disp ( V_GS , The v a l u e o f V GS i n v o l t s i s
disp ( R_G2 *10^ -6 , The v a l u e o f R G2 i n M
34
: )
: )
)
: )
i s : )
27
28
29
// Exa 2 . 1 1
clc ;
clear ;
close ;
// Given d a t a
V_DD = 15; // i n V
KnWbyL = 0.25; // i n mA/V2
KnWbyL = KnWbyL *10^ -3; // i n A/V2
Vt = 1.5; // i n V
V_A = 50; // i n V
R_D = 10; // i n k
R_D = R_D *10^3; // i n
R_L = 10; // i n k
R_L = R_L *10^3; // i n
R_G = 10; // i n M
R_G = R_G *10^6; // i n
// I D= 1 /2 KnWbyL ( V DVt ) 2 , ( V GS= V D , a s dc
gate current i s zero )
(i)
// V D= V DD I D R D
( ii )
I_D = 1.06; // i n mA
I_D = I_D *10^ -3; // i n A
V_D = V_DD - I_D * R_D ; // i n V
V_GS = V_D ; // i n V
// The c o o r d i n a t e s o f o p e r a t i n g p o i n t
V_GSQ = V_D ; // i n V
I_DQ = I_D *10^3; // i n mA
disp ( The c o o r d i n a t e s o f o p e r a t i n g p o i n t s a r e V GSQ
= + string ( V_GSQ ) + V and I DQ= + string ( I_DQ ) +
mA )
gm = KnWbyL *( V_GS - Vt ) ; // i n A/V
r_o = V_A / I_D ; // i n
// The g a i n i s : Av= vo / v i = gm ( R D | | R L | | r o )
35
36
37
38
39
40
41
i n V/V
// i i = ( v i vo ) /R G
// i i = v i /R G(1 vo / v i ) and Rin= v i / i i = R G/(1 Av
)
Rin = R_G /(1 - Av ) ; // i n
disp ( Rin *10^ -6 , The i n p u t r e s i s t a n c e i n M
i s : )
disp ( The l a r g e s t a l l o w a b l e i n p u t s i g n a l v i i s
d e t e r m i n e d by t h e n e e d t o k e e p t h e MOSFET i n
s a t u r a t i o n at a l l times )
disp (
V DS >= V GS
vt )
disp ( By e n f o r c i n g t h i s c o n d i t i o n w i t h e q u a l i t y a t
t h e p o i n t V GS i s maximum and V DS i s
c o r r e s p o n d i n g l y minimum )
disp (
V DSmin=
V GSmax Vt )
disp (
V DS|Av | v i
= V GS + v i Vt )
disp (
4.4 3.3 vi
= 4 . 4 + v i 1.5 )
disp ( which r e s u l t s i n v i= 0 . 3 4V )
// Exa 2 . 1 2
clc ;
clear ;
close ;
// Given d a t a
I_D = 0.5; // i n mA
I_D = I_D *10^ -3; // i n mA
V_D = 3; // i n V
Vt = -1; // i n V
KpWbyL = 1; // i n mA/V2
36
w h i l e m a i n t a i n i n g s a t u r a t i o n r e g i o n o p e r a t i o n i n
k
i s : )
s h o u l d be ( i n v o l t ) )
// For V GS= 1 . 5 ; / / V
// W2= 2W1;
// r DS1 / r DS2= 2
r_DS2 = r_DS1 /2; // i n
37
Scilab code Exa 2.15 Required value of VGS and minimum value of VDS
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
// Exa 2 . 1 5
clc ;
clear ;
close ;
// Given d a t a
I_D = 0.2; // i n mA
I_D = I_D *10^ -3; // i n mA
Vt = 1; // i n V
KpWbyL = 0.1; // i n mA/V2
KpWbyL = KpWbyL *10^ -3; // i n A/V2
// Formul I D= 1 /2 KpWbyL ( V GSVT) 2
V_GS = sqrt (2* I_D / KpWbyL ) + Vt ; // i n V
V_DSmin = V_GS - Vt ; // i n V
disp ( V_GS , R e q u i r e d V GS i n v o l t s i s : )
disp ( V_DSmin , The minimum r e q u i r e d V DS i n v o l t s i s
: )
// For I D= 0 . 8 mA
I_D = 0.8*10^ -3; // i n A
V_GS = sqrt (2* I_D / KpWbyL ) + Vt ; // i n V
V_DSmin = V_GS - Vt ; // i n V
disp ( V_GS , R e q u i r e d V GS i n v o l t s i s : )
disp ( V_DSmin , The minimum r e q u i r e d V DS i n v o l t s i s
: )
38
// Exa 2 . 1 6
clc ;
clear ;
close ;
// Given d a t a
V_SS = -5; // i n V
unCox = 60; // i n
A /V2
unCox = unCox *10^ -6; // i n A/V2
Vt = 1; // i n V
W = 100; // i n
m
L = 3; // i n
m
V_G =0; // i n V
V_DD = 5; // i n V
V_D =0; // i n V
I_D = 1*10^ -3; // i n A
// I D= (V DDV D ) /R D
R_D = ( V_DD - V_D ) / I_D ; // i n
disp ( R_D *10^ -3 , The v a l u e o f R D i n k
i s : )
// Formul I D= 1 /2 unCox W/L ( V GSVt ) 2
V_GS = sqrt (2* I_D * L /( unCox * W ) ) + Vt ; // i n V
V_S = V_G - V_GS ; // i n V
R_S = ( V_S - V_SS ) / I_D ; // i n
disp ( R_S *10^ -3 , The r e s i s t a n c e i n k
i s );
39
8 upCox = 60; // i n
A /V2
9 upCox = upCox *10^ -6; // i n A/V2
10 L = 0.8; // i n
m
11 V_GS = -1.5; // i n V
12 Vt = 0.7; // i n V
13 R = V_D / I_D ; // i n
14 disp ( R *10^ -3 , The v a l u e r e q u i r e d
for R in k
is :
)
15 // Formul I D= 1 /2 upCox W/L ( V GSVt ) 2
16 W = 2* I_D * L /( upCox *( V_GS - Vt ) ^2)
17 disp (W , The v a l u e r e q u i r e d f o r W i n
m i s : )
18
19
//
Note :
Calculation of evaluating the value of W
i n t h e book i s wrong , s o t h e Answer o f t h e book
i s wrong
// Exa 2 . 1 8
clc ;
clear ;
close ;
// Given d a t a
Vt = 1; // i n V
unCox = 120; // i n
A /V2
unCox = unCox *10^ -6; // i n A/V2
L1 =1; // i n
m
L2 = L1 ; // i n
m
I_D = 120; // i n
A
I_D = I_D *10^ -6; // i n A
V_GS1 = 1.5; // i n V
V_G2 = 3.5; // i n V
V_S2 = 1.5; // i n V
V_DD = 5; // i n V
V_D2 = 3.5; // i n V
40
// Exa 2 . 1 9
clc ;
clear ;
close ;
// Given d a t a
Vt = 2; // i n V
K1WbyL = 1; // i n mA/V2
K1WbyL = K1WbyL *10^ -3; // i n mA/V2
I_D = 10; // i n
A
I_D = I_D *10^ -6; // i n A
V_DD = 10; // i n V
R_D = 4; // i n k
R_D = R_D *10^3; // i n
// Formul I D= 1 /2 K1WbyL ( V GSVt ) 2
V_GS = sqrt (2* I_D / K1WbyL ) + Vt ; // i n V
V1 = - V_GS ; // i n V
// P a r t ( b )
I_D = 2; // i n mA
I_D = I_D *10^ -3; // i n A
V2 = V_DD - I_D * R_D ; // i n V
// Formul I D= 1 /2 K1WbyL ( V GSVt ) 2
V_GS = sqrt (2* I_D / K1WbyL ) + Vt ; // i n V
41
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
V3 = - V_GS ; // i n V
// P a r t ( c )
I_D = 1; // i n mA
I_D = I_D *10^ -3; // i n A
// Formul I D= 1 /2 K1WbyL ( V GSVt ) 2
V_GS = sqrt (2* I_D / K1WbyL ) + Vt ; // i n V
V4 = V_GS ; // i n V
// P a r t ( d )
I_D = 2; // i n mA
R_D = 2.5; // i n k
R_D = R_D *10^3; // i n
V_SS = 10; // i n V
I_D = I_D *10^ -3; // i n A
V_GS = sqrt (2* I_D / K1WbyL ) + Vt ; // i n V
V5 = - V_SS + I_D * R_D ; // i n V
disp ( V1 , The v a l u e o f V1 i n v o l t s i s :
disp ( V2 , The v a l u e o f V2 i n v o l t s i s :
disp ( V3 , The v a l u e o f V3 i n v o l t s i s :
disp ( V4 , The v a l u e o f V4 i n v o l t s i s :
disp ( V5 , The v a l u e o f V5 i n v o l t s i s :
// Exa 2 . 2 0
clc ;
clear ;
close ;
// Given d a t a
unCox = 20*10^ -6; // i n A/V2
upCox = unCox /2.5; // i n A/V2
V_DD = 3; // i n V
Vt = 1; // i n V
W = 30; // i n
m
L = 10; // i n
m
42
)
)
)
)
)
13
14 // V GS1= V GS2
15 // Formula V DD= V GS1+V GS2
16 V_GS1 = V_DD /2; // i n V
17 V_GS2 = V_GS1 ; // i n V
18 V2 = V_GS1 ; // inV
19 I1 = 1/2* unCox * W / L *( V_GS1 - Vt ) ^2; // i n A
20 // Both t r a n s i s t o r have V D = V G and t h e r e f o r e
21
22
23
24
25
26
27
they
// Exa 2 . 2 2
clc ;
clear ;
close ;
// Given d a t a
Vt = 0.9; // i n V
V_A = 50; // i n V
V_D = 2; // i n V
R_L = 10; // i n M
R_L = R_L *10^3; // i n
R_G = 10; // i n M
R_G = R_G *10^6; // i n
I_D = 500; // i n
A
I_D = I_D *10^ -6; // i n A
43
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
V_GS = V_D ; // i n V
ro = V_A / I_D ; // i n
gm = 2* I_D /( V_GS - Vt ) ; // i n A/V
// vo= gm v i ( r o | | R L )
vo_by_vi = - gm *( ro * R_L /( ro + R_L ) ) ; // i n V/V
disp ( vo_by_vi , The v o l t a g e g a i n i n V/V i s : )
// For I= 1 mA o r t w i c e t h e c u r r e n t
I_D1 = I_D ; // i n A
I_D2 = 2* I_D1 ; // i n A
gm1 = gm ; // i n A/V
// E f f e c t on V D
// I D 1 / I D 2 = ( V GS1Vt ) 2 / ( V GS2Vt ) 2
V_GS1 = V_GS ;
V_GS2 = Vt + sqrt (2) *( V_GS1 - Vt ) ; // i n V
disp ( V_GS2 , The new v a l u e o f V GS i n v o l t s i s : )
// E f f e c t on gm
// gm1/gm2= s q r t ( I D 1 / I D 2 )
gm2 = sqrt ( I_D2 / I_D1 ) * gm1 ; // i n A/V
disp ( gm2 *10^3 , The new v a l u e o f gm2 i n mA/V i s : )
// E f f e c t on r o
// r o 1 / r o 2= I D 2 / I D 1
ro1 = ro ; // i n
ro2 = I_D1 * ro1 / I_D2 ; // i n
disp ( ro2 *10^ -3 , The new v a l u e o f r o i n k /V i s : )
// E f f e c t on g a i n
// Av= gm ( r o 2 | | R L )
Av = - gm *( ro2 * R_L /( ro2 + R_L ) ) ; // i n V/V
disp ( Av , The new v a l u e o f v o l t a g e g a i n i n V/V i s :
)
43
44
v a l u e w i l l be same a s i n t h e book
// Exa 2 . 2 3
clc ;
clear ;
close ;
// Given d a t a
I_D = 1; // i n mA
I_D = I_D *10^ -3; // i n A
gm = 1; // i n mA/V
gm = gm *10^ -3; // i n A/V
f_L = 10; // i n Hz
R_S = 6; // i n k
R_S = R_S *10^3; // i n
R_D = 10; // i n k
R_D = R_D *10^3; // i n
vo_by_vi = - gm * R_D /(1+ gm * R_S ) ; // i n V/V
disp ( vo_by_vi , Mid band g a i n i n V/V i s : ) ;
// Formula f L= 1 / ( 2 %pi ( 1 /gm | | R S ) ) CS
CS = 1/(2* %pi *(1/ gm * R_S /(1/ gm + R_S ) ) * f_L ) ; // i n F
disp ( CS *10^6 , The v a l u e o f Cs i n
F i s : )
45
R_G = 4.7; // i n M
R_G = R_G *10^6; // i n
R_D = 15; // i n k
R_D = R_D *10^3; // i n
R_L = R_D ; // i n
gm = 1; // i n mA/V
gm = gm *10^ -3; // i n A/V
ro =150; // i n k
ro = ro *10^3; // i n
Cgs = 1; // i n pF
Cgs = Cgs *10^ -12; // i n F
Cgd = 0.4; // i n pF
Cgd = Cgd *10^ -12; // i n F
vgsBYvsig = R_G /( Rsig + R_G ) ;
Rdesh_L = R_D * R_L /( R_D + R_L ) ; // i n
voBYvgs = - gm * Rdesh_L ;
Av = voBYvgs / vgsBYvsig ; // i n V/V
disp ( Av , The Midband g a i n i n V/V i s : )
CM = Cgd *(1+ gm * Rdesh_L ) ; // i n F
// f H= 1 / ( 2 %pi ( R s i g | | R G ) ( Cgs CM) )
f_H = 1/(2* %pi *( Rsig * R_G /( Rsig + R_G ) ) *( Cgs + CM ) ) ; //
i n Hz
29 disp ( f_H *10^ -3 , F r e q u e n c y i n kHz i s : )
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
46
Chapter 3
Bipolar Junction Transistors
// Exa 3 . 1
clc ;
clear ;
close ;
// Given d a t a
V_E = -0.7; // i n V
Bita =50;
RC = 5; // i n k
RE = 10; // i n k
RE = RE *10^3; // i n
RC = RC *10^3; // i n
V_CC = 10; // i n V
V_BE = -10; // i n v o l t
I_E = ( V_E - V_BE ) / RE ; // i n A
disp ( I_E *10^3 , E m i t t e r c u r r e n t i n mA i s : )
// I E= I B+I C and I C= B i t a I B , s o
I_B = I_E /(1+ Bita ) ; // i n A
disp ( I_B *10^6 , Base c u r r e n t i n
A i s : )
I_C = I_E - I_B ; // i n A
disp ( I_C *10^3 , C o l l e c t o r c u r r e n t i n mA i s : )
V_C = V_CC - I_C * RC ; // i n V
47
22
// Exa 3 . 2
clc ;
clear ;
close ;
// Given d a t a
V_E = 1.7; // i n V
V_B = 1; // i n V
RC = 5; // i n k
RE = 5; // i n k
RE = RE *10^3; // i n
RC = RC *10^3; // i n
RB = 100; // i n k \
RB = RB *10^3; // i n
V_CC = 10; // i n V
V_BE = -10; // i n v o l t
I_E = ( V_CC - V_E ) / RE ; // i n A
I_B = V_B / RB ; // i n V
// Formula I B= (1 a l p h a ) I E
alpha = 1 - I_B / I_E ;
disp ( alpha , V a l u e o f a l p h a i s : )
bita = alpha /(1 - alpha ) ;
disp ( bita , V a l u e o f b i t a i s : )
V_C = ( I_E - I_B ) * RC - V_CC ; // i n v o l t
disp ( V_C , C o l l e c t o r v o l t a g e i n v o l t s i s : )
48
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
clear ;
close ;
// Given d a t a
V_CC = 10; // i n V
V_CE = 3.2; // i n V
RC = 6.8; // i n k
RC = RC *10^3; // i n
I_S = 1*10^ -15; // i n A
V_T = 25*10^ -3; // i n V
I_C1 = ( V_CC - V_CE ) / RC ; // i n A
// Formula I C= I S %e ( V BE1/V T )
V_BE1 = V_T * log ( I_C1 / I_S ) ; // i n v o l t
disp ( I_C1 *10^3 , C o l l e c t o r c u r r e n t i n mA i s : )
disp ( V_BE1 , V a l u e o f V BE i n v o l t s i s : )
// P a r t ( b )
v_in = 5*10^ -3; // i n V
Av = -( V_CC - V_CE ) / V_T ; // i n V/V
disp ( Av , V o l t a g e g a i n i n V/V i s : )
v_o = abs ( Av ) * v_in ; // i n V
disp ( v_o , Change i n o u t p u t v o l t a g e i n v o l t s i s : )
// P a r t ( c ) f o r V CE= 0 . 3 V
V_CE = 0.3; // i n V
I_C2 = ( V_CC - V_CE ) / RC ; // i n A
(i)
// I C 1= I S %e ( V BE1/V T )
// I C 2= I S %e ( V BE2/V T )
( ii )
// d i v i d e t h e e q u a t i o n ( i i ) by ( i )
delta_V_BE = V_T * log ( I_C2 / I_C1 ) ; // i n v o l t
( where
d e l t a V B E = V BE2V BE1 )
32 disp ( delta_V_BE *10^3 , The p o s i t i v e i n c r e a m e n t i n
V BE i n mV i s : )
33
34 // P a r t ( d )
35 v_o = 0.99* V_CC ; // i n V
36 I_C3 = ( V_CC - v_o ) / RC ; // i n A
37 delta_V_BE = V_T * log ( I_C3 / I_C1 ) ; // i n V
38 disp ( delta_V_BE *10^3 , The n e g a t i v e i n c r e a m e n t i n
49
V BE i n mV i s : )
// Exa 3 . 4
clc ;
clear ;
close ;
// Given d a t a
V_CC = 10; // i n V
V_CE = 5; // i n V
V_BE = 0.7; // i n V
I_C = 5*10^ -3; // i n mA
bita = 100;
R_C = ( V_CC - V_CE ) / I_C ; // i n
I_B = I_C / bita ; // i n A
R_B = ( V_CC - V_BE ) / I_B ; // i n
disp ( R_C *10^ -3 , The v a l u e o f R C i n k
A
disp ( I_B *10^6 , The v a l u e o f I B i n
disp ( R_B *10^ -3 , The v a l u e o f R B i n k
i s : )
i s : )
i s : )
50
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
R_C = 2; // i n k
R_C = R_C *10^3; // i n
R_B = 530; // i n k
R_B = R_B *10^3; // i n
// when I C =0
I_C =0;
V_CE = V_CC - I_C * R_C ; // i n v o l t
V_CE = 0:0.1:6; // i n V o l t
I_C = ( V_CC - V_CE ) / R_C *1000; // i n mA
plot ( V_CE , I_C ) ;
title ( DC l o a d l i n e )
xlabel ( V CE i n v o l t s )
ylabel ( I C i n mA )
disp ( DC l o a d l i n e shown i n f i g u r e )
// When V CE= 0
I_C = V_CC / R_C ; // i n A
// O p e r a t i n g p o i n t f o r s i l i c o n t r a n s i s t o r
V_BE = 0.7; // i n V
I_B = ( V_CC - V_BE ) / R_B ; // i n A
I_CQ = bita * I_B ; // i n A
V_CEQ = V_CC - I_CQ * R_C ; // i n v o l t
disp ( O p e r a t i n g p o i n t i s + string ( V_CEQ ) + V and +
string ( I_CQ *10^3) + mA )
51
10
11
12
13
14
15
16
17
18
19
20
21
22
23
1
2
3
4
5
6
7
8
9
10
11
12
13
14
52
// Exa 3 . 8
clc ;
clear ;
close ;
// Given d a t a
V_BE = 0.7; // i n V
V_CE = 3; // i n V
I_C = 1; // i n mA
I_C = I_C *10^ -3; // i n A
bita = 100;
I_B = I_C / bita ; // i n A
// V CE= V BE+V CB and V CB= I B R B
R_B = ( V_CE - V_BE ) / I_B ; // i n
disp ( R_B *10^ -3 , The v a l u e o f R B i n k
// Exa 3 . 9
clc ;
clear ;
close ;
// Given d a t a
R1 = 10; // i n k
R1 = R1 *10^3; // i n
R2 = 5; // i n k
R2 = R2 *10^3; // i n
53
i s : )
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
RC = 1; // i n k
RC = RC *10^3; // i n
RE = 2; // i n k
RE = RE *10^3; // i n
V_CC = 15; // i n V
V_BE = 0.7; // i n V
// When
I_C =0;
V_CE = V_CC - I_C *( RC + RE ) ; // i n V
// When V CE= 0
I_C = V_CC /( RC + RE ) ; // i n A
V_B = V_CC * R2 /( R1 + R2 ) ; // i n V
I_E = ( V_B - V_BE ) / RE ; // i n A
I_C = I_E ; // i n A ( a p p r o x )
I_CQ = I_C ; // i n A
V_CE = V_CC - I_C *( RC + RE ) ; // i n V
V_CEQ = V_CE ; // i n V
V_CE = 0:0.1:15; // i n V o l t
I_C = ( V_CC - V_CE ) /( RC + RE ) *1000; // i n mA
plot ( V_CE , I_C ) ;
title ( DC l o a d l i n e )
xlabel ( V CE i n v o l t s )
ylabel ( I C i n mA )
disp ( DC l o a d l i n e shown i n f i g u r e )
disp ( O p e r a t i n g p o i n t i s + string ( V_CEQ ) + V and +
string ( I_CQ *10^3) + mA )
54
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
V_BB = 3; // i n V
V_BE = 0.7; // i n V
V_T = 25*10^ -3; // i n V
bita =100;
RC = 3; // i n k
RC = RC *10^3; // i n
RB = 100; // i n k
RB = RB *10^3; // i n
I_B = ( V_BB - V_BE ) / RB ; // i n V
I_C = bita * I_B ; // i n A
V_C = V_CC - I_C * RC ; // i n V
gm = I_C / V_T ; // i n A/V
r_pi = bita / gm ; // i n
// v b e= r p i / (RB+ r p i ) v i
v_be_by_v_i = r_pi /( RB + r_pi ) ;
// v o= gm v b e RC
v_o_by_v_i = - gm * v_be_by_v_i * RC ; // i n V/V
Av = v_o_by_v_i ; // i n V/V
disp ( round ( Av ) , V o l t a g e g a i n i n V/V i s : )
// Exa 3 . 1 1
clc ;
clear ;
close ;
// Given d a t a
V_B = 4; // i n V
V_BE = 0.7; // i n V
V_CC = 10; // i n V
V_E = V_B - V_BE ; // i n V
R_E = 3.3; // i n k
R_E = R_E *10^3; // i n
RC = 4.7; // i n k
RC = RC *10^3; // i n
55
14
15
16
17
18
19
20
21
22
Scilab code Exa 3.12 All node voltage and all branch current
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
// Exa 3 . 1 2
clc ;
clear ;
close ;
// Given d a t a
V_B = 5; // i n V
V_BE = 0.7; // i n V
V_CC = 10; // i n V
bita =100;
R_B = 100; // i n k
R_C = 2; // i n k
R_B = R_B *10^3; // i n
R_C = R_C *10^3; // i n
I_B = ( V_B - V_BE ) / R_B ; // i n A
I_C = bita * I_B ; // i n A
V_C = V_CC - I_C * R_C ; // i n V
I_E = I_C ; // i n A ( a p p r o x )
disp ( I_B *10^3 , The v a l u e o f I
disp ( I_C *10^3 , The v a l u e o f I
disp ( V_C , The v a l u e o f V C i n
disp ( I_E *10^3 , The v a l u e o f I
56
B i n mA i s
C i n mA i s
volts is :
E i n mAis
: )
: )
)
: )
Scilab code Exa 3.13 All node voltage and all branch current
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
// Exa 3 . 1 3
clc ;
clear ;
close ;
// Given d a t a
V_B = 0; // i n V
V_EB = 0.7; // i n V
bita =100;
V_EC = 0.2; // i n V
V_E = V_EB + V_B ; // i n V
V_CC = 5; // i n V
R_C = 1; // i n k
R_C = R_C *10^3; // i n
R_B = 10; // i n k
R_B = R_B *10^3; // i n
(i)
// V E= V B+V EB
// V C= V EV EC= V B+V EBV EC
( ii )
( iii
// I E= ( V CCV E ) /R C= ( V CCV BV EB ) /R C
)
// I B= V B/R B
( iv )
// I C= ( V C+V CC ) /R C= ( V B+V EBV EC+V CC ) /R B
(v)
// By u s i n g r e l a t i o n s h i p , I E= I B+I C
V_B = (9* V_CC -11* V_EB + V_EC ) /12; // i n V
V_E = V_B + V_EB ; // i n V
V_C = V_B + V_EB - V_EC ; // i n V
I_E = ( V_CC - V_B - V_EB ) / R_C // i n amp
I_C = ( V_B + V_EB - V_EC + V_CC ) / R_B ; // i n amp
I_B = V_B / R_B ; // i n amp
disp ( V_B , The v a l u e o f V B i n v o l t s i s : )
disp ( V_E , The v a l u e o f V E i n v o l t s i s : )
disp ( V_C , The v a l u e o f V C i n v o l t s i s : )
57
31
32
33
// Exa 3 . 1 4
clc ;
clear ;
close ;
// Given d a t a
bita =100;
hFE = 100;
VCEsat = 0.2; // i n V
VBEsat = 0.8; // i n V
VBEactive = 0.7; // i n V
VBB = 5; // i n V
VCC = 10; // i n V
R_C = 3; // i n k
R_C = R_C *10^3; // i n
R_B = 50; // i n k
R_B = R_B *10^3; // i n
// Formula VCC= I C s a t R C+VCEsat
ICsat = ( VCC - VCEsat ) / R_C ; //A
disp ( ICsat *10^3 , The v a l u e o f IC ( s a t ) i n mA i s : )
IBmin = ICsat / bita ; // i n A
// Apply KVL t o i n p u t c i r c u i t , VBB= IB R B+VBEsat
IB = ( VBB - VBEsat ) / R_B ; // i n A
disp ( IB *10^6 , A c t u a l b a s e c u r r e n t i n
A i s : )
// Exa 3 . 1 6
58
2 clc ;
3 clear ;
4 close ;
5 // Given d a t a
6 // b i t a= a l p h a /(1 a l p h a )
7 // At a l p h a= 0 . 5
8 alpha = 0.5;
9 bita =
alpha /(1 - alpha ) ;
10 disp ( bita , At a l p h a = 0 . 5 , t h e v a l u e o f b i t a i s : )
11 // At a l p h a= 0 . 9
12 alpha = 0.9;
13 bita = alpha /(1 - alpha ) ;
14 disp ( bita , At a l p h a = 0 . 9 , t h e v a l u e o f b i t a i s : )
15 // At a l p h a= 0 . 5
16 alpha = 0.999;
17 bita = alpha /(1 - alpha ) ;
18 disp ( bita , At a l p h a = 0 . 9 9 9 , t h e v a l u e o f b i t a i s : )
59
i s : )
i s : )
16
17
18
19
20
21
22
bita =100;
alpha = bita /(1+ bita ) ;
disp ( alpha , At b i t a =100 , t h e v a l u e o f a l p h a i s : )
// At b i t a= 200
bita =200;
alpha = bita /(1+ bita ) ;
disp ( alpha , At b i t a =200 , t h e v a l u e o f a l p h a i s : )
// Exa 3 . 1 8
clc ;
clear ;
close ;
// Given d a t a
VBE = 0.76; // i n V
VT = 0.025; // i n V
I_C = 10*10^ -3; // i n A
// Formula I C= I S %e (VBE/VT)
I_S = I_C /( %e ^( VBE / VT ) ) ; // i n A
disp ( I_S , The v a l u e o f I S i n amp i s : )
// P a r t ( a ) f o r VBE = 0 . 7 V
VBE = 0.7; // i n V
I_C = I_S * %e ^( VBE / VT )
disp ( I_C *10^3 , For VBE = 0 . 7 V , The v a l u e o f I C i n
mA i s : )
16
17 // P a r t ( b ) f o r I C= 10
A
18 I_C = 10*10^ -6; // i n A
19 // Formula I C= I S %e (VBE/VT)
20 VBE = VT * log ( I_C / I_S ) ;
21 disp ( VBE , For I C = 10
A , The v a l u e o f VBE i n V i s
: )
60
// Exa 3 . 1 9
clc ;
clear ;
close ;
// Given d a t a
VBE = 0.7; // i n V
VT = 0.025; // i n V
I_B = 100; // i n
A
I_B = I_B *10^ -6; // i n A
I_C = 10*10^ -3; // i n A
// Formula I C= I S %e (VBE/VT)
I_S = I_C /( %e ^( VBE / VT ) ) ; // i n A
alpha = I_C /( I_C + I_B ) ;
bita = I_C / I_B ;
IS_by_alpha = I_S / alpha ; // i n A
IS_by_bita = I_S / bita ; // i n A
disp ( alpha , The v a l u e o f a l p h a i s : ) ;
disp ( bita , The v a l u e o f b i t a i s : ) ;
disp ( IS_by_alpha , The v a l u e o f I s / a l p h a i n A i s : ) ;
disp ( IS_by_bita , The v a l u e o f I s / b i t a i n A i s : ) ;
61
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
R_C = 10; // i n k
R_C = R_C *10^3; // i n
R_B = 10; // i n k
R_B = R_B *10^3; // i n
I1 = ( VCC - VBE ) / R_C ; // i n A
disp ( I1 *10^3 , The v a l u e o f I 1 i n mA i s : )
// P a r t ( b )
VC = -4; // i n V
VB = -10; // i n V
R_C = 5.6; // i n k
R_C = R_C *10^3; // i n
R_B = 2.4; // i n k
R_B = R_B *10^3; // i n
VCC =12; // V
I_C = ( VC - VB ) / R_B ; // i n A
V2 = VCC - ( R_C * I_C ) ;
disp ( V2 , The v a l u e o f V2 i n v o l t i s : ) ;
// P a r t ( c )
VCC = 0;
VCE = -10; // i n V
R_C = 10; // i n k
R_C = R_C *10^3; // i n
I_C = ( VCC - VCE ) / R_C ; // i n A
V4 = 1; // i n V
I3 = I_C ; // i n A ( a p p r o x )
disp ( V4 , The v a l u e o f V4 i n v o l t i s : ) ;
disp ( I3 *10^3 , The v a l u e o f I 3 i n mA i s : )
// P a r t ( d )
VBE = -10; // i n V
VCC = 10; // i n V
R_B = 5; // i n k
R_B = R_B *10^3; // i n
R_C = 15; // i n k
R_C = R_C *10^3; // i n
// I 5= I C and
// I 5= ( V60.7VBE) /R B and I C= (VCCV6 ) /R C
V6 = ( VCC * R_B + R_C *(0.7+ VBE ) ) /( R_C + R_B ) ;
disp ( V6 , The v a l u e o f V6 i n v o l t i s : )
62
: )
// Exa 3 . 2 1
clc ;
clear ;
close ;
// Given d a t a
// P a r t ( a )
V_C = 2; // i n V
R_C = 1; // i n k
R_C = R_C *10^3; // i n
V_B = 4.3; // i n V
R_B = 200; // i n k
R_B = R_B *10^3; // i n
I_C = V_C / R_C ; // i n A
I_B = V_B / R_B ; // i n A
bita = I_C / I_B ;
disp ( P a r t ( a ) )
disp ( I_C *10^3 , C o l l e c t o r c u r r e n t i n mA i s : )
disp ( I_B *10^6 , Base c u r r e n t i n
A i s : )
disp ( bita , The v a l u e o f b i t a i s : )
// P a r t ( b )
V_C = 2.3; // i n V
R_C = 230; // i n k
R_C = R_C *10^3; // i n
V_B = 4.3; // i n V
R_B = 20; // i n k
R_B = R_B *10^3; // i n
I = V_C / R_C ; // c u r r e n t t h r o u g h 230
I C + I B in A
29 I_B = ( V_B - V_C ) / R_B ; // i n A
63
resistro i . e .
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
I_C = I - I_B ; // i n A
bita = abs ( I_C / I_B ) ;
disp ( P a r t ( b ) )
disp ( I_C *10^3 , C o l l e c t o r c u r r e n t i n mA i s : )
disp ( I_B *10^3 , Base c u r r e n t i n mA i s : )
disp ( bita , The v a l u e o f b i t a i s : )
// P a r t ( c )
V_E = 10; // i n V
R_E = 1; // i n k
R_E = R_E *10^3; // i n
V_1 = 7; // i n V
R_C = 1; // i n k
R_C = R_C *10^3; // i n
V_B = 6.3; // i n V
R_B = 100; // i n k
R_B = R_B *10^3; // i n
I_E = ( V_E - V_1 ) / R_C ; // i n A
I_C = I_E ; // i n A ( a p p r o x )
V_C = I_C * R_C ; // i n V
I_B = ( V_B - V_C ) / R_B ; // i n A
bita = I_E / I_B -1;
disp ( P a r t ( c ) )
disp ( I_E *10^3 , E m i t t e r c u r r e n t i n mA i s : )
disp ( I_B *10^6 , Base c u r r e n t i n
A i s : )
disp ( V_C , C o l l e c t o r v o l t a g e i n v o l t s i s : )
disp ( bita , The v a l u e o f b i t a i s : )
// Note : I n t h e book t h e v a l u e o f b a s e c u r r e n t i n
t h e f i r s t p a r t i s wrong due t o c a l c u l a t i o n e r r o r .
59 //
In the part ( b ) the v a l u e s o f c o l l e c t o r
c u r r e n t and b i t a a r e wrong due t o c a l c u l a t i o n
e r r o r in the f i r s t l i n e of part (b)
Scilab code Exa 3.22 The emitter base and collector voltage and current
64
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
// Exa 3 . 2 2
clc ;
clear ;
close ;
// Given d a t a
// P a r t ( a )
bita = 30;
R_C = 2.2; // i n k
R_C = R_C *10^3; // i n
R_B = 2.2; // i n k
R_B = R_B *10^3; // i n
VCC = 3; // i n V
VCE = -3; // i n V
VBE = 0.7; // i n V
V_B = 0; // i n V
V_E = V_B - VBE ; // i n V
I_E = ( V_E - VCE ) / R_B ; // i n
I_C = I_E ; // i n A
V_C = VCC - I_E * R_C ; // i n V
I_B = I_C / bita ; // i n A
disp ( P a r t ( a ) )
disp ( V_B , The v a l u e o f V
disp ( V_E , The v a l u e o f V
disp ( I_E *10^3 , The v a l u e
disp ( V_C , The v a l u e o f V
disp ( I_B *10^3 , The v a l u e
// P a r t ( b )
R_C = 560; // i n
R_B = 1.1; // i n k
R_B = R_B *10^3; // i n
VCC = 9; // i n V
VCE = 3; // i n V
V_B = 3; // i n V
V_E = V_B + VBE ; // i n V
I_E = ( VCC - V_E ) / R_B ; // i n
alpha = bita /(1+ bita ) ;
I_C = I_E * alpha ; // i n A
V_C = I_C * R_C ; // i n V
B in
E in
of I
C in
of I
65
V
V
E
V
B
is
is
in
is
in
: )
: )
mA i s : )
: )
mA i s : )
A
of V
of V
value
of V
value
B in
E in
of I
C in
of I
V
V
E
V
B
is
is
in
is
in
: )
: )
mA i s : )
: )
mA i s : )
// Exa 3 . 2 3
clc ;
clear ;
close ;
// Given d a t a
VBE = 0.7; // i n V
VCC = 9; // i n V
VCE = -9; // i n V
V_B = -1.5; // i n V
R_C = 10; // i n k
R_C = R_C *10^3; // i n
R_B = 10; // i n k
R_B = R_B *10^3; // i n
I_B = abs ( V_B ) / R_B ; // i n A
V_E = V_B - VBE ; // i n V
disp ( V_E , The v a l u e o f V E i n v o l t i s : )
I_E = ( V_E - VCE ) / R_B ; // i n A
bita = I_E / I_B -1;
alpha = bita /(1+ bita ) ;
disp ( alpha , The v a l u e o f a l p h a i n v o l t i s : )
disp ( bita , The v a l u e o f b i t a i n v o l t i s : )
V_C = VCC - I_E * alpha * R_C ; // i n V
disp ( V_C , The v a l u e o f V C i n v o l t i s : )
// When b i t a = i n f i n i t e t h e n
alpha = 1 ; // As i n f i n i t e /(1+ i n f i n i t e ) = 1
66
26 I_B = 0;
27 V_B =0;
28 V_C = VCC - I_E * R_C ; //
29 disp ( When B i t a =
30 disp ( V_B , The v a l u e
31 disp ( V_E , The v a l u e
32 disp ( V_C , The v a l u e
in volt
infinite
of V B
of V E
of V C
t h e n : )
in v o l t i s : )
in v o l t i s : )
in v o l t i s : )
67
: )
6
7
8
9
10
11
12
13
14
15
16
17
18
19
R1 = 10; // i n k
R1 = R1 *10^3; // i n
R2 = 10; // i n k
R2 = R2 *10^3; // i n
I_C =.5; // mA
V_T = 0.025; // i n V
I_C = I_C *10^ -3; // i n A
V = 10; // i n V
Vth = V * R1 /( R1 + R2 ) ; // i n V
Rth = R1 * R2 /( R1 + R2 ) ; // i n
vo = I_C * Rth ; // i n V
vi = V_T ; // i n V
vo_by_vi = vo / vi ; // i n V/V
disp ( vo_by_vi , The v a l u e o f vo / v i i n V/V i s : )
// Exa 3 . 2 7
clc ;
clear ;
close ;
// Given d a t a
V_B = 2; // i n V
V_CC =5; // i n V
V_BE = 0.7; // i n V
R_E = 1*10^3; // i n
R_C = 1*10^3; // i n
V_E = V_B - V_BE ; // i n V
I_E = V_E / R_E ; // i n A
I_C = I_E ; // i n A
V_C = V_CC - I_C * R_C ; // i n V
disp ( At V B= +2 V )
disp ( V_E , The v a l u e o f V E i n v o l t s i s : )
disp ( V_C , The v a l u e o f V C i n v o l t s i s : )
68
19
20
21
22
23
24
25
26
// P a r t ( b )
V_B = 0; // i n V
V_E = 0; // i n V
I_E = 0; // i n A
V_C = 5; // i n V
disp ( At V B= 0 V )
disp ( V_E , The v a l u e o f V E i n v o l t s i s : )
disp ( V_C , The v a l u e o f V C i n v o l t s i s : )
// Exa 3 . 2 8
clc ;
clear ;
close ;
// Given d a t a
V_B = 0; // i n V
R_E =1*10^3; // i n
R_C =1*10^3; // i n
V_CC =5; // i n V
V_BE = 0.7; // i n V
V_E = V_B - V_BE ; // i n V
I_E = (1+ V_E ) / R_E ; // i n A
I_C = I_E ; // ( a p p r o x ) i n A
V_C = V_CC - I_C * R_C ; // i n V
disp ( P a r t ( i ) )
disp ( V_E , The v a l u e o f V E
disp ( V_C , The v a l u e o f V C
// For s a t u r a t i o n
V_CE =0.2 ; // V
V_CB = -0.5; // i n V
// I C= 5V C/R C and V C=
// I C= (5.2 V E ) /R C
// I E= ( V E+1) /R E and a t
I C=I E ,
i n v o l t i s : );
i n v o l t i s : );
V EVCE, So
69
the edge o f s a t u r a t i o n
24 V_E = 4.2/2; // / i n V
25 V_B = V_E +0.7; // i n V
26 V_C = V_E +0.2; // i n V
27 disp ( P a r t ( i i ) )
28 disp ( V_E , The v a l u e o f
29 disp ( V_B , The v a l u e o f
30 disp ( V_C , The v a l u e o f
31
32 // Note : I n t h e book ,
V E i n v o l t s i s : );
V B i n v o l t s i s : );
V C i n v o l t s i s : );
// Exa 3 . 2 9
clc ;
clear ;
close ;
// Given d a t a
V_CC =5; // i n V
V_E = 1; // i n V
V_BE = 0.7; // i n V
R_E =5*10^3; // i n
R_C =5*10^3; // i n
R_B = 20*10^3; // i n
I_E = ( V_CC - V_E ) / R_E ; // i n A
// For pnp t r a n s i s t o r V BE= V EV B
V_B = V_E - V_BE ; // i n V
I_B = V_B / R_B ; // i n A
I_C = I_E - I_B ; // i n A
V_C = I_C * R_C - V_CC ; // i n V
bita = I_C / I_B ;
alpha = I_C / I_E ;
disp ( V_B , The v a l u e o f V B i n v o l t s i s : ) ;
70
21
22
23
24
25
26
: );
: );
: );
);
// Exa 3 . 3 0
clc ;
clear ;
close ;
// Given d a t a
V_CC =5; // i n V
V_T = 0.025; // i n V
R_C =7.5*10^3; // i n
I_C = 0.5; // i n mA
I_C = I_C *10^ -3; // i n A
I_E = I_C ; // ( a p p r o x ) i n A
V_C = V_CC - I_C * R_C ; // i n V
disp ( V_C , dc v o l t a g e a t t h e c o l l e c t o r i n v o l t i s :
)
gm = I_C / V_T ; // i n A/V
disp ( gm *10^3 , The v a l u e o f gm i n mA/V i s : )
// v b e= v i
// v c= gm v b e R C
vcbyvi = gm * R_C ; // i n V/V
disp ( vcbyvi , The v a l u e o f vc / v i i n V/V i s : )
Scilab code Exa 3.31 Input resistance and overall voltage gain
1
// Exa 3 . 3 1
71
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
clc ;
clear ;
close ;
// Given d a t a
V_T = 0.025; // i n V
I_E = 0.5; // i n mA
I_E = I_E *10^ -3; // i n mA
Rsig = 50; // i n
R_C = 5*10^3; // i n
re = V_T / I_E ; // i n ohm
Rin = Rsig + re ; // i n ohm
disp ( Rin , I n p u t r e s i s t a n c e i n
i s : )
// P a r t ( b )
// vo= 0.99 i e R C and i e = v s i g / Rin
vo_by_v_sig = 0.99* R_C / Rin ; // i n V/V
disp ( vo_by_v_sig , The v a l u e o f vo / v s i g i n V/V i s :
)
Scilab code Exa 3.32 Input resistance and overall voltage gain
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
// Exa 3 . 3 2
clc ;
clear ;
close ;
// Given d a t a
bita = 200;
alpha = bita /(1+ bita ) ;
R_C = 100; // i n
R_B = 10; // i n k
Rsig = 1; // i n k
Rsig = Rsig *10^3; // i n
R_B = R_B *10^3; // i n
V_T = 25*10^ -3;
V =1.5; // i n V
I_E = 10; // i n mA
72
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
73
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
disp ( P a r t ( a ) )
V_BE = 690; // i n mV
V_BE = V_BE *10^ -3; // i n V
I_C = 1; // i n mA
I_B = 50; // i n
A
I_C = I_C *10^ -3; // i n A
I_B = I_B *10^ -6; // i n A
bita = I_C / I_B ;
alpha = bita /(1+ bita ) ;
I_E = I_C / alpha ; // i n A
// I C= I S %e ( V BE/V T )
I_S = I_C /( %e ^( V_BE / V_T ) ) ;
disp ( bita , The v a l u e o f b i t a i s : )
disp ( alpha , The v a l u e o f a l p h a i s : )
disp ( I_E *10^3 , The v a l u e o f I E i n mA i s : )
disp ( I_S , The v a l u e o f I S i n amp i s : )
// P a r t ( b )
disp ( P a r t ( b ) )
V_BE = 690; // i n mV
V_BE = V_BE *10^ -3; // i n V
I_C = 1; // i n mA
I_C = I_C *10^ -3; // i n A
I_E = 1.070; // i n mA
I_E = I_E *10^ -3; // i n A
bita = I_C / I_B ;
alpha = I_C / I_E ;
bita = alpha /(1 - alpha ) ;
I_B = I_C / bita ; // i n A
// I C= I S %e ( V BE/V T )
I_S = I_C /( %e ^( V_BE / V_T ) ) ;
disp ( bita , The v a l u e o f b i t a i s : )
disp ( alpha , The v a l u e o f a l p h a i s : )
disp ( I_B *10^6 , The v a l u e o f I B i n
A i s : )
disp ( I_S , The v a l u e o f I S i n amp i s : )
// P a r t ( c )
disp ( P a r t (C) )
74
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
V_BE = 580; // i n mV
V_BE = V_BE *10^ -3; // i n V
I_E = 0.137; // i n mA
I_B = 7; // i n
A
I_E = I_E *10^ -3; // i n A
I_B = I_B *10^ -6; // i n A
// I C= a l p h a I E = b i t a I B
bita = I_E / I_B -1;
alpha = bita /(1+ bita ) ;
I_C = bita * I_B ; // i n A
// I C= I S %e ( V BE/V T )
I_S = I_C /( %e ^( V_BE / V_T ) ) ;
disp ( bita , The v a l u e o f b i t a i s : )
disp ( alpha , The v a l u e o f a l p h a i s : )
disp ( I_C *10^3 , The v a l u e o f I C i n mA i s : )
disp ( I_S , The v a l u e o f I S i n amp i s : )
// P a r t ( d )
disp ( P a r t ( d ) )
V_BE = 780; // i n mV
V_BE = V_BE *10^ -3; // i n V
I_C = 10.10; // i n mA
I_B = 120; // i n
A
I_C = I_C *10^ -3; // i n A
I_B = I_B *10^ -6; // i n A
bita = I_C / I_B ;
alpha = bita /(1+ bita ) ;
I_E = I_C / alpha ; // i n A
// I C= I S %e ( V BE/V T )
I_S = I_C /( %e ^( V_BE / V_T ) ) ;
disp ( bita , The v a l u e o f b i t a i s : )
disp ( alpha , The v a l u e o f a l p h a i s : )
disp ( I_E *10^3 , The v a l u e o f I E i n mA i s : )
disp ( I_S , The v a l u e o f I S i n amp i s : )
// P a r t ( e )
disp ( P a r t ( e ) )
V_BE = 820; // i n mV
75
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
76
Chapter 4
Differential Amplifiers
// Exa 4 . 1
clc ;
clear ;
close ;
// Given d a t a
V_CC = 10; // i n v o l t
V_EE = -10; // i n v o l t
I = 1; // i n mA
I = I *10^ -3; // i n A
R_C = 10; // i n kohm
R_C = R_C *10^3; // i n kohm
V_BE =0.7; // i n v o l t
i_C1 = I /2; // i n A
i_C2 = i_C1 ; // i n A
disp ( i_C1 *10^3 , V a l u e o f i C 1 i n mA i s : )
V_C1 = V_CC - i_C1 * R_C ; // i n V
// For V cm=0 v o l t
V_E = -0.7; // i n v o l t
V_CE1 = V_C1 - V_E ; // i n v o l t
77
22
23
24 // For V cm= 5 v o l t
25 V_cm = -5; // i n V
26 V_B = V_cm ; // i n V
27 // From V BE= V BV E
28 V_E = V_B - V_BE ; // i n v o l t
29 V_CE1 = V_C1 - V_E ; // i n v o l t
30 disp ( V_CE1 , For V cm =5V , The a l u e o f V CE1 i n
v o l t i s )
31
32 // For V cm= 5 v o l t
33 V_cm = 5; // i n V
34 V_B = V_cm ; // i n V
35 V_E = V_B - V_BE ; // i n v o l t
36 V_CE1 = V_C1 - V_E ; // i n v o l t
37 disp ( V_CE1 , For V cm =5V , The a l u e o f V CE1 i n
i s )
// Exa 4 . 2
clc ;
clear ;
close ;
// Given d a t a
V_DD = 1.5; // i n V
V_SS = V_DD ; // i n V
KnWL = 4; // i n mA/V2
KnWL = KnWL *10^ -3; // i n A/V2
Vt = 0.5; // i n V
I =0.4; // i n mA
I = I *10^ -3; // i n A
R_D = 2.5; // i n k
78
volt
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
// P a r t ( c )
disp ( P a r t ( c ) )
V_CM =1; // i n V
V_GS = 0.82; // i n V
V_G = 1; // i n V
V_S = V_G - V_GS ; // i n V
disp ( V_S , V a l u e o f V S i n v o l t i s
i_D1 = I /2; // i n mA
disp ( i_D1 , V a l u e o f i D 1 i n mA i s
i_D1 = i_D1 *10^ -3; // i n A
V_D1 = V_DD - i_D1 * R_D ; // i n V
V_D2 = V_D1 ; // i n V
disp ( V_D1 , V a l u e o f V D1 i n v o l t
disp ( V_D2 , V a l u e o f V D2 i n v o l t
79
: )
: )
i s )
i s )
: )
: )
i s )
i s )
52
53 // P a r t ( d )
54 disp ( P a r t ( d ) )
55 V_CM_max = Vt + V_DD - i_D1 * R_D
56 disp ( V_CM_max , H i g h e s t v a l u e o f V CM i n v o l t i s : )
57
58 // P a r t ( e )
59 V_S = 0.4; // i n V
60 disp ( P a r t ( e ) )
61 V_CM_min = - V_SS + V_S + Vt + V_OV ; // i n V
62 disp ( V_CM_min , Lowest v a l u e o f V CM i n v o l t i s )
63 V_Smin = V_CM_min - V_GS ; // i n v o l t
64 disp ( V_Smin , Lowest v a l u e o f V S i n v o l t i s )
// Exa 4 . 3
clc ;
clear ;
close ;
format ( v ,5)
// Given d a t a
I = 0.4; // i n mA
unCox = 0.2; // i n mA/V2
i_D = I /2; // i n mA
V_OV1 = 0.2; // i n V
V_OV2 = 0.3; // i n V
V_OV3 = 0.4; // i n V
WbyL1 = 2* i_D /( unCox * V_OV1 ^2) ;
gm1 = I / V_OV1 ; // i n mA/V
WbyL2 = 2* i_D /( unCox * V_OV2 ^2) ;
gm2 = I / V_OV2 ; // i n mA/V
WbyL3 = 2* i_D /( unCox * V_OV3 ^2) ;
gm3 = I / V_OV3 ; // i n mA/V
disp ( Vov ( i n V)
+ string ( V_OV1 ) +
80
+ string ( V_OV2 ) +
20
V_OV3 ) )
disp ( W/L
+ string (
+ string ( WbyL1 ) +
+ string ( WbyL2 ) +
+ string (
WbyL3 ) )
21 disp ( gm( i n mA/V)
+ string ( gm2 ) +
+ string ( gm1 ) +
+ string ( gm3 ) )
// Exa 4 . 4
clc ;
clear ;
close ;
// Given d a t a
format ( v ,11)
V_A = 20; // i n V
R_D = 5; // i n k
R_D = R_D *10^3; // i n
I = 0.8; // i n mA
I = I *10^ -3; // i n A
i_D = I /2; // i n A
unCox = 0.2; // mA/V2
unCox = unCox *10^ -3; // i n A/V2
WbyL = 100;
// Formula i D= 1/2 unCox WbyLV OV2
V_OV = sqrt (2* i_D /( unCox * WbyL ) ) ; // i n V
disp ( V_OV , The v a l u e o f V OV i n v o l t s i s : )
gm = I / V_OV ; // i n A/V ;
disp ( gm *10^3 , The v a l u e o f gm i n mA/V i s : )
r_o = V_A / i_D ; // i n
disp ( r_o *10^ -3 , The v a l u e o f r o i n k
i s : )
// Ad= v o / v i d = gm ( R D | | r o )
Ad = gm *( R_D * r_o /( R_D + r_o ) ) ; // i n V/V
disp ( Ad , D i f f e r e n t i a l g a i n i n V/V i s : )
81
// Exa 4 . 5
clc ;
clear ;
close ;
// Given d a t a
R_D = 5; // i n k
R_D = R_D *10^3; // i n
R_SS = 25; // i n k
R_SS = R_SS *10^3; // i n
I = 0.8; // i n mA
I = I *10^ -3; // i n A
i_D = I /2; // i n A
unCox = 0.2; // mA/V2
unCox = unCox *10^ -3; // i n A/V2
WbyL = 100;
// Formula i D= 1/2 unCox WbyLV OV2
V_OV = sqrt (2* i_D /( unCox * WbyL ) ) ; // i n V
gm = i_D / V_OV ; // i n A/V ;
// P a r t ( a )
Ad = 1/2* gm * R_D ; // i n V/V
disp ( Ad , D i f f e r e n t i a l g a i n i n V/V i s : )
Acm = - R_D /(2* R_SS ) ; // i n V/V
disp ( Acm , Common mode g a i n i n V/V i s )
CMRR = abs ( Ad ) / abs ( Acm ) ;
CMRRindB = round (20* log10 ( CMRR ) ) ; // i n dB
disp ( CMRRindB , Common mode r e j e c t i o n r a t i o i n dB i s
: )
// P a r t ( b )
disp ( P a r t ( b ) when o u t p u t i s t a k e n d i f f e r e n t i a l l y )
82
32 Ad = gm * R_D ; // i n V/V
33 disp ( Ad , D i f f e r e n t i a l g a i n i n V/V i s : )
34 Acm = 0;
35 disp ( Acm , Common mode g a i n i n V/V i s )
36 // CMRRindB= 20 l o g 1 0 ( Ad/Acm) = i n f i n i t e ; / / i n dB
37 disp ( Common mode r e j e c t i o n r a t i o i n dB i s : )
38 disp ( i n f i n i t e ) ;
39
40 // P a r t ( c )
41 disp ( P a r t ( c ) when o u t p u t i s t a k e n d i f f e r e n t i a l l y
42
43
44
45
46
47
48
49
50
51
83
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
R_SS = 25; // i n k
R_SS = R_SS *10^3; // i n
I = 0.8; // i n mA
I = I *10^ -3; // i n A
i_D = I /2; // i n A
unCox = 0.2; // mA/V2
unCox = unCox *10^ -3; // i n A/V2
WbyL = 100;
// Formula i D= 1/2 unCox WbyLV OV2
V_OV = sqrt (2* i_D /( unCox * WbyL ) ) ; // i n V
gm = i_D / V_OV ; // i n A/V ;
// gm mismatch have a n e g l i g i b l e e f f e c t on Ad
Ad = gm * R_D ; // i n V/V( a p p r o x )
// d e l t a g m= 1% o f gm
delta_gm = gm *1/100; // i n A/V
Acm = R_D /(2* R_SS ) * delta_gm / gm ;
CMRRindB = 20* log10 ( Ad / Acm ) ;
disp ( CMRRindB , CMRR i n dB i s : )
84
i s : )
15
16
17
18
v_C1 = -5; // i n V
v_C2 = I_E *10^3 -5; // i n V
disp ( v_C1 , V a l u e o f v C1 i n v o l t s i s : )
disp ( v_C2 , V a l u e o f v C2 i n v o l t s i s : )
mVis : )
// Exa 4 . 9
clc ;
clear ;
close ;
// Given d a t a
Bita = 100;
// P a r t ( a )
RE = 150; // i n
VT = 25; // i n mV
VT = VT *10^ -3; // i n V
85
12 IE = 0.5; // i n mA
13 IE = IE *10^ -3; // i n A
14 re1 = VT / IE ; // i n
15 R_id = 2*( Bita +1) *( re1 + RE ) ; // i n
16 R_id = round ( R_id *10^ -3) ; // i n k
17 disp ( R_id , The i n p u t d i f f e r e n t i a l
r e s i s t a n c e in
i s : )
18
19 // P a r t ( b )
20 RC =10; // i n k
21 RC = RC *10^3; // i n
22 Rsig = 5+5; // i n k
23 VoltageGain1 = R_id /( Rsig + R_id ) ; // v o l t a g e g a i n from
t h e s i g n a l s o u r c e t o t h e b a s e o f Q1 and Q2 i n V/V
VoltageGain2 = 2* RC /(2*( re1 + RE ) ) ; // v o l t a g e g a i n from
t h e b a s e s t o t h e o u t p u t i n V/V
25 Ad = VoltageGain1 * VoltageGain2 ; // i n V/V
26 disp ( Ad , The o v e r a l l d i f f e r e n t i a l v o l t a g e g a i n i n V/
V i s );
24
27
28 // P a r t ( c )
29 delta_RC = 0.02* RC ;
30 R_EE = 200; // i n k
31 R_EE = R_EE *10^3; // i n
32 Acm = RC /(2* R_EE ) * delta_RC / RC ; // i n V/V
33 disp ( Acm , Common mode g a i n i n V/V i s : )
34
35 // P a r t ( d )
36 CMRRindB = 20* log10 ( Ad / Acm ) ; // i n dB
37 disp ( CMRRindB , CMRR i n dB i s : )
38
39 // P a r t ( e )
40 V_A = 100; // i n V
41 r_o = V_A /( IE ) ; // i n
42 // Ricm= ( B i t a +1) ( R EE | | r o / 2 )
43 Ricm = ( Bita +1) *( R_EE *( r_o /2) /( R_EE +( r_o /2) ) ) ;
44 disp ( Ricm *10^ -6 , I n p u t common mode r e s i s t a n c e i n
i s : )
86
// Exa 4 . 1 0
clc ;
clear ;
close ;
// Given d a t a
delta_RDbyRD = 2/100;
delta_WLbyWL = 2/100;
delta_Vt = 2; // i n mV
delta_Vt = delta_Vt *10^ -3; // i n V
// ( From Exa 4 . 4 )
V_A = 20; // i n V
R_D = 5; // i n k
R_D = R_D *10^3; // i n
I = 0.8; // i n mA
I = I *10^ -3; // i n A
i_D = I /2; // i n A
unCox = 0.2; // mA/V2
unCox = unCox *10^ -3; // i n A/V2
WbyL = 100;
// Formula i D= 1/2 unCox WbyLV OV2
V_OV = sqrt (2* i_D /( unCox * WbyL ) ) ; // i n V
V_OS1 = V_OV /2* delta_RDbyRD ; // i n V
// V OS due t o W/L r a t i o
V_OS2 = V_OV /2* delta_WLbyWL ; // i n V
// V OS due t o t h r e s h o l d v o l t a g e
V_OS3 = delta_Vt ; // i n V
// T o t a l o f f s e t v o l t a g e
V_OS = sqrt ( V_OS1 ^2+ V_OS2 ^2+ V_OS3 ^2) ; // i n V
V_OS = V_OS *10^3; // i n mV
disp ( V_OS , T o t a l o f f s e t v o l t a g e i n mV i s : )
87
// Exa 4 . 1 1
clc ;
clear ;
close ;
// Given d a t a
WLn = 100;
WLp = 200;
unCox = 0.2; // mA/V2
unCox = unCox *10^ -3; // i n A/V2
RSS = 25; // i n k
RSS = RSS *10^3; // i n
I =0.8; // i n mA
I = I *10^ -3; // i n A
V_A = 20; // i n V
i_D = I /2; // i n A
// Formula i D= 1/2 unCox WLnV OV2
V_OV = sqrt (2* i_D /( unCox * WLn ) ) ; // i n V
gm = I / V_OV ; // i n A/V
disp ( gm *10^3 , V a l u e o f Gm i n mA/V i s : )
ro2 = V_A /( I /2) ; // i n ohm
ro4 = ro2 ; // i n ohm
Ro = ro2 * ro4 /( ro2 + ro4 ) ; // i n ohm
disp ( Ro *10^ -3 , V a l u e o f Ro i n k
i s : )
Ad = gm * Ro ; // i n V/V
disp ( Ad , V a l u e o f Ad i n V/V i s : )
// F i n d i n g t h e v a l u e o f gm3
upCox = 0.1; // mA/V2
upCox = upCox *10^ -3; // i n A/V2
// Formula i D= 1/2 upCox WLpV OV2
V_OV = sqrt (2* i_D /( upCox * WLp ) ) ; // i n V
gm3 = I / V_OV ; // i n A/V
Acm = 1/(2* gm3 * RSS ) ; // i n V/V
88
33
34
35
// Exa 4 . 1 2
clc ;
clear ;
close ;
// Given d a t a
I =0.8; // i n mA
I = I *10^ -3; // i n A
V_A = 100; // i n V
Bita =160;
VT =25; // i n mV
VT = VT *10^ -3; // i n V
gm = ( I /2) / VT ; // i n A/V
Gm = gm ; // S h o r t c i r c u i t t r n s c o n d u c t a n c e i n mA/V
disp ( Gm *10^3 , The v a l u e o f Gm i n mA/V )
ro2 = V_A /( I /2) ; // i n ohm
ro4 = ro2 ; // i n ohm
Ro = ro2 * ro4 /( ro2 + ro4 ) ; // i n ohm
disp ( Ro *10^ -3 , The v a l u e o f Ro i n k
i s : )
Ad = Gm * Ro ; // i n V/V
disp ( Ad , V a l u e o f Ad i n V/V i s : )
r_pi = Bita / gm ; // i n
Rid = 2* r_pi ; // i n
disp ( Rid *10^ -3 , The v a l u e o f Rid i n k
i s : )
// Exa 4 . 1 3
89
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
clc ;
clear ;
close ;
// Given d a t a
Vtp = -0.8; // i n V
KpWL = 3.5; // i n mA/V2
I =0.7; // i n mA
I = I *10^ -3; // i n A
R_D = 2; // i n k
R_D = R_D *10^3; // i n
KpWL = KpWL *10^ -3; // i n A/V2
v_G1 = 0; // i n V
v_G2 = v_G1 ; // i n V
VSS = 2.5; // i n V
VDD = VSS ; // i n V
VCS = 0.5; // i n V
// P a r t ( a )
V_OV = - sqrt ( I / KpWL ) ; // i n V
disp ( V_OV , The v a l u e o f V OV i n v o l t s i s : )
V_GS = V_OV + Vtp ; // i n V
disp ( V_GS , The v a l u e o f V GS i n v o l t s i s : )
V_G = 0; // a s g a t e i s c o n n e c t e d g r o u n d
v_S1 = V_G - V_GS ; // i n V
v_S2 = v_S1 ; // i n V
disp ( v_S1 , The v a l u e o f V S i n v o l t s i s : )
v_D1 = I /2* R_D - VDD ; // i n V
v_D2 = v_D1 ; // i n V
disp ( v_D1 , The v a l u e o f v D1 i n V i s : )
disp ( v_D2 , The v a l u e o f v D2 i n V i s : )
// P a r t ( b )
V_CMmin = I * R_D /2 - VDD + Vtp ; // i n V
V_CMmax = VSS - VCS + Vtp + V_OV ; // i n V
disp ( V_CMmin , The v a l u e o f V CMmin i n v o l t i s : )
disp ( V_CMmax , The v a l u e o f V CMmax i n v o l t i s : )
90
// Exa 4 . 1 4
clc ;
clear ;
close ;
// Given d a t a
V_OV = 0.2; // i n V
gm =1; // i n mA/V
gm = gm *10^ -3; // i n A/V
Vt =0.8; // i n V
unCox = 90; // i n
A /V2
unCox = unCox *10^ -6; // i n A/V2
// gm= I /V OV
I = gm * V_OV ; // i n A
disp ( I *10^3 , B i a s c u r r e n t i n mA i s : )
I_D = I /2; // i n A
// Formula I D= 1 /2 unCox WLnV OV2
WbyL = 2* I_D /( unCox * V_OV ^2) ;
disp ( WbyL , W/L r a t i o i s : )
91
10
11
12
13
14
15
16
17
18
19
20
21
22
// Exa 4 . 1 6
clc ;
clear ;
close ;
// Given d a t a
I =1; // i n mA
I = I *10^ -3; // i n A
i_C =1; // i n mA
i_C = i_C *10^ -3; // i n A
V_CC = 5; // i n V
V_CM = -2; // i n V
V_BE = 0.7; // i n V
R_C = 3; // i n k
R_C = R_C *10^3; // i n
Alpha =1;
Bita =100;
V_B = 1; // i n V
i_C1 = Alpha * I ; // i n A
i_C2 =0;
92
string ( v_C2 ) + V )
93
Chapter 5
Feedback Amplifiers
94
5
6
7
8
9
10
11
12
13
14
15
16
17
// Given d a t a
Af = 100; // u n i t l e s s
Vi = 50; // i n mV
Vi = Vi *10^ -3; // i n V
Vs = 0.5; // i n V
// Formula Af= Vo/ Vs
Vo = Af * Vs ; // i n V
A = Vo / Vi ;
disp (A , V a l u e o f A i s : )
// Formula Af= A/(1+BA)
B = 1/ Af -1/ A ;
B = B *100; // i n %
disp (B , V a l u e o f B i s i n p e r c e n t : )
// Exa 5 . 3
clc ;
clear ;
close ;
// Given d a t a
Bita = 5/100;
f_H = 50; // i n kHz
f_H = f_H *10^3; // i n Hz
f_L = 50; // i n kHz
Amid = 1000;
f_LF = f_L /(1+ Bita * Amid ) ; // i n Hz
f_HF = f_H *(1+ Bita * Amid ) ; // i n Hz
disp ( f_LF , V a l u e o f f L F i n Hz i s : )
disp ( f_HF *10^ -6 , V a l u e o f f L F i n MHz i s : )
1 // Exa 5 . 4
2 clc ;
3 clear ;
4 close ;
5 // Given d a t a
6 dAf_by_Af = 0.2/100;
7 dA_by_A = 150/2000;
8 A =2000;
9 // Formula d A f b y A f = 1/(1+ B i t a A) dA by A
10 Bita = dA_by_A /( A * dAf_by_Af ) -1/ A ;
11 Af = A /(1+ Bita * A ) ;
12 disp ( Bita *100 , V a l u e o f B i t a i n p e r c e n t i s )
13 disp ( Af , V a l u e o f Af i s : )
Scilab code Exa 5.5 Fraction of the output that is feebback to input
1 // Exa 5 . 5
2 clc ;
3 clear ;
4 close ;
5 // Given d a t a
6 Av = 140;
7 Avf = 17.5;
8 // Formula Avf= Av/(1+Av B i t a )
9 Bita = 1/ Avf -1/ Av ;
10 disp ( Bita , F r a c t i o n o f t h e o u t p u t
i s )
96
5
6
7
8
9
10
11
12
13
14
15
16
// Given d a t a
Av = 100;
Avf = 50;
// Formula Avf= Av/(1+Av B i t a )
Bita = 1/ Avf -1/ Av ;
disp ( Bita , The v l a u e o f b i t a i s )
// P a r t ( i i )
Avf = 75;
// Formula Avf= Av/(1+Av B i t a )
Av = Avf /(1 - Bita * Avf )
disp ( Av , V a l u e o f a m p l i f i e r g a i n i s : )
15
16 // P a r t ( i i )
17 Av = 40;
18 Avf = 25;
97
19
20
98
8 R_S = 1; // i n kohm
9 R_S = R_S *10^3; // i n ohm
10 r_pi = 1100; // i n ohm
11 h_ie = r_pi ;
12 // Formula Av= Vo/Vs , But Vo= gm v p i R E and Vs= I b
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
( Ri+r p i ) , s o
Av = gm * R_E /( R_S + h_ie )
// As Vo=Vf , s o
Bita =1;
D = 1+ Bita * Av ;
Avf = Av / D ;
Ri = R_S + r_pi ; // i n ohm
Ri = Ri *10^ -3; // i n kohm
R_if = Ri * D ; // i n kohm
// Ro= i n f i n i t e , s o
// Rof= i n f i n i t e
disp ( Av , V a l u e o f Av i s : )
disp ( Bita , V a l u e o f B i t a i s : )
disp ( Avf , V a l u e o f Avf i s : )
disp ( Ri , V a l u e o f Ri i n kohm )
disp ( R_if , V a l u e o f R i f i n kohm i s : )
disp ( V a l u e o f Rof i s : )
disp ( i n f i n i t e )
Scilab code Exa 5.11 Value of Avf Rif Rof and bita
1
2
3
4
5
6
7
8
9
// Exa 5 . 1 1
clc ;
clear ;
close ;
// Given d a t a
gm =2; // i n mA/V
gm = gm *10^ -3; // i n A/V
r_d = 40; // i n kohm
r_d = r_d *10^3; // i n ohm
99
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
Rs = 3; // i n kohm
Rs = Rs *10^3; // i n ohm
miu = gm * r_d ;
Bita =1;
Av = miu * Rs /( r_d + Rs ) ;
D = 1+ Bita * Av ;
Avf = Av / D ;
// Ri= i n f i n i t e , s o R i f =
Rof = r_d / D ; // i n ohm
disp ( Av , V a l u e o f Av i s :
disp (D , V a l u e o f D i s )
disp ( Avf , V a l u e o f Avf i s
disp ( V a l u e o f R i f i s )
disp ( i n f i n i t e )
disp ( Rof , V a l u e o f Rof i n
Ri D = i n f i n i t e
)
: )
ohm i s : )
// Exa 5 . 1 2
clc ;
clear ;
close ;
// Given d a t a
gm =75; // i n A/V
Rs = 1; // i n kohm
Rs = Rs *10^3; // i n ohm
R_E = 1; // i n kohm
R_E = R_E *10^3; // i n ohm
rpi = 1; // i n kohm
rpi = rpi *10^3; // i n ohm
hie = rpi ;
Io = - gm ;
Vi = Rs + R_E + rpi ;
Gm = Io / Vi ;
100
18
19
20
21
22
23
24
25
26
27
28
29
30
31
disp ( Gm , V a l u e o f Gm i s : )
Bita = - R_E ;
disp ( Bita , V a l u e o f B i t a i s : )
D = 1+ Bita * Gm ;
disp (D , V a l u e o f D i s : )
Gmf = Gm / D ;
disp ( Gmf , V a l u e o f Gmf i s : )
Ri = Rs + R_E + hie ; // i n ohm
Rif = Ri * D ; // i n ohm
Rif = Rif *10^ -3; // i n kohm
disp ( Rif , V a l u e o f R i f i n kohm i s : )
// Ro= i n f i n i t e , s o R o f = RoD = i n f i n i t e
disp ( V a l u e o f R o f i s )
disp ( i n f i n i t e )
// Exa 5 . 1 9
clc ;
clear ;
close ;
// Given d a t a
A = 10^5;
Af = 100;
// Formula Af= A/(1+A B i t a )
Bita = 1/ Af -1/ A ;
// when A= 1 0 3
A =10^3;
Af_desh = A /(1+ A * Bita ) ;
delta_Af = Af_desh - Af ;
Perc_Change_inAf = delta_Af / Af *100; // i n %
disp ( Perc_Change_inAf , P e r c e n t a g e c h a n g e i n Af i s :
)
101
f o l l o w e r , the output
v o l t a g e i s same a s i n p u t
Af = A /(1+ Bita * A ) ;
CLG = 1+ A * Bita ; // c l o s e d l o o p g a i n
disp ( CLG , C l o s e d l o o p g a i n i s : )
CLG_dB = 20* log10 ( CLG ) ;
disp ( CLG_dB , C l o s e d l o o p g a i n i n dB i s : )
Vo = Af * Vs ; // i n V
disp ( Vo , V a l u e o f Vo i n v o l t i s : )
Vi = Vs - Vo ; // i n V
disp ( round ( Vi *10^3) , V a l u e o f Vi i n mV i s : )
// I f A d e c r e a s e 10%, i . e .
A =90;
Af_desh = A /(1+ Bita * A ) ;
Per_gain_reduction = ( Af_desh - Af ) / Af *100; // i n %
disp ( Per_gain_reduction , P e r c e n t a g e o f g a i n
r e d u c t i o n i n % )
Scilab code Exa 5.21 Open loop gain and loop gain
1 // Exa 5 . 2 1
2 clc ;
102
3 clear ;
4 close ;
5 // Given d a t a
6 // P a r t ( a )
7 PerError = 1; // i n %
8 A = 10^5; // ( Assumed v a l u e )
9 ABita = 1/ PerError *100;
10 Bita = 1/( PerError * A ) ;
11 disp ( % e r r o r
12
13
14
15
16
17
18
19
20
21
22
A
A
1+ A )
disp ( string ( PerError ) +
+ string (
A)+
+ string ( ABita ) +
+ string (1+ ABita ) )
// P a r t ( b )
PerError = 5; // i n %
ABita = 1/ PerError *100;
Bita = 1/( PerError * A ) ;
disp ( string ( PerError ) +
+ string (
A)+
+ string ( ABita ) +
+ string (1+ ABita ) )
// P a r t ( c )
PerError = 50; // i n %
ABita = 1/ PerError *100;
Bita = 1/( PerError * A ) ;
disp ( string ( PerError ) +
+ string ( A )
+
+ string ( ABita ) +
+ string (1+ ABita ) )
103
6 S = -20; // s e n s i t i v i t y
o f c l o s e d t o open l o o p g a i n i n
dB
// s e n s i t i v i t y o f c l o s e d t o open l o o p g a i n = 1/(1+AB
) = S
8 // o r (1+AB) = S
9 AB = 10^( - S /20) - 1;
10 disp ( AB , The l o o p g a i n AB f o r which t h e s e n s i t i v i t y
o f c l o s e d l o o p g a i n t o open l o o p g a i n i s 20 dB ,
i s : )
7
11
12 // P a r t ( b ) when
13 S = 1/2; // s e n s i t i v i t y
o f c l o s e d t o open l o o p g a i n i n
dB
14 // S= 1/(1+AB)
15 AB = 1/ S -1;
16 disp ( AB , The l o o p g a i n AB f o r which t h e s e n s i t i v i t y
o f c l o s e d l o o p g a i n t o open l o o p g a i n i s 1/2 , i s
: )
// Exa 5 . 2 3
clc ;
clear ;
close ;
// Given d a t a
A =10^5;
Af = 10^3;
// Af= A/(1+A B i t a )
Bita = 1/ Af -1/ A ;
GDF = 1+ A * Bita ; // g a i n d e n s i t i v i t y f a c t o r
disp ( GDF , Gain d e n s i t i v i t y f a c t o r i s : )
// P a r t ( a ) when A d r o p s 10 %
A_desh = A - A *10/100;
Af_desh = A_desh /(1+ A_desh * Bita ) ;
104
15
16
17
18
19
20
21
// Exa 5 . 2 4
clc ;
clear ;
close ;
// Given d a t a
A =100;
Af = 10;
f_L = 100; // i n Hz
f_H = 10; // i n kHz
// Af= A/(1+A B i t a )
Bita = 1/ Af -1/ A ;
f_desh_L = f_L /(1+ A * Bita ) ; // i n Hz
f_desh_H = f_H /(1+ A * Bita ) ; // i n kHz
disp ( f_desh_L , Low f r e q u e n c y i n Hz i s : )
disp ( f_desh_H , High f r e q u e n c y i n kHz i s : )
// Note : I n t h e book C a l c u l a t i o n t o f i n d t h e v a l u e
o f h i g h f r e q u e n c y i . e . f d e s h H i s wrong s o t h e
a n s w e r i n t h e book i s wrong
105
// Exa 5 . 2 5
clc ;
clear ;
close ;
// Given d a t a
Vs = 100; // i n mV
Vf = 95; // i n mV
Vs = Vs *10^ -3; // i n V
Vf = Vf *10^ -3; // i n V
Vo =10; // i n V
Vi = Vs - Vf ; // i n V
Av = Vo / Vi ; // i n V/V
disp ( Av , V a l u e o f A i n V/V i s : )
Bita = Vf / Vo ; // i n V/V
disp ( Bita , V a l u e o f B i t a i n V/V i s : )
// Note : I n t h e book C a l c u l a t i o n t o f i n d t h e v a l u e
o f B i t a i s wrong s o t h e a s n w e r i n t h e book i s
wrong
// Exa 5 . 2 6
clc ;
clear ;
close ;
// Given d a t a
Is = 100; // i n
A
Is = Is *10^ -6; // i n A
If = 95; // i n
A
106
9
10
11
12
13
14
15
16
17
If = If *10^ -6; // i n A
Io = 10; // i n mA
Io = Io *10^ -3; // i n A
A = Io /( Is - If ) ; // n A/A
Bita = If / Io ; // A/A
disp (A , V a l u e o f A i n A/A i s : )
disp ( Bita , V a l u e o f B i t a i n A/A i s : )
// Note : I n t h e book , t o e v a l u a t i n g t h e v a l u e o f
B i t a , t h e y p u t t e d wrong v a l u e o f I f ( 9 5 a t p l a c e
of 90)
Scilab code Exa 5.28 Gain input resistance and output resistance of the
closed loop amp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
// Exa 5 . 2 8
clc ;
clear ;
close ;
// Given d a t a
A =2000; //V/V
Bita = 0.1; // inV /V
Ri = 1; // i n kohm
Ri = Ri *10^3; // i n ohm
Ro = 1; // i n kohm
Ro = Ro *10^3; // i n ohm
Af = A /(1+ A * Bita ) ;
disp ( Af , The g a i n Af i n v o l t i s : )
Rif = Ri *(1+ A * Bita ) ; // i n ohm
disp ( Rif *10^ -3 , The i n p u t r e s i s t a n c e i n kohm i s : )
Rof = Ro /(1+ A * Bita ) ; // i n ohm
disp ( Rof *10^ -3 , The o u t p u t r e s i s t a n c e i n kohm i s :
)
18
19
107
// Note : I n t h e book , t o f i n d i n g t h e v a l u e o f Af ,
R i f and Rof t h e r e i s m i s s p r i n t i n g t o p u t t i n g t h e
v a l u e o f B i t a but v a l u e o f Af and R i f i s c o r r e c t
b e c a u s e t o c a l c u l a t i n g Af and R i f , t h e v a l u e o f
Bita i s taken . 1 ( not . 0 1 )
21 //
but t o e v a l u a t i n g t h e v a l u e o f Rof
c a l c u l a t i o n i s a l s o wrong s o t h e a n s w e r i n t h e
book i s wrong
20
// Exa 5 . 2 9
clc ;
clear ;
close ;
// Given d a t a
// P a r t ( b )
Af = 10;
A = 10^4;
// Af= A/(1+A B i t a ) ;
Bita = 1/ Af -1/ A ;
// B i t a= R1 / ( R1+R2 )
R2_by_R1 = 1/ Bita -1;
disp ( R2_by_R1 , V a l u e o f R2/R1 i s : )
// P a r t ( c )
Vs = 1; // i n V
Vo = (1+ R2_by_R1 ) * Vs ;
disp ( Vo , V a l u e o f Vo i n v o l t i s : )
Vf = Vo /(1+ R2_by_R1 )
disp ( Vf , V a l u e o f Vf i n v o l t i s : )
108
Chapter 6
Oscillators
Scilab code Exa 6.1 Minimum gain of the amplifier to provide oscillation
1
2
3
4
5
6
7
8
9
10
11
// Exa 6 . 1
clc ;
clear ;
close ;
// Given d a t a
Vf = 0.0125; // i n v o l t
Vo = 0.5; // i n v o l t
Bita = Vf / Vo ;
// For o s c i l l a t o r A B i t a= 1
A = 1/ Bita ;
disp ( A m p l i f i e r S h o u l d have a minimum g a i n o f +
string ( A ) + t o p r o v i d e o s c i l l a t i o n )
109
4
5
6
7
8
9
10
11
12
13
14
15
close ;
// Given d a t a
R1 = 50; // i n kohm
R1 = R1 *10^3; // i n ohm
R2 = R1 ; // i n ohm
R3 = R2 ; // i n ohm
C1 = 60; // i n pF
C1 = C1 *10^ -12; // i n F
C2 = C1 ; // i n F
C3 = C2 ; // i n F
f = 1/(2* %pi * R1 * C1 * sqrt (6) ) ;
disp ( f *10^ -3 , F r e q u e n c y o f o s c i l l t i o n s i n kHz i s :
)
// Exa 6 . 3
clc ;
clear ;
close ;
// Given d a t a
f =2; // i n kHz
f = f *10^3; // i n Hz
// L e t
R = 10; // i n kohm
( As R s h o u l d be g r e a t e r t h a n 1
kohm )
R = R *10^3; // i n ohm
// Formula f= 1 / ( 2 %pi RC)
C = 1/(2* %pi * f * R ) ; // i n F
C = C *10^9; // i n nF
// For B i t a t o be 1 / 3 , Choose
R4 = R ; // i n ohm
R3 = 2* R4 ; // i n ohm
disp (C , V a l u e o f C i n nF i s : )
disp ( R3 *10^ -3 , V a l u e o f R3 i n kohm i s : )
110
19
// Exa 6 . 4
clc ;
clear ;
close ;
// Given d a t a
R1 = 200; // i n kohm
R1 = R1 *10^3; // i n ohm
R2 = R1 ; // i n ohm
C1 = 200; // i n pF
C1 = C1 *10^ -12; // i n F
C2 = C1 ; // i n F
f = 1/(2* %pi * R1 * C1 ) ; // i n Hz
disp ( f *10^ -3 , F r e q u e n c y o f o s c i l l t i o n s i n kHz i s :
)
// Note : C a l c u l a t i o n t o f i n d t h e v a l u e o f f i n t h e
book i s wrong , s o a n s w e r i n t h e book i s wrong
// Exa 6 . 5
clc ;
clear ;
close ;
// Given d a t a
L = 100; // i n
H
L = L *10^ -6; // i n H
C1 = .001; // i n
F
C1 = C1 *10^ -6; // i n F
111
10
11
12
13
14
15
16
17
18
19
20
21
22
C2 = .01; // i n
F
C2 = C2 *10^ -6; // i n F
C = C1 * C2 /( C1 + C2 ) ; // i n F
// ( i )
f = 1/(2* %pi * sqrt ( L * C ) ) ; // i n Hz
disp ( round ( f *10^ -3) , O p e r a t i n g f r e q u e n c y i n kHz i s :
)
// ( i i )
Bita = C1 / C2 ;
disp ( Bita , Feed back f r a c t i o n i s : )
// ( i i i )
// A B i t a >=1, s o Amin B i t a= 1
Amin = 1/ Bita ;
disp ( Amin , Minimum g a i n t o s u b s t a i n o s c i l l a t i o n s i s
: )
// Exa 6 . 6
clc ;
clear ;
close ;
// Given d a t a
L = 15; // i n
H
L = L *10^ -6; // i n H
C1 = .004; // i n
F
C1 = C1 *10^ -6; // i n F
C2 = .04; // i n
F
C2 = C2 *10^ -6; // i n F
C = C1 * C2 /( C1 + C2 ) ; // i n F
f = 1/(2* %pi * sqrt ( L * C ) ) ; // i n Hz
disp ( f *10^ -3 , F r e q u e n c y o f o s c i l l a t i o n s i n kHz i s :
)
112
// Exa 6 . 7
clc ;
clear ;
close ;
// Given d a t a
L = 0.01; // i n H
C = 10; // i n pF
C = C *10^ -12; // i n F
f = 1/(2* %pi * sqrt ( L * C ) ) ; // i n Hz
disp ( f *10^ -3 , F r e q u e n c y o f o s c i l l a t i o n s i n kHz i s :
)
// Note : C a l c u l a t i o n t o f i n d t h e v a l u e o f f i n t h e
book i s wrong , s o a n s w e r i n t h e book i s wrong
// Exa 6 . 8
clc ;
clear ;
close ;
// Given d a t a
L = 0.8; // i n H
C = .08; // i n pF
C = C *10^ -12; // i n F
C_M = 1.9; // i n pF
C_M = C_M *10^ -12; // i n F
C_T = C * C_M /( C + C_M ) ; // i n F
R =5; // i n kohm
113
: )
16 // ( i i )
17 f_p = 1/(2* %pi * sqrt ( L * C_T ) ) ; // i n Hz
18 disp ( f_p *10^ -3 , p a r a l l e l r e s o n a n t f r e q u e n c y i n kHz
i s : )
19
20
// Note : C a l c u l a t i o n t o f i n d t h e v a l u e o f p a r a l l e l
r e s o n a n t f r e q u e n c y i n t h e book i s wrong , s o
a n s w e r i n t h e book i s wrong
// Exa 6 . 1 0
clc ;
clear ;
close ;
// Given d a t a
R1 = 220; // i n kohm
R1 = R1 *10^3; // i n ohm
R2 = R1 ; // i n ohm
C1 = 250; // i n pF
C1 = C1 *10^ -12; // i n F
C2 = C1 ; // i n F
f = 1/(2* %pi * R1 * C1 ) ;
disp (f , F r e q u e n c y o f o s c i l l t i o n s i n Hz i s : )
114
4
5
6
7
8
9
10
11
12
13
14
15
16
close ;
// Given d a t a
R = 10; // i n kohm
R = R *10^3; // i n ohm
f =1000;
fie = 60; // i n
// The i m p e d e n c e o f g i v e n c i r c u i t , Z= R+j 1 / ( omega
C)
// t h e p h a s e s h i f t , t a n ( f i e )= i m a g i n a r y p a r t / R e a l
part
// t a n d ( f i e ) = 1 / ( omega RC)
C = 1/(2* %pi * R * tand ( fie ) ) ;
disp ( C *10^12 , The v a l u e o f C i n pF i s : )
// Note : There i s an c a l c u l a t i o n e r r o r t o e v a l u a t e
t h e v a l u e o f C , So t h e a n s w e r i n t h e book i s
wrong
// Exa 6 . 1 2
clc ;
clear ;
close ;
// Given d a t a
L = 50; // i n
H
L = L *10^ -6; // i n H
C1 = 300; // i n pF
C1 = C1 *10^ -12; // i n F
C2 = 100; // i n pF
C2 = C2 *10^ -12; // i n F
C_eq = C1 * C2 /( C1 + C2 ) ; // i n F
f = 1/(2* %pi * sqrt ( L * C_eq ) ) ; // i n Hz
disp ( f *10^ -6 , F r e q u e n c y o f o s c i l l a t i o n s i n MHz i s :
)
115
15
16
17
Bita = C2 / C1 ;
// ( i i i )
// A B i t a >=1, s o A B i t a= 1 ( f o r s u s t a i n e d
oscillations )
18 Amin = 1/ Bita ;
19 disp ( Amin , Minimum g a i n t o s u b s t a i n o s c i l l a t i o n s
: )
is
// Exa 6 . 1 4
clc ;
clear ;
close ;
// Given d a t a
L1 = 2; // i n mH
L1 = L1 *10^ -3; // i n H
L2 = 1.5; // i n mH
L2 = L2 *10^ -3; // i n H
// Formula f= 1 / ( 2 %pi s q r t ( ( L1+L2 ) C)
// For f= 1 0 0 0 kHz , C w i l l be maximum
f =1000; // i n kHz
f = f *10^3; // i n Hz
Cmax = 1/((2* %pi * f ) ^2*( L1 + L2 ) ) ; // i n F
// For f= 2 0 0 0 kHz , C w i l l be maximum
f =2000; // i n kHz
f = f *10^3; // i n Hz
Cmin = 1/((2* %pi * f ) ^2*( L1 + L2 ) ) ; // i n F
disp ( Cmin *10^12 , Minimum C a p a c i t a n c e i n pF i s : )
disp ( Cmax *10^12 , Maximum C a p a c i t a n c e i n pF i s : )
116
Chapter 7
Examintion Paper
// Exa 1 . b
clc ;
clear ;
close ;
// Given d a t a
R1 = 10; // i n k
R2 = 10; // i n k
Rf = 50; // i n k
V = 2; // i n V
V1 = V * R1 /( R1 + R2 ) ; // i n V
V01 = - Rf / R1 * V1 ; // i n V
disp ( V1 , The v a l u e o f V1 i n v o l t s i s : )
disp ( V01 , The v a l u e o f V01 i n v o l t s i s : )
disp ( Only 2 V s o u r c e t h e n t h e c i r c u i t a c t s a s non
i n v e r t i n g a m p l i f i e r )
117
// Exa 2 . a
clc ;
clear ;
close ;
// Given d a t a
V_P = -4; // i n V
I_DSS = 10; // i n mA
V_GS = 0; // i n V
R_D = 1.8; // i n k
V_DD = 20; // i n V
I_D = I_DSS *(1 - V_GS / V_P ) ^2; // i n mA
// A p p l y i n g KVL t o t h e c i r c u i t , we g e t V DD= I D R D
+V D
13 V_D = V_DD - I_D * R_D ; // i n V
14 disp ( I_D , The v a l u e o f I D i n mA i s : )
15 disp ( V_D , The v a l u e o f V D i n v o l t s i s : )
1
2
3
4
5
6
7
8
9
10
11
12
// Exa 2 . c
clc ;
clear ;
close ;
// Given d a t a
V_GS = 3; // i n V
Vth = 1; // i n V
unCox = 25; // i n mA/V2
unCox = unCox *10^ -3; // i n A/V2
W =3; // i n
m
L =1; // i n
m
r_DS = 1/( unCox * W / L *( V_GS - Vth ) ) ; // i n
i s : )
disp ( r_DS , The v a l u e o f r DS i n
118
// Exa 3 . b
clc ;
clear ;
close ;
// Given d a t a
I_CQ = 10; // i n mA
I_CQ = I_CQ *10^ -3; // i n A
V_CQ = 5; // i n V
V_CC = 10; // i n V
R_C = 0.4; // i n k
R_C = R_C *10^3; // i n
V_BE = 0.075; // i n V
V_BB = 0.175; // i n V
bita =100;
bita_max =120;
bita_min = 40;
// A p p l y i n g KVL we g e t , V CQ= V CCI C ( R C+R E )
R_E = ( V_CC - V_CQ ) / I_CQ - R_C ; // i n
i s : )
disp ( R_E , The v a l u e o f R E i n
I_B = I_CQ / bita ; // i n A
R_B = ( V_BB - V_BE ) / I_B ; // i n
disp ( R_B *10^ -3 , The v a l u e o f R B i n k )
I_Cmax = bita_max * I_B ; // i n A
I_Cmin = bita_min * I_B ; // i n A
delta_I_CQ = I_Cmax - I_Cmin ; // i n A
disp ( delta_I_CQ *10^3 , The v a l u e o f d e l t a I C i n mA
i s : )
119