You are on page 1of 67

Scilab Textbook Companion for

Integrated Circuits
by K. R. Botkar1
Created by
Tushar Kashyap
B.TECH
Electronics Engineering
Model Engineering College
College Teacher
Ms.Vineetha George E, Model Engineering College
Cross-Checked by
Ms. Vineetha George E
August 10, 2013

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: Integrated Circuits
Author: K. R. Botkar
Publisher: Khanna Publishers
Edition: 5
Year: 2010
ISBN: 81-7409-208-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

2 Thick Film And Thin Film Hybrid ICs

3 Semoconductor Devices Fundamentals

14

5 Monolithic Components

19

7 Operational Amplifier Characteristics

23

8 Applications of Operational Amplifier

31

9 Active Filters

36

10 Special Purpose Amplifiers

38

11 Nonlinear Circuit Application

44

12 Signal Generators

47

13 Voltage Regulators

52

15 Phase Locked Loops

55

16 Bipolar and MOS Digital Gate Circuits

60

17 Light Emitting Diodes and Liquid Crystal Displays

66

List of Scilab Codes


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

2.1
2.2
2.3
2.4
2.6
2.8
2.9
2.10
2.11
3.2
3.3
3.4
3.5
3.6
5.1
5.2
5.3
5.4
7.1
7.2
7.4
7.5
7.14
7.15
7.16
7.17
8.1
8.2

Resistance . . . . . . . . . . . . . . . .
Resistance Calculation . . . . . . . . . .
Sheet Resistivity . . . . . . . . . . . . .
Design Capacitor . . . . . . . . . . . . .
Capacitance . . . . . . . . . . . . . . .
Thickness . . . . . . . . . . . . . . . . .
Length . . . . . . . . . . . . . . . . . .
Absolute Coefficient . . . . . . . . . . .
Ratio . . . . . . . . . . . . . . . . . . .
Resistivity . . . . . . . . . . . . . . . .
Resistivity of Intrinsic Ge . . . . . . . .
Hole Concentration . . . . . . . . . . .
Resistivity of Cu . . . . . . . . . . . . .
Bipolar Transistor Parameters . . . . .
Transit Time . . . . . . . . . . . . . . .
Unit gain frequency . . . . . . . . . . .
Resistance and Sheet resistance . . . . .
Capacitance per unit area . . . . . . . .
Bipolar Differential Amplifier Parameter
Rc and Re . . . . . . . . . . . . . . . .
Offset Voltage Change . . . . . . . . . .
Temperature Coefficient . . . . . . . . .
Effect on Output Voltage . . . . . . . .
Slew rate and Fmax . . . . . . . . . . .
Largest Amplitude . . . . . . . . . . . .
Maximum allowable frequency . . . . .
Device Temperature . . . . . . . . . . .
Device Temperature . . . . . . . . . . .
4

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

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

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

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

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

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

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

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

6
7
8
8
9
10
10
11
12
14
15
15
16
16
19
20
20
21
23
24
25
26
27
28
28
29
31
32

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

8.3
8.4
8.7
8.8
9.6
9.12
10.3
10.4
10.8
10.9
11.4
11.5
11.11
12.6
12.11
12.12
12.20
13.3
13.14
15.2
15.3
15.4
15.5
16.2
16.3
16.12
16.13
16.14
17.2

Device Temperature . . . . . . . . . . . . . . . . .
Device Temperature . . . . . . . . . . . . . . . . .
Output Voltage . . . . . . . . . . . . . . . . . . . .
Vp and Vo . . . . . . . . . . . . . . . . . . . . . .
Determine Q Fl and Fh . . . . . . . . . . . . . . .
Unity gain frequency and Capacitor determination
Class B Power Amplifier . . . . . . . . . . . . . . .
Power Output . . . . . . . . . . . . . . . . . . . .
LM4250 Parameters . . . . . . . . . . . . . . . . .
Common Emitter Amplifier Parameters . . . . . .
Time taken . . . . . . . . . . . . . . . . . . . . . .
Rise Time . . . . . . . . . . . . . . . . . . . . . . .
Design Peak Detector . . . . . . . . . . . . . . . .
555 Timer . . . . . . . . . . . . . . . . . . . . . . .
Design . . . . . . . . . . . . . . . . . . . . . . . . .
Generating pulse by 555 timer . . . . . . . . . . .
Waveform Generator . . . . . . . . . . . . . . . . .
Maximum Efficiency and Power . . . . . . . . . . .
Inductor and Capacitor . . . . . . . . . . . . . . .
Output Signal Frequency . . . . . . . . . . . . . .
VCO and Phase detector . . . . . . . . . . . . . .
Second Order Butterworth Filter . . . . . . . . . .
Lock Range . . . . . . . . . . . . . . . . . . . . . .
Noise Margin . . . . . . . . . . . . . . . . . . . . .
Fanouts . . . . . . . . . . . . . . . . . . . . . . . .
NMOS operating region . . . . . . . . . . . . . . .
Power Dissipation . . . . . . . . . . . . . . . . . .
AC Power . . . . . . . . . . . . . . . . . . . . . . .
Viewing distance . . . . . . . . . . . . . . . . . . .

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

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

32
33
33
34
36
36
38
39
40
41
44
44
45
47
48
48
50
52
53
55
56
57
58
60
61
62
63
64
66

Chapter 2
Thick Film And Thin Film
Hybrid ICs

Scilab code Exa 2.1 Resistance


1
2
3

5
6
7
8
9
10
11
12
13
14

// C h a p t e r 2 T h i c k Film and Thin Film H y b r i d I C s


// C a p t i o n : R e s i s t a n c e
// Example2 . 1 : a ) A r e s i s t o r h a s an a s p e c t r a t i o o f
2 0 : 1 and s h e e t r e s i s t a n c e o f 200 ohm/ s q u a r e . Find
out the value o f r e s i s t a n c e .
// b ) Find o u t t h e number o f s q u a r e s c o n t a i n e d i n a
2 k i l o o h m r e s i s t o r whose s h e e t r e s i s t a n c e i s 200
ohm p e r s q u a r e .
// S o l u t i o n : a )
clear ;
clc ;
function y = myfunction (x , z ) // y : r e s i s t a n c e , x : s h e e t
r e s i s t a n c e =200ohm/ s q u a r e , z : a s p e c t r a t i o =20:1
y = x * z // s i n c e , r e s i a t a n c e =s h e e t r e s i s t a n c e
disp ( r e s i s t a n c e i s =)
d i s p ( ohm , y )
endfunction
// S o l u t i o n : b )
6

15
16

17
18
19
20
21

// we have t o f i n d number o f s q u a r e which i s t o f i n d


aspect ratio .
function s = myfunction1 (r , p ) // r : r e s i s t o r =2kohm ( o r
2 0 0 0 ohm ) , p : s h e e t r e s i s t a n c e =200 Ohm/ s q u a r e , s :
number o f s q u a r e ( a s p e c t r a t i o )
s = r / p // s i n c e , number o f s q u a r e =( r e s i s t o r / s h e e t
resistance )
disp ( number o f s q u a r e s a r e =) // i n c l u d e ; a t t h e
time o f c a l l i n g the f u n c t i o n
d i s p ( squares , s )
endfunction
// m y f u n c t i o n ( 2 0 0 , 2 0 / 1 ) ; m y f u n c t i o n 1 ( 2 0 0 0 , 2 0 0 ) ;

Scilab code Exa 2.2 Resistance Calculation


1
2
3

4
5
6
7

8
9

10
11
12

// C h a p t e r 2 T h i c k Film and Thin Film H y b r i d I C s


// C a p t i o n : R e s i s t a n c e c a l c u l a t i o n
// Example2 . 2 : A t h i c k f i l m r e s i s t o r i s s c r e e n e d w i t h
a p a s t e o f f s h e e t r e s i s t i v i t y 1 0 0 0 0 ohm/ s q u a r e ,
and t h e r e s i s t o r i s d e f i n e d a s 0 . 2 4 cm l o n g and
0 . 0 6 cm w i d e . C a l c u l a t e t h e r e s i s t a n c e R .
// S o l u t i o n :
clear ;
clc ;
function R = myfunction3 (p ,l , w ) // r : r e s i s t o r , p=s h e e t
r e s i s t a n c e =10000 ohm/ s q u a r e , l : l e n g t h o f r e s i s t o r
=0.24cm , w : w i d t h o f t h e r e s i s t o r =0.06cm
R = p *( l / w ) // s i n c e , r e s i s t a n c e =s h e e t r e s i s t a n c e (
l e n g t h o f r e s i s t o r / width o f the r e s i s t o r )
disp ( r e s i s t a n c e o f t h e t h i c k f i l m r e s i s t o r i s =
) // a t t h e t i m e o f c a l l i n g t h e f u n c t i o n
include ; after it
disp ( ohm ,R )
endfunction
// m y f u n c t i o n 3 ( 1 0 0 0 0 , 0 . 2 4 , 0 . 0 6 ) ;
7

Scilab code Exa 2.3 Sheet Resistivity


1
2
3

4
5
6
7

9
10
11
12

// C h a p t e r 2 T h i c k Film and Thin Film H y b r i d I C s


// C a p t i o n : S h e e t R e s i s t i v i t y
// Example2 . 3 : C a l c u l a t e t h e s h e e t r e s i s t i v i t y o f a
square o f t h i c k f i l m r e s i s t o r m a t e r i a l with the
f o l l o w i n g p r o p e r t i e s : b u l k r e s i s t i v i t y =101ohm
cm and t h i c k f i l m t h i c k n e s s =10 m i c r o m e t e r .
// S o l u t i o n :
clear ;
clc ;
function Ps = myfunction4 (p , t ) // Ps : s h e e t r e s i s t a n c e ,
p : b u l k r e s i s t i v i t y o f t h i c k f i l m =101( o r 0 . 0 1 ) ,
t : t h i c k n e s s o f t h i c k f i l m =10 m i c r o m e t e r
(=1010 4=0.001)
Ps = p / t // s i n c e , s h e e t r e s i s t a n c e o f t h e f i l m=
bulk r e s i s t a n c e of the f i l m / t h i c k n e s s of the
film
disp ( s h e e t r e s i s t i v i t y i s = ) // i n c l u d e ; a t a t
the time o f c a l l i n g the f u n c t i o n
disp ( ohm p e r s q u a r e , Ps )
endfunction
// m y f u n c t i o n 4 (10 1 ,1010 4) ;

Scilab code Exa 2.4 Design Capacitor


1
2
3

// C h a p t e r 2 T h i c k Film and Thin Film H y b r i d I C s


// C a p t i o n : D e s i g n C a p a c i t o r
// Example2 . 4 : D e s i g n a c i r c u l a r 100 pF c a p a c i t o r w i t h
the thick f i l m d i e l e c t r i c having d i e l e c t r i c f i l m
t h i c k n e s s =0.02mm( o r 0 . 0 0 2 cm ) , assume Er =100
8

4
5
6
7
8
9
10

11

12
13
14

// S o l u t i o n : We have t o f i n d t h e r a d i u s o f c r c u l a r
c a p a c i t o r i n o r d e r to design i t .
clear ;
clc ;
function r1 = myfunction5 (c , t )
r1 = c * t // c o n s t a n t=c a p a c i t o r t h i c k n e s s o f t h i c k
film
Er =100 // g i v e n r e l a t i v e p e r m e a b i l i t y o f t h i c k
film
r = sqrt ( r1 /( Er * %pi *8.85*10^ -12) ) // r a d i u s o f
c i r c u l a r c a p a c i t o r , Eo =8 ,8510 12( d i e l e c t r i c
constant of f r e e space )
disp ( r a d i u s o f c i r c u l a r c a p a c i t o r i s = ) //
i n c l u d e ; at the time o f c a l l i n g the
function
disp ( m e t e r ,r )
endfunction
// m y f u n c t i o n 5 ( 1 0 0 1 0 1 2 , 0 . 0 0 2 ) ;

Scilab code Exa 2.6 Capacitance


1
2
3

4
5
6
7
8

// C h a p t e r 2 T h i c k Film and Thin Film H y b r i d I C s


// C a p t i o n : C a p a c i t a n c e
// Example2 . 6 : Find o u t t h e c a p a c i t a n c e o f a t h i c k
f i l m c a p a c i t o r , i f t h e d i e l e c t r i c c o n s t a n t Er =100 ,
d i e l e c t r i c f i l m t h i c k n e s s =25 m i c r o m e t e r and a r e a A
= 0 . 0 6 2 5 cm s q u a r e .
// S o l u t i o n :
clear ;
clc ;
function c = capacitance ( Er ,A , t )
c =8.8*10^ -12* Er * A /(10^ -12* t ) // c a p a c i t a n c e v a l u e
w i l l be 2.210 10 o r 220 pF , Eo : d i e l e c t r i c
c o n s t a n t o f f r e e s p a c e =8.810 12 , Er :
d i e l e c t r i c c o n s t a n t o f t h i c k f i l m= 1 0 0 ( g i v e n )
9

9
10

11
12
13

