Вы находитесь на странице: 1из 67

Scilab Textbook Companion for

Integrated Circuits
by K. R. Botkar
1
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
1
Scilab numbering policy used in this document and the relation to the
above book.
Exa Example (Solved example)
Eqn Equation (Particular equation of the above book)
AP Appendix to Example(Scilab Code that is an Appednix to a particular
Example of the above book)
For example, Exa 3.51 means solved example 3.51 of this book. Sec 2.3 means
a scilab code whose theory is explained in Section 2.3 of the book.
2
Contents
List of Scilab Codes 4
2 Thick Film And Thin Film Hybrid ICs 6
3 Semoconductor Devices Fundamentals 14
5 Monolithic Components 19
7 Operational Amplier Characteristics 23
8 Applications of Operational Amplier 31
9 Active Filters 36
10 Special Purpose Ampliers 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
3
List of Scilab Codes
Exa 2.1 Resistance . . . . . . . . . . . . . . . . . . . . . . . . 6
Exa 2.2 Resistance Calculation . . . . . . . . . . . . . . . . . . 7
Exa 2.3 Sheet Resistivity . . . . . . . . . . . . . . . . . . . . . 8
Exa 2.4 Design Capacitor . . . . . . . . . . . . . . . . . . . . . 8
Exa 2.6 Capacitance . . . . . . . . . . . . . . . . . . . . . . . 9
Exa 2.8 Thickness . . . . . . . . . . . . . . . . . . . . . . . . . 10
Exa 2.9 Length . . . . . . . . . . . . . . . . . . . . . . . . . . 10
Exa 2.10 Absolute Coecient . . . . . . . . . . . . . . . . . . . 11
Exa 2.11 Ratio . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
Exa 3.2 Resistivity . . . . . . . . . . . . . . . . . . . . . . . . 14
Exa 3.3 Resistivity of Intrinsic Ge . . . . . . . . . . . . . . . . 15
Exa 3.4 Hole Concentration . . . . . . . . . . . . . . . . . . . 15
Exa 3.5 Resistivity of Cu . . . . . . . . . . . . . . . . . . . . . 16
Exa 3.6 Bipolar Transistor Parameters . . . . . . . . . . . . . 16
Exa 5.1 Transit Time . . . . . . . . . . . . . . . . . . . . . . . 19
Exa 5.2 Unit gain frequency . . . . . . . . . . . . . . . . . . . 20
Exa 5.3 Resistance and Sheet resistance . . . . . . . . . . . . . 20
Exa 5.4 Capacitance per unit area . . . . . . . . . . . . . . . . 21
Exa 7.1 Bipolar Dierential Amplier Parameter . . . . . . . . 23
Exa 7.2 Rc and Re . . . . . . . . . . . . . . . . . . . . . . . . 24
Exa 7.4 Oset Voltage Change . . . . . . . . . . . . . . . . . . 25
Exa 7.5 Temperature Coecient . . . . . . . . . . . . . . . . . 26
Exa 7.14 Eect on Output Voltage . . . . . . . . . . . . . . . . 27
Exa 7.15 Slew rate and Fmax . . . . . . . . . . . . . . . . . . . 28
Exa 7.16 Largest Amplitude . . . . . . . . . . . . . . . . . . . . 28
Exa 7.17 Maximum allowable frequency . . . . . . . . . . . . . 29
Exa 8.1 Device Temperature . . . . . . . . . . . . . . . . . . . 31
Exa 8.2 Device Temperature . . . . . . . . . . . . . . . . . . . 32
4
Exa 8.3 Device Temperature . . . . . . . . . . . . . . . . . . . 32
Exa 8.4 Device Temperature . . . . . . . . . . . . . . . . . . . 33
Exa 8.7 Output Voltage . . . . . . . . . . . . . . . . . . . . . . 33
Exa 8.8 Vp and Vo . . . . . . . . . . . . . . . . . . . . . . . . 34
Exa 9.6 Determine Q Fl and Fh . . . . . . . . . . . . . . . . . 36
Exa 9.12 Unity gain frequency and Capacitor determination . . 36
Exa 10.3 Class B Power Amplier . . . . . . . . . . . . . . . . . 38
Exa 10.4 Power Output . . . . . . . . . . . . . . . . . . . . . . 39
Exa 10.8 LM4250 Parameters . . . . . . . . . . . . . . . . . . . 40
Exa 10.9 Common Emitter Amplier Parameters . . . . . . . . 41
Exa 11.4 Time taken . . . . . . . . . . . . . . . . . . . . . . . . 44
Exa 11.5 Rise Time . . . . . . . . . . . . . . . . . . . . . . . . . 44
Exa 11.11 Design Peak Detector . . . . . . . . . . . . . . . . . . 45
Exa 12.6 555 Timer . . . . . . . . . . . . . . . . . . . . . . . . . 47
Exa 12.11 Design . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
Exa 12.12 Generating pulse by 555 timer . . . . . . . . . . . . . 48
Exa 12.20 Waveform Generator . . . . . . . . . . . . . . . . . . . 50
Exa 13.3 Maximum Eciency and Power . . . . . . . . . . . . . 52
Exa 13.14 Inductor and Capacitor . . . . . . . . . . . . . . . . . 53
Exa 15.2 Output Signal Frequency . . . . . . . . . . . . . . . . 55
Exa 15.3 VCO and Phase detector . . . . . . . . . . . . . . . . 56
Exa 15.4 Second Order Butterworth Filter . . . . . . . . . . . . 57
Exa 15.5 Lock Range . . . . . . . . . . . . . . . . . . . . . . . . 58
Exa 16.2 Noise Margin . . . . . . . . . . . . . . . . . . . . . . . 60
Exa 16.3 Fanouts . . . . . . . . . . . . . . . . . . . . . . . . . . 61
Exa 16.12 NMOS operating region . . . . . . . . . . . . . . . . . 62
Exa 16.13 Power Dissipation . . . . . . . . . . . . . . . . . . . . 63
Exa 16.14 AC Power . . . . . . . . . . . . . . . . . . . . . . . . . 64
Exa 17.2 Viewing distance . . . . . . . . . . . . . . . . . . . . . 66
5
Chapter 2
Thick Film And Thin Film
Hybrid ICs
Scilab code Exa 2.1 Resistance
1 // Chapter 2 Thi ck Fi l m and Thin Fi l m Hybri d ICs
2 // Capti on : Re s i s t a nc e
3 // Example2 . 1 : a ) A r e s i s t o r has an a s pe c t r a t i o o f
20: 1 and s he e t r e s i s t a n c e o f 200 ohm/ s quar e . Fi nd
out t he val ue o f r e s i s t a n c e .
4 // b) Fi nd out t he number o f s qua r e s c ont ai ne d i n a
2 ki l oohm r e s i s t o r whose s he e t r e s i s t a n c e i s 200
ohm per s quar e .
5 // So l ut i o n : a )
6 clear;
7 clc;
8 function y= myfunction(x,z)//y : r e s i s t a n c e , x : s he e t
r e s i s t a n c e =200ohm/ s quar e , z : a s pe c t r a t i o =20: 1
9 y = x*z // s i nc e , r e s i a t a n c e=s he e t r e s i s t a n c e
10 disp( r e s i s t a n c e i s =)
11 di s p ( ohm ,y)
12 endfunction
13
14 // So l ut i o n : b)
6
15 // we have t o f i nd number o f s quar e whi ch i s t o f i nd
a s pe c t r a t i o .
16 function s=myfunction1(r,p)// r : r e s i s t o r =2kohm( or
2000ohm) , p : s he e t r e s i s t a n c e =200 Ohm/ s quar e , s :
number o f s quar e ( a s pe c t r a t i o )
17 s=r/p// s i nc e , number o f s quar e =( r e s i s t o r / s he e t
r e s i s t a n c e )
18 disp( number o f s qua r e s ar e =) // i nc l ude ; at t he
ti me o f c a l l i n g t he f unc t i o n
19 di s p ( squares ,s)
20 endfunction
21 // myf unct i on ( 200 , 20/1) ; myf unct i on1 ( 2000 , 200) ;
Scilab code Exa 2.2 Resistance Calculation
1 // Chapter 2 Thi ck Fi l m and Thin Fi l m Hybri d ICs
2 // Capti on : Re s i s t a nc e c a l c u l a t i o n
3 // Example2 . 2 : A t hi c k f i l m r e s i s t o r i s s c r e e ne d wi th
a pas t e o f f s he e t r e s i s t i v i t y 10000 ohm/ s quar e ,
and t he r e s i s t o r i s de f i ne d as 0. 24 cm l ong and
0. 06 cm wi de . Ca l c ul a t e t he r e s i s t a n c e R.
4 // So l ut i o n :
5 clear;
6 clc;
7 function R=myfunction3(p,l,w)// r : r e s i s t o r , p=s he e t
r e s i s t a n c e =10000 ohm/ s quar e , l : l e ng t h o f r e s i s t o r
=0. 24cm, w: wi dth o f t he r e s i s t o r =0. 06cm
8 R=p*(l/w)// s i nc e , r e s i s t a n c e=s he e t r e s i s t a n c e (
l e ng t h o f r e s i s t o r / wi dth o f t he r e s i s t o r )
9 disp( r e s i s t a n c e o f t he t hi c k f i l m r e s i s t o r i s =
)// at t he ti me o f c a l l i n g t he f unc t i o n
i nc l ude ; a f t e r i t
10 disp( ohm ,R)
11 endfunction
12 // myf unct i on3 ( 1 0 0 0 0 , 0 . 2 4 , 0 . 0 6 ) ;
7
Scilab code Exa 2.3 Sheet Resistivity
1 // Chapter 2 Thi ck Fi l m and Thin Fi l m Hybri d ICs
2 // Capti on : Sheet Re s i s t i v i t y
3 // Example2 . 3 : Ca l c ul a t e t he s he e t r e s i s t i v i t y o f a
s quar e o f t hi c k f i l m r e s i s t o r ma t e r i a l wi th t he
f o l l o wi n g p r o p e r t i e s : bul k r e s i s t i v i t y =101ohm
cm and t hi c k f i l m t h i c k n e s s =10 mi cr omet er .
4 // So l ut i o n :
5 clear;
6 clc;
7 function Ps=myfunction4(p,t)// Ps : s he e t r e s i s t a n c e ,
p : bul k r e s i s t i v i t y o f t hi c k f i l m =101( or 0 . 0 1 ) ,
t : t h i c k n e s s o f t hi c k f i l m=10 mi cr omet er
(=1010 4=0. 001)
8 Ps=p/t// s i nc e , s he e t r e s i s t a n c e o f t he f i l m=
bul k r e s i s t a n c e o f t he f i l m / t h i c k n e s s o f t he
f i l m
9 disp( s he e t r e s i s t i v i t y i s = )// i nc l ude ; at at
t he ti me o f c a l l i n g t he f unc t i o n
10 disp( ohm per s quar e ,Ps)
11 endfunction
12 // myf unct i on4 (10 1 , 1010 4) ;
Scilab code Exa 2.4 Design Capacitor
1 // Chapter 2 Thi ck Fi l m and Thin Fi l m Hybri d ICs
2 // Capti on : Des i gn Capac i t or
3 // Example2 . 4 : Des i gn a c i r c u l a r 100pF c a p a c i t o r wi th
t he t hi c k f i l m d i e l e c t r i c havi ng 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( or 0. 002cm) , assume Er=100
8
4 // So l ut i o n : We have t o f i nd t he r a di us o f c r c u l a r
c a p a c i t o r i no r de r t o de s i gn i t .
5 clear;
6 clc;
7 function r1= myfunction5(c,t)
8 r1=c*t// c ons t ant=c a p a c i t o r t h i c k n e s s o f t hi c k
f i l m
9 Er=100 // gi ve n r e l a t i v e pe r me a bi l i t y o f t hi c k
f i l m
10 r=sqrt(r1/(Er*%pi *8.85*10^ -12))// r a di us o f
c i r c u l a r c a pa c i t o r , Eo=8 , 8510 12( d i e l e c t r i c
c ons t ant o f f r e e s pac e )
11 disp( r a di us o f c i r c u l a r c a p a c i t o r i s = )//
i nc l ude ; at t he ti me o f c a l l i n g t he
f unc t i o n
12 disp( meter ,r)
13 endfunction
14 // myf unct i on5 ( 10010 12 , 0. 002) ;
Scilab code Exa 2.6 Capacitance
1 // Chapter 2 Thi ck Fi l m and Thin Fi l m Hybri d ICs
2 // Capti on : Capaci t anc e
3 // Example2 . 6 : Fi nd out t he c a pa c i t a nc e o f a t hi c k
f i l m c a pa c i t o r , i f t he d i e l e c t r i c c ons t ant 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 mi cr omet er and ar e a A
=0. 0625 cm s quar e .
4 // So l ut i o n :
5 clear;
6 clc;
7 function c=capacitance(Er,A,t)
8 c=8.8*10^ -12* Er*A/(10^ -12*t)// c a pa c i t a nc e val ue
wi l l be 2. 210 10 or 220pF , Eo : d i e l e c t r i c
c ons t ant o f f r e e s pac e =8. 810 12 , Er :
d i e l e c t r i c c ons t ant o f t hi c k f i l m= 100( gi ve n )
9
, A: ar e a o f t hi c k f i l m =0. 0626 cm s quar e ( or
0. 062510 4m s quar e ) , t : t h i c k n e s s o f t he
t hi c k f i l m= 25106m)
9 // c a pa c i t a nc e=EoEr A/ t
10 disp( c a pa c i t a nc e i s = )// c =2. 200D
10(=2. 210 10)F, i nc l ude ; at l a s t at t he
ti me o f c a l l i n g t he f unc t i o n
11 disp( pF ,c)//pF: pi c o Farad
12 endfunction
13 // c a pa c i t a nc e ( 100 , 0. 062510 4 , 2510 6) ;
Scilab code Exa 2.8 Thickness
1 // Chapter 2 Thi ck Fi l m and Thin Fi l m Hybri d ICs
2 // Capti on : Thi c kne s s
3 // Example2 . 8 : The bul k r e s i s t i v i t y o f ni chrom i s 120
uohmcm. Ca l c ul a t e t he t h i c k n e s s T i n angs t r oms
o f a f i l m wi th s he e t r e s i s t i v i t y o f 100ohm/ s quar e
.
4 // So l ut i o n :
5 function T=thickness(Ps,p)// Ps : s he e t r e s i s t i v i t y
o f ni chrom=100ohm/ s quar e , p : bul k r e s i s t i v i t y o f
ni chrom=120uohmcm
6 T=p/(Ps*10^ -8) // s i n c e Ps=p/T and 1 angstrom
=108cm, s o d i v i d i n g by 108 he r e
7 disp( t h i c k n e s s i s = )// i nc l ude ; at t he ti me
o f c a l l i mg t he f unc t i o n
8 disp( angstrom ,T)
9 endfunction
10 // t h i c k n e s s (100 , 12010 6) ;
Scilab code Exa 2.9 Length
10
1 // Chapter 2 Thi ck Fi l m and Thin Fi l m Hybri d ICs
2 // Capti on : Length
3 // Rxample2 . 9 : Ca l c ul a t e t he l e ng t h o f a 400ohm t hi n
f i l m r e s i s t o r . Gi ven a s he e t r e s i s t i v i t y oof 100
ohm/ s quar e and a r e s i s t o r wi dth o f 100um
4 // So l ut i o n :
5 clear;
6 clc;
7 function L=extent(r,w,Ps)// L: l e ng t h o f t hi n f i l m , r
: r e s i s t a n c e o f t hi n f i l m =400ohm, w: wi dth o f
r e s i s t o r =100um, Ps : s he e t r e s i s t a n c e =100ohm/ s quar e
8 L=r*w/(10^ -6*Ps)// s i nc e , r=Ps L/w and l e ng t h i n
mi cr omet er s o d i v i d i n g by 10 6.
9 disp( l e ng t h o f t hi n f i l m i s = )// i nc l ude ; at
t he ti me o f c a l l i n g t he f unc t i o n at l a s t
10 disp( mi cr omet er ,L)
11 endfunction
12 // e xt e nt ( 400 , 10010 6 , 100) ;
Scilab code Exa 2.10 Absolute Coecient
1 // Chapter 2 Thi ck Fi l m and Thin Fi l m Hybri d ICs
2 // Capti on : Abs ol ut e Co e f f i c i e n t
3 // Example2 . 1 0 : A t hi n f i l m r e s i s t o r meas ur es 150 ohmat
25 de gr e e c e l c i u s and 151. 5ohm at 100 de gr e e
c e l c i u s . Ca l c ul a t e i t s a bs o l ut 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 n pa r t s per mi l l i o n (ppm) per de gr e
c e l c i u s .
4 // So l ut i o n :
5 clear;
6 clc;
7 function TCR=absresistor(Rt1 ,Rt2 ,T1,T2)// TCR:
a bs o l ut e t e mpe r at ur e c o e f f i c i e n t o f r e s i s t a n c e ,
Rt1 : r e s i s t a n c e at 100 de gr e e c e l c i u s =150ohm, Rt2 :
r e s i s t a n c e at 25 de gr e e c e l c i u s =151. 5ohm, T1 :
11
t e mpe r at ur e =100 de gr e e c e l c i u s , T2 : t empe r at ur e =25
de gr e e c e l c i u s
8 TCR=(Rt2 -Rt1)*10^6/( Rt1*(T1 -T2))
9 disp( a bs o l ut 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 nc l ude ; at t he ti me o f c a l l i n g t he
f unc t i o n at l a s t
10 di s p ( ppm/degree Celsius ,TCR)// ppm: par t per
mi l l i o n
11 endfunction
12 // 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 // Chapter 2 Thi ck Fi l m and Thin Fi l m Hybri d ICs
2 // Capti on : Rat i o
3 // Example2 . 1 1 : Two t hi n r e s i s t o r ar e measured at 50
de gr e e c e l c i u s and 100 de gr e e c e l s i u s and ar e
f ound t o have t he f o l l o wi n g va l ue s :
4 // Temperatur ( de gr e e C) Ra( ohm)
Rb( ohm)
5 // 50 50
100
6 // 100 51
102. 1
7 // Ca l c u l l a t e t he r a t i o TCR i n ppm/ de gr e e c e l c i u s .
8 // So l ut i o n :
9 function TCR= ratio(Rat1 ,Rbt1 ,Rat2 ,Rbt2 ,T1,T2)
10 TCR=(Rat2/Rbt2 -Rat1/Rbt1)*10^6/(( Rat1/Rbt1)*(T1 -
T2))
11 disp( r a t i o TCR i s =) // i i n c l u d e ; at t he ti me
o f c a l l i n g t he f unc t i o n at l a s t
12 di s p ( ppm/degree Celsius ,TCR)//ppm: par t per
mi l l i o n
13 endfunction
14 // 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 // Chapter 3 Semoconduct or De vi c e s Fundamental s
2 // Capti on : Re s i s t i v i t y
3 // Example3 . 2 : A Sampl e o f Si i s doped wi th 1017
phos phor us atoms / c ubi c cm. What i s i t s
r e s i s t i v i t y ? Gi ven Un=700 s quar e cm/vs e c .
4 // So l ut i o n :
5 clear;
6 clc;
7 function Res=resistivity(u,n)//n : doped c o nc e nt r a t i o n
=1017 atoms / c ubi c cm, u : mo bi l i t y o f e l e c t r o n s
=700 s quar e cm/vs e c .
8 q=1.6*10^ -19 //q : c har ge
9 Res =1/(q*u*n)// s i n c e P i s n e g l e g i b l e .
10 disp( r e s i s t i v i t y o f t he s i doped wi th n
dopant i s : )// i nc l ude ; at t he ti me o f
c a l l i n g
11 disp( ohmcm ,Res)
12 endfunction
13 // a f t e r e xe c ut i ng 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 . , r e s i s t i v i t y
( 1017 , 700) ;
14 // Re s ul t : Re s i s t i v i t y o f t he Si doped wi th ndopant
i s : 0. 089 ohmcm( approx )
Scilab code Exa 3.3 Resistivity of Intrinsic Ge
1 // Chapter 3 Semoconduct or De vi c e s Fundamental s
2 // Capti on : Re s i s t i v i t y o f I n t r i n s i c Ge
3 // Example3 . 3 : Fi nd t he r e s i s t i v i t y o f i n t r i n s i c Ge
at 300K. Gi ven un=3900 , and up=1900 cm2/N s e c .
and ni =2. 51013 cm3 f o r i n t r i n s i c Ge .
4 // So l ut i o n :
5 function RES=resistivity(un,up)// un : e l e c t r o n
c onc e nt r at i on , up : hol e c o nc e nt r a t i o n
6 q=1.6*10^ -19; // i n coul umb
7 ni =2.5*10^13; // c o nc e nt r a t i o n i n cm3
8 RES =1/(q*ni*(un+up))// s i n c e n=p=ni
9 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 : )
10 disp( ohmcm ,RES)
11 endfunction
12 // r e s i s t i v i t y ( 3900 , 1900) ;
Scilab code Exa 3.4 Hole Concentration
1 // Chapter 3 Semoconduct or De vi c e s Fundamental s
2 // Capti on : Hol e Conc e nt r at i on
3 // Example3 . 4 : A s e mi c onduc t or i s doped wi th a
c o nc e nt r a t i o n o f 1017 atoms /cm3 o f r s e n i c .
What i s t he e q ui l i br i um hol e c o nc e nt r a t i o n p at
300K. Gi ven ni =1. 51010 cm3
4 // So l ut i o n :
5 clear;
15
6 clc;
7 function p=holeconcentration(ni ,Nd)// ni=i n t r i n s i i c
c o nc e nt r a t i o n =1. 51010 cm3, Nd: donar
c o nc e nt r a t i o n ; s i nc e , Nd>>ni , s o Nd=n=1017 atoms
/cm 3 .
8 p=ni^2/Nd
9 disp( hol e c o nc e nt r a r t i o n at 300K i s : )
10 disp( per c ubi c cm ,p)
11 endfunction
12 // ho l e c o nc e nt 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 // Chapter 3 Semoconduct or De vi c e s Fundamental s
2 // Capti on : Re s i s t i v i t y o f Cu
3 // Example3 . 5 : The r e s i s t i v i t y o f met al i s gi ve n by p
=1/nqu , where n i s number o f e l e c t r o n s per c ubi c
meter , u i s mo bi l i t y , a nd q i s e l e c t r o n i c c har ge
. Determi ne t he r e s i s t i v i t o f copper at room
t e mpe r at ur e . Gi ven n=8. 51028 per c ubi c meter , u
=3.210 3 m2/Vs ec , at room t e mper at ur e .
4 // So l ut i o n :
5 q=1.6*10^ -19;
6 n=8.5*10^28;
7 u=3.2*10^ -3;
8 p=1/(n*q*u);
9 disp( r e s i s t i v i t y o f t he copper i s : )
10 disp( ohmmeter ,p)
11 // 2. 298D08 means 2. 29810 8
Scilab code Exa 3.6 Bipolar Transistor Parameters
1 // Chapter 3 Semoconduct or De vi c e s Fundamental s
16
2 // Capti on : Bi po l a r Tr a ns i s t o r Par amet er s
3 // Example3 . 6 : Determi ne 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 . Gi ven : I c =0. 2 mA, Vcb
=10V, Vcs=15V, Cuo=0. 25pF , Cj e=1 pF , Ccso =1. 5pF , Bo
=2000 , Tf =0. 3 ns , n=2104 and Vo=0. 55V f o r a l l
j u n c t i o n s .
4 // So l ut i o n :
5 clear;
6 clc;
7 Cuo =0.25; // c o l l e c t o r bas e d e p l e t i o n r e g i o n
c a pa c i t a nc e i n pi c o Farad ( pF) f o r z e r o bi a s
8 Ccso =1.5 ;// c o l l e c t o r s ubs t r a t e j unc t i o n
c a pa c i t a nc e i n pi c o Farad ( pF) f o r z e r o bi a s
9 q=1.6*10^ -19 ;// e l e c t r o n c har ge i n coul omb
10 Ic=0.2 ;// c o l l e c t o r c ur r e nt i n ampere (A)
11 k=8.6*10^ -5; // i n eV/K, where 1eV=1.610 19
12 T=300; // a bs o l ut e t e mpe r at ur e i n k e l v i n (K)
13 Vcb =10 ;// f or war d bi a s on t he j unc t i o n i n v o l t ( v )
14 Vcs =15 ;// c o l l e c t o r s ubs t r a t e bi a s i n v o l t (V)
15 Cje=1 ;// d e p l e t i o n r e g i o n c a pa c i t a nc e i n pi c o Farad (
pF)
16 Bo=200; // s mal l s i g n a l c ur r e nt gai n
17 Tf=0.3; // t r a n s i t ti me i n f or war d d i r e c t i o n i n nano
s e c onds ( nS )
18 n=2*10^ -4; // p r o p o r t i o n a l i t y c ons t ant f o r Ro and gm
19 Vo =0.55; // bi a s v o l t a g e i n v o l t (V)
20 Cu=Cuo/sqrt (1+( Vcb/Vo));// c o l l e c t o r bas e
c a pa c i t a nc e
21 disp( Cu i s : )
22 disp( pF ,Cu)
23 Ccs=Ccso/sqrt (1+( Vcs/Vo));// c o l l e c t o r s ubs t r a t e
c a pa c i t a nc e
24 disp( Ccs i s : )
25 disp( pF ,Ccs)
26 gm=q*Ic/(k*T*1.6*10^ -19);// s i n c e k i s i n eV s o
c o nve r t i ng i t i n Coulomb/ Kel vi n
27 disp( gm i s : )// t r ans c onduc t anc e o f t he b i p o l a r
t r a n s i s t o r he r e
17
28 disp( mA/V ,gm)
29 Cb=Tf*gm;// d i f f u s i o n c a pa c i t a nc e i n pi c o Farad ( pF)
30 C1=Cb+Cje;// s mal l s i g n a l c a pa c i t a nc e o f b i p o l a r
t r a n s i s t o r
31 disp(C1 i s : )
32 disp(pF,C1)
33 R1=Bo/gm;// s mal l s i g n a l i nput r e s i s t a n c e o f b i p o l a r
t r a n s i s t o r
34 disp( R1 i s : )
35 disp( k i l o Ohm ,R1)
36 Ro=1/(n*gm);// s mal l s i g n a l out put r e s i s t a n c e
37 disp( R0 i s )
38 disp( k i l o Ohm ,Ro)
39 Ru=10*Bo*Ro /10^3; // c o l l e c t o r bas e r e s i s t a n c e
40 disp( Ru i s : )
41 disp( Mega Ohm ,Ru)
18
Chapter 5
Monolithic Components
Scilab code Exa 5.1 Transit Time
1 // Chapter 5 Mo no l i t hi c Components
2 // Capti on : Tr ans i t Time
3 // Example5 . 1 : A l a t e r a l pnp de vi c e bas e wi dth i s 8
um and t he d i f f u s i o n c o f f i c i e n t f o r bas e r e g i o n
i s 10 cm2/ s e c . Ca l c ul a t e t he bas e t r a n s i t ti me
and t he uni t y gai n f r e que nc y .
4 // So l ut i o n :
5 function T=transittime(W,D)//W: bas e wi dth=8um; D:
bas e d i f f u s i o n c o f f i c i e n t =10 sq cm/ s e c .
6 T= W^2/(2*D);// s i n c e f ( t r a n s i t f r e que nc y
r e s po ns e ) =2D/(W2)
7 disp( bas e t r a n s i t ti me i s : )
8 disp( ns ,T*10^9) // i n nanos econds ( ns )
9 F=1/(2* %pi*T)// where F=uni t y gai n f r e que nc y
=1/(2%pi t r a n s i t ti me )
10 disp( uni t y gai n f r e que nc y i s : )
11 disp( MHz ,F/10^6) // i n Mega Her t z
12 endfunction
13 // t r a n s i t t i me ((810 6) , 1010 4) ;
19
Scilab code Exa 5.2 Unit gain frequency
1 // Chapter 5 Mo no l i t hi c Components
2 // Capti on : Uni t gai n f r e que nc y
3 // Example5 . 2 : a ) Fi nd Fl ( uni t gai n f r e que nc y ) f o r
t he l a t e r a l pnp de vi c e . Assume d i f f u s i o n
c o f f i c i e n t o f ho l e s i n t he bas e o f 0 . 5 sq cm/ s e c
and bas e wi dth o f 10um.
4 // b) Fi nd t he Fs ( uni t gai n f r e que nc y ) f o r t he
s ubs t r a t e pnp de vi c e . Assume D=20 sqcm/ s e c and W=8
um.
5 clear;
6 clc;
7 // a ) So l ut i o n : f o r t he l a t e r a l pnp de vi c e
8 Wl=10*10^ -4; // bas e wi dth i n mi cr o c e nt i me t e r ( ucm)
9 Dl=0.5; // bas e d i f f u s i o n c o f f i c i e n t i n sq cm/ s e c
10 Fl=2*Dl/(Wl^2);
11 disp( uni t gai n f r e que nc y f o r l a t e r a l pnp de vi c e i s
; )
12 disp( MHz ,Fl /10^6)
13 //b) So l ut i o n : f o r s ubs t r a t e pnp de vi c e
14 Ws=8*10^ -4; // bas e i n ucm
15 Ds=20; // bas e d i f f u s i o n c o f f i c i e n t i n sq cm/ s e c
16 Fs=Ds/(Ws^2);
17 disp( uni t gai n f r e que nc y f o r s ubs t r a t e pnp de vi c e
i s ; )
18 disp( MHz ,Fs /10^6)
Scilab code Exa 5.3 Resistance and Sheet resistance
1 // Chapter 5 Mo no l i t hi c Components
2 // Capati on : Re s i s t a nc e and Sheet r e s i s t a n c e
20
3 // Example5 . 3 : a )A bas e d i f f u s i o n l a y e r l e ng t h i s 100
um and i t s wi dth i s 10um. The s he e t r e s i s t a n c e o f
t he l a y e r i s 100 ohm/ s quar e . Ca l c ul a t e i t s
r e s i s t a n c e .
4 //b) Ca l c ul a t e t he s he e t r e s i s t a n c e o f a 20um t hi c k
, 5 ohmcm epl a y e r .
5 // a ) So l ut i o n :
6 L=100; // bas e d i f f u s i o n l a y e r i n um
7 W=10; // bas e d i f f u s i o n wi dth i n um
8 Rs=100; // s he e t r e s i s t a n c e i n ohm/ s quar e
9 R=L*Rs/W;
10 disp( r e s i s t a n c e o f bas e d i f f u s i o n l a y e r i s : )
11 disp( Ohm ,R)
12 //b) So l ut i o n :
13 Pe=5*10^ -2; // epl a y e r r e s i s t i v i t y i n ucm
14 t=20*10^ -6; // t h i c k n e s s o f t he l a y e r i n um
15 Rse=Pe/t;// s he e t r e s i t i v i t y o f epl a y e r
16 disp( s he e t r e s i s t a n c e o f epl a y e r i s : )
17 disp( Ohm ,Rse)
Scilab code Exa 5.4 Capacitance per unit area
1 // Chapter 5 Mo no l i t hi c Components
2 // Capti on : Capaci t anc e per uni t ar e a
3 // Example5 . 4 : Determi ne t he c a pa c i t a nc e per uni t
ar e a o f t he 400 ar ms t r ong gat e oxi de o f a MOSFET
de vi c e r e l a t i v e p e r mi t t i v i t y o f s i l i c o n di o x i de
=3. 9.
4 // So l ut i o n :
5 clear;
6 clc;
7 Eo =8.86*10^ -14; // p e r mi t t i v i t y o f f r e e s pac e i n F/cm
8 Er=3.9; // r e l a t i v e p e r mi t t i v i t y o f MOSFET de vi c e
9 t=0.4*10^ -5; // t h i c k n e s s o f t he gat e oxi de i n cm
10 Co=Eo*Er/t;// s i n c e c a po a c i t a nc e (C)=p e r mi t t i v i t y (E)
21
ar e a (A) / t hi c k ne s ( t ) ; s o C/A=e / t
11 disp( c a pa c i t a nc e per uni t ar e a o f gat e oxi de i s : )
12 disp( F/cm2 ,Co)
22
Chapter 7
Operational Amplier
Characteristics
Scilab code Exa 7.1 Bipolar Dierential Amplier Parameter
1 // Chapter 7 Ope r a t i o na l Ampl i f i e r Ch a r a c t e r i s t i c s
2 // Capti on : Bi po l a r Di f f e r e n t i a l Ampl i f i e r Parameter
3 // Example7 . 1 : The f o l l o wi n g s p e c i f i c a t i o n ar e gi ve n
f o r t he dual i nput , bal anc e d out put b i p o l a r
d i f e r e n t i a l a mp l i f i e r :
4 //Rc=2. 2 kOhm, Re=4/7kOhm, Rs=50 ohm, Vcc=10V, Vee=10V
and Bf=Bo=100. Assume Vbe=0. 7V.
5 // Determi ne
6 // a ) I c q and Vceq
7 //b) Di f f e r e n t i a l mode v o l t a g e f g a i n , and
8 // c ) I nput and out put r e s i s t a n c e s .
9 clear;
10 clc;
11 // a ) So l ut i o n : \
12 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
13 Re =4.7*10^3; // e mi 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
14 Rs=50; // bas e or s our 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
i n ohm
15 Vcc =10; // c o l l e c t o r power s uppl y i n Vol t
16 Vee=-10; // ne g a t i ve e mi t t e r power s uppl y
17 Bf=100; // gai n o f t he t r a n s i s t o r
18 Bo=Bf;
19 Vbe =0.7; // bas e e mi t t e r v o l t a g e o f one t r a n s i a t o r
20 Icq=(abs(Vee)-Vbe)/(2*Re+(Rs/Bf));
21 Vceq=Vcc+Vbe -Rc*Icq;
22 //b) So l ut i o n :
23 gm=Icq /(25*10^ -3);// where t r ans c onduc t anc e gm=I c /Vt
, Vt=25mV at room t emper at ur e , s o gm =I c /25
24 Ad=-gm*Rc;// d i f f e r e n t i a l mode v o l t a g e gai n I c q he r e
wi l l be t aken as f ound above not appr oxi mat ed
t o as gi ve n book
25 // c ) So l ut i o n :
26 r=Bo/gm;// i nput r e s i s t a n c e o f one t r a n s i s t o r
27 Ri=2*r;// d i f f e r e n t i a l mode i nput r e s i s t a n c e
28 Ro=Rc;// d i f f e r e n t i a l mode out put r e s i s t a n c e
29 disp( A ,Icq*10^3, o pe r a t i ng poi nt c o l l e c t o r c ur r e nt
)
30 disp( V ,Vceq , c o l l e c t o r toe mi t t e r v o l t a g e i s : )
31 disp(abs(Ad), Di f f e r e n t i a l mode v o l t a g e gai n )
32 disp( k i l o Ohm ,Ri/10^3, I nput Re s i s t a nc e )
33 disp( k i l o Ohm ,Ro/10^3, Output Re s i s t a nc e )
34 // Note :
35 // val ue o f I c q i s t aken as 0. 0009893 A or 0. 9893 mA
not appr oxi mat ed t o 0. 98 mA
Scilab code Exa 7.2 Rc and Re
1 // Chapter 7 Ope r a t i o na l Ampl i f i e r Ch a r a c t e r i s t i c s
2 // Capti on : Rc and Re
3 // Example7 . 2 : A b i p o l a r d i f f e r e n t a i l a mp l i f i e r us e s
a t r a n s i s t o r havi ng Bo=200 and bi a s e d at I c q =100
uA. Determi ne Rc and Re s o t hat abs (Ad) =500 and
24
CMRR=80 dB.
4 // So l ut i o n :
5 clear;
6 clc;
7 //CMRR i n dB i s e xpr e s s e d as 20logCMRR, s o 80=20
logCMRR or
8 CMRR =10^(80/20);
9 Icq =100*10^ -6; // c o l l e c t o r c ur r e nt
10 Vt=25*10^ -3; // s t andar d val ue o f t hr e s ho l d v o l t a g e at
room t e mpe r at ur e
11 gm=Icq/Vt;
12 Re=CMRR /(2*gm);// s i n c e CMRR=2gmRe ( approx )
13 Ad=500; // a bs o l ut e val ue o f d i f f e r e n t i a l mode
v o l t a g e gai n
14 Rc=-Ad/gm;// Co l l e c t o r r e s i s t a n c e
15 disp( Mega Ohm ,Re/10^6, e mi t t e r r e s i t a n c e ( Re ) o f
b i p o l a r d i f f e r e n t i a l a mp l i f i e r i s : )
16 disp( Ki 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 mp l i f i e r i s : )
Scilab code Exa 7.4 Oset Voltage Change
1 // Chapter 7 Ope r at i on Ampl i f i e r Ch a r a c t e r i s t i c s
2 // Capti on : Of f s e t Vol t age Change
3 // Example7 . 4 : What i s t he change i n t he o f f s e t
v o l t a g e o f a b i p o l a r t r a n s i s t o r a mp l i f i e r f o r a
d i f f e r e n c e o f 10V i n t he c o l l e c t o r toe mi t t e r
v o l t a g e and Va=250 V. Assume room t e mpe r at ur e .
4 // So l ut i o n :
5 clear;
6 clc;
7 Vt=25*10^ -3; // t hr e s ho l d v o l t a g e at room t e mpe r at ur e
i n Vol t
8 Va=250; // e a r l y v o l t a g e o f t he b i p o l a r t r a n s i s t o r i n
v o l t
25
9 deltaVce =1; // l e t us assume 1V o f change i n Vce (
c o l l e c t o r toe mi t t e r v o l t a g e )
10 deltaVos1=Vt*(-deltaVce/Va);
11 disp( mV ,abs(deltaVos1)*10^3, change i n o f f s e t
v o l t a g e f o r 1 V change i n Vce i s : )
12 for i=1:1,
13 if i==1 then
14 deltaVce =10; // i n v o l t
15 deltaVos=deltaVce*deltaVos1;
16 disp( mV ,abs(deltaVos)*10^3, change i n
o f f s e t v o l t a g e o f b i p o l a r t r a n s i s t o r f o r
10V c o l l e c t o r toe mi t t e r v o l t a g e ( Vce )
d i f f e r e n c e i s : )
17 end
18 end
Scilab code Exa 7.5 Temperature Coecient
1 // Chapter 7 Ope r a t i o na l Ampl i f i e r Ch a r a c t e r i s t i c s
2 // Capti on : Temperature Co e f f i c i e n t
3 // Example7 . 5 : Determi ne t he t e mpe r at ur e c o e f f i c i e n t
o f t he i nput o f f s e t v o l t a g e f o r t he b i p o l a r
d i f f e r e n t i a l a mp l i f i e r havi ng Vos =1. 5 mV. What i s
t he pe r c e nt age change i n t he Vos per de gr e e
t e mpe r at ur e change .
4 // So l ut i o n :
5 clear;
6 clc;
7 // t e mpe r at ur e c o f f i c i e n t o f t he i nput o f f s e t
v o l t a g e f o r t he b i p o l a r d i f f e r e n t i a l a mp l i f i e r
Vos i s =dVos /dT=Vos /T;
8 Vos =1.5*10^ -3; // i nput o f f s e t v o l t a g e f o r b i p o l a r
d i f f e r e n t i a l t r a n s i s t o r a mp l i f i e r
9 T=300; // assumi ng room t e mpe r at ur e
10 TC=Vos/T;// t e mpe r at ur e c o f f i c i e n t o f Vos
26
11 // pe r c e nt age change i n t he Vos per de gr e e
t e mpe r at ur e change wi l l be gi ve n by as f o l l o w :
12 PC=(TC/Vos)*100; // pe r c e nt age change (PC) i n t he Vos
per de gr e e t e mper at ur e change
13 disp( %per de gr e e c e l c i u s ,PC , pe r c e nt age change i n
t he Vos per de gr e e t e mpe r at ur e change i s : )
Scilab code Exa 7.14 Eect on Output Voltage
1 // Chapter 7 Ope r a t i o na l Ampl i f i e r Ch a r a c t e r i s t i c s
2 // Capti on : Ef f e c t on Output Vol t age
3 // Example7 . 1 4 : For t he no ni nve r t i ng OPAmp wi th
i nput r e s i s t a n c e R1 nad f e e dbac k r e s i s t a n c e R2
f i nd t he e f f e c t on out put v o l t a g e Vo be c aus e o f
t he common mode v o l t a g e Vcm when t he i nput
v o l t a g e Vs changes by 1V. Gi ven CMRR=70 dB.
4 // So l ut i o n :
5 clear;
6 clc;
7 CMRR =70; //Common Mode Re j e c t i o n Rat i o i n dB
8 // s i n c e CMRR=20 l o g (Vcm/Vdm) dB
9 // s o Vdm=Vcm/10(CMRR/20)
10 // s i n c e out put v o l t a g e o f OPAmp i s Vo=(R1+R2) Vdm/
R1=(R1+R2) Vcm/( R110(CMRR/20) )
11 R1=100; // assumi ng i nput r e s i s t a n c e s t andar d val ue i n
k i l o Ohm
12 R2=900; // assumi ng f e e dbac k r e s i s t a n c e s t andar d val ue
i n k i l o Ohm
13 Vs=1; // change i n i nput v o l t a g e gi ve n i n que s t i o n
14 Vcm=Vs;// s i n c e change i n i nput v o l t a g e i s a ppl i e d t o
no ni nve r t i ng i nput and t hr ough t he f e e dbac k t o
t he i n v e r t i n g i put o f t he OpAmp as we l l .
15 Vo=(R1+R2)*Vcm/(R1*10^( CMRR /20))
16 disp( mV ,abs(Vo)*10^3, change i n out put v o l t a g e due
t o common mode Vol t age (Vcm) i s : )
27
17 // Note :
18 // CMRR, Vdm, Vo may be o f e i t h e r p o l a r i t y . Here
a bs o l ut e val ue i s c a l c u l a t e d
Scilab code Exa 7.15 Slew rate and Fmax
1 // Chapter 7 Ope r a t i o na l Ampl i f i e r Ch a r a c t e r i s t i c s
2 // Capti on : Sl ew r a t e and Fmax
3 // Example7 . 1 5 : For t ype 741 OpAmp f o l l o wi n g
par amet er ar e gi ve n . Qui e s c e nt c o l l e c t o r c ur r e nt
I c =9. 5 uA, Cc=30 pF. Peak ampl i t ude o f i nput
v o l t a g e Vm=15V.
4 // a ) Determi ne t he s l e w r a t e
5 //b) Determi ne f u l l power bandwi dth Fmax f o r t he s l e w
r a t e as obt ai ne d f rom par t ( a ) .
6 clear;
7 clc;
8 // a ) So l ut i o n :
9 Ic =9.5*10^ -6; // o pe r a t i ng c o l l e c t o r c ur r e nt i n A
10 Cc =30*10^ -12; // p a r a s i t i c c a pa c i t a nc e
11 SlewRate =2*Ic/Cc;
12 disp( V/ us ,SlewRate /10^6 , Sl ew r a t e i s : )
13 //b) So l ut i o n :
14 Vm=15; // ampl i t ude o f i nput v o l t a g e i n Vol t
15 Fmax=SlewRate /(2* %pi*Vm);// f u l l power bandwi dth
16 disp( kHz ,Fmax /10^3, f u l l power bandwi dth Fmax f o r
t he Sl ew Rate obt ai ne d above i s : )
Scilab code Exa 7.16 Largest Amplitude
1 // Chapter 7 Ope r a t i o na l Ampl i f i e r Ch a r a c t e r i s t i c s
2 // Capti on : Lar ge s t Ampl i tude
28
3 // Example7 . 1 6 : An a mp l i f i e r has a 10 kHz s i newave
i nput s i g n a l . Fi nd t he l a r g e s t ampl i t ude t hat t he
out put o f t he a mp l i f i e r can be , wi t hout
d i s t o r t i o n owi ng t o s l e w r a t e l i mi t i n g . Gi ven
s l e w r a t e =0. 5V/u s e c .
4 // So l ut i o n :
5 clear;
6 clc;
7 Fmax =10*10^3; // f r e que nc y o f s i newave i nput s i g n a l i n
Hz
8 SlewRate =0.5*10^6; // gi ve n i n que s t i o n i n V/ s e c
9 Vm=SlewRate /(2* %pi*Fmax);// Si nc e Fmax=s l e w r a t e /( 2
%pi Vm)
10 disp( V( peak ) ,Vm , l a r g e s t ampl i t ude t hat t he out put
o f t he a mp l i f i e r can be wi t hout d i s t o r t i o n owi ng
t o s l e w r a t e l i mi t a t i o n i s : )
11 // Note :
12 // c a l c u l a t e d ampl i t ude i s 7. 9577 V, whi ch can be
appr oxi mat ed t o 8 V
Scilab code Exa 7.17 Maximum allowable frequency
1 // Chapter 7 Ope r a t i o na l Ampl i f i e r Ch a r a c t e r i s t i c s
2 // Capti on : Maximum a l l o wa bl e f r e que nc y
3 // Example7 . 1 7 : When a l ow f r e que nc y s i n u s o i d a l
wavef orm i s a ppl i e d t o an i nput o f t he
no ni nve r t i ng OpAmp t he a mp l i f i e r r e s ponds
l i n e a r l y over an out put r ange f rom 10V t o +10V.
I f R1=R2 and t he s l e w r a t e o f t he a mp l i f i e r i s 50
V/u s ec , what i s t he maximum a l l o wa bl e f r e que nc y
o f an i nput s i n u s o i d i f t he out put s i g n a l swi ng
i s t o be mai nt ai ned f rom 10V t o +10V wi t hout
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 dbac k
r e s i t a n c e .
4 // So l ut i o n
29
5 clear;
6 clc;
7 SlewRate =50/10^ -6; // i n V/ s e c
8 Vo=10-( -10);// f rom que s t i o n out put i s r angi ng f rom
10V t o +10V
9 Vom=Vo;// where Vom i s t he maximum val ue o f Vo
10 // t h e r e f o r e
11 Fmax=SlewRate /(2* %pi*Vom);
12 disp( kHz ,Fmax /10^3, maximum a l l o wa bl e f r e que nc y o f
an i nput s i n u s o i d a l f o r out put swi ng mai nt ai ned
f rom 10V t o +10v i s : )
13 // Note :
14 // obt ai ne d maximum a l l o wa bl e ampl i t ude i s 397. 88736
kHz whi ch can be appr oxi mat ed t o 400 kHz
30
Chapter 8
Applications of Operational
Amplier
Scilab code Exa 8.1 Device Temperature
1 // Chapter 8 Ap p l i c a t i o n s o f Ope r at i onal Ampl i f i e r
2 // Capti on : Devi ce Temperature
3 // Example8 . 1 : The Heat ge ne r at e d by a l i n e a r IC , uA
741 i s 200 mW. I f t he t her mal r e s i s t a n c e i s 150
de gr e e Ce l s i u s /Watt and t he ambi ent t e mpe r at ur e
i s 25 de gr e e c e l s i u s . c a l c u l a t e t he de vi c e
t e mpe r at ur e .
4 // So l ut i o n :
5 clear;
6 clc;
7 Pd =200*10^ -3; // heat ge ne r at e d
8 Rt=150; // t her mal r e s i s t a n c e
9 Ta=25; // ambi ent t e mpe r at ur e i n de gr e e c e l s i u s
10 // assumi ng t her mal e q ui l i br i um c ondi t on
11 Td=Pd*Rt+Ta;
12 disp( de gr e e c e l s i u s ,Td , The de vi c e t empe r at ur e i s :
)
31
Scilab code Exa 8.2 Device Temperature
1 // Chapter 8 Ap p l i c a t i o n s o f Ope r at i onal Ampl i f i e r
2 // Capti on : Devi ce Temperature
3 // Example8 . 2 : For t he de vi c e i n Example8 . 1 , Pdmax
=500 mW. Determi ne t he de vi c e t e mper at ur e a f t e r
e q ui l i br i um i s a t t a i ne d f o r an ambi ent
t e mpe r at ur e o f 75 de gr e e c e l s i u s and i f t he
de vi c e i s s ubj e c t e d t o maximum heat g e ne r a t i o n .
Maximum a l l o wa bl e de vi c e t e mpe r at ur e i s 150
de gr e e Ce l s i u s .
4 // So l ut i o n :
5 clear;
6 clc;
7 Pmax =500*10^ -3;
8 Pd=Pmax;// s i n c e de vi c e i s s ubj e c t e d t o maximum heat
g e ne r a t i o n
9 Rt=150; // t her mal r e s i t a n c e
10 Ta=75; // ambi ent t e mpe r at ur e
11 Td=Pd*Rt+Ta;
12 disp( de gr e e c e l s i u s ,Td , de vi c e t e mpe r at ur e i s : )
Scilab code Exa 8.3 Device Temperature
1 // Chapter 8 Ap p l i c a t i o n s o f Ope r at i onal Ampl i f i e r
2 // Capti on : Devi ce Temperature
3 // Example8 . 3 : a ) The ambi ent t e mpe r at ur e o f t he de vi c e
o f Example8 . 2 r i s e s above 90 de gr e e c e l s i u s .
What i s t he new val ue o f Td i f i t s t i l l g e ne r a t e s
500 mW?
4 // a ) So l ut i o n :
5 clear;
32
6 clc;
7 Pd =500*10^ -3;
8 Rt=150; // t her mal r e s i s t a n c e
9 Ta=90; // ambi ent t e mpe r at ur e
10 Td=Pd*Rt+Ta;
11 disp( de gr e e c e l s i u s ,Td , New val ue o f de vi c e
t e mpe r at ur e i s : )
Scilab code Exa 8.4 Device Temperature
1 // Chapter 8 Ap p l i c a t i o n s o f Ope r at i onal Ampl i f i e r
2 // Capti on : Devi ce Temperature
3 // Example8 . 4 : Forced a i r c o o l i n g pr ovi de d f o r t he
de vi c e i n Example8 . 3 l o we r s t he ambi ent
t e mpe r at ur e at 60 de gr e e c e l s i u s . What i s
t e mpe r at ur e o f t he de vi c e ?
4 // So l ut i o n :
5 clear;
6 clc;
7 Pd =500*10^ -3;
8 Rt=150; // t her mal r e s i s t a n c e
9 Ta=60; // ambi ent t e mpe r at ur e
10 Td=Pd*Rt+Ta;
11 disp( de gr e e c e l s i u s ,Td , Temperature o f t he de vi c e
i s : )
Scilab code Exa 8.7 Output Voltage
1 // Chapter 8 Ap p l i c a t i o n s o f Ope r at i onal Ampl i f i e r
2 // Capti on : Output Vol t age
3 // Example8 . 7 : I n t he summing a mp l i f i e r ( i n v e r t i n g
mode ) t he s i g n a l s t o be combi ned ar e V1=3V, V2=2v
, and V3=1V. The i nput r e s i s t o r ar e R1=R2=R3=3
33
k i l o ohm. The f e e ddbac k r e s i s t o r Rf=1 k i l o ohm.
Cons i de r i d e a l OpAmp, de t e r mi ne Vo .
4 // So l ut i o n :
5 clear;
6 clc;
7 V1=3; // i nput s i g n a l
8 V2=2; // i nput s i g n a l
9 V3=1; // i nput s i g n a l
10 Rf =1*10^3; // f e e dbac k r e s i t o r
11 R1 =3*10^3; // i nput r e s i s t o r i n ohm
12 R2=R1;// i nput r e s i s t o r i n ohm
13 R3=R2;// i nput r e s i s t o r i n ohm
14 Vo=-(Rf/R1*V1+Rf/R2*V2+Rf/R3*V3);
15 disp( V ,Vo , Output Vol t age o f summing a mp l i f i e r i s :
)
Scilab code Exa 8.8 Vp and Vo
1 // Chapter 8 Ap p l i c a t i o n s o f Ope r at i onal Ampl i f i e r
2 // Capti on : Vp and Vo
3 // Example8 . 8 : I n t he 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 nput
r e s i s t o r s f o r a l l t he t hr e e i nput s i g n a l ar e same
and ar e e qual t o 1 k i l o Ohm. The f e e dbac k
r e s i s t o r Rf i s 2 k i l o ohm. Determi ne t he v o l t a g e
Vp at t he no ni nve r t i ng pi n o f t he OpAmp and t he
out put Vo . Assume i d e a l Op=Amp.
4 // So l ut i o n :
5 clear;
6 clc;
7 Rf =2*10^3; // f e e dbac k r e s i s t o r
8 R1 =1*10^3;
9 R2=R1;
10 R3=R2;
11 V1=2;
34
12 V2=-4;
13 V3=5;
14 n=3; // no o f i nput s
15 Vp=(Rf/R1*V1+Rf/R2*V2+Rf/R3*V3)/n;
16 Vo=(1+Rf/R1)*Vp;
17 disp( V ,Vp , v o l t a g e at no ni nve r t i ng pi n i s : )
18 disp( V ,Vo , out put v o l t a g e v o l t a g e o f no ni nve r t i ng
summing OpAmp i s : )
35
Chapter 9
Active Filters
Scilab code Exa 9.6 Determine Q Fl and Fh
1 // Chapter 9 Ac t i ve F i l t e r s
2 // Capti on : Determi ne Q Fl and Fh
3 // Example9 . 6 : A c e r t a i n twopol e band pas s f i l t e r
r e s po ns e i s r e q ui r e d wi th a c e nt r e f r e que nc y o f 2
kHz and a 3 dB bandwi dth o f 400 Hz . Determi ne Q,
Fl and Fh .
4 // So l ut i o n :
5 clear;
6 clc;
7 Fo =2*10^3; // c e nt r e f r e que nc y i n Hz
8 BW=400; // 3 dB bandwi dth
9 Q=Fo/BW;// Qf a c t o r o f band pas s f i l t e r
10 Fl=Fo*sqrt (1+1/(4*Q^2))-Fo/(2*Q);
11 Fh=Fo*sqrt (1+1/(4*Q^2))+Fo/(2*Q);
12 disp( Hz ,Fl , l owe r c ut t o f f f r e que nc y i s : )
13 disp( Hz ,Fh , Hi gher c ut t o f f f r e que nc y i s : )
Scilab code Exa 9.12 Unity gain frequency and Capacitor determination
36
1 // Chapter 9 Ac t i ve F i l t e r s
2 // Capti on : Uni ty gai n f r e que nc y and Capac i t or
de t e r mi nat i on
3 // Example9 . 1 2 : a ) Determi ne t he uni t y gai n f r e que nc y ,
Fo , o f a s wi t c he d c a p a c i t o r i n t e g r a t o r havi ng
f o l l o wi n g s p e c i f i c a t i o n s : Fcl k=1 kHz , C1=1 pF , and
C2=15. 9 pF
4 //b) What i s t he val ue 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 havi ng R=1. 6 mega Ohm and Fo as
obt ai ne d i n par t ( a ) .
5 // a ) So l ut i o n :
6 clear;
7 clc;
8 C1=1*10^ -12; // s o ur c e c a p a c i t o r i n F
9 C2 =15.9*10^ -12; // f e e dbac k c a p a c i t o r
10 Fclk =1*10^3; // c l o c k f r e que nc y or s wi t c hi ng f r e que nc y
11 Fo=1*(C1/C2)*Fclk /(2* %pi);
12 disp( Hz ,Fo , uni t y gai n f r e que nc y i s : )
13 //b) So l ut i o n :
14 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
15 C=1/(2* %pi*Fo*R);
16 disp( nF ,C*10^9, f o r Rc i n t e g r a t o r val ue o f
c a p a c i t o r needed i s : )
17 // Note :
18 // Obtai ned r e s u l t s ar e appr oxi mat ed t o ne a r e s t
val ue s , t hus Fo=10 Hz and C=10 nF
37
Chapter 10
Special Purpose Ampliers
Scilab code Exa 10.3 Class B Power Amplier
1 // Chapter 10 S p e c i a l Purpose Ampl i f i e r s
2 // Capti on : Cl as s B Power Ampl i f i e r
3 // Exampl e10 . 3 : A c l a s s B audi o power a mp l i f i e r has a
s uppl y v o l t a g e o f abs ( Vcc ) =15V. The c l o s e d l oop
gai n Av=50 and t he a mp l i f i e r has t o d e l i v e r 10W
o f power i nt o an 8 ohm l oad . Fi nd :
4 // a ) t he peak out put v o l t a g e swi ng
5 //b) t he peak out put c ur r e nt swi ng
6 // c ) t he i nput s i g n a l r e q ui r e d ( rms )
7 //d) t he t o t a l power f rom t he power s uppl y
8 // e ) t he power d i s s i p a t e d i n t he a mp l i f i e r
9 // f ) t he power c o nve r s i o n e f f i c i e n c y
10 clear;
11 clc;
12 // a ) So l ut i o n :
13 Po=10; // power i n Watt
14 Rl=8; // l oad r e s i s t a n c e i n Ohm;
15 Vorms=sqrt(Po*Rl);// s i n c e out put power Po=Vorms 2/
Rl
16 Vom=sqrt (2)*Vorms;// peak out put v o l t a g e swi ng
17 disp( V ,abs(Vom), The peak out put Vol t age swi ng : )
38
18 //b) So l ut i o n :
19 Iom=Vom/Rl;
20 disp( A ,abs(Iom), The peak out put c ur r e nt swi ng i s :
)
21 // c ) So l ut i o n :
22 Av=50; // c l o s e d l oop gai n
23 Vsrms=Vorms/Av;
24 disp( V ,Vsrms , The i nput rms s i g n a l r e q ui r e d i s : )
25 //d) So l ut i o n :
26 Vcc =15; // a bs o l ut e val ue o f poer s uppl y i n v o l t
27 Pin =2*Vcc*Iom/%pi;// s i n c e I orms 2( 1/2)=Iom
28 disp( W ,Pin , The t o t a l power f rom power s uppl y i s :
)
29 // e ) So l ut i o n :
30 Pd=(2/ %pi)*Vcc*sqrt (2*Po/Rl)-Po;
31 disp( W ,Pd , The power d i s s i p a t e d i n t he a mp l i f i e r
i s : )
32 // f ) So l ut i o n :
33 n=(Po/Pin)*100;
34 disp( % ,n, The power c o nve r s i o n e f f i c i e n c y i s : )
35 // Note :
36 //Vcc , Vom and Iom can be o f e i t h e r p o l a r i t y but he r e
onl y a bs o l ut e val ue i s c o ns i de r e d and c a l c u l a t e d
Scilab code Exa 10.4 Power Output
1 // Chapter 10 S p e c i a l Purpose Ampl i f i e r
2 // Capti on : Power Output
3 // Exampl e10 . 4 : For t he a mp l i f i e r o f Exampl e10 . 3 ,
f i nd t he power out put l e v e l at whi ch t he power
d i s s i p a t i o n wi l l bw maximum and t he maximum power
d i s s i p a t i o n .
4 // So l ut i o n :
5 clear;
6 clc;
39
7 Vcc =15; // power s uppl y i n v o l t
8 Rl=8; // l oad 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 ( 2Po/Rl )Po
10 // t o de t e r mi ne t he val ue o f Po at whi ch Pd i s
maximum we d i f f e r e n t i a t e above e quat i on and
equat e t o zer o , we f i nd Po as
11 Po=2*Vcc ^2/(( %pi)^2*Rl);
12 // t he r e f o r e maximum power d i s s i p a t e d i s
13 Pdmax =2* Vcc/%pi*sqrt (2*Po/Rl)-Po;
14 disp( W ,Po , The power out put l e v e l f o r maximum
power d i s s i p a t i o n i s : )
15 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 po ndi ng out put power l e v e l i s ; )
Scilab code Exa 10.8 LM4250 Parameters
1 // Chapter 10 S p e c i a l Purpose Ampl i f i e r s
2 // Capti on : LM4250 Par amet er s
3 // Exampl e10 . 8 : The mi cropower programmabl e OpAmp LM
4250 i s s uppl i e d by 3 v s o ur s e ( a bs o l ut e val ue )
s our c e . Determi ne t he val ue 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 Rset i s c onne c t e d t o ( a ) Vee and ( b
) ground . ( c ) de t e r mi ne t he q ui e s c e nt s uppl y
c ur r e nt and t he q ui e s c e nt power d i s s i p a t i o n .
4 clear;
5 clc;
6 // a ) So l ut i o n :
7 Vcc =3; // power s uppl y i n Vol t
8 Vee=-Vcc;// ne g a t i ve power s uppl y i n Vol t
9 Iset =0.1*10^ -6; // bi a s s e t t i n g c ur r e nt i n A;
10 Rset=(Vcc+abs(Vee) -0.5)/Iset;
11 disp( mega Ohm ,Rset /10^6, The bi a s s e t t i n g c ur r e nt
r e s i s t o r f o r Vee=10 V i s : )
12 //b) So l ut i o n :
13 clear Vee;
40
14 Vee =0; // s i n c e Rset i s c onne c t e d t o ground
15 Rset=(Vcc+abs(Vee) -0.5)/Iset;
16 disp( mega Ohm ,Rset /10^6, The bi a s s e t t i n g c ur r e nt
r e s i s t o r f o r Vee=0 V i s : )
17 // c ) So l ut i o n :
18 Qcurrent =5* Iset;
19 Qpower =(Vcc+3)*Qcurrent;// where abs ( Vee )=3 V
20 disp( uA ,Qcurrent *10^6 , The q ui e s c e nt c ur r e nt
s uppl y i s : )
21 disp( uW ,Qpower *10^6, The q ui e s c e nt power
d i s s i p a t e d i s : )
Scilab code Exa 10.9 Common Emitter Amplier Parameters
1 // Chapter 10 S p e c i a l Purpose Ampl i f i e r s
2 // Capti on : Common Emi t t er Ampl i f i e r Par amet er s
3 // Exampl e10 . 9 : A s i n g l e common e mi t t e r a mp l i f i e r has
f o l l o wi n g de vi c e and c i r c u i t par ame t e r s : Rb=60
Ohm, Rs=40 Ohm, Cu=1. 5 pF , Cl=1 pF , f t =1. 6 GHz at I c
=2. 5 mA q ui e s c e nt c ur r e nt . Determi ne each o f t he
f o l l o wi n g f o r two va l ue s o f Rl : 30 Ohm and 100
Ohm. a ) f 1 b) F2 ( c )BW ( d) Avmid ( e ) avmidBw.
4 clear;
5 clc;
6 Ft =1.6*10^9; // r educed uni t y gai n f r e que nc y i n Hz
7 Ic =2.5*10^ -3; // c o l l e c t o r c ur r e nt i n A
8 Vt=25*10^ -3; // t hr e s ho l d v o l t a g e at room t e mpe r at ur e
9 gm=Ic/Vt;// t r ans c onduc t anc e
10 Cu =1.5*10^ -12;
11 Cl=1*10^ -12;
12 Rs=40;
13 Rb=60;
14 C2=gm/(2* %pi*Ft)-Cu
15 for i=1:2,
16 if i==1 then
41
17 Rl=30; // l oad r e s i s t a n c e
18 F1 =1/(2* %pi*(Rs+Rb)*(C2+Cu*(1+gm*Rl)));//
f i r s t br eak f r e que nc y
19 F2 =1/(2* %pi*Rl*(Cu+Cl));// s econd br eak
f r e que nc y
20 BW=F1;// s i n c e s i n g l e common e mi t t e r
a mp l i f i e r s o n=1 t hus BW=F1 s q r t ( 2( 1/ n)
1) , i . e . ,BW=F1
21 Avmid=-gm*Rl;//mid f r e que nc y gai n
22 GBW=Avmid*BW;// gai nbandwi dth pr oduct
23 disp( For Rl =30 Ohm )
24 disp( MHz ,F1/10^6, f i r s t br eak f r e que nc y i s
: )
25 disp( MHz ,F2/10^6, s econd br eak f r e que nc y
i s : )
26 disp( MHz ,BW/10^6, Bandwi dth i s : )
27 disp(abs(Avmid), mid f r e que nc y gai n i s : )
28 disp( MHz ,abs(GBW)/10^6 , gai nbandwi dth
pr oduct i s : )
29 else
30 Rl=100; // l oad r e s i s t a n c e i n ohm
31 F1 =1/(2* %pi*(Rs+Rb)*(C2+Cu*(1+gm*Rl)));//
f i r s t br eak f r e que nc y
32 F2 =1/(2* %pi*Rl*(Cu+Cl));// s econd br eak
f r e que nc y
33 BW=F1;// s i n c e s i n g l e common e mi t t e r
a mp l i f i e r s o n=1 t hus BW=F1 s q r t ( 2( 1/ n)
1) , i . e . ,BW=F1
34 Avmid=-gm*Rl;//mid f r e que nc y gai n
35 GBW=Avmid*BW;// gai nbandwi dth pr oduct
36 disp( For Rl =100 Ohm )
37 disp( MHz ,F1/10^6, f i r s t br eak f r e que nc y i s
: )
38 disp( MHz ,F2/10^6, s econd br eak f r e que nc y
i s : )
39 disp( MHz ,BW/10^6, Bandwi dth i s : )
40 disp(abs(Avmid), mid f r e que nc y gai n i s : )
41 disp( MHz ,abs(GBW)/10^6 , gai nbandwi dth
42
pr oduct i s : )
42 end
43 end
43
Chapter 11
Nonlinear Circuit Application
Scilab code Exa 11.4 Time taken
1 // Chapter 11 No nl i ne a r Ci r c u i t Appl i c a t i o n
2 // Capti on : Time t aken
3 // Exampl e11 . 4 : b) Type 741 Opamp i s used as a
compar at or and i t s s l e w r a t e i s 0 . 5V/ us . How l ong
wi l l i t change f rom +10 V t o 10v?
4 //b) So l ut i o n :
5 clear;
6 clc;
7 deltaVo =10-( -10);
8 SlewRate =0.5*10^ -6;
9 t=deltaVo/SlewRate;
10 disp( us ,t/10^6, ti me t aken by t he out put v o l t a g e
t o change f rom +10 V t o 10 V i s : )
Scilab code Exa 11.5 Rise Time
1 // Chapter 11 No nl i ne a r Ci r c u i t Appl i c a t i o n
2 // Capti on : Ri s e Time
44
3 // Exampl e11 . 5 : The upper 3dB f r e que nc y o f an OpAmp
i s 1MHz. Ca l c ul a t e t he r i s e ti me o f t he out put .
I f t he upper 3dB f r e que nc y o f t he OpAmp i s
i nc r e a s e d t o 50 MHz by r e duc i ng t he gai n such
t hat gai n bandwi dth pr oduct r emai ns cons t ant , then
f i nd out t he new r i s e ti me . Di s c us s t he e f f e c t o f
i n c r e a s i n g bandwi dth on ac c ur ac y o f compar at or .
4 // So l ut i o n :
5 clear;
6 clc;
7 F3dB =1*10^6; // upper 3dB f r e que nc y o f OpAmp
8 Tr =0.35/ F3dB;// f rom d e f i n i t i o n o f r i s e ti me
9 disp( n s e c ,Tr*10^9, Ri s e ti me o f t he out put i s : )
10 F3dB1 =50*10^6;
11 Tr1 =0.35/ F3dB1;
12 disp( n s e c ,Tr1*10^9, Ri s e ti me o f t he out put i s : )
Scilab code Exa 11.11 Design Peak Detector
1 // Chapter 11 No nl i ne a r Ci r c u i t Appl i c a t i o n
2 // Capti on : Des i gn Peak De t e c t or
3 // Exampl e11 . 1 1 : Des i gn a p o s i t i v e peak de t e c t o r
us i ng t ype uA 760 compar at or t hat can r es pond t o
a 100 mV( pp ) , 5 MHz s i n u s o i d a l i nput s i g n a l . The
de vi c e has f o l l o wi n g s p e c i f i c a t i o n s . Response
ti me =25 ns , pr opagat i on ti me =12 ns , and I nput
bi a s c ur r e nt =8uA.
4 // So l ut i o n :
5 clear;
6 clc;
7 Vp=50*10^ -3; // s i n c e peakpeak v o l t a g e i s 100 mV
8 f=5*10^6;
9 T=200*10^ -9;
10 t=15*10^ -9 // s i n c e r i s e ti me ( t ) s houl d be g r e a t e r
than pr opagat i on de l ay ( 12 ns )
45
11 deltaVc=Vp*(1-cos (4*t/T*90*( %pi)/180));
12 Ib=8*10^ -6; // i nput bi a s c ur r e nt
13 C=Ib/( deltaVc/T);
14 disp( mV ,deltaVc *10^3, v o l t a g e change i s : )
15 disp( pF ,C*10^12 , c a p a c i t o r val ue i s : )
16 // Note :
17 // t he Exact val ue as c a l c u l a t e d i s t aken t o
c a l c u l a t e C, s o C=293. 59555 pF. I f approx val ue
o f del t aVc i s t aken as 5 mV then C=320 pF
46
Chapter 12
Signal Generators
Scilab code Exa 12.6 555 Timer
1 // Chapter 12 S i g n a l Ge ne r at or s
2 // Capti on : 555 Timer
3 // Exampl e12 . 6 : Ca l c ul a t e ( a ) Tc ( b)Td , and ( c ) t he
f r e e r unni ng f r e que nc y f o r t he t i me r 555
c onne c t e d i n a s t a b l e mode . Gi ven Ra=6. 8 k i l o Ohm;
Rb=3. 3 k i l o Ohm; C=0. 1 uF. What i s t he duty c y c l e
, d , o f t he c i r c u i t ?
4 // So l ut i o n :
5 clear;
6 clc;
7 Ra =6.8*10^3;
8 Rb =3.3*10^3;
9 C=0.1*10^ -6;
10 // Usi ng e quat i on f o r a s t a b l e mul t i v i b r a t o r we have
11 Tc =0.69*( Ra+Rb)*C;// c har gi ng ti me
12 Td =0.69* Rb*C;// di s c ha r g i ng ti me
13 f=1.44/(( Ra+2*Rb)*C);// f r e e r unni ng f r e que nc y
14 d=Rb/(Ra+2*Rb);// duty c y c l e
15 disp( ms ,Tc*10^3, c har gi ng ti me o f 555 t i me r i n
a s t a b l e mode i s : )
16 disp( ms ,Td*10^3, di s c ha r g i ng ti me o f 555 t i me 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 unni ng f r e que nc y o f 555
t i me 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 me r i n a s t a b l e mode i s :
)
Scilab code Exa 12.11 Design
1 // Chapter 12 S i g n a l Ge ne r at or s
2 // Capti on : Des i gn
3 // Exampl e12 . 1 1 : A 555 one s hot c i r c u i t wi th Vcc=16 V
i s t o have a 2 ms out put pul s e wi dth . Des i gn a
s u i t a b l e Ci r c u i t . I t h r e s =0. 25 uA( max . ) f rom data
s he e t o f t he de vi c e .
4 // So l ut i o n :
5 clear;
6 clc;
7 Ithres =0.25*10^ -6;
8 T=2*10^ -3 // out put pul s e wi dth
9 Vcc =16; // power s uppl y t o 555
10 //The val ue o f minimum c a p a c i t o r c har gi ng c ur r e nt I c
s houl d be much g r e a t e r than t he t hr e s ho l d
Cur r ent I t h r e s
11 Icmin =1000* Ithres;// s i n c e Icmi n>>I t h r e s
12 Ra=Vcc /(3* Icmin);
13 C=T/(1.1* Ra);
14 disp( k i l o Ohm ,Ra/10^3, r e s i t a n c e de s i g n i s : )
15 disp( uF ,C*10^6, Capac i t or de s i g n i s : )
Scilab code Exa 12.12 Generating pulse by 555 timer
1 // Chapter 12 S i g n a l Ge ne r at or s
2 // Capti on : Ge ne r at i ng pul s e by 555 t i me r
48
3 // Exampl e12 . 1 2 : ( a ) Des i gn a 555 a s t a b l e mu l t i v i br a t o r
t o g e ne r a t e an out put pul s e wi th pul s e
r e p e t i t i o n f r e que nc y (PRF)=4 kHz and a duty c y c l e
o f 60%. Gi ven Vcc=15V.
4 // ( b) Anal ys e t he c i r c u i t de s i gne d i n par t ( a ) t o
de t e r mi ne t he a c t ua l PRF and duty c y c l e . Gi ven
I t h r e s =25 uA( max . ) f o r t i me r 555.
5 clear;
6 clc;
7 // a ) So l ut i o n :
8 d=60*10^ -2; // duty c y c l e gi ve n
9 PRF =4*10^3;
10 Vcc =15; // power s uppl y
11 T=1/PRF;// where T=Tc+Td
12 Tc=d*T;
13 Td=T-Tc;
14 Ithres =25*10^ -6;
15 Icmin =1*10^ -3; // s i n c e Icmi n>>I t hr e s , s o assumi ng
I cmi n=1 mA
16 R=Vcc /(3* Icmin);// where R=Ra+Rb
17 C=Tc /(0.7*R);
18 Rb=Td /(0.7*C);
19 Ra=R-Rb;
20 disp( k i l o Ohm ,Ra/10^3, Des i gned r e s i s t o r ( Ra) f o r
555 t i me r i n a s t a b l e mode i s : )
21 disp( k i l o Ohm ,Rb/10^3, Des i gned r e s i s t o r (Rb) f o r
555 t i me r i n a s t a b l e mode i s : )
22 disp( uF ,C*10^6, Des i gned Capac i t or f o r 555 t i me r
i n a s t a b l e mode i s : )
23 //b) So l ut i o n :
24 // f rom e quat i on o f c har gi ng
25 Tc1 =0.7*R*C;
26 Td1 =0.7* Rb*C;
27 T1=Tc1+Td1;
28 PRFa =1/T1;
29 da=Tc1/(Tc1+Td1)*100;
30 disp( kHz ,PRFa /10^3, a c t ua l Pul s e Re pe t i t i o n
Frequency i s : )
49
31 disp( % ,da , a c t ua l duty c y c l e i s : )
Scilab code Exa 12.20 Waveform Generator
1 // Chapter 12 S i g n a l Ge ne r at or s
2 // Capti on : Waveform Gener at or
3 // Exampl e12 . 2 0 : Des i gn a wavef orm g e ne r a t o r us i ng
t ype 8038 IC . The f r e que nc y o f Os c i l l a t i o n i s 5
kHz and t he duty c y c l e s i s 50%. From data s heet ,
t y p i c a l va l ue s f o r t he de vi c e at Vcc=5 V ar e as
f o l l ws :
4 //Voh=3. 6 V; Vol =0. 2 V; I l l =1.6 mA and I l h =40 uA.
5 // So l ut i o n :
6 clear;
7 clc;
8 Fo =5*10^3;
9 // f o r 50% duty c y c l e Tp=Tn
10 Vcc =5; // i n v o l t
11 Vol =0.2; // i n Vol t
12 Voh =3.6; // i n v o l t
13 Ill = -1.6*10^ -3;
14 Ilh =40*10^ -6;
15 Tp =1/(2* Fo);
16 C=0.01; // assumi ng t he Capac i t or val ue i n uF f o r
optimum de s i gn
17 Ra=Tp /(1.66*C);
18 Rb=2*Ra*Tp /(1.66* Ra*C+Tp);
19 R2min=(Vcc -Vol)/(2*10^ -3 - abs(Ill));// s i n c e I l l i s
ne g a t i ve
20 R2max=(Vcc -Voh)/(1*10^ -6+ Ilh);// s i n c e I l h i s
p o s i t i v e
21 disp( k i l o Ohm ,Ra*10^3, de s i gne d val ue o f Ra i s : )
22 disp( k i l o Ohm ,Rb*10^3, de s i gne d val ue o f Rb i s : )
23 disp( k i l o Ohm ,R2min /10^3, minimum pul l up r e s i s t o r
i s : )
50
24 disp( k i l o Ohm ,R2max /10^3, maximum pul l up r e s i s t o r
i s : )
51
Chapter 13
Voltage Regulators
Scilab code Exa 13.3 Maximum Eciency and Power
1 // Chapter 13 Vol t age Re gul at or s
2 // Capti on : Maximum Ef f i c i e n c y and Power
3 // Exampl e13 . 3 : Ca l c ul a t e t he 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 he 5 V MC7805
s e r i e s r e g u l a t o r . The i nput r i p p l e i s 10 V and t he
l oad c ur r e nt i s 1 A. The out put i s between 4. 75
t o 5. 25 f o r &v<=Vin<=20 V.
4 // So l ut i o n :
5 clear;
6 clc;
7 Vo=5;
8 Vin =17; // s i n c e f o r MC7805 a maximum o f 7 . 5 V i s
added t o t he r i p p l e . Si nc e 10 V r o ppl e i s gi ve n s o
Vin=10+7=17 V
9 Il=1; // l oad c ur r e nt i n ampere
10 n=Vo/Vin *100; // s e r i e s pas s r e g ua t o r o v e r a l l
e f f i c i e n c y
11 Pd=(Vin -Vo)*Il;
12 disp( % ,n, maximum e f f i c i e n c y f o r 5V MC7805 s e r i e s
r e g u l a t o r i s : )
13 disp( W ,Pd , power d i s s i p a t i o n f o r t he 5V MC7805
52
s e r i e s r e g u l a t o r i s : )
Scilab code Exa 13.14 Inductor and Capacitor
1 // Chapter 13 Vol t age Re gul at or s
2 // Capti on : I nduc t or and Capac i t or
3 // Exampl e13 . 1 4 : A s wi t c hi ng v o l t a g e r e g u l a t o r
o pe r a t e s at a s wi t c hi ng f r e que nc y o f 30kHz and i s
t o s uppl y a l oad c ur r e nt I o o f 1 A at a dc
out put v o l t a g e Vo o f +10V. The dc i nput v o l t a g e i s
Vin=20V and t he out put ( peakpeak ) r i p p l e f a c t o r
i s not t o exceed 0. 05%. Assume Rl =10 Ohm.
4 // a ) Fi nd t he val ue o f t he f i l t e r i nduc t o r L such
t hat t he maximum change or r i p p l e i n t he c ur r e nt
t hr ough t he i nduc t o r wi l l not exceed 40% o f t he
ave r age or dc c ur r e nt .
5 //b) Fi nd t he val ue o f t he out pur c a p a c i t o r CL f o r L1
=100 uH and f o r L2=500 uH.
6 clear;
7 clc;
8 // a ) So l ut i o n :
9 Rl=10;
10 D=0.5;
11 T=2.5;
12 fs =30*10^3;
13 L=Rl*T*(1-D)/fs;
14 disp( uH ,L/10^-6, f i l t e r i nduc t o r L t o e ns ur e
maximum r i p p l e i n t he c ur r e nt t hr ough t he
i nduc t o r wi l l not exceed 40% o f t he dc c ur r e nt i s
: )
15 //b) So l ut i o n :
16 L1 =100*10^ -6;
17 RF =0.05*10^2; // out put ( peakpeak ) r i p p l e f a c t o r
maximum l i mi t
18 // f o r r i p p l e f a c t o r c o ndi 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 , out put c a p a c i t o r i s : )
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 , out put c a p a c i t o r i s : )
54
Chapter 15
Phase Locked Loops
Scilab code Exa 15.2 Output Signal Frequency
1 // Chapter 15 Phas e Locked Loops
2 // Capti on : Output Si g na l Frequency
3 // Example 1 5 . 2 : A PLL has a Ko o f 2%pi ( 1 kHz ) /V, a
Kv o f 500 per s ec , and a f r e e r unni ng f r e que nc y
o f 500Hz .
4 // a ) For a c ons t ant i nput s i g n a l f r e que nc y o f 250 Hz
and 1kHz . f i nd vf .
5 clear;
6 clc;
7 // a ) So l ut i o n :
8 Ko=2*%pi *10^3; // VCO gai n i n kHz/V
9 Kv=500; // l oop bandwi th i n per s econd
10 Wc=500; // Fr ee r unni ng f r e que nc y o f VCO i n PLL or 2
%pi 500
11 //Wi=angul ar i nput s i g n a l f r e que nc y i n Hz
12 //Wo=angul ar out put s i g n a l f r e que nc y i n Hz
13 // s i n c e vf =(Wo( t )Wc) /Ko
14 // under l oc ke d c o ndi t i o n Wo=Wi , s o vf =(WoWc) /Ko
15 for i=1:2,
16 if i==1 then
17 Wo=250;
55
18 // or
19 Fo=2*%pi*Wo;// i n Hz
20 vf=(Fo -2* %pi *500)/Ko;
21 disp( For i nput s i g n a l f r e que nc y W=250 Hz
)
22 disp( V ,vf , out put s i g n a l v o l t a g e o f PLL f o r Wo
=250 Hz i s : )
23 else
24 Wo =1000;
25 Fo=2*%pi*Wo;// i n Hz
26 vf=(Fo -2* %pi *500)/Ko;
27 disp( For i nput s i g n a l f r e que nc y Wo=1
kHz )
28 disp( V ,vf , out put s i g n a l v o l t a g e o f PLL f o r
Wo=1kHz i s : )
29 end
30 end
Scilab code Exa 15.3 VCO and Phase detector
1 // Chapter 15 Phas e Locked Loops
2 // Capti on : VCO and Phase de t e c t o r
3 // Exampl e15 . 3 : A PLL has f r e e r unni ng f r e que nc y Wc
=500 kHz , bandwi th o f l ow pas s f i l t e r =10kHz .
Suppose an i nput s i g n a l o f f r e que nc y 600kHz i s
a ppl i e d . Wi l l t he l oop a c q ui r e l o c k ? What i s VCO
out put f r e que nc y ? The phase de t e c t o r pr oduc e s sum
and d i f f e r e n c e f r e que nc y components .
4 // So l ut i o n :
5 clear;
6 clc;
7 BW=10; // bandwi dth o f l ow pas s f i l t e r i n kHz
8 Fi=600; // i nput f r e que nc y i n kHz
9 Fc=500; // f r e e r unni ng f r e que nc y i n kHz
10 // Output f rom phase de 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 que nc y component o f phase
de t e c t o r i n kHz )
14 disp( kHz ,Difference , d i f f e r e n c e f r e que nc y
component o f phase de t e c t o r i n kHz )
15 if Sum >BW then
16 if Difference >BW then
17 disp( Both Sum and Di f f e r e n c e f r e que nc y
components ar e o ut s i de t he pas s bandof low
pas s f i l t e r )
18 disp( Loop wi l l not a c q ui r e l o c k )
19 disp( VCO f r e que nc y wi l l be i t s f r e e r unni ng
f r e que nc y )
20 end
21 end
Scilab code Exa 15.4 Second Order Butterworth Filter
1 // Chapter 15 Phas e Locked Loops
2 // Capti on : Second Order But t er wor t h Fi l t e r
3 // Example 1 5 . 4 : A Sy nt he s i z e r us i ng PLL has Kv=5%pi
rad / s . What val ue o f lowpas s f i l t e r bandwi dth
s houl d be used s o t hat t he c l os e d l oop system
appr oxi mat es a secondor de r But t er wor t h f i l t e r ?
4 // So l ut i o n :
5 clear;
6 clc;
7 // For But t er wor t h f i l t e r t he damping r a t i o ( Dr ) i s
8 Dr =0.707;
9 Kv=5*%pi;
10 Wl=Kv*(2*Dr)^2; // s i n c e (Wl/Kv) 2=2Dr
11 disp( rad / s e c ,Wl , l ow pas s f i l t e r bandwi dth )
12 // BW f o r c l o s e d l oop system i s
13 BW=sqrt(Kv*Wl);// s i n c e BW=Wn, where Wn=na t ur a l
57
f r e que nc y ,BW=bandwi dth o f c l o s e d l oop system
14 Wn=real(BW);
15 t=2.2/ Wn;
16 disp( rad / s e c ,BW , bandwi dth o f c l o s e d l oop system
i s : )
17 disp( s e c ,t, c o r r e s po ndi ng system r i s e ti me i s : )
Scilab code Exa 15.5 Lock Range
1 // Chapter 15 Phas e Locked Loops
2 // Capti on : Lock Range
3 // Exampl e15 . 5 : A PLL has a VCO wi th Ko=25kHz/V and
Fc=50kHz . The a mp l i f i e r gai n i s A=2 and t he phase
de t e c t o r has a maximum out put v o l t a g e swi ng o f
+0. 7V and 0.7V. Fi nd t he l o c k r ange o f t he PLL.
Assume f i l t e r gai n e qual t o uni t y .
4 // So l ut i o n :
5 clear;
6 clc;
7 k1 =2*0.7/ %pi;// p o s i t i v e maximum gai n val ue o f phase
de t e c t o r
8 k2=-k1;// ne g a t i ve maximum gai n val ue o f phase
de t e c t o r
9 A=2; // a mp l i f i e r gai n
10 Ko=25; // VCO gai n i n kHz
11 // p o s i t i v e maximum out put v o l t a g e swi ng o f phase
de t e c t o r i s
12 V1=k1*%pi /2;
13 // Ne gat i ve maximum out put v o l t a g e swi ng o f phase
de t e c t o r i s
14 V2=k2*%pi /2;
15 Vf1=k1*A*%pi/2; // Po 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 dr i v e VCO
16 Vf2=k2*A*%pi/2; // ne g a t i ve 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 dr i v e VCO
58
17 //maximum VCO f r e que nc y swi ng t hat can be obt ai ne d
i s
18 Fh=Ko*Vf1;// p o s i t i v e maximum VCO f r e que nc y swi ng
19 Fl=Ko*Vf2;// Ne gat i ve maximum VCO f r e que nc y swi ng
20 // s o l o c k r ange o f PLL i s
21 f=Fh -Fl;
22 disp( kHz ,f, The l o c k r ange o f t he PLL i s : )
59
Chapter 16
Bipolar and MOS Digital Gate
Circuits
Scilab code Exa 16.2 Noise Margin
1 // Chapter 16 Bi po l a r and MOS Di g i t a l Gate Ci r c u i t s
2 // Capti on : Noi s e Margi n
3 // Example 1 6 . 2 : An RTL gat e has t he wor s t c as e
v o l t a g e s l i s t e d bel ow :
4 // Temp( de gr e e C) Voh(V) Vih (V)
Vi l (V) Vol (V)
5 // 55 1. 014 1. 01
0. 718 0. 710
6 // 25 0. 844 0. 815
0. 565 0. 300
7 // 125 0. 673 0. 67
0. 325 0. 320
8 // Ca l c ul t e t he wor s t c as e NMl and NMh no i s e mar gi ns .
9 // So l ut i o n :
10 clear;
11 clc;
12 T=[ -55;25;125]; // t e mpe r at ur e s i n de gr e e c e l s i u s
gi ve n i n t a bl e
13 for j=1:3,
60
14 if j==1 then
15 disp( Noi s e mar gi ns f o r T=55 de gr e e c e l s i u s ar e
: )
16 NMl =0.718 -0.710; // s i n c e NMl=Vi l Vol
17 NMh =1.014 -1.01; // s i n c e NMh=VihVoh
18 disp( Vol t ,NMl , l owe r l i mi t o f no i s e margi n at
55 de gr e e c e l s i u s i s : )
19 disp( v o l t ,NMh , upper l i mi t o f no i s e l i mi t at
55 de gr e e c e l s i u s i s : )
20 elseif j==2 then
21 disp( Noi s e margi n f o r T=25 de gr e e c e l s i u s ar e :
)
22 NMl =0.565 -0.300;
23 NMh =0.844 -0.815;
24 disp( Vol t ,NMl , l owe r l i mi t o f no i s e margi n at
25 de gr e e c e l s i u s i s : )
25 disp( Vol t ,NMh , upper l i mi t o f no i s e margi n at
25 de gr e e c e l s i u s i s : )
26 elseif j==3 then
27 disp( Noi s e margi n f o r T=125 de gr e e c e l s i u s ar e :
)
28 NMl =0.325 -0.320;
29 NMh =0.673 -0.670;
30 disp( Vol t ,NMl , l owe r l i mi t o f no i s e margi n at
125 de gr e e c e l s i u s i s : )
31 disp( Vol t ,NMh , uppwr l i mi t o f no i s e margi n at
125 de gr e e c e l s i u s i s : )
32 end
33 end
Scilab code Exa 16.3 Fanouts
1 // Chapter 16 Bi po l a r and MOS Di g i t a l Gate Ci r c u i t s
2 // Capti on : Fanouts
3 // Example 1 6 . 3 : A TTL gat e i s guar t nt e e d t o s i nk 10
61
mA wi t hout e xc e e di ng ann out put v o l t a g e Vol =0. 4V
and t o s o ur c e 5mA wi t hout dr oppi ng bel ow Voh=2. 4V
. I f Ti h=100uA at 2 . 4V and I i l =1mA at 0 . 4V,
c a l c u l a t e t he lows t a t e and hi ghs t a t e f anout s .
4 // So l ut i o n :
5 clear;
6 clc;
7 // f o r TTL gat e
8 // f anout at l ow out put 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 o f out put t r a n s i t o r / l oad c ur r e nt o f t he
dr i ve n gat e .
9 // f anout f o r hi gh out put i s =s o ur c e c ur r e nt i n
dr i v i ng g a t t e / i nput c ur r e nt o f l oad gat e
10 // f rom que s t i o n gi ve n
11 Ic3 =10*10^ -3; // c o l l e c t o r s a t ur a t i o o n c ur r e nt at
out put t r a n s i s t o r
12 Ie=1*10^ -3; // l oad c ur r e nt o f dr i ve n gat e
13 Ie4 =5*10^ -3; // s o ur c e c ur r e nt i n dr i v i ng gat e
14 Ic1 =100*10^ -6; // i nput c ur r e nt o f l oad gat e
15 Fl=Ic3/Ie;
16 disp(Fl, f an out at l ow out put s t a t e i s : )
17 Fh=Ie4/Ic1;
18 disp(Fh, f an out at hi gh out put s t a t e i s : )
Scilab code Exa 16.12 NMOS operating region
1 // Chapter 16 Bi po l a r and MOS Di g i t a l Gate Ci r c u i t s
2 // Capti on : NMOS o pe r a t i ng r e g i o n
3 // Example 1 6 . 1 2 : A NMOS t r a n s i s t o r wi th K=20uA/V2
and Vth=1. 5V i s ope r at e d at Vgs=5V and I ds =100uA.
Determi ne t he r e g i o n o f t he o pe 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 nd Vds .
4 // So l ut i o n :
5 clear;
6 clc;
62
7 K=20*10^ -6;
8 Vgs =5;
9 Vth =1.5;
10 Ids =100*10^ -6;
11 Id=(K/2)*(Vgs -Vth)^2;
12 disp( uA ,Id/10^-6, dr ai n c ur r e nt i n s a t u r a t i o n
r e g i o n )
13 if Id>Ids then
14 disp( r e g i o n o f o pe 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 )
15 end
16 // s i n c e NMOS l i e s i n LINEAR REGION s o I ds =(K/2) ( 2(
VgsVth ) VdsVds 2) ; t hus s u b s t i t u t i n g t he va l ue s
we have
17 // 10010 6==(2010 6/2) ( 2( 5 1. 5) VdsVds 2) ;
18 // s o Vds27Vds+10=0; e q ui v a l e nt t o q ua dr a t t i c
e quat i on o f f orm aX2+bX+c=0
19 Vds=poly(0, Vds );
20 p=Vds^2-7*Vds +10; // e quat i on whose r o o t s has t o be
f ound
21 z=roots(p);
22 z=real(z)
23 if (z(1) <(Vgs -Vth)) then
24 disp( Vol t ,z(1), dr ai n t o s o ur c e v o l t a g e ( Vds )
i n t h i s Li ne ar Regi on i s : )
25 elseif (z(2) <(Vgs -Vth)) then
26 disp( Vol t ,z(2), dr ai n t o s o ur c e v o l t a g e ( Vds )
i n t h i s Li ne ar Regi on i s : )
27 end
Scilab code Exa 16.13 Power Dissipation
1 // Chapter 16 Bi po l a r and MOS Di g i t a l Gate Ci r c u i t s
2 // Capti on : Power Di s s i p a t i o n
3 // Exampl e16 . 1 3 : Ca l c ul a t e t he maximum power
63
d i s s i p a t e d by s a t ur a t e d l oad NMOS i n v e r t e r f o r
f o l l o wi n g gi ve n va l ue s : Vdd=5V; Vth=1. 5V; de vi c e
t r ans c onduc t anc e par amet er f o r l oad de vi c e Kl
=23. 3410 6 A/V 2 . Assume Vo=0V i n l ow s t a t e .
4 // So l ut i o n :
5 clear;
6 clc;
7 Vdd =5; // dr ai n v o l t a g e o f NMOS i n v e r t e r i n Vol t
8 Vth =1.5; // t hr e s ho l d v o l t a g e o f NMOS i n v e r t e r i n
Vol t
9 Kl =23.34*10^ -6; // t r ans c onduc t anc e Parameter f o r
l oad de vi c e
10 // s i n c e maximum power can be obt ai ne d i f maximum
de vi c e c ur r e nt f l o ws whi sh i s when Vo=l ow 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 pe r a t i o n we have
I d=Kl ( VgsVth ) 2/2;
11 // f o r s a t ur a t e d l oad i n v e r t e r Vgs=Vds and
12 //Vds=Vdd i n l ow out put c ondi t i on , s o I d=Kl ( VddVth )
2/2
13 Id =23.34*10^ -6*(Vdd -Vth)^2/2;
14 Pmax=Id*Vdd;
15 disp( mW ,Pmax/10^-3, maximum power d i s s i p a t e d by
s a t ur a t e d l oad NMOS i n v e r t e r i s : )
Scilab code Exa 16.14 AC Power
1 // Chapter 16 Bi po l a r and MOS Di g i t a l Gate Ci r c u i t s
2 // Capti on : AC Power
3 // Exampl e16 . 1 4 : Ca l c ul a t e t he ac power d i s s i p a t e d by
a CMOS i n v e r t e r whi ch d r i v e s a 20pF l oad . Gi ven f
=1MHz and Vdd=10V.
4 // So l ut i o n :
5 clear;
6 clc;
7 Ct =20*10^ -12; // l oad c a p a c i t o r i n Farad
64
8 Vdd =10; // dr ai n v o l t a g e s uppl y i n Vol t
9 f=1*10^6; // f r e que nc y at whi ch out put v o l t a g e changes
10 // s i n c e P=CtVdd2 f
11 P=20*10^ -12*(10) ^2*10^6;
12 disp( W ,P, ac power d i s s i p a t e d by a CMOS i n v e r t e r
i s : )
65
Chapter 17
Light Emitting Diodes and
Liquid Crystal Displays
Scilab code Exa 17.2 Viewing distance
1 // Chapter 17 Li g ht Emi t t i ng Di odes and Li qui d
Cr ys t a l Di s pl ays
2 // Capti on : Vi ewi ng di s t a nc e
3 // Exampl e17 . 2 : Fi nd out t he vi ewi nng di s t a nc e d f o r
a s even segmant LED di s pl a y f o r a c ha r a c t e r
he i g ht o f 1cm and a he i g ht angl e o f 3 met er s .
4 // So l ut i o n :
5 clear;
6 clc;
7 //d : vi e wi ng di s t a nc e
8 h=1*10^ -2; // he i g ht o f c ha r a c t e r i n cm
9 O=3; // he i g ht angl e i n met er s
10 // e qui v a q l e nt t o he i g ht angl e o f 3 met er s
11 d=h/tan (0.167* %pi /180);// where 3 met er s he i g ht angl e
i s e q ui v a l e nt t o 0. 167 de g r e e s .
12 disp( met er s ,d, vi e wi ng di s t a nc e i s : )
66

Вам также может понравиться