, A : a r e a o f t h i c k f i l m = 0 . 0 6 2 6 cm s q u a r e ( o r
0 . 0 6 2 5 1 0 4m s q u a r e ) , t : t h i c k n e s s o f t h e
t h i c k f i l m= 2510 6m)
// c a p a c i t a n c e=Eo Er A/ t
disp ( c a p a c i t a n c e i s = ) // c = 2 . 2 0 0D
10(=2.210 10)F , i n c l u d e ; a t l a s t a t t h e
time o f c a l l i n g the f u n c t i o n
disp ( pF ,c ) // pF : p i c o Farad
endfunction
// c a p a c i t a n c e ( 1 0 0 , 0 . 0 6 2 5 1 0 4 , 2 5 1 0 6 ) ;

Scilab code Exa 2.8 Thickness


1
2
3

4
5

6
7
8
9
10

// C h a p t e r 2 T h i c k Film and Thin Film H y b r i d I C s


// C a p t i o n : T h i c k n e s s
// Example2 . 8 : The b u l k r e s i s t i v i t y o f n i c h r o m i s 120
uohmcm . C a l c u l a t e t h e t h i c k n e s s T i n a n g s t r o m s
o f a f i l m w i t h s h e e t r e s i s t i v i t y o f 100ohm/ s q u a r e
.
// S o l u t i o n :
function T = thickness ( Ps , p ) // Ps : s h e e t r e s i s t i v i t y
o f n i c h r o m =100ohm/ s q u a r e , p : b u l k r e s i s t i v i t y o f
n i c h r o m =120uohmcm
T = p /( Ps *10^ -8) // s i n c e Ps=p/T and 1 a n g s t r o m
=108cm , s o d i v i d i n g by 10 8 h e r e
disp ( t h i c k n e s s i s = ) // i n c l u d e ; a t t h e t i m e
of ca ll im g the function
disp ( a n g s t r o m ,T )
endfunction
// t h i c k n e s s ( 1 0 0 , 1 2 0 1 0 6 ) ;

Scilab code Exa 2.9 Length


10

1
2
3

4
5
6
7

8
9
10
11
12

// C h a p t e r 2 T h i c k Film and Thin Film H y b r i d I C s


// C a p t i o n : Length
// Rxample2 . 9 : C a l c u l a t e t h e l e n g t h o f a 400ohm t h i n
f i l m r e s i s t o r . Given a s h e e t r e s i s t i v i t y o o f 100
ohm/ s q u a r e and a r e s i s t o r w i d t h o f 100um
// S o l u t i o n :
clear ;
clc ;
function L = extent (r ,w , Ps ) // L : l e n g t h o f t h i n f i l m , r
: r e s i s t a n c e o f t h i n f i l m =400ohm , w : w i d t h o f
r e s i s t o r =100um , Ps : s h e e t r e s i s t a n c e =100ohm/ s q u a r e
L = r * w /(10^ -6* Ps ) // s i n c e , r=Ps L/w and l e n g t h i n
m i c r o m e t e r s o d i v i d i n g by 10 6.
disp ( l e n g t h o f t h i n f i l m i s = ) // i n c l u d e ; a t
the time o f c a l l i n g the f u n c t i o n at l a s t
disp ( m i c r o m e t e r ,L )
endfunction
// e x t e n t ( 4 0 0 , 1 0 0 1 0 6 , 1 0 0 ) ;

Scilab code Exa 2.10 Absolute Coefficient


1
2
3

4
5
6
7

// C h a p t e r 2 T h i c k Film and Thin Film H y b r i d I C s


// C a p t i o n : A b s o l u t e C o e f f i c i e n t
// Example2 . 1 0 : A t h i n f i l m r e s i s t o r m e a s u r e s 150 ohmat
25 d e g r e e c e l c i u s and 1 5 1 . 5 ohm a t 100 d e g r e e
c e l ci u s . Calculate i t s absolute c o e f f i c i e n t of
r e s i s t a n c e i n p a r t s p e r m i l l i o n ( ppm ) p e r d e g r e
celcius .
// S o l u t i o n :
clear ;
clc ;
function TCR = absresistor ( Rt1 , Rt2 , T1 , T2 ) // TCR :
absolute temperature c o e f f i c i e n t of resist ance ,
Rt1 : r e s i s t a n c e a t 100 d e g r e e c e l c i u s =150ohm , Rt2 :
r e s i s t a n c e a t 25 d e g r e e c e l c i u s = 1 5 1 . 5 ohm , T1 :
11

8
9

10
11
12

t e m p e r a t u r e =100 d e g r e e c e l c i u s , T2 : t e m p e r a t u r e =25
degree c e l c i u s
TCR =( Rt2 - Rt1 ) *10^6/( Rt1 *( T1 - T2 ) )
disp ( a b s o l u t e c o e f f i c i e n t o f r e s i s t a n c e i s =) //
i n c l u d e ; at the time o f c a l l i n g the
f u n c t i o n at l a s t
d i s p ( ppm / degree Celsius , TCR ) // ppm : p a r t p e r
million
endfunction
// a b s r e s i s t o r ( 1 5 0 , 1 5 1 . 5 , 1 0 0 , 2 5 ) ;

Scilab code Exa 2.11 Ratio


1
2
3

4
5
6
7
8
9
10
11
12
13
14

// C h a p t e r 2 T h i c k Film and Thin Film H y b r i d I C s


// C a p t i o n : R a t i o
// Example2 . 1 1 : Two t h i n r e s i s t o r a r e m e a s u r e d a t 50
d e g r e e c e l c i u s and 100 d e g r e e c e l s i u s and a r e
f o u n d t o have t h e f o l l o w i n g v a l u e s :
// Temperatur ( d e g r e e C)
Ra ( ohm )
Rb ( ohm )
//
50
50
100
//
100
51
102.1
// C a l c u l l a t e t h e r a t i o TCR i n ppm/ d e g r e e c e l c i u s .
// S o l u t i o n :
function TCR = ratio ( Rat1 , Rbt1 , Rat2 , Rbt2 , T1 , T2 )
TCR =( Rat2 / Rbt2 - Rat1 / Rbt1 ) *10^6/(( Rat1 / Rbt1 ) *( T1 T2 ) )
disp ( r a t i o TCR i s =) // i i n c l u d e ; a t t h e t i m e
of c a l l i n g the f u n c t i o n at l a s t
d i s p ( ppm / degree Celsius , TCR ) //ppm : p a r t p e r
million
endfunction
// r a t i o ( 1 0 0 , 5 0 , 1 0 2 . 1 , 5 1 , 1 0 0 , 5 0 ) ;
12

13

Chapter 3
Semoconductor Devices
Fundamentals

Scilab code Exa 3.2 Resistivity


1
2
3

4
5
6
7

8
9
10

11
12
13

// C h a p t e r 3 S e m o c o n d u c t o r D e v i c e s F u n d a m e n t a l s
// C a p t i o n : R e s i s t i v i t y
// Example3 . 2 : A Sample o f S i i s doped w i t h 1 0 1 7
p h o s p h o r u s atoms / c u b i c cm . What i s i t s
r e s i s t i v i t y ? Given Un=700 s q u a r e cm/vs e c .
// S o l u t i o n :
clear ;
clc ;
function Res = resistivity (u , n ) // n : doped c o n c e n t r a t i o n
=1017 atoms / c u b i c cm , u : m o b i l i t y o f e l e c t r o n s
=700 s q u a r e cm/vs e c .
q =1.6*10^ -19 // q : c h a r g e
Res =1/( q * u * n ) // s i n c e P i s n e g l e g i b l e .
disp ( r e s i s t i v i t y o f t h e s i doped w i t h
n
d o p a n t i s : ) // i n c l u d e ; a t t h e t i m e o f
calling
disp ( ohmcm , Res )
endfunction
// a f t e r e x e c u t i n g c a l l i n g r e s i t i v i t y ( u=700 and n
14

=1017) i . e . ,
resistivity
(1017 ,700) ;
14 // R e s u l t : R e s i s t i v i t y o f t h e S i doped w i t h nd o p a n t
i s : 0 . 0 8 9 ohmcm ( a p p r o x )

Scilab code Exa 3.3 Resistivity of Intrinsic Ge


1
2
3

4
5
6
7
8
9
10
11
12

// C h a p t e r 3 S e m o c o n d u c t o r D e v i c e s F u n d a m e n t a l s
// C a p t i o n : R e s i s t i v i t y o f I n t r i n s i c Ge
// Example3 . 3 : Find t h e r e s i s t i v i t y o f i n t r i n s i c Ge
a t 300K . Given un =3900 , and up =1900 cm2/N s e c .
and n i = 2 . 5 1 0 1 3 cm3 f o r i n t r i n s i c Ge .
// S o l u t i o n :
function RES = resistivity ( un , up ) // un : e l e c t r o n
c o n c e n t r a t i o n , up : h o l e c o n c e n t r a t i o n
q =1.6*10^ -19; // i n coulumb
ni =2.5*10^13; // c o n c e n t r a t i o n i n cm3
RES =1/( q * ni *( un + up ) ) // s i n c e n=p=n i
disp ( r e s i s t i v i t y o f i n t r i n s i c Ge i s : )
disp ( ohmcm , RES )
endfunction
// r e s i s t i v i t y ( 3 9 0 0 , 1 9 0 0 ) ;

Scilab code Exa 3.4 Hole Concentration


// C h a p t e r 3 S e m o c o n d u c t o r D e v i c e s F u n d a m e n t a l s
// C a p t i o n : H o l e C o n c e n t r a t i o n
// Example3 . 4 : A s e m i c o n d u c t o r i s doped w i t h a
c o n c e n t r a t i o n o f 1 0 1 7 atoms /cm3 o f r s e n i c .
What i s t h e e q u i l i b r i u m h o l e c o n c e n t r a t i o n p a t
300K . Given n i = 1 . 5 1 0 1 0 cm3
4 // S o l u t i o n :
5 clear ;

1
2
3

15

6 clc ;
7 function p = holeconcentration ( ni , Nd ) // n i= i n t r i n s i i c

8
9
10
11
12

c o n c e n t r a t i o n = 1 . 5 1 0 1 0 cm 3 , Nd : d o n a r
c o n c e n t r a t i o n ; s i n c e , Nd>>n i , s o Nd=n =1017 atoms
/cm 3 .
p = ni ^2/ Nd
disp ( h o l e c o n c e n t r a r t i o n a t 300K i s : )
disp ( p e r c u b i c cm ,p )
endfunction
// h o l e c o n c e n t r a t i o n ( 1 . 5 1 0 1 0 , 1 0 1 7 ) ;

Scilab code Exa 3.5 Resistivity of Cu


1
2
3

4
5
6
7
8
9
10
11

// C h a p t e r 3 S e m o c o n d u c t o r D e v i c e s F u n d a m e n t a l s
// C a p t i o n : R e s i s t i v i t y o f Cu
// Example3 . 5 : The r e s i s t i v i t y o f m e t a l i s g i v e n by p
=1/nqu , where n i s number o f e l e c t r o n s p e r c u b i c
meter , u i s m o b i l i t y , a nd q i s e l e c t r o n i c c h a r g e
. D e t e r m i n e t h e r e s i s t i v i t o f c o p p e r a t room
t e m p e r a t u r e . Given n = 8 . 5 1 0 2 8 p e r c u b i c meter , u
=3.210 3 m2/Vs e c , a t room t e m p e r a t u r e .
// S o l u t i o n :
q =1.6*10^ -19;
n =8.5*10^28;
u =3.2*10^ -3;
p =1/( n * q * u ) ;
disp ( r e s i s t i v i t y o f t h e c o p p e r i s : )
disp ( ohmm e t e r ,p )
// 2 . 2 9 8D08 means 2 . 2 9 8 1 0 8

Scilab code Exa 3.6 Bipolar Transistor Parameters


1

// C h a p t e r 3 S e m o c o n d u c t o r D e v i c e s F u n d a m e n t a l s
16

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

// C a p t i o n : B i p o l a r T r a n s i s t o r P a r a m e t e r s
// Example3 . 6 : D e t e r m i n e Cu , Ccs ,Gm, C1 , R1 , R0 and Ru
f o r a b i p o l a r t r a n s i s i t o r . Given : I c =0.2 mA, Vcb
=10V, Vcs =15V, Cuo =0.25 pF , C j e=1 pF , Ccso =1.5 pF , Bo
=2000 , Tf =0.3 ns , n=2104 and Vo =0.55V f o r a l l
junctions .
// S o l u t i o n :
clear ;
clc ;
Cuo =0.25; // c o l l e c t o r b a s e d e p l e t i o n r e g i o n
c a p a c i t a n c e i n p i c o Farad ( pF ) f o r z e r o b i a s
Ccso =1.5 ; // c o l l e c t o r s u b s t r a t e j u n c t i o n
c a p a c i t a n c e i n p i c o Farad ( pF ) f o r z e r o b i a s
q =1.6*10^ -19 ; // e l e c t r o n c h a r g e i n coulomb
Ic =0.2 ; // c o l l e c t o r c u r r e n t i n ampere (A)
k =8.6*10^ -5; // i n eV/K, where 1eV =1.610 19
T =300; // a b s o l u t e t e m p e r a t u r e i n k e l v i n (K)
Vcb =10 ; // f o r w a r d b i a s on t h e j u n c t i o n i n v o l t ( v )
Vcs =15 ; // c o l l e c t o r s u b s t r a t e b i a s i n v o l t (V)
Cje =1 ; // d e p l e t i o n r e g i o n c a p a c i t a n c e i n p i c o Farad (
pF )
Bo =200; // s m a l l s i g n a l c u r r e n t g a i n
Tf =0.3; // t r a n s i t t i m e i n f o r w a r d d i r e c t i o n i n nano
s e c o n d s ( nS )
n =2*10^ -4; // p r o p o r t i o n a l i t y c o n s t a n t f o r Ro and gm
Vo =0.55; // b i a s v o l t a g e i n v o l t (V)
Cu = Cuo / sqrt (1+( Vcb / Vo ) ) ; // c o l l e c t o r b a s e
capacitance
disp ( Cu i s : )
disp ( pF , Cu )
Ccs = Ccso / sqrt (1+( Vcs / Vo ) ) ; // c o l l e c t o r s u b s t r a t e
capacitance
disp ( Ccs i s : )
disp ( pF , Ccs )
gm = q * Ic /( k * T *1.6*10^ -19) ; // s i n c e k i s i n eV s o
c o n v e r t i n g i t i n Coulomb / K e l v i n
disp ( gm i s : ) // t r a n s c o n d u c t a n c e o f t h e b i p o l a r
t r a n s i s t o r here
17

28 disp ( mA/V , gm )
29 Cb = Tf * gm ; // d i f f u s i o n c a p a c i t a n c e i n p i c o Farad ( pF )
30 C1 = Cb + Cje ; // s m a l l s i g n a l c a p a c i t a n c e o f b i p o l a r

transistor
31 disp ( C1 i s : )
32 disp ( pF , C1 )
33 R1 = Bo / gm ; // s m a l l
34
35
36
37
38
39
40
41

s i g n a l input r e s i s t a n c e of bipolar
transistor
disp ( R1 i s : )
disp ( k i l o Ohm , R1 )
Ro =1/( n * gm ) ; // s m a l l s i g n a l o u t p u t r e s i s t a n c e
disp ( R0 i s )
disp ( k i l o Ohm , Ro )
Ru =10* Bo * Ro /10^3; // c o l l e c t o r b a s e r e s i s t a n c e
disp ( Ru i s : )
disp ( Mega Ohm , Ru )

18

Chapter 5
Monolithic Components

Scilab code Exa 5.1 Transit Time


1
2
3

4
5
6
7
8
9
10
11
12
13

// C h a p t e r 5 M o n o l i t h i c Components
// C a p t i o n : T r a n s i t Time
// Example5 . 1 : A l a t e r a l pnp d e v i c e b a s e w i d t h i s 8
um and t h e d i f f u s i o n c o f f i c i e n t f o r b a s e r e g i o n
i s 10 cm2/ s e c . C a l c u l a t e t h e b a s e t r a n s i t t i m e
and t h e u n i t y g a i n f r e q u e n c y .
// S o l u t i o n :
function T = transittime (W , D ) //W: b a s e w i d t h =8um ; D :
b a s e d i f f u s i o n c o f f i c i e n t =10 s q cm/ s e c .
T = W ^2/(2* D ) ; // s i n c e f ( t r a n s i t f r e q u e n c y
r e s p o n s e ) =2D/ (W 2 )
disp ( b a s e t r a n s i t t i m e i s : )
disp ( n s ,T *10^9) // i n n a n o s e c o n d s ( n s )
F =1/(2* %pi * T ) // where F=u n i t y g a i n f r e q u e n c y
=1/(2 %pi t r a n s i t t i m e )
disp ( u n i t y g a i n f r e q u e n c y i s : )
disp ( MHz ,F /10^6) // i n Mega H e r t z
endfunction
// t r a n s i t t i m e ( ( 8 1 0 6 ) ,1 0 1 0 4 ) ;

19

Scilab code Exa 5.2 Unit gain frequency


1
2
3

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

// C h a p t e r 5 M o n o l i t h i c Components
// C a p t i o n : U n i t g a i n f r e q u e n c y
// Example5 . 2 : a ) Find F l ( u n i t g a i n f r e q u e n c y ) f o r
t h e l a t e r a l pnp d e v i c e . Assume d i f f u s i o n
c o f f i c i e n t o f h o l e s i n t h e b a s e o f 0 . 5 s q cm/ s e c
and b a s e w i d t h o f 10um .
// b ) Find t h e Fs ( u n i t g a i n f r e q u e n c y ) f o r t h e
s u b s t r a t e pnp d e v i c e . Assume D=20 sqcm / s e c and W=8
um .
clear ;
clc ;
// a ) S o l u t i o n : f o r t h e l a t e r a l pnp d e v i c e
Wl =10*10^ -4; // b a s e w i d t h i n m i c r o c e n t i m e t e r ( ucm )
Dl =0.5; // b a s e d i f f u s i o n c o f f i c i e n t i n s q cm/ s e c
Fl =2* Dl /( Wl ^2) ;
disp ( u n i t g a i n f r e q u e n c y f o r l a t e r a l pnp d e v i c e i s
; )
disp ( MHz , Fl /10^6)
// b ) S o l u t i o n : f o r s u b s t r a t e pnp d e v i c e
Ws =8*10^ -4; // b a s e i n ucm
Ds =20; // b a s e d i f f u s i o n c o f f i c i e n t i n s q cm/ s e c
Fs = Ds /( Ws ^2) ;
disp ( u n i t g a i n f r e q u e n c y f o r s u b s t r a t e pnp d e v i c e
is ; )
disp ( MHz , Fs /10^6)

Scilab code Exa 5.3 Resistance and Sheet resistance


1
2

// C h a p t e r 5 M o n o l i t h i c Components
// C a p a t i o n : R e s i s t a n c e and S h e e t r e s i s t a n c e
20

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

// Example5 . 3 : a )A b a s e d i f f u s i o n l a y e r l e n g t h i s 100
um and i t s w i d t h i s 10um . The s h e e t r e s i s t a n c e o f
t h e l a y e r i s 100 ohm/ s q u a r e . C a l c u l a t e i t s
resistance .
// b ) C a l c u l a t e t h e s h e e t r e s i s t a n c e o f a 20um t h i c k
, 5 ohmcm epl a y e r .
// a ) S o l u t i o n :
L =100; // b a s e d i f f u s i o n l a y e r i n um
W =10; // b a s e d i f f u s i o n w i d t h i n um
Rs =100; // s h e e t r e s i s t a n c e i n ohm/ s q u a r e
R = L * Rs / W ;
disp ( r e s i s t a n c e o f b a s e d i f f u s i o n l a y e r i s : )
disp ( Ohm ,R )
// b ) S o l u t i o n :
Pe =5*10^ -2; // epl a y e r r e s i s t i v i t y i n ucm
t =20*10^ -6; // t h i c k n e s s o f t h e l a y e r i n um
Rse = Pe / t ; // s h e e t r e s i t i v i t y o f epl a y e r
disp ( s h e e t r e s i s t a n c e o f epl a y e r i s : )
disp ( Ohm , Rse )

Scilab code Exa 5.4 Capacitance per unit area


1
2
3

4
5
6
7
8
9
10

// C h a p t e r 5 M o n o l i t h i c Components
// C a p t i o n : C a p a c i t a n c e p e r u n i t a r e a
// Example5 . 4 : D e t e r m i n e t h e c a p a c i t a n c e p e r u n i t
a r e a o f t h e 400 a r m s t r o n g g a t e o x i d e o f a MOSFET
device r e l a t i v e permittivity of s i l i c o n dioxide
=3.9.
// S o l u t i o n :
clear ;
clc ;
Eo =8.86*10^ -14; // p e r m i t t i v i t y o f f r e e s p a c e i n F/cm
Er =3.9; // r e l a t i v e p e r m i t t i v i t y o f MOSFET d e v i c e
t =0.4*10^ -5; // t h i c k n e s s o f t h e g a t e o x i d e i n cm
Co = Eo * Er / t ; // s i n c e c a p o a c i t a n c e (C)= p e r m i t t i v i t y (E)
21

a r e a (A) / t h i c k n e s ( t ) ;
s o C/A=e / t
11 disp ( c a p a c i t a n c e p e r u n i t a r e a o f g a t e o x i d e i s : )
12 disp ( F/cm2 , Co )

22

Chapter 7
Operational Amplifier
Characteristics

Scilab code Exa 7.1 Bipolar Differential Amplifier Parameter


1
2
3

4
5
6
7
8
9
10
11
12
13
14

// C h a p t e r 7 O p e r a t i o n a l A m p l i f i e r C h a r a c t e r i s t i c s
// C a p t i o n : B i p o l a r D i f f e r e n t i a l A m p l i f i e r P a r a m e t e r
// Example7 . 1 : The f o l l o w i n g s p e c i f i c a t i o n a r e g i v e n
f o r the dual input , balanced output b i p o l a r
diferential amplifier :
// Rc =2.2 kOhm , Re=4/7kOhm , Rs=50 ohm , Vcc=10V, Vee=10V
and Bf=Bo =100. Assume
Vbe =0.7V .
// D e t e r m i n e
// a ) I c q and Vceq
// b ) D i f f e r e n t i a l mode v o l t a g e f g a i n , and
// c ) I n p u t and o u t p u t r e s i s t a n c e s .
clear ;
clc ;
// a ) S o l u t i o n : \
Rc =2.2*10^3; // c o l l e c t o r r e s i s t a n c e i n one
t r a n s i s t o r i n ohm
Re =4.7*10^3; // e m i t t e r e s i t a n c e o f one t r a n s i s t o r i n
ohm
Rs =50; // b a s e o r s o u r c e r e s i t a n c e o f one t r a n s i s t o r
23

15
16
17
18
19
20
21
22
23
24

25
26
27
28
29
30
31
32
33
34
35

i n ohm
Vcc =10; // c o l l e c t o r power s u p p l y i n V o l t
Vee = -10; // n e g a t i v e e m i t t e r power s u p p l y
Bf =100; // g a i n o f t h e t r a n s i s t o r
Bo = Bf ;
Vbe =0.7; // b a s e e m i t t e r v o l t a g e o f one t r a n s i a t o r
Icq =( abs ( Vee ) - Vbe ) /(2* Re +( Rs / Bf ) ) ;
Vceq = Vcc + Vbe - Rc * Icq ;
// b ) S o l u t i o n :
gm = Icq /(25*10^ -3) ; // where t r a n s c o n d u c t a n c e gm=I c /Vt
, Vt=25mV a t room t e m p e r a t u r e , s o gm =I c /25
Ad = - gm * Rc ; // d i f f e r e n t i a l mode v o l t a g e g a i n I c q h e r e
w i l l be t a k e n a s f o u n d a b o v e n o t a p p r o x i m a t e d
t o a s g i v e n book
// c ) S o l u t i o n :
r = Bo / gm ; // i n p u t r e s i s t a n c e o f one t r a n s i s t o r
Ri =2* r ; // d i f f e r e n t i a l mode i n p u t r e s i s t a n c e
Ro = Rc ; // d i f f e r e n t i a l mode o u t p u t r e s i s t a n c e
disp ( A , Icq *10^3 , o p e r a t i n g p o i n t c o l l e c t o r c u r r e n t
)
disp ( V , Vceq , 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 s : )
disp ( abs ( Ad ) , D i f f e r e n t i a l mode v o l t a g e g a i n )
disp ( k i l o Ohm , Ri /10^3 , I n p u t R e s i s t a n c e )
disp ( k i l o Ohm , Ro /10^3 , Output R e s i s t a n c e )
// Note :
// v a l u e o f
I c q i s t a k e n a s 0 . 0 0 0 9 8 9 3 A o r 0 . 9 8 9 3 mA
n o t a p p r o x i m a t e d t o 0 . 9 8 mA

Scilab code Exa 7.2 Rc and Re


1
2
3

// C h a p t e r 7 O p e r a t i o n a l A m p l i f i e r C h a r a c t e r i s t i c s
// C a p t i o n : Rc and Re
// Example7 . 2 : A b i p o l a r d i f f e r e n t a i l a m p l i f i e r u s e s
a t r a n s i s t o r h a v i n g Bo=200 and b i a s e d a t I c q =100
uA . D e t e r m i n e Rc and Re s o t h a t a b s ( Ad ) =500 and
24

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

CMRR=80 dB .
// S o l u t i o n :
clear ;
clc ;
//CMRR i n dB i s e x p r e s s e d a s 20logCMRR , s o 80=20
logCMRR o r
CMRR =10^(80/20) ;
Icq =100*10^ -6; // c o l l e c t o r c u r r e n t
Vt =25*10^ -3; // s t a n d a r d v a l u e o f t h r e s h o l d v o l t a g e a t
room t e m p e r a t u r e
gm = Icq / Vt ;
Re = CMRR /(2* gm ) ; // s i n c e CMRR=2gmRe ( a p p r o x )
Ad =500; // a b s o l u t e v a l u e o f d i f f e r e n t i a l mode
voltage gain
Rc = - Ad / gm ; // C o l l e c t o r r e s i s t a n c e
disp ( Mega Ohm , Re /10^6 , e m i t t e r r e s i t a n c e ( Re ) o f
bipolar differential amplifier is : )
disp ( K i l o Ohm , abs ( Rc ) /10^3 , c o l l e c t o r r e s i s t a n c e (
Rc ) o f b i p o l a r d i f f e r e n t i a l a m p l i f i e r i s : )

Scilab code Exa 7.4 Offset Voltage Change


1
2
3

4
5
6
7
8

// C h a p t e r 7 O p e r a t i o n A m p l i f i e r C h a r a c t e r i s t i c s
// C a p t i o n : O f f s e t V o l t a g e Change
// Example7 . 4 : What i s t h e c h a n g e i n t h e o f f s e t
voltage of a bipolar transistor amplifier for a
d i f f e r e n c e o f 10V i n t h e c o l l e c t o r to e m i t t e r
v o l t a g e and Va=250 V . Assume room t e m p e r a t u r e .
// S o l u t i o n :
clear ;
clc ;
Vt =25*10^ -3; // t h r e s h o l d v o l t a g e a t room t e m p e r a t u r e
in Volt
Va =250; // e a r l y v o l t a g e o f t h e b i p o l a r t r a n s i s t o r i n
volt
25

9
10
11
12
13
14
15
16

17
18

deltaVce =1; // l e t u s assume 1V o f c h a n g e i n Vce (


c o l l e c t o r to e m i t t e r v o l t a g e )
deltaVos1 = Vt *( - deltaVce / Va ) ;
disp ( mV , abs ( deltaVos1 ) *10^3 , c h a n g e i n o f f s e t
v o l t a g e f o r 1 V c h a n g e i n Vce i s : )
for i =1:1 ,
if i ==1 then
deltaVce =10; // i n v o l t
deltaVos = deltaVce * deltaVos1 ;
disp ( mV , abs ( deltaVos ) *10^3 , c h a n g e i n
o f f s e t voltage of bipolar transistor for
10V c o l l e c t o r to e m i t t e r v o l t a g e ( Vce )
difference is : )
end
end

Scilab code Exa 7.5 Temperature Coefficient


1
2
3

4
5
6
7

8
9
10

// C h a p t e r 7 O p e r a t i o n a l A m p l i f i e r C h a r a c t e r i s t i c s
// C a p t i o n : T e m p e r a t u r e C o e f f i c i e n t
// Example7 . 5 : D e t e r m i n e t h e t e m p e r a t u r e c o e f f i c i e n t
of the input o f f s e t voltage f o r the b i p o l a r
d i f f e r e n t i a l a m p l i f i e r h a v i n g Vos =1.5 mV. What i s
t h e p e r c e n t a g e c h a n g e i n t h e Vos p e r d e g r e e
temperature change .
// S o l u t i o n :
clear ;
clc ;
// t e m p e r a t u r e c o f f i c i e n t o f t h e i n p u t o f f s e t
voltage f o r the b i p o l a r d i f f e r e n t i a l a m p l i f i e r
Vos i s =dVos /dT=Vos /T ;
Vos =1.5*10^ -3; // i n p u t o f f s e t v o l t a g e f o r b i p o l a r
differential transistor amplifier
T =300; // a s s u m i n g room t e m p e r a t u r e
TC = Vos / T ; // t e m p e r a t u r e c o f f i c i e n t o f Vos
26

// p e r c e n t a g e c h a n g e i n t h e Vos p e r d e g r e e
t e m p e r a t u r e c h a n g e w i l l be g i v e n by a s f o l l o w :
12 PC =( TC / Vos ) *100; // p e r c e n t a g e c h a n g e (PC) i n t h e Vos
per degree temperature change
13 disp ( %per d e g r e e c e l c i u s ,PC , p e r c e n t a g e c h a n g e i n
t h e Vos
per degree temperature change i s : )
11

Scilab code Exa 7.14 Effect on Output Voltage


1
2
3

4
5
6
7
8
9
10
11
12
13
14

15
16

// C h a p t e r 7 O p e r a t i o n a l A m p l i f i e r C h a r a c t e r i s t i c s
// C a p t i o n : E f f e c t on Output V o l t a g e
// Example7 . 1 4 : For t h e n o n i n v e r t i n g OPAmp w i t h
i n p u t r e s i s t a n c e R1 nad f e e d b a c k r e s i s t a n c e R2
f i n d t h e e f f e c t on o u t p u t v o l t a g e Vo b e c a u s e o f
t h e common mode v o l t a g e Vcm when t h e i n p u t
v o l t a g e Vs c h a n g e s by 1V . Given CMRR=70 dB .
// S o l u t i o n :
clear ;
clc ;
CMRR =70; //Common Mode R e j e c t i o n R a t i o i n dB
// s i n c e CMRR=20 l o g (Vcm/Vdm) dB
// s o Vdm=Vcm/ 1 0 (CMRR/ 2 0 )
// s i n c e o u t p u t v o l t a g e o f OPAmp i s Vo=(R1+R2 ) Vdm/
R1=(R1+R2 ) Vcm/ ( R1 1 0 (CMRR/ 2 0 ) )
R1 =100; // a s s u m i n g i n p u t r e s i s t a n c e s t a n d a r d v a l u e i n
k i l o Ohm
R2 =900; // a s s u m i n g f e e d b a c k r e s i s t a n c e s t a n d a r d v a l u e
i n k i l o Ohm
Vs =1; // c h a n g e i n i n p u t v o l t a g e g i v e n i n q u e s t i o n
Vcm = Vs ; // s i n c e c h a n g e i n i n p u t v o l t a g e i s a p p l i e d t o
n o n i n v e r t i n g i n p u t and t h r o u g h t h e f e e d b a c k t o
t h e i n v e r t i n g i p u t o f t h e OpAmp a s w e l l .
Vo =( R1 + R2 ) * Vcm /( R1 *10^( CMRR /20) )
disp ( mV , abs ( Vo ) *10^3 , c h a n g e i n o u t p u t v o l t a g e due
t o common mode V o l t a g e (Vcm) i s : )
27

17
18

// Note :
// CMRR, Vdm, Vo may be o f e i t h e r p o l a r i t y . Here
absolute value i s calculated

Scilab code Exa 7.15 Slew rate and Fmax


1
2
3

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

// C h a p t e r 7 O p e r a t i o n a l A m p l i f i e r C h a r a c t e r i s t i c s
// C a p t i o n : S l e w r a t e and Fmax
// Example7 . 1 5 : For t y p e 741 OpAmp f o l l o w i n g
parameter are given . Quiescent c o l l e c t o r current
I c =9.5 uA , Cc=30 pF . Peak a m p l i t u d e o f i n p u t
v o l t a g e Vm=15V .
// a ) D e t e r m i n e t h e s l e w r a t e
// b ) D e t e r m i n e f u l l power bandwidth Fmax f o r t h e s l e w
r a t e a s o b t a i n e d from p a r t ( a ) .
clear ;
clc ;
// a ) S o l u t i o n :
Ic =9.5*10^ -6; // o p e r a t i n g c o l l e c t o r c u r r e n t i n A
Cc =30*10^ -12; // p a r a s i t i c c a p a c i t a n c e
SlewRate =2* Ic / Cc ;
disp ( V/ u s , SlewRate /10^6 , S l e w r a t e i s : )
// b ) S o l u t i o n :
Vm =15; // a m p l i t u d e o f i n p u t v o l t a g e i n V o l t
Fmax = SlewRate /(2* %pi * Vm ) ; // f u l l power bandwidth
disp ( kHz , Fmax /10^3 , f u l l power bandwidth Fmax f o r
t h e S l e w Rate o b t a i n e d a b o v e i s : )

Scilab code Exa 7.16 Largest Amplitude


1
2

// C h a p t e r 7 O p e r a t i o n a l A m p l i f i e r C h a r a c t e r i s t i c s
// C a p t i o n : L a r g e s t A m p l i t u d e
28

4
5
6
7
8
9
10

11
12

// Example7 . 1 6 : An a m p l i f i e r h a s a 10 kHz s i n e w a v e
i n p u t s i g n a l . Find t h e l a r g e s t a m p l i t u d e t h a t t h e
o u t p u t o f t h e a m p l i f i e r can be , w i t h o u t
d i s t o r t i o n owing t o s l e w r a t e l i m i t i n g . Given
s l e w r a t e =0.5V/ u s e c .
// S o l u t i o n :
clear ;
clc ;
Fmax =10*10^3; // f r e q u e n c y o f s i n e w a v e i n p u t s i g n a l i n
Hz
SlewRate =0.5*10^6; // g i v e n i n q u e s t i o n i n V/ s e c
Vm = SlewRate /(2* %pi * Fmax ) ; // S i n c e Fmax=s l e w r a t e / ( 2
%pi Vm)
disp ( V( peak ) ,Vm , l a r g e s t a m p l i t u d e t h a t t h e o u t p u t
o f t h e a m p l i f i e r can be w i t h o u t d i s t o r t i o n owing
to slew rate l i m i t a t i o n i s : )
// Note :
// c a l c u l a t e d a m p l i t u d e
i s 7 . 9 5 7 7 V, which can be
approximated to 8 V

Scilab code Exa 7.17 Maximum allowable frequency


// C h a p t e r 7 O p e r a t i o n a l A m p l i f i e r C h a r a c t e r i s t i c s
// C a p t i o n : Maximum a l l o w a b l e f r e q u e n c y
// Example7 . 1 7 : When a low f r e q u e n c y s i n u s o i d a l
waveform i s a p p l i e d t o an i n p u t o f t h e
n o n i n v e r t i n g OpAmp t h e a m p l i f i e r r e s p o n d s
l i n e a r l y o v e r an o u t p u t r a n g e from 10V t o +10V .
I f R1=R2 and t h e s l e w r a t e o f t h e a m p l i f i e r i s 50
V/u s e c , what i s t h e maximum a l l o w a b l e f r e q u e n c y
o f an i n p u t s i n u s o i d i f t h e o u t p u t s i g n a l s w i n g
i s t o be m a i n t a i n e d from 10V t o +10V w i t h o u t
d i s t o r t i o n ? r e s i s t a n c e and R2 i s f e e d b a c k
resitance .
4 // S o l u t i o n
1
2
3

29

5 clear ;
6 clc ;
7 SlewRate =50/10^ -6; // i n V/ s e c
8 Vo =10 -( -10) ; // from q u e s t i o n o u t p u t
9
10
11
12

13
14

i s r a n g i n g from
10V t o +10V
Vom = Vo ; // where Vom i s t h e maximum v a l u e o f Vo
// t h e r e f o r e
Fmax = SlewRate /(2* %pi * Vom ) ;
disp ( kHz , Fmax /10^3 , maximum a l l o w a b l e f r e q u e n c y o f
an i n p u t s i n u s o i d a l f o r o u t p u t s w i n g m a i n t a i n e d
from 10V t o +10v i s : )
// Note :
// o b t a i n e d maximum a l l o w a b l e a m p l i t u d e i s 3 9 7 . 8 8 7 3 6
kHz which can be a p p r o x i m a t e d t o 400 kHz

30

Chapter 8
Applications of Operational
Amplifier

Scilab code Exa 8.1 Device Temperature


1
2
3

4
5
6
7
8
9
10
11
12

// C h a p t e r 8 A p p l i c a t i o n s o f O p e r a t i o n a l A m p l i f i e r
// C a p t i o n : D e v i c e T e m p e r a t u r e
// Example8 . 1 : The Heat g e n e r a t e d by a l i n e a r IC , uA
741 i s 200 mW. I f t h e t h e r m a l r e s i s t a n c e i s 150
d e g r e e C e l s i u s / Watt and t h e a m b i e n t t e m p e r a t u r e
i s 25 d e g r e e c e l s i u s . c a l c u l a t e t h e d e v i c e
temperature .
// S o l u t i o n :
clear ;
clc ;
Pd =200*10^ -3; // h e a t g e n e r a t e d
Rt =150; // t h e r m a l r e s i s t a n c e
Ta =25; // a m b i e n t t e m p e r a t u r e i n d e g r e e c e l s i u s
// a s s u m i n g t h e r m a l e q u i l i b r i u m c o n d i t o n
Td = Pd * Rt + Ta ;
disp ( d e g r e e c e l s i u s ,Td , The d e v i c e t e m p e r a t u r e i s :
)

31

Scilab code Exa 8.2 Device Temperature


1
2
3

4
5
6
7
8
9
10
11
12

// C h a p t e r 8 A p p l i c a t i o n s o f O p e r a t i o n a l A m p l i f i e r
// C a p t i o n : D e v i c e T e m p e r a t u r e
// Example8 . 2 : For t h e d e v i c e i n Example8 . 1 , Pdmax
=500 mW. D e t e r m i n e t h e d e v i c e t e m p e r a t u r e a f t e r
e q u i l i b r i u m i s a t t a i n e d f o r an a m b i e n t
t e m p e r a t u r e o f 75 d e g r e e c e l s i u s and i f t h e
d e v i c e i s s u b j e c t e d t o maximum h e a t g e n e r a t i o n .
Maximum a l l o w a b l e d e v i c e t e m p e r a t u r e i s 150
degree Celsius .
// S o l u t i o n :
clear ;
clc ;
Pmax =500*10^ -3;
Pd = Pmax ; // s i n c e d e v i c e i s s u b j e c t e d t o maximum h e a t
generation
Rt =150; // t h e r m a l r e s i t a n c e
Ta =75; // a m b i e n t t e m p e r a t u r e
Td = Pd * Rt + Ta ;
disp ( d e g r e e c e l s i u s ,Td , d e v i c e t e m p e r a t u r e i s : )

Scilab code Exa 8.3 Device Temperature


// C h a p t e r 8 A p p l i c a t i o n s o f O p e r a t i o n a l A m p l i f i e r
// C a p t i o n : D e v i c e T e m p e r a t u r e
// Example8 . 3 : a ) The a m b i e n t t e m p e r a t u r e o f t h e d e v i c e
o f Example8 . 2 r i s e s a b o v e 90 d e g r e e c e l s i u s .
What i s t h e new v a l u e o f Td i f i t s t i l l g e n e r a t e s
500 mW?
4 // a ) S o l u t i o n :
5 clear ;
1
2
3

32

6
7
8
9
10
11

clc ;
Pd =500*10^ -3;
Rt =150; // t h e r m a l r e s i s t a n c e
Ta =90; // a m b i e n t t e m p e r a t u r e
Td = Pd * Rt + Ta ;
disp ( d e g r e e c e l s i u s ,Td , New v a l u e o f d e v i c e
temperature i s : )

Scilab code Exa 8.4 Device Temperature


1
2
3

4
5
6
7
8
9
10
11

// C h a p t e r 8 A p p l i c a t i o n s o f O p e r a t i o n a l A m p l i f i e r
// C a p t i o n : D e v i c e T e m p e r a t u r e
// Example8 . 4 : F o r c e d a i r c o o l i n g p r o v i d e d f o r t h e
d e v i c e i n Example8 . 3 l o w e r s t h e a m b i e n t
t e m p e r a t u r e a t 60 d e g r e e c e l s i u s . What i s
temperature of the device ?
// S o l u t i o n :
clear ;
clc ;
Pd =500*10^ -3;
Rt =150; // t h e r m a l r e s i s t a n c e
Ta =60; // a m b i e n t t e m p e r a t u r e
Td = Pd * Rt + Ta ;
disp ( d e g r e e c e l s i u s ,Td , T e m p e r a t u r e o f t h e d e v i c e
is : )

Scilab code Exa 8.7 Output Voltage


1
2
3

// C h a p t e r 8 A p p l i c a t i o n s o f O p e r a t i o n a l A m p l i f i e r
// C a p t i o n : Output V o l t a g e
// Example8 . 7 : I n t h e summing a m p l i f i e r ( i n v e r t i n g
mode ) t h e s i g n a l s t o be combined a r e V1=3V, V2=2v
, and V3=1V . The i n p u t r e s i s t o r a r e R1=R2=R3=3
33

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

k i l o ohm . The f e e d d b a c k r e s i s t o r Rf=1 k i l o ohm .


C o n s i d e r i d e a l OpAmp, d e t e r m i n e Vo .
// S o l u t i o n :
clear ;
clc ;
V1 =3; // i n p u t s i g n a l
V2 =2; // i n p u t s i g n a l
V3 =1; // i n p u t s i g n a l
Rf =1*10^3; // f e e d b a c k r e s i t o r
R1 =3*10^3; // i n p u t r e s i s t o r i n ohm
R2 = R1 ; // i n p u t r e s i s t o r i n ohm
R3 = R2 ; // i n p u t r e s i s t o r i n ohm
Vo = -( Rf / R1 * V1 + Rf / R2 * V2 + Rf / R3 * V3 ) ;
disp ( V ,Vo , Output V o l t a g e o f summing a m p l i f i e r i s :
)

Scilab code Exa 8.8 Vp and Vo


1
2
3

4
5
6
7
8
9
10
11

// C h a p t e r 8 A p p l i c a t i o n s o f O p e r a t i o n a l A m p l i f i e r
// C a p t i o n : Vp and Vo
// Example8 . 8 : I n t h e c i r c u i t o f noni n v e r t i n g
summing OpAmp, V1=+2V, V2=4V, V3=+5V . i n p u t
r e s i s t o r s f o r a l l t h e t h r e e i n p u t s i g n a l a r e same
and a r e e q u a l t o 1 k i l o Ohm . The f e e d b a c k
r e s i s t o r Rf i s 2 k i l o ohm . D e t e r m i n e t h e v o l t a g e
Vp a t t h e n o n i n v e r t i n g p i n o f t h e OpAmp and t h e
o u t p u t Vo . Assume i d e a l Op=Amp .
// S o l u t i o n :
clear ;
clc ;
Rf =2*10^3; // f e e d b a c k r e s i s t o r
R1 =1*10^3;
R2 = R1 ;
R3 = R2 ;
V1 =2;
34

12
13
14
15
16
17
18

V2 = -4;
V3 =5;
n =3; // no o f i n p u t s
Vp =( Rf / R1 * V1 + Rf / R2 * V2 + Rf / R3 * V3 ) / n ;
Vo =(1+ Rf / R1 ) * Vp ;
disp ( V ,Vp , v o l t a g e a t n o n i n v e r t i n g p i n i s : )
disp ( V ,Vo , o u t p u t v o l t a g e v o l t a g e o f n o n i n v e r t i n g
summing OpAmp i s : )

35

Chapter 9
Active Filters

Scilab code Exa 9.6 Determine Q Fl and Fh


1
2
3

4
5
6
7
8
9
10
11
12
13

// C h a p t e r 9 A c t i v e F i l t e r s
// C a p t i o n : D e t e r m i n e Q F l and Fh
// Example9 . 6 : A c e r t a i n twop o l e band p a s s f i l t e r
r e s p o n s e i s r e q u i r e d with a c e n t r e frequency o f 2
kHz and a 3 dB bandwidth o f 400 Hz . D e t e r m i n e Q,
F l and Fh .
// S o l u t i o n :
clear ;
clc ;
Fo =2*10^3; // c e n t r e f r e q u e n c y i n Hz
BW =400; // 3 dB bandwidth
Q = Fo / BW ; // Qf a c t o r o f band p a s s f i l t e r
Fl = Fo * sqrt (1+1/(4* Q ^2) ) - Fo /(2* Q ) ;
Fh = Fo * sqrt (1+1/(4* Q ^2) ) + Fo /(2* Q ) ;
disp ( Hz ,Fl , l o w e r c u t t o f f f r e q u e n c y i s : )
disp ( Hz ,Fh , H i g h e r c u t t o f f f r e q u e n c y i s : )

Scilab code Exa 9.12 Unity gain frequency and Capacitor determination
36

1
2
3

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

// C h a p t e r 9 A c t i v e F i l t e r s
// C a p t i o n : U n i t y g a i n f r e q u e n c y and C a p a c i t o r
determination
// Example9 . 1 2 : a ) D e t e r m i n e t h e u n i t y g a i n f r e q u e n c y ,
Fo , o f a s w i t c h e d c a p a c i t o r i n t e g r a t o r h a v i n g
f o l l o w i n g s p e c i f i c a t i o n s : F c l k =1 kHz , C1=1 pF , and
C2 =15.9 pF
// b ) What i s t h e v a l u e o f c a p a c i t o r f o r an RC
i n t e g r a t o r h a v i n g R=1.6 mega Ohm and Fo a s
obtained in part ( a ) .
// a ) S o l u t i o n :
clear ;
clc ;
C1 =1*10^ -12; // s o u r c e c a p a c i t o r i n F
C2 =15.9*10^ -12; // f e e d b a c k c a p a c i t o r
Fclk =1*10^3; // c l o c k f r e q u e n c y o r s w i t c h i n g f r e q u e n c y
Fo =1*( C1 / C2 ) * Fclk /(2* %pi ) ;
disp ( Hz ,Fo , u n i t y g a i n f r e q u e n c y i s : )
// b ) S o l u t i o n :
R =1.6*10^6; // r e s i s t o r o f RC i n t e g r a t o r i n Ohm
C =1/(2* %pi * Fo * R ) ;
disp ( nF ,C *10^9 , f o r Rc i n t e g r a t o r v a l u e o f
c a p a c i t o r needed i s : )
// Note :
// O b t a i n e d r e s u l t s a r e a p p r o x i m a t e d t o n e a r e s t
v a l u e s , t h u s Fo=10 Hz and C=10 nF

37

Chapter 10
Special Purpose Amplifiers

Scilab code Exa 10.3 Class B Power Amplifier


1
2
3

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

// C h a p t e r 10 S p e c i a l P u r p o s e A m p l i f i e r s
// C a p t i o n : C l a s s B Power A m p l i f i e r
// Example10 . 3 : A c l a s s B a u d i o power a m p l i f i e r h a s a
s u p p l y v o l t a g e o f a b s ( Vcc ) =15V . The c l o s e d l o o p
g a i n Av=50 and t h e a m p l i f i e r h a s t o d e l i v e r 10W
o f power i n t o an 8 ohm l o a d . Find :
// a ) t h e peak o u t p u t v o l t a g e s w i n g
// b ) t h e peak o u t p u t c u r r e n t s w i n g
// c ) t h e i n p u t s i g n a l r e q u i r e d ( rms )
// d ) t h e t o t a l power from t h e power s u p p l y
// e ) t h e power d i s s i p a t e d i n t h e a m p l i f i e r
// f ) t h e power c o n v e r s i o n e f f i c i e n c y
clear ;
clc ;
// a ) S o l u t i o n :
Po =10; // power i n Watt
Rl =8; // l o a d r e s i s t a n c e i n Ohm ;
Vorms = sqrt ( Po * Rl ) ; // s i n c e o u t p u t power Po=Vorms 2/
Rl
Vom = sqrt (2) * Vorms ; // peak o u t p u t v o l t a g e s w i n g
disp ( V , abs ( Vom ) , The peak o u t p u t V o l t a g e s w i n g : )
38

18 // b ) S o l u t i o n :
19 Iom = Vom / Rl ;
20 disp ( A , abs ( Iom ) , The peak o u t p u t c u r r e n t s w i n g

is :

)
21 // c ) S o l u t i o n :
22 Av =50; // c l o s e d l o o p g a i n
23 Vsrms = Vorms / Av ;
24 disp ( V , Vsrms , The i n p u t rms s i g n a l r e q u i r e d i s : )
25 // d ) S o l u t i o n :
26 Vcc =15; // a b s o l u t e v a l u e o f p o e r s u p p l y i n v o l t
27 Pin =2* Vcc * Iom / %pi ; // s i n c e I o r m s 2 ( 1 / 2 )=Iom
28 disp ( W ,Pin , The t o t a l power from power s u p p l y i s :
29
30
31
32
33
34
35
36

)
// e ) S o l u t i o n :
Pd =(2/ %pi ) * Vcc * sqrt (2* Po / Rl ) - Po ;
disp ( W ,Pd , The power d i s s i p a t e d i n t h e a m p l i f i e r
is : )
// f ) S o l u t i o n :
n =( Po / Pin ) *100;
disp ( % ,n , The power c o n v e r s i o n e f f i c i e n c y i s : )
// Note :
// Vcc , Vom and Iom can be o f e i t h e r p o l a r i t y but h e r e
o n l y a b s o l u t e v a l u e i s c o n s i d e r e d and c a l c u l a t e d

Scilab code Exa 10.4 Power Output


// C h a p t e r 10 S p e c i a l P u r p o s e A m p l i f i e r
// C a p t i o n : Power Output
// Example10 . 4 : For t h e a m p l i f i e r o f Example10 . 3 ,
f i n d t h e power o u t p u t l e v e l a t which t h e power
d i s s i p a t i o n w i l l bw maximum and t h e maximum power
dissipation .
4 // S o l u t i o n :
5 clear ;
6 clc ;
1
2
3

39

7 Vcc =15; // power s u p p l y i n v o l t


8 Rl =8; // l o a d r e s i s t a n c e i n ohm
9 // s i n c e Pd=2Vcc / %pi s q r t ( 2 Po/ Rl )Po
10 // t o d e t e r m i n e t h e v a l u e o f Po a t which Pd i s

11
12
13
14
15

maximum we d i f f e r e n t i a t e a b o v e e q u a t i o n and
e q u a t e t o z e r o , we f i n d Po a s
Po =2* Vcc ^2/(( %pi ) ^2* Rl ) ;
// t h e r e f o r e maximum power d i s s i p a t e d i s
Pdmax =2* Vcc / %pi * sqrt (2* Po / Rl ) - Po ;
disp ( W ,Po , The power o u t p u t l e v e l f o r maximum
power d i s s i p a t i o n i s : )
disp ( W , Pdmax , Maximum power d i s s i p a t i o n f o r
c o r r e s p o n d i n g o u t p u t power l e v e l i s ; )

Scilab code Exa 10.8 LM4250 Parameters


1
2
3

4
5
6
7
8
9
10
11
12
13

// C h a p t e r 10 S p e c i a l P u r p o s e A m p l i f i e r s
// C a p t i o n : LM4250 P a r a m e t e r s
// Example10 . 8 : The m i c r o p o w e r programmable OpAmp LM
4 2 5 0 i s s u p p l i e d by 3 v s o u r s e ( a b s o l u t e v a l u e )
s o u r c e . Determine the value o f s e t r e s i s t o r f o r
I s e t =0.1 uA i f R s e t i s c o n n e c t e d t o ( a ) Vee and ( b
) ground . ( c ) det er mi ne the q u i e s c e n t supply
c u r r e n t and t h e q u i e s c e n t power d i s s i p a t i o n .
clear ;
clc ;
// a ) S o l u t i o n :
Vcc =3; // power s u p p l y i n V o l t
Vee = - Vcc ; // n e g a t i v e power s u p p l y i n V o l t
Iset =0.1*10^ -6; // b i a s s e t t i n g c u r r e n t i n A ;
Rset =( Vcc + abs ( Vee ) -0.5) / Iset ;
disp ( mega Ohm , Rset /10^6 , The b i a s s e t t i n g c u r r e n t
r e s i s t o r f o r Vee=10 V i s : )
// b ) S o l u t i o n :
clear Vee ;
40

14 Vee =0; // s i n c e R s e t i s c o n n e c t e d t o g r o u n d
15 Rset =( Vcc + abs ( Vee ) -0.5) / Iset ;
16 disp ( mega Ohm , Rset /10^6 , The b i a s s e t t i n g

current

r e s i s t o r f o r Vee=0 V i s : )
// c ) S o l u t i o n :
Qcurrent =5* Iset ;
Qpower =( Vcc +3) * Qcurrent ; // where a b s ( Vee ) =3 V
disp ( uA , Qcurrent *10^6 , The q u i e s c e n t c u r r e n t
supply i s : )
21 disp ( uW , Qpower *10^6 , The q u i e s c e n t power
dissipated is : )
17
18
19
20

Scilab code Exa 10.9 Common Emitter Amplifier Parameters


1
2
3

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

// C h a p t e r 10 S p e c i a l P u r p o s e A m p l i f i e r s
// C a p t i o n : Common E m i t t e r A m p l i f i e r P a r a m e t e r s
// Example10 . 9 : A s i n g l e common e m i t t e r a m p l i f i e r h a s
f o l l o w i n g d e v i c e and c i r c u i t p a r a m e t e r s : Rb=60
Ohm, Rs=40 Ohm, Cu=1.5 pF , Cl=1 pF , f t =1.6 GHz a t I c
=2.5 mA q u i e s c e n t c u r r e n t . D e t e r m i n e e a c h o f t h e
f o l l o w i n g f o r two v a l u e s o f Rl : 30 Ohm and 100
Ohm . a ) f 1 b ) F2 ( c )BW ( d ) Avmid ( e ) avmid Bw .
clear ;
clc ;
Ft =1.6*10^9; // r e d u c e d u n i t y g a i n f r e q u e n c y i n Hz
Ic =2.5*10^ -3; // c o l l e c t o r c u r r e n t i n A
Vt =25*10^ -3; // t h r e s h o l d v o l t a g e a t room t e m p e r a t u r e
gm = Ic / Vt ; // t r a n s c o n d u c t a n c e
Cu =1.5*10^ -12;
Cl =1*10^ -12;
Rs =40;
Rb =60;
C2 = gm /(2* %pi * Ft ) - Cu
for i =1:2 ,
if i ==1 then
41

Rl =30; // l o a d r e s i s t a n c e
F1 =1/(2* %pi *( Rs + Rb ) *( C2 + Cu *(1+ gm * Rl ) ) ) ; //
f i r s t break frequency
F2 =1/(2* %pi * Rl *( Cu + Cl ) ) ; // s e c o n d b r e a k
frequency
BW = F1 ; // s i n c e s i n g l e common e m i t t e r
a m p l i f i e r s o n=1 t h u s BW=F1 s q r t ( 2 ( 1 / n )
1) , i . e . ,BW=F1
Avmid = - gm * Rl ; // mid f r e q u e n c y g a i n
GBW = Avmid * BW ; // g a i n bandwidth p r o d u c t
disp ( For Rl =30 Ohm )
disp ( MHz , F1 /10^6 , f i r s t b r e a k f r e q u e n c y i s
: )
disp ( MHz , F2 /10^6 , s e c o n d b r e a k f r e q u e n c y
is : )
disp ( MHz , BW /10^6 , Bandwidth i s : )
disp ( abs ( Avmid ) , mid f r e q u e n c y g a i n i s : )
disp ( MHz , abs ( GBW ) /10^6 , g a i n bandwidth
product i s : )

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

else
Rl =100; // l o a d r e s i s t a n c e i n ohm
F1 =1/(2* %pi *( Rs + Rb ) *( C2 + Cu *(1+ gm * Rl ) ) ) ; //
f i r s t break frequency
F2 =1/(2* %pi * Rl *( Cu + Cl ) ) ; // s e c o n d b r e a k
frequency
BW = F1 ; // s i n c e s i n g l e common e m i t t e r
a m p l i f i e r s o n=1 t h u s BW=F1 s q r t ( 2 ( 1 / n )
1) , i . e . ,BW=F1
Avmid = - gm * Rl ; // mid f r e q u e n c y g a i n
GBW = Avmid * BW ; // g a i n bandwidth p r o d u c t
disp ( For Rl =100 Ohm )
disp ( MHz , F1 /10^6 , f i r s t b r e a k f r e q u e n c y i s
: )
disp ( MHz , F2 /10^6 , s e c o n d b r e a k f r e q u e n c y
is : )
disp ( MHz , BW /10^6 , Bandwidth i s : )
disp ( abs ( Avmid ) , mid f r e q u e n c y g a i n i s : )
disp ( MHz , abs ( GBW ) /10^6 , g a i n bandwidth
42

product i s : )
42
end
43 end

43

Chapter 11
Nonlinear Circuit Application

Scilab code Exa 11.4 Time taken


1
2
3

4
5
6
7
8
9
10

// C h a p t e r 11 N o n l i n e a r C i r c u i t A p p l i c a t i o n
// C a p t i o n : Time t a k e n
// Example11 . 4 : b ) Type 741 Opamp i s u s e d a s a
c o m p a r a t o r and i t s s l e w r a t e i s 0 . 5V/ u s . How l o n g
w i l l i t c h a n g e from +10 V t o 10v ?
// b ) S o l u t i o n :
clear ;
clc ;
deltaVo =10 -( -10) ;
SlewRate =0.5*10^ -6;
t = deltaVo / SlewRate ;
disp ( u s ,t /10^6 , t i m e t a k e n by t h e o u t p u t v o l t a g e
t o c h a n g e from +10 V t o 10 V i s : )

Scilab code Exa 11.5 Rise Time


1
2

// C h a p t e r 11 N o n l i n e a r C i r c u i t A p p l i c a t i o n
// C a p t i o n : R i s e Time
44

4
5
6
7
8
9
10
11
12

// Example11 . 5 : The u p p e r 3dB f r e q u e n c y o f an OpAmp


i s 1MHz . C a l c u l a t e t h e r i s e t i m e o f t h e o u t p u t .
I f t h e u p p e r 3dB f r e q u e n c y o f t h e OpAmp i s
i n c r e a s e d t o 50 MHz by r e d u c i n g t h e g a i n s u c h
t h a t g a i n bandwidth p r o d u c t r e m a i n s c o n s t a n t , t h e n
f i n d o u t t h e new r i s e t i m e . D i s c u s s t h e e f f e c t o f
i n c r e a s i n g bandwidth on a c c u r a c y o f c o m p a r a t o r .
// S o l u t i o n :
clear ;
clc ;
F3dB =1*10^6; // u p p e r 3dB f r e q u e n c y o f OpAmp
Tr =0.35/ F3dB ; // from d e f i n i t i o n o f r i s e t i m e
disp ( n s e c , Tr *10^9 , R i s e t i m e o f t h e o u t p u t i s : )
F3dB1 =50*10^6;
Tr1 =0.35/ F3dB1 ;
disp ( n s e c , Tr1 *10^9 , R i s e t i m e o f t h e o u t p u t i s : )

Scilab code Exa 11.11 Design Peak Detector


1
2
3

4
5
6
7
8
9
10

// C h a p t e r 11 N o n l i n e a r C i r c u i t A p p l i c a t i o n
// C a p t i o n : D e s i g n Peak D e t e c t o r
// Example11 . 1 1 : D e s i g n a p o s i t i v e peak d e t e c t o r
u s i n g t y p e uA 760 c o m p a r a t o r t h a t can r e s p o n d t o
a 100 mV( pp ) , 5 MHz s i n u s o i d a l i n p u t s i g n a l . The
d e v i c e has f o l l o w i n g s p e c i f i c a t i o n s . Response
t i m e =25 ns , p r o p a g a t i o n t i m e =12 ns , and I n p u t
b i a s c u r r e n t =8uA .
// S o l u t i o n :
clear ;
clc ;
Vp =50*10^ -3; // s i n c e peakpeak v o l t a g e i s 100 mV
f =5*10^6;
T =200*10^ -9;
t =15*10^ -9 // s i n c e r i s e t i m e ( t ) s h o u l d be g r e a t e r
than p r o p a g a t i o n d e l a y (12 ns )
45

11 deltaVc = Vp *(1 - cos (4* t / T *90*( %pi ) /180) ) ;


12 Ib =8*10^ -6; // i n p u t b i a s c u r r e n t
13 C = Ib /( deltaVc / T ) ;
14 disp ( mV , deltaVc *10^3 , v o l t a g e c h a n g e i s : )
15 disp ( pF ,C *10^12 , c a p a c i t o r v a l u e i s : )
16 // Note :
17 // t h e Exact v a l u e a s c a l c u l a t e d i s t a k e n t o

c a l c u l a t e C , s o C= 2 9 3 . 5 9 5 5 5 pF . I f a p p r o x v a l u e
o f d e l t a V c i s t a k e n a s 5 mV t h e n C=320 pF

46

Chapter 12
Signal Generators

Scilab code Exa 12.6 555 Timer


1
2
3

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

// C h a p t e r 12 S i g n a l G e n e r a t o r s
// C a p t i o n : 555 Timer
// Example12 . 6 : C a l c u l a t e ( a ) Tc ( b ) Td , and ( c ) t h e
f r e e r u n n i n g f r e q u e n c y f o r t h e t i m e r 555
c o n n e c t e d i n a s t a b l e mode . Given Ra=6.8 k i l o Ohm ;
Rb=3.3 k i l o Ohm ; C=0.1 uF . What i s t h e duty c y c l e
,d , of the c i r c u i t ?
// S o l u t i o n :
clear ;
clc ;
Ra =6.8*10^3;
Rb =3.3*10^3;
C =0.1*10^ -6;
// U s i n g e q u a t i o n f o r a s t a b l e m u l t i v i b r a t o r we have
Tc =0.69*( Ra + Rb ) * C ; // c h a r g i n g t i m e
Td =0.69* Rb * C ; // d i s c h a r g i n g t i m e
f =1.44/(( Ra +2* Rb ) * C ) ; // f r e e r u n n i n g f r e q u e n c y
d = Rb /( Ra +2* Rb ) ; // duty c y c l e
disp ( ms , Tc *10^3 , c h a r g i n g t i m e o f 555 t i m e r i n
a s t a b l e mode i s : )
disp ( ms , Td *10^3 , d i s c h a r g i n g t i m e o f 555 t i m e r i n
47

a s t a b l e mode i s : )
17 disp ( kHz ,f /10^3 , f r e e r u n n i n g f r e q u e n c y o f 555
t i m e r i n a s t a b l e mode i s : )
18 disp (d , duty c y c l e o f 555 t i m e r i n a s t a b l e mode i s :
)

Scilab code Exa 12.11 Design


1
2
3

4
5
6
7
8
9
10

11
12
13
14
15

// C h a p t e r 12 S i g n a l G e n e r a t o r s
// C a p t i o n : D e s i g n
// Example12 . 1 1 : A 555 one s h o t c i r c u i t w i t h Vcc=16 V
i s t o have a 2 ms o u t p u t p u l s e w i d t h . D e s i g n a
s u i t a b l e C i r c u i t . I t h r e s =0.25 uA ( max . ) from d a t a
sheet of the device .
// S o l u t i o n :
clear ;
clc ;
Ithres =0.25*10^ -6;
T =2*10^ -3 // o u t p u t p u l s e w i d t h
Vcc =16; // power s u p p l y t o 555
// The v a l u e o f minimum c a p a c i t o r c h a r g i n g c u r r e n t I c
s h o u l d be much g r e a t e r t h a n t h e t h r e s h o l d
Current I t h r e s
Icmin =1000* Ithres ; // s i n c e Icmin >> I t h r e s
Ra = Vcc /(3* Icmin ) ;
C = T /(1.1* Ra ) ;
disp ( k i l o Ohm , Ra /10^3 , r e s i t a n c e d e s i g n i s : )
disp ( uF ,C *10^6 , C a p a c i t o r d e s i g n i s : )

Scilab code Exa 12.12 Generating pulse by 555 timer


1
2

// C h a p t e r 12 S i g n a l G e n e r a t o r s
// C a p t i o n : G e n e r a t i n g p u l s e by 555 t i m e r
48

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

// Example12 . 1 2 : ( a ) D e s i g n a 555 a s t a b l e m u l t i v i b r a t o r
t o g e n e r a t e an o u t p u t p u l s e w i t h p u l s e
r e p e t i t i o n f r e q u e n c y (PRF) =4 kHz and a duty c y c l e
o f 60%. Given Vcc=15V .
// ( b ) A n a l y s e t h e c i r c u i t d e s i g n e d i n p a r t ( a ) t o
d e t e r m i n e t h e a c t u a l PRF and duty c y c l e . Given
I t h r e s =25 uA ( max . ) f o r t i m e r 5 5 5 .
clear ;
clc ;
// a ) S o l u t i o n :
d =60*10^ -2; // duty c y c l e g i v e n
PRF =4*10^3;
Vcc =15; // power s u p p l y
T =1/ PRF ; // where T=Tc+Td
Tc = d * T ;
Td =T - Tc ;
Ithres =25*10^ -6;
Icmin =1*10^ -3; // s i n c e Icmin >>I t h r e s , s o a s s u m i n g
I c m i n =1 mA
R = Vcc /(3* Icmin ) ; // where R=Ra+Rb
C = Tc /(0.7* R ) ;
Rb = Td /(0.7* C ) ;
Ra =R - Rb ;
disp ( k i l o Ohm , Ra /10^3 , D e s i g n e d r e s i s t o r ( Ra ) f o r
555 t i m e r i n a s t a b l e mode i s : )
disp ( k i l o Ohm , Rb /10^3 , D e s i g n e d r e s i s t o r ( Rb ) f o r
555 t i m e r i n a s t a b l e mode i s : )
disp ( uF ,C *10^6 , D e s i g n e d C a p a c i t o r f o r 555 t i m e r
i n a s t a b l e mode i s : )
// b ) S o l u t i o n :
// from e q u a t i o n o f c h a r g i n g
Tc1 =0.7* R * C ;
Td1 =0.7* Rb * C ;
T1 = Tc1 + Td1 ;
PRFa =1/ T1 ;
da = Tc1 /( Tc1 + Td1 ) *100;
disp ( kHz , PRFa /10^3 , a c t u a l P u l s e R e p e t i t i o n
Frequency i s : )
49

31

disp ( % ,da , a c t u a l duty c y c l e i s : )

Scilab code Exa 12.20 Waveform Generator


1
2
3

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

// C h a p t e r 12 S i g n a l G e n e r a t o r s
// C a p t i o n : Waveform G e n e r a t o r
// Example12 . 2 0 : D e s i g n a waveform g e n e r a t o r u s i n g
t y p e 8 0 3 8 IC . The f r e q u e n c y o f O s c i l l a t i o n i s 5
kHz and t h e duty c y c l e s i s 50%. From d a t a s h e e t ,
t y p i c a l v a l u e s f o r t h e d e v i c e a t Vcc=5 V a r e a s
follws :
// Voh =3.6 V ; Vol =0.2 V ; I l l =1.6 mA and I l h =40 uA .
// S o l u t i o n :
clear ;
clc ;
Fo =5*10^3;
// f o r 50% duty c y c l e Tp=Tn
Vcc =5; // i n v o l t
Vol =0.2; // i n V o l t
Voh =3.6; // i n v o l t
Ill = -1.6*10^ -3;
Ilh =40*10^ -6;
Tp =1/(2* Fo ) ;
C =0.01; // a s s u m i n g t h e C a p a c i t o r v a l u e i n uF f o r
optimum d e s i g n
Ra = Tp /(1.66* C ) ;
Rb =2* Ra * Tp /(1.66* Ra * C + Tp ) ;
R2min =( Vcc - Vol ) /(2*10^ -3 - abs ( Ill ) ) ; // s i n c e I l l i s
negative
R2max =( Vcc - Voh ) /(1*10^ -6+ Ilh ) ; // s i n c e I l h i s
positive
disp ( k i l o Ohm , Ra *10^3 , d e s i g n e d v a l u e o f Ra i s : )
disp ( k i l o Ohm , Rb *10^3 , d e s i g n e d v a l u e o f Rb i s : )
disp ( k i l o Ohm , R2min /10^3 , minimum p u l l up r e s i s t o r
is : )
50

24

disp ( k i l o Ohm , R2max /10^3 , maximum p u l l up r e s i s t o r


is : )

51

Chapter 13
Voltage Regulators

Scilab code Exa 13.3 Maximum Efficiency and Power


1
2
3

4
5
6
7
8

9
10
11
12
13

// C h a p t e r 13 V o l t a g e R e g u l a t o r s
// C a p t i o n : Maximum E f f i c i e n c y and Power
// Example13 . 3 : C a l c u l a t e t h e maximum e f f i c i e n c y and
a s s o c i a t e d power d i s s i p a t i o n f o r t h e 5 V MC7805
s e r i e s r e g u l a t o r . The i n p u t r i p p l e i s 10 V and t h e
l o a d c u r r e n t i s 1 A . The o u t p u t i s b e t w e e n 4 . 7 5
t o 5 . 2 5 f o r &v<=Vin <=20 V .
// S o l u t i o n :
clear ;
clc ;
Vo =5;
Vin =17; // s i n c e f o r MC7805 a maximum o f 7 . 5 V i s
added t o t h e r i p p l e . S i n c e 10 V r o p p l e i s g i v e n s o
Vin=10+7=17 V
Il =1; // l o a d c u r r e n t i n ampere
n = Vo / Vin *100; // s e r i e s p a s s r e g u a t o r o v e r a l l
efficiency
Pd =( Vin - Vo ) * Il ;
disp ( % ,n , maximum e f f i c i e n c y f o r 5V MC7805 s e r i e s
regulator is : )
disp ( W ,Pd , power d i s s i p a t i o n f o r t h e 5V MC7805
52

series regulator is : )

Scilab code Exa 13.14 Inductor and Capacitor


1
2
3

5
6
7
8
9
10
11
12
13
14

15
16
17
18

// C h a p t e r 13 V o l t a g e R e g u l a t o r s
// C a p t i o n : I n d u c t o r and C a p a c i t o r
// Example13 . 1 4 : A s w i t c h i n g v o l t a g e r e g u l a t o r
o p e r a t e s a t a s w i t c h i n g f r e q u e n c y o f 30 kHz and i s
t o s u p p l y a l o a d c u r r e n t I o o f 1 A a t a dc
o u t p u t v o l t a g e Vo o f +10V . The dc i n p u t v o l t a g e i s
Vin =20V and t h e o u t p u t ( peakpeak ) r i p p l e f a c t o r
i s n o t t o e x c e e d 0 . 0 5%. Assume Rl =10 Ohm .
// a ) Find t h e v a l u e o f t h e f i l t e r i n d u c t o r L s u c h
t h a t t h e maximum c h a n g e o r r i p p l e i n t h e c u r r e n t
t h r o u g h t h e i n d u c t o r w i l l n o t e x c e e d 40% o f t h e
a v e r a g e o r dc c u r r e n t .
// b ) Find t h e v a l u e o f t h e o u t p u r c a p a c i t o r CL f o r L1
=100 uH and f o r L2=500 uH .
clear ;
clc ;
// a ) S o l u t i o n :
Rl =10;
D =0.5;
T =2.5;
fs =30*10^3;
L = Rl * T *(1 - D ) / fs ;
disp ( uH ,L /10^ -6 , f i l t e r i n d u c t o r L t o e n s u r e
maximum r i p p l e i n t h e c u r r e n t t h r o u g h t h e
i n d u c t o r w i l l n o t e x c e e d 40% o f t h e dc c u r r e n t i s
: )
// b ) S o l u t i o n :
L1 =100*10^ -6;
RF =0.05*10^2; // o u t p u t ( peakpeak ) r i p p l e f a c t o r
maximum l i m i t
// f o r r i p p l e f a c t o r c o n d i t i o n we have
53

19 CL1 =1/(15* fs ^2* L1 * RF ) ;


20 disp ( For L=100 uH )
21 disp ( uF , CL1 *10^10 , o u t p u t c a p a c i t o r
22 disp ( For L=500 uH )
23 L2 =500*10^ -6;
24 CL2 =1/(15* fs ^2* L2 * RF ) ;
25 disp ( uF , CL2 *10^10 , o u t p u t c a p a c i t o r

54

is : )

is : )

Chapter 15
Phase Locked Loops

Scilab code Exa 15.2 Output Signal Frequency


1
2
3

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

// C h a p t e r 15 P h a s e Locked Loops
// C a p t i o n : Output S i g n a l F r e q u e n c y
// Example 1 5 . 2 : A PLL h a s a Ko o f 2 %pi ( 1 kHz ) /V, a
Kv o f 500 p e r s e c , and a f r e e r u n n i n g f r e q u e n c y
o f 500 Hz .
// a ) For a c o n s t a n t i n p u t s i g n a l f r e q u e n c y o f 250 Hz
and 1 kHz . f i n d v f .
clear ;
clc ;
// a ) S o l u t i o n :
Ko =2* %pi *10^3; // VCO g a i n i n kHz /V
Kv =500; // l o o p b a n d w i t h i n p e r s e c o n d
Wc =500; // F r e e r u n n i n g f r e q u e n c y o f VCO i n PLL o r 2
%pi 500
//Wi=a n g u l a r i n p u t s i g n a l
f r e q u e n c y i n Hz
//Wo=a n g u l a r o u t p u t s i g n a l f r e q u e n c y i n Hz
// s i n c e v f =(Wo( t )Wc) /Ko
// u n d e r l o c k e d c o n d i t i o n Wo=Wi , s o v f =(WoWc) /Ko
for i =1:2 ,
if i ==1 then
Wo =250;
55

18
// o r
19
Fo =2* %pi * Wo ; // i n Hz
20 vf =( Fo -2* %pi *500) / Ko ;
21 disp ( For i n p u t s i g n a l
22
23
24
25
26
27
28
29
30

f r e q u e n c y W=250 Hz
)
disp ( V ,vf , o u t p u t s i g n a l v o l t a g e o f PLL f o r Wo
=250 Hz i s : )
else
Wo =1000;
Fo =2* %pi * Wo ; // i n Hz
vf =( Fo -2* %pi *500) / Ko ;
disp ( For i n p u t s i g n a l f r e q u e n c y Wo=1
kHz )
disp ( V ,vf , o u t p u t s i g n a l v o l t a g e o f PLL f o r
Wo=1kHz i s : )
end
end

Scilab code Exa 15.3 VCO and Phase detector


1
2
3

4
5
6
7
8
9
10

// C h a p t e r 15 P h a s e Locked Loops
// C a p t i o n : VCO and Phase d e t e c t o r
// Example15 . 3 : A PLL h a s f r e e r u n n i n g f r e q u e n c y Wc
=500 kHz , b a n d w i t h o f low p a s s f i l t e r =10kHz .
S u p p o s e an i n p u t s i g n a l o f f r e q u e n c y 600 kHz i s
a p p l i e d . W i l l t h e l o o p a c q u i r e l o c k ? What i s VCO
o u t p u t f r e q u e n c y ? The p h a s e d e t e c t o r p r o d u c e s sum
and d i f f e r e n c e f r e q u e n c y c o m p o n e n ts .
// S o l u t i o n :
clear ;
clc ;
BW =10; // bandwidth o f low p a s s f i l t e r i n kHz
Fi =600; // i n p u t f r e q u e n c y i n kHz
Fc =500; // f r e e r u n n i n g f r e q u e n c y i n kHz
// Output from p h a s e d e t e c t o r i s
56

11 Sum = Fi + Fc ;
12 Difference = Fi - Fc ;
13 disp ( kHz ,Sum , sum f r e q u e n c y component o f p h a s e
14
15
16
17

18
19
20
21

d e t e c t o r i n kHz )
disp ( kHz , Difference , d i f f e r e n c e f r e q u e n c y
component o f p h a s e d e t e c t o r i n kHz )
if Sum > BW then
if Difference > BW then
disp ( Both Sum and D i f f e r e n c e f r e q u e n c y
c o m p o n e n t s a r e o u t s i d e t h e p a s s b a n d o f low
pass f i l t e r )
disp ( Loop w i l l n o t a c q u i r e l o c k )
disp ( VCO f r e q u e n c y w i l l be i t s f r e e r u n n i n g
frequency )
end
end

Scilab code Exa 15.4 Second Order Butterworth Filter


1
2
3

4
5
6
7
8
9
10
11
12
13

// C h a p t e r 15 P h a s e Locked Loops
// C a p t i o n : S e c o n d Order B u t t e r w o r t h F i l t e r
// Example 1 5 . 4 : A S y n t h e s i z e r u s i n g PLL h a s Kv=5%pi
r a d / s . What v a l u e o f lowp a s s f i l t e r bandwidth
s h o u l d be u s e d s o t h a t t h e c l o s e d l o o p s y s t e m
a p p r o x i m a t e s a s e c o n d o r d e r B u t t e r w o r t h f i l t e r ?
// S o l u t i o n :
clear ;
clc ;
// For B u t t e r w o r t h f i l t e r t h e damping r a t i o ( Dr ) i s
Dr =0.707;
Kv =5* %pi ;
Wl = Kv *(2* Dr ) ^2; // s i n c e ( Wl/Kv ) 2=2Dr
disp ( r a d / s e c ,Wl , low p a s s f i l t e r bandwidth )
// BW f o r c l o s e d l o o p s y s t e m i s
BW = sqrt ( Kv * Wl ) ; // s i n c e BW=Wn, where Wn=n a t u r a l
57

14
15
16
17

f r e q u e n c y ,BW=bandwidth o f c l o s e d l o o p s y s t e m
Wn = real ( BW ) ;
t =2.2/ Wn ;
disp ( r a d / s e c ,BW , bandwidth o f c l o s e d l o o p s y s t e m
is : )
disp ( s e c ,t , c o r r e s p o n d i n g s y s t e m r i s e t i m e i s : )

Scilab code Exa 15.5 Lock Range


1
2
3

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

// C h a p t e r 15 P h a s e Locked Loops
// C a p t i o n : Lock Range
// Example15 . 5 : A PLL h a s a VCO w i t h Ko=25kHz /V and
Fc=50kHz . The a m p l i f i e r g a i n i s A=2 and t h e p h a s e
d e t e c t o r h a s a maximum o u t p u t v o l t a g e s w i n g o f
+0.7V and 0.7V . Find t h e l o c k r a n g e o f t h e PLL .
Assume f i l t e r g a i n e q u a l t o u n i t y .
// S o l u t i o n :
clear ;
clc ;
k1 =2*0.7/ %pi ; // p o s i t i v e maximum g a i n v a l u e o f p h a s e
detector
k2 = - k1 ; // n e g a t i v e maximum g a i n v a l u e o f p h a s e
detector
A =2; // a m p l i f i e r g a i n
Ko =25; // VCO g a i n i n kHz
// p o s i t i v e maximum o u t p u t v o l t a g e s w i n g o f p h a s e
detector is
V1 = k1 * %pi /2;
// N e g a t i v e maximum o u t p u t v o l t a g e s w i n g o f p h a s e
detector is
V2 = k2 * %pi /2;
Vf1 = k1 * A * %pi /2; // P o s i t i v e maximum c o n t r o l v o l t a g e
a v a i l a b l e t o d r i v e VCO
Vf2 = k2 * A * %pi /2; // n e g a t i v e maximum c o n t r o l v o l t a g e
a v a i l a b l e t o d r i v e VCO
58

17
18
19
20
21
22

//maximum VCO f r e q u e n c y s w i n g t h a t can be o b t a i n e d


is
Fh = Ko * Vf1 ; // p o s i t i v e maximum VCO f r e q u e n c y s w i n g
Fl = Ko * Vf2 ; // N e g a t i v e maximum VCO f r e q u e n c y s w i n g
// s o l o c k r a n g e o f PLL i s
f = Fh - Fl ;
disp ( kHz ,f , The l o c k r a n g e o f t h e PLL i s : )

59

Chapter 16
Bipolar and MOS Digital Gate
Circuits

Scilab code Exa 16.2 Noise Margin


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

// C h a p t e r 16 B i p o l a r and MOS D i g i t a l Gate C i r c u i t s


// C a p t i o n : N o i s e Margin
// Example 1 6 . 2 : An RTL g a t e h a s t h e w o r s t c a s e
v o l t a g e s l i s t e d below :
// Temp ( d e g r e e C)
Voh (V)
Vih (V)
V i l (V)
Vol (V)
//
55
1.014
1.01
0.718
0.710
//
25
0.844
0.815
0.565
0.300
//
125
0.673
0.67
0.325
0.320
// C a l c u l t e t h e w o r s t c a s e NMl and NMh n o i s e m a r g i n s .
// S o l u t i o n :
clear ;
clc ;
T =[ -55;25;125]; // t e m p e r a t u r e s i n d e g r e e c e l s i u s
given in table
for j =1:3 ,
60

14 if j ==1 then
15
disp ( N o i s e m a r g i n s f o r T=55 d e g r e e
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33

c e l s i u s are
: )
NMl =0.718 -0.710; // s i n c e NMl=V i l Vol
NMh =1.014 -1.01; // s i n c e NMh=VihVoh
disp ( V o l t ,NMl , l o w e r l i m i t o f n o i s e m a r g i n a t
55 d e g r e e c e l s i u s i s : )
disp ( v o l t ,NMh , u p p e r l i m i t o f n o i s e l i m i t a t
55 d e g r e e c e l s i u s i s : )
elseif j ==2 then
disp ( N o i s e m a r g i n f o r T=25 d e g r e e c e l s i u s a r e :
)
NMl =0.565 -0.300;
NMh =0.844 -0.815;
disp ( V o l t ,NMl , l o w e r l i m i t o f n o i s e m a r g i n a t
25 d e g r e e c e l s i u s i s : )
disp ( V o l t ,NMh , u p p e r l i m i t o f n o i s e m a r g i n a t
25 d e g r e e c e l s i u s i s : )
elseif j ==3 then
disp ( N o i s e m a r g i n f o r T=125 d e g r e e c e l s i u s a r e :
)
NMl =0.325 -0.320;
NMh =0.673 -0.670;
disp ( V o l t ,NMl , l o w e r l i m i t o f n o i s e m a r g i n a t
125 d e g r e e c e l s i u s i s : )
disp ( V o l t ,NMh , uppwr l i m i t o f n o i s e m a r g i n a t
125 d e g r e e c e l s i u s i s : )
end
end

Scilab code Exa 16.3 Fanouts


1
2
3

// C h a p t e r 16 B i p o l a r and MOS D i g i t a l Gate C i r c u i t s


// C a p t i o n : F a n o u t s
// Example 1 6 . 3 : A TTL g a t e i s g u a r t n t e e d t o s i n k 10
61

4
5
6
7
8

9
10
11
12
13
14
15
16
17
18

mA w i t h o u t e x c e e d i n g ann o u t p u t v o l t a g e Vol =0.4V


and t o s o u r c e 5mA w i t h o u t d r o p p i n g b e l o w Voh =2.4V
. I f Tih =100uA a t 2 . 4V and I i l =1mA a t 0 . 4 V,
c a l c u l a t e t h e lows t a t e and h i g h s t a t e f a n o u t s .
// S o l u t i o n :
clear ;
clc ;
// f o r TTL g a t e
// f a n o u t a t low o u t p u t i s = c o l l e c t o r s a t u r a t i o n
c ur r e nt of output t r a n s i t o r / load c u r re n t of the
driven gate .
// f a n o u t f o r h i g h o u t p u t i s =s o u r c e c u r r e n t i n
driving gatte / input current of load gate
// from q u e s t i o n g i v e n
Ic3 =10*10^ -3; // c o l l e c t o r s a t u r a t i o o n c u r r e n t a t
output t r a n s i s t o r
Ie =1*10^ -3; // l o a d c u r r e n t o f d r i v e n g a t e
Ie4 =5*10^ -3; // s o u r c e c u r r e n t i n d r i v i n g g a t e
Ic1 =100*10^ -6; // i n p u t c u r r e n t o f l o a d g a t e
Fl = Ic3 / Ie ;
disp ( Fl , f a n o u t a t low o u t p u t s t a t e i s : )
Fh = Ie4 / Ic1 ;
disp ( Fh , f a n o u t a t h i g h o u t p u t s t a t e i s : )

Scilab code Exa 16.12 NMOS operating region


// C h a p t e r 16 B i p o l a r and MOS D i g i t a l Gate C i r c u i t s
// C a p t i o n : NMOS o p e r a t i n g r e g i o n
// Example 1 6 . 1 2 : A NMOS t r a n s i s t o r w i t h K=20uA/V2
and Vth =1.5V i s o p e r a t e d a t Vgs=5V and I d s =100uA .
D e t e r m i n e t h e r e g i o n o f t h e o p e r a t i o n on IV
c h a r a c t e r i s t i c s and f i n d Vds .
4 // S o l u t i o n :
5 clear ;
6 clc ;

1
2
3

62

7
8
9
10
11
12
13
14
15
16

17
18
19
20
21
22
23
24
25
26
27

K =20*10^ -6;
Vgs =5;
Vth =1.5;
Ids =100*10^ -6;
Id =( K /2) *( Vgs - Vth ) ^2;
disp ( uA , Id /10^ -6 , d r a i n c u r r e n t i n s a t u r a t i o n
region )
if Id > Ids then
disp ( r e g i o n o f o p e r a t i o n o f NMOS t r a n s i s t o r on
IV c h a r a c t e r i s t i c s i s LINEAR REGION )
end
// s i n c e NMOS l i e s i n LINEAR REGION s o I d s =(K/ 2 ) ( 2 (
VgsVth ) VdsVds 2 ) ; t h u s s u b s t i t u t i n g t h e v a l u e s
we have
// 10010 6==(2010 6/2) ( 2 ( 5 1 . 5 ) VdsVds 2 ) ;
// s o Vds27Vds +10=0; e q u i v a l e n t t o q u a d r a t t i c
e q u a t i o n o f form aX2+bX+c=0
Vds = poly (0 , Vds ) ;
p = Vds ^2 -7* Vds +10; // e q u a t i o n whose r o o t s h a s t o be
found
z = roots ( p ) ;
z = real ( z )
if ( z (1) <( Vgs - Vth ) ) then
disp ( V o l t ,z (1) , d r a i n t o s o u r c e v o l t a g e ( Vds )
i n t h i s Linear Region i s : )
elseif ( z (2) <( Vgs - Vth ) ) then
disp ( V o l t ,z (2) , d r a i n t o s o u r c e v o l t a g e ( Vds )
i n t h i s Linear Region i s : )
end

Scilab code Exa 16.13 Power Dissipation


1
2
3

// C h a p t e r 16 B i p o l a r and MOS D i g i t a l Gate C i r c u i t s


// C a p t i o n : Power D i s s i p a t i o n
// Example16 . 1 3 : C a l c u l a t e t h e maximum power
63

4
5
6
7
8
9
10

11
12
13
14
15

d i s s i p a t e d by s a t u r a t e d l o a d NMOS i n v e r t e r f o r
f o l l o w i n g g i v e n v a l u e s : Vdd=5V ; Vth =1.5V ; d e v i c e
t r a n s c o n d u c t a n c e p a r a m e t e r f o r l o a d d e v i c e Kl
=23.3410 6 A/V 2 . Assume Vo=0V i n low s t a t e .
// S o l u t i o n :
clear ;
clc ;
Vdd =5; // d r a i n v o l t a g e o f NMOS i n v e r t e r i n V o l t
Vth =1.5; // t h r e s h o l d v o l t a g e o f NMOS i n v e r t e r i n
Volt
Kl =23.34*10^ -6; // t r a n s c o n d u c t a n c e P a r a m e t e r f o r
load device
// s i n c e maximum power can be o b t a i n e d i f maximum
d e v i c e c u r r e n t f l o w s w h i s h i s when Vo=low i . e . , 0
V . So , f o r s a t u r a t i o n r e g i o n o f o p e r a t i o n we have
I d=Kl ( VgsVth ) 2 / 2 ;
// f o r s a t u r a t e d l o a d i n v e r t e r Vgs=Vds and
// Vds=Vdd i n low o u t p u t c o n d i t i o n , s o I d=Kl ( VddVth )
2/2
Id =23.34*10^ -6*( Vdd - Vth ) ^2/2;
Pmax = Id * Vdd ;
disp ( mW , Pmax /10^ -3 , maximum power d i s s i p a t e d by
s a t u r a t e d l o a d NMOS i n v e r t e r i s : )

Scilab code Exa 16.14 AC Power


1
2
3

4
5
6
7

// C h a p t e r 16 B i p o l a r and MOS D i g i t a l Gate C i r c u i t s


// C a p t i o n : AC Power
// Example16 . 1 4 : C a l c u l a t e t h e a c power d i s s i p a t e d by
a CMOS i n v e r t e r which d r i v e s a 20 pF l o a d . Given f
=1MHz and Vdd=10V .
// S o l u t i o n :
clear ;
clc ;
Ct =20*10^ -12; // l o a d c a p a c i t o r i n Farad
64

8 Vdd =10; // d r a i n v o l t a g e s u p p l y i n V o l t
9 f =1*10^6; // f r e q u e n c y a t which o u t p u t v o l t a g e c h a n g e s
10 // s i n c e P=Ct Vdd 2 f
11 P =20*10^ -12*(10) ^2*10^6;
12 disp ( W ,P , a c power d i s s i p a t e d
by a CMOS i n v e r t e r

is : )

65

Chapter 17
Light Emitting Diodes and
Liquid Crystal Displays

Scilab code Exa 17.2 Viewing distance


1
2
3

4
5
6
7
8
9
10
11
12

// C h a p t e r 17 L i g h t E m i t t i n g D i o d e s and L i q u i d
Crystal Displays
// C a p t i o n : V i e w i n g d i s t a n c e
// Example17 . 2 : Find o u t t h e v i e w i n n g d i s t a n c e d f o r
a s e v e n segmant LED d i s p l a y f o r a c h a r a c t e r
h e i g h t o f 1cm and a h e i g h t a n g l e o f 3 m e t e r s .
// S o l u t i o n :
clear ;
clc ;
// d : v i e w i n g d i s t a n c e
h =1*10^ -2; // h e i g h t o f c h a r a c t e r i n cm
O =3; // h e i g h t a n g l e i n m e t e r s
// e q u i v a q l e n t t o h e i g h t a n g l e o f 3 m e t e r s
d = h / tan (0.167* %pi /180) ; // where 3 m e t e r s h e i g h t a n g l e
i s e q u i v a l e n t to 0.167 degrees .
disp ( m e t e r s ,d , v i e w i n g d i s t a n c e i s : )

66

You might also like