Scilab Textbook Companion for Microelectronic Circuits by A. S. Sedra And K. C. Smith1 Created by Shruthi S.H B.Tech (pursuing) Electronics Engineering NIT, Surathkal College Teacher Mrs Rekha S, NIT Surathkal Cross-Checked by Giridharan, IITB May 20, 2016 1 Funded by a grant from the National Mission on Education through ICT, http://spoken-tutorial.org/NMEICT-Intro. This Textbook Companion and Scilab codes written in it can be downloaded from the ”Textbook Companion Project” section at the website http://scilab.in Book Description Title: Microelectronic Circuits Author: A. S. Sedra And K. C. Smith Publisher: Oxford University Press Edition: 5 Year: 2004 ISBN: 0-19-514252-7 1 Scilab numbering policy used in this document and the relation to the above book. Exa Example (Solved example) Eqn Equation (Particular equation of the above book) AP Appendix to Example(Scilab Code that is an Appednix to a particular Example of the above book) For example, Exa 3.51 means solved example 3.51 of this book. Sec 2.3 means a scilab code whose theory is explained in Section 2.3 of the book. 2 Contents List of Scilab Codes 4 1 Introduction to Electronics 5 2 Operational Amplifiers 10 3 Diodes 12 4 MOS Field Effect Transistors 19 5 Bipolar Junction Transistor 28 6 single stage integrated circuit amplifiers 42 7 Differential and multistage amplifier 60 8 Feedback 69 9 Operational amplifier and data converter circuits 74 10 Digital CMOS logic circuits 81 11 Memory and advanced digital circuits 86 12 Filters and tuned amplifiers 89 14 Output Stages and amplifier 90 3 List of Scilab Codes Exa Exa Exa Exa Exa Exa Exa Exa Exa Exa Exa Exa Exa Exa Exa Exa Exa Exa Exa Exa Exa Exa Exa Exa Exa Exa Exa Exa 1.1 1.2 1.3 1.4 1.5 1.6 2.1 2.3 3.1 3.2 3.3 3.4 3.5 3.6 3.7 3.8 3.9 4.1 4.2 4.3 4.4 4.5 4.6 4.7 4.9 4.10 4.11 4.12 Amplifier gain power and eficiency . . . . . . . . . . Gain of transistor amplifier . . . . . . . . . . . . . . Overall voltage gain of three stage amplifier . . . . . Bipolar junction transistor . . . . . . . . . . . . . . DC gain 3dB frequency and frequency at which gain Evaluation of tPHL . . . . . . . . . . . . . . . . . . Closed loop and open loop gain . . . . . . . . . . . . Design instrumentation amplifier . . . . . . . . . . . Peak value of diode current and maximum reverse vo Values of Iand V for the circuit given . . . . . . . . . Evaluating junction scaling constant . . . . . . . . . To determine ID and VD . . . . . . . . . . . . . . . Repeating example 4 using piecewise linear model . Power supply ripple . . . . . . . . . . . . . . . . . . Percentage change in regulated voltage . . . . . . . . line regulation load regulation . . . . . . . . . . . . . Value of capacitance C that will result in peak pe . . To determine operating point parameters . . . . . . Design of given circuit . . . . . . . . . . . . . . . . . Design of given circuit . . . . . . . . . . . . . . . . . Design of given circuit . . . . . . . . . . . . . . . . . To determine all node voltages and currents throug . Design of given circuit . . . . . . . . . . . . . . . . . To determine drain currents and output voltage . . . Design of given circuit . . . . . . . . . . . . . . . . . Small signal analysis . . . . . . . . . . . . . . . . . . To determine all parameters of transistor amplifie . . Midband gain and upper 3dB frequency . . . . . . . 4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 6 6 7 8 9 10 11 12 12 13 14 14 15 15 16 17 19 20 20 21 22 22 23 24 24 25 26 Exa Exa Exa Exa Exa Exa Exa Exa Exa Exa Exa Exa Exa Exa Exa Exa Exa Exa Exa Exa Exa Exa Exa Exa Exa Exa Exa Exa Exa Exa Exa Exa Exa Exa Exa Exa Exa Exa 4.13 5.1 5.2 5.3 5.4 5.5 5.7 5.8 5.9 5.10 5.11 5.13 5.14 5.17 5.18 5.19 6.1 6.2 6.3 6.4 6.5 6.6 6.7 6.8 6.9 6.10 6.11 6.12 6.13 6.14 7.1 7.2 7.3 7.5 8.1 8.2 8.3 8.4 Coupling capacitor values . . . . . . . . . . . . . . . . Design of given circuit with current 2mA . . . . . . . Consider a common Emitter circuit . . . . . . . . . . . Determine RB . . . . . . . . . . . . . . . . . . . . . . Analyse the circuit to find node voltages and bran . . Analyse the circuit to find node voltages and bran . . Analyse the circuit to find node voltages and bran . . Analyse the circuit to find node voltages and bran . . Analyse the circuit to find node voltages and bran . . Analyse the circuit to find node voltages and bran . . Analyse the circuit to find node voltages and bran . . Design of bias network of the amplifier . . . . . . . . . Analysis of transistor amplifier . . . . . . . . . . . . . Amplifier parameters . . . . . . . . . . . . . . . . . . . Midband gain and 3dB frequency . . . . . . . . . . . . To select values of capacitance required . . . . . . . . To find the operating point of NMOS transistor . . . . Comparison between NMOS transistor and npn transis Comparison between NMOS transistor and npn transis Design of the circuit with output current 100uA . . . . Determine 3dB frequency . . . . . . . . . . . . . . . . To determine midband gain and upper 3dB frequency Application of miller theorem . . . . . . . . . . . . . . Analysis of CMOS CS amplifier . . . . . . . . . . . . . Analysis of CMOS CS amplifier . . . . . . . . . . . . . To determine AM ft fZ f3dB . . . . . . . . . . . . . . Avo Rin Rout Gi Gis Gv fH . . . . . . . . . . . . . . . Comparison between Cascode amplifier and CS amplif Analysis of CC CE amplifier . . . . . . . . . . . . . . To determine required resistor values . . . . . . . . . . Analysis of differential amplifier . . . . . . . . . . . . . Analysis of Active loaded MOS differential amplifi . . To determine all parameters for different transist . . . Analysis of given circuit . . . . . . . . . . . . . . . . . Analysis of op amp connected in an inverting conf . . Feedback triple . . . . . . . . . . . . . . . . . . . . . . Small signal analysis . . . . . . . . . . . . . . . . . . . Small signal analysis . . . . . . . . . . . . . . . . . . . 5 27 28 29 30 30 31 32 33 33 34 35 36 37 38 39 40 42 43 44 47 48 48 49 49 51 52 53 54 57 58 60 61 63 67 69 70 71 72 Exa Exa Exa Exa Exa Exa Exa Exa Exa Exa Exa Exa Exa Exa Exa Exa 9.1 9.2 9.3 10.1 10.2 10.3 10.4 11.1 11.2 11.3 12.4 14.1 14.2 14.3 14.4 14.5 Design of two stage CMOS op amp . . . . . . . . . . . To determine Av ft fP SR and PD of folded casc . . . To determine input offset voltage . . . . . . . . . . . . To determine tPHL tPLH and tP . . . . . . . . . . . . WbyL ratios for the logic circuit . . . . . . . . . . . . To determine the parameters of pseudo NMOS inverte To determine parameters for NMOS transistor . . . . Min WbyL ratio to ensure flip flop will switch . . . . . Design of two stage CMOS op amp . . . . . . . . . . . Time required . . . . . . . . . . . . . . . . . . . . . . To design tuned amplifier . . . . . . . . . . . . . . . . To design a Class B Output Amplifier . . . . . . . . . To determine quiescent current and power . . . . . . . Redesign the output stage of Example 2 . . . . . . . . To determine thermal resistance junction temperat . . To determine the maximum power dissipated . . . . . 6 74 76 80 81 82 82 84 86 87 88 89 90 91 92 92 93 Chapter 1 Introduction to Electronics Scilab code Exa 1.1 Amplifier gain power and eficiency 1 // Example1 . 1 : A m p l i f i e r g a i n , power and e f i c i e n c y 2 // A m p l i f i e r o p e r a t e s a t +10−V/−10−V power s u p p l y . 3 A_v =9/1; // s i n u s o i d a l v o l t a g e i n p u t o f 1V peak and 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 s i n u s o i d a l o u t p u t v o l t a g e o f 9V peak I_o =9/1000; // 1 k i l o ohms l o a d disp ( A_v , ” V o l t a g e g a i n (V/V) =” ) disp (20* log10 ( A_v ) ,” V o l t a g e g a i n ( dB ) =” ) I_i =0.0001 // s i n u s o i d a l c u r r e n t i n p u t o f 0 . 1mA peak A_i = I_o / I_i ; disp ( A_i , ” C u r r e n t g a i n (A/A) =” ) disp (20* log10 ( A_i ) ,” C u r r e n t g a i n ( dB ) =” ) V_orms = 9/ sqrt (2) ; I_orms = 9/ sqrt (2) ; P_L = V_orms * I_orms ; // o u t p u t power i n mW V_irms =1/ sqrt (2) ; I_irms =0.1/ sqrt (2) ; P_I = V_irms * I_irms ; // i n p u t power i n mW A_p = P_L / P_I ; disp ( A_p , ” Power g a i n (W/W) =” ) disp (10* log10 ( A_p ) ,” Power g a i n ( dB ) =” ) P_dc =10*9.5+10*9.5; // a m p l i f i e r draws a c u r r e n t o f 7 21 22 23 24 25 9 . 5mA from e a c h o f i t s two power s u p p l i e s disp ( P_dc , ” Power drawn from t h e dc s u p p l i e s (mW) =” ) P_dissipated = P_dc + P_I - P_L ; disp ( P_dissipated , ” 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 (mW) ” ) n = P_L / P_dc *100; disp (n , ” A m p l i f i e r e f f i c i e n c y i n p e r c e n t a g e ” ) Scilab code Exa 1.2 Gain of transistor amplifier 1 2 3 4 5 6 7 8 9 10 11 12 13 // Example 1 . 2 : Gain o f t r a n s i s t o r a m p l i f i e r // A m p l i f i e r h a s t r a n s f e r c h a r a c t e r i s t i c s v O =10 −(10ˆ −11) ∗ ( exp ˆ40 ∗ v 1 ) a p p l i e s f o r v 1 i s g r e a t e r t h a n o r e q u a l 0V and v o i s g r e a t e r t h a n o r e q u a l t o 0 . 3V L_l = 0.3; // l i m i t L − disp ( L_l , ” The l i m i t L − (V) =” ) v_I =1/40* log ((10 -0.3) /10^ -11) ; // from t h e t r a n s f e r c h a r a c t e r i s t i c s and v o =0.3V disp ( v_I , ” v I i n v o l t s =” ) L_u =10 -10^ -11; // o b t a i n e d by v I =0 i n t r a n s f e r characteristics disp ( L_u , ” t h e l i m i t L + (V) =” ) V_I =1/40* log ((10 -5) /10^ -11) ; // V O=5V disp ( V_I , ” The v a l u e o f t h e dc b i a s v o l t a g e t h a t r e s u l t s i n V O=5V (V)=” ) A_v = -10^ -11* exp (40* V_I ) *40; // A v=dv O / d v I disp ( A_v , ” Gain a t t h e o p e r a t i n g p o i n t (V/V) =” ) disp ( ”NOTE t h e g a i n i s n e g a t i v e t h a t i m p l i e s t h e a m p l i f i e r i s an i n v e r t i n g a m p l i f i e r ” ) Scilab code Exa 1.3 Overall voltage gain of three stage amplifier 8 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 // Example 1 . 3 : O v e r a l l v o l t a g e g a i n o f c t h r e e − stage amplifier gainloss_in =10^6/(1*10^6+100*10^3) ; // f r a c t i o n o f input s i g n a l i s obtained using voltage divider r u l e , g a i n l o s s i n= v i 1 / v s A_v1 =10*100000/(100000+1000) ; // A v1 = v i 2 / v i 1 i s the voltage gain at f i r s t stage A_v2 =100*10000/(10000+1000) ; // A v2 = v i 3 / v i 2 i s the voltage gain at second stage A_v3 =100/(100+10) ; // A v3 = v L / v i 3 i s t h e v o l t a g e gain at the output stage A_v = A_v1 * A_v2 * A_v3 ; // A v i s t h e t o t a l v o l t a g e g a i n disp ( A_v , ” The o v e r a l l v o l t a g e g a i n (V/V) =” ) disp (20* log10 ( A_v ) ,” The o v e r a l l v o l t a g e g a i n ( dB ) =” ) gain_src_ld = A_v * gainloss_in ; disp ( gain_src_ld , ” The v o l t a g e g a i n from s o u r c e t o g a i n (V/V) =” ) disp (20* log10 ( gain_src_ld ) ,” The v o l t a g e g a i n from s o u r c e t o l o a d ( dB ) =” ) A_i =10^4* A_v ; // A i= i o / i i =( v L / 1 0 0 ) / ( v i 1 / 1 0 ˆ 6 ) disp ( A_i , ” The c u r r e n t g a i n (A/A)=” ) disp (20* log10 ( A_i ) ,” The c u r r e n t g a i n ( dB ) =” ) A_p =818*818*10^4; // A p=P L / P I=v L ∗ i o / v i 1 ∗ i i disp ( A_p , ” The power g a i n (W/W) =” ) disp (10* log10 ( A_p ) ,” The power g a i n ( dB ) =” ) Scilab code Exa 1.4 Bipolar junction transistor 1 2 3 4 // Example1 . 4 : B i p o l a r j u n c t i o n t r a n s i s t o r // 1 , 4 a // u s i n g v o l t a g e d i v i d e r r u l e t h e f r a c t i o n o f i n p u t s i g n a l v b e=v s ∗ r p i / ( r p i +R s ) 5 // o u t p u t v o l t a g e v o=−g m v b e ( R L | | r o ) 9 r_pi =2.5*10^3; // ( ohm ) R_s =5*10^3; // ( ohm ) R_L =5*10^3 // ( ohm ) g_m =40*10^ -3; // ( mho ) r_o =100*10^3; // ( ohm ) gain = -( r_pi * g_m *( R_L * r_o /( R_L + r_o ) ) ) /( r_pi + R_s ) ; // g a i n=v o / v s 12 disp ( gain , ” The v o l t a g e g a i n (V/V) =” ) 13 gain_negl_r_o = - r_pi * g_m * R_L /( r_pi + R_s ) ; 14 disp ( gain_negl_r_o , ” Gain n e g l e c t i n g t h e e f f e c t o f r o (V/V) =” ) 6 7 8 9 10 11 15 16 // 1 . 4 b 17 // B i b=g m ∗ v b e 18 // B i s s h o r t c i r c u i t g a i n 19 B = g_m * r_pi ; 20 disp (B , ” The s h o r t c i r c u i t g a i n (A/A) =” ) Scilab code Exa 1.5 DC gain 3dB frequency and frequency at which gain 1 2 3 4 5 6 7 8 9 10 11 12 13 14 // Example 1 . 5 : DC g a i n , 3dB f r e q u e n c y and f r e q u e n c y a t which g a i n =0 o f v o l t a g e a m p l i f i e r // 1 . 5 b R_s =20*10^3; // ( ohm ) R_i =100*10^3; // ( ohm ) C_i =60*10^ -12; // ( ohm ) u = 144; // (V/V) R_o = 200; // ( ohm ) R_L = 1000; // ( ohm ) K = u /((1+ R_s / R_i ) *(1+ R_o / R_L ) ) ; disp (K , ” The dc g a i n (V/V)= ” ) disp (20* log10 ( K ) ,” The dc g a i n ( dB ) =” ) w_o =1/( C_i * R_s * R_i /( R_s + R_i ) ) ; disp ( w_o , ” The 3−dB f r e q u e n c y ( r a d / s ) =” ) 10 15 f_o = w_o /2/ %pi ; 16 disp ( f_o , ” F r e q u e n c y ( Hz ) =” ) 17 disp (100* w_o , ” u n i t y g a i n f r e q u e n c y ( r a d / s )=” ,100* f_o , ” U n i t y g a i n f r e q u e n c y ( Hz ) ” ) Scilab code Exa 1.6 Evaluation of tPHL 1 2 3 4 5 6 7 8 9 10 11 12 // Example 1 . 6 : Time f o r t h e o u t p u t t o r e a c h (V OH+ V OL ) /2 V_DD =5; // (V) R =1000; // ( ohm ) R_on =100; // ( ohm ) V_offset =0.1; // (V) C =10*10^ -12; // ( F ) V_OH =5; // (V) V_OL = V_offset +( V_DD - V_offset ) * R_on /( R + R_on ) ; T=R*C; v_o_t_PLH =( V_OH + V_OL ) /2; // t o f i n d t PLH t_PLH =0.69* T ; // t PLH i s low t o h i g h p r o p o g t i o n delay disp ( t_PLH , ” t i m e r e q u i r e d f o r he o u t p u t t o r e a c h ( V OH+V OL ) /2 ( s e c o n d s ) =” ) 11 Chapter 2 Operational Amplifiers Scilab code Exa 2.1 Closed loop and open loop gain 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 // Example 2 . 1 : C l o s e d l o o p and open l o o p g a i n // C o n s i d e r i n v e r t i n g c o n f i g u r a t i o n // 2 . 1 a R_1 =1000; // ( ohm ) R_2 =100*10^3; // ( ohm ) A =10^3; // (V/V) disp (A , ”A (V/V) ” ) G = - R_2 / R_1 /(1+(1+ R_2 / R_1 ) / A ) ; disp ( -G , ”G” ) e =( -G -( R_2 / R_1 ) ) /( R_2 / R_1 ) *100; disp (e , ” e (%) ” ) v_1 =0.1; // (V) v_1 = G * v_1 / A ; disp ( v_1 , ” v 1 (V) ” ) A =10^4; // (V/V) disp (A , ”A (V/V) ” ) G = - R_2 / R_1 /(1+(1+ R_2 / R_1 ) / A ) ; disp ( -G , ”G” ) e =( -G -( R_2 / R_1 ) ) /( R_2 / R_1 ) *100; disp (e , ” e (%) ” ) 12 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 v_1 =0.1; // (V) v_1 = G * v_1 / A ; disp ( v_1 , ” v 1 (V) ” ) A =10^5; // (V/V) disp (A , ”A (V/V) ” ) G = - R_2 / R_1 /(1+(1+ R_2 / R_1 ) / A ) ; disp ( -G , ”G” ) e =( -G -( R_2 / R_1 ) ) /( R_2 / R_1 ) *100; disp (e , ” e (%) ” ) v_1 =0.1; // (V) v_1 = G * v_1 / A ; disp ( v_1 , ” v 1 (V) ” ) // 2 . 1 b A =50000; // (V/V) disp (A , ”A (V/V) ” ) G = - R_2 / R_1 /(1+(1+ R_2 / R_1 ) / A ) ; disp ( -G , ”G” ) disp ( ” Thus a −50% c h a n g e i n t h e open l o o p g a i n r e s u l t s i n o n l y −0.1% i n t h e c l o s e d l o o p g a i n ” ) Scilab code Exa 2.3 Design instrumentation amplifier 1 // Example 2 . 3 : D e s i g n i n s t r u m e n t a t i o n 2 R_2 =1 -50000 -1/1000+50; 3 disp ( R_2 , ” R 2 ( ohm ) ” ) 4 R_1 =2* R_2 /999; 5 disp ( R_1 , ” R 1 ( ohm ) ” ) 13 amplifier Chapter 3 Diodes Scilab code Exa 3.1 Peak value of diode current and maximum reverse vo 1 2 3 4 5 6 // Example 3 . 1 : Peak v a l u e o f d i o d e c u r r e n t and maximum r e v e r s e v o l t a g e // v s i s s i n u s o i d a l i n p u t v o l t a g e w i t h peak 24V // b a t t e r y c h a r g e s t o 12V I_d =(24 -12) /100 max_v_rev =24+12; disp ( I_d , ” peak v a l u e o f d i o d e c u r r e n t (A) ” , max_v_rev , ”maximum r e v e r s e v o l t a g e a c r o s s t h e d i o d e (V) ” ) Scilab code Exa 3.2 Values of Iand V for the circuit given // Example 3 . 2 : V a l u e s o f I a n d V f o r t h e c i r c u i t given 2 disp ( ” C o n s i d e r f i g 3 . 6 ( a ) . Assume b o t h d i o d e s a r e conducting ”) 3 I_D2 =(10 -0) /10; 4 I =(0 -( -10) ) /5 - I_D2 ; // node e q u t i o n a t B f o r f i g 3.6( a) 1 14 5 V_B =0; 6 V =0; 7 disp (I , ” I (mA)=” , V , ”V (V) ” ,” D 1 i s 8 9 10 11 12 13 14 15 16 conducting as assumed o r i g i n a l l y ” ) disp ( ” C o n s i d e r f i g 3 . 6 ( a ) . Assume b o t h d i o d e s a r e conducting ”) I_D2 =(10 -0) /5; I =(0 -( -10) ) /10 -2; // node e q u t i o n a t B f o r f i g 3 . 6 ( b ) disp (I , ” I (mA)=” , V ,( ”V (V) ” ) ) disp ( ” I m p l i e s a s s u m p t i o n i s wrong . l e t s assume D 1 i s o f f and D 2 i s on ” ) I_D2 =(10 -( -10) ) /15; V_B = -10+10* I_D2 ; I =0; disp (I , ” I (mA) ” , V_B , ”V (V) ” ,” D 1 i s r e v e r s e b i a s e d ”) Scilab code Exa 3.3 Evaluating junction scaling constant 1 2 3 4 5 6 7 8 9 10 11 12 // Example 3 . 3 : E v a l u a t i n g j u n c t i o n s c a l i n g c o n s t a n t // i −I S ∗ exp ( v / ( n∗V T ) ) i m p l i e s I S=i ∗ exp (−v / ( n∗V T ) ) n =1; i =10^ -3; // (A) v =700; // (V) V_T =25; // (V) I_S = i * exp ( - v /( n * V_T ) ) disp ( I_S , ” I S (A) f o r n=1” ) n =2; I_S = i * exp ( - v /( n * V_T ) ) disp ( I_S , ” I S (A) f o r n=2” ) disp ( ” These v a l u e s i m p l i e s I S i s 1 0 0 0 t i m e s g r e a t e r ”) 15 Scilab code Exa 3.4 To determine ID and VD 1 2 3 4 5 6 7 8 9 10 11 12 13 // Example 3 . 4 : To d e t e r m i n e I D and V D V_DD =5; // (V) R =1000; // ( ohm ) I_1 =1*10^ -3; // (A) V_D =0.7; // (V) V_1 = V_D ; I_D =( V_DD - V_D ) / R ; I_2 = I_D ; V_2 = V_1 +0.1* log10 ( I_2 / I_1 ) ; I_D =( V_DD - V_2 ) / R ; disp ( I_D , ” The d i o d e c u r r e n t (A) ” ) V_D = V_2 +0.1* log10 ( I_D / I_2 ) disp ( V_D , ” The d i o d e v o l a g e (V) ” ) Scilab code Exa 3.5 Repeating example 4 using piecewise linear model 1 2 3 4 5 6 7 8 9 // Example 3 . 5 : R e p e a t i n g e x a m p l e 3 . 4 u s i n g p i e c e w i s e l i n e a r model V_D0 =0.65; // (V) r_D =20; // ( ohm ) R =1000; // ( ohm ) V_DD =5; // (V) I_D =( V_DD - V_D0 ) /( R + r_D ) ; disp ( I_D , ” I D (A) ” ) V_D = V_D0 + I_D * r_D ; disp ( V_D , ” The d i o d v o l t a g e (V) ” ) 16 Scilab code Exa 3.6 Power supply ripple 1 2 3 4 5 6 7 8 9 10 11 // Example 3 . 6 : Power s u p p l y r i p p l e V_S =10; // V S=V + V_D =0.7; // (V) R =10*10^3; // ( ohm ) n =2; V_T =25*10^ -3; // (V) V_s =1; // (V) I_D =( V_S - V_D ) / R ; r_D = n * V_T / I_D ; v_d = V_s * r_D /( R + r_D ) ; disp ( v_d , ” v d ( peak (V) ) ” ) Scilab code Exa 3.7 Percentage change in regulated voltage 1 2 3 4 5 6 7 8 9 10 11 12 13 // Example 3 . 7 : P e r c e n t a g e c h a n g e i n r e g u l a t e d voltage V_DD =10; // (V) V_D =0.7*3; // s t r i n g o f 3 d i o d e s p r o v i d e t h i s constant voltage R =1*10^3; I_D =( V_DD - V_D ) / R ; n =2; V_T = 25*10^ -3; // (V) r_d = n * V_T / I_D ; // i n c r e m e n t a l r e s i s t a n c e r =3* r_d ; // t o t a l i n c r e m e n t a l r e s i s t a n c e deltav_O =2* r /( r + R ) ; // d e l t a v i s peak t o peak c h a n g e in output v o l t a g e disp ( deltav_O , ” P e r c e n t a g e c h a n g e (V) i n r e g u l a t e d v o l t a g e c a u s e d by 10% c h a n g e i n power s u p p l y ” ) I =2.1*10^ -3; // The c u r r e n t drawn from t h e d i o d e string deltav_O = - I * r ; // D e c r e a s e i n v o l t a g e a c r o s s d i o d e string 17 14 disp ( deltav_O , ” D e c r e a s e i n v o l t a g e a c r o s s d i o d e s t r i n g (V) ” ) Scilab code Exa 3.8 line regulation load regulation 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 // Example 3 . 8 : l i n e r e g u l a t i o n l o a d r e g u l a t i o n V_Z =6.8; // (V) I_Z =0.005; // (A) r_Z =20; // ( ohm ) V =10; // V=V + R =0.5*10^3; // ( ohm ) // 3 . 8 a V_ZO = V_Z - r_Z * I_Z ; I_Z =( V - V_ZO ) /( R + r_Z ) V_O = V_ZO + I_Z * r_Z ; disp ( V_O , ”V O (V) ” ) // 3 . 8 b deltaV =1; // c h a n g e i n V i s +1 and −1 deltaV_O = deltaV * r_Z /( R + r_Z ) ; // c o r r e s p o n d i n g c h a n g e in output v o l t a g e 18 disp ( deltaV_O , ” L i n e r e g u l a t i o n (V/V) ” ) 19 20 // 3 . 8 c 21 I_L =1*10^ -3; // l o a d c u r r e n t 22 deltaI_L =1*10^ -3; 23 deltaI_Z = -1*10^ -3; // c h a n g e i n z e n e r c u r r e n t 24 deltaV_O = r_Z * deltaI_Z ; 25 disp ( deltaV_O , ” Load r e g u l a t i o n (V/A) ” ) 26 27 // 3 . 8 d 28 I_L =6.8/2000; // l o a d c u r r e n t w i t h l o a d r e s i s t a n c e o f 2000 18 29 30 31 deltaI_Z = - I_L ; deltaV_O = r_Z * deltaI_Z ; disp ( deltaV_O , ” C o r r e s p o n d i n g c h a n g e i n z e n e r v o l t a g e (V) f o r z e n e r c u r r e n t c h a n g e o f −3.4mA” ) 32 33 // 3 . 8 e 34 R_L =0.5*10^3; // ( ohm ) 35 V_O = V * R_L /( R + R_L ) ; 36 disp ( V_O , ”V O (V) f o r R L =0.5K ohm” ) 37 38 // 3 . 8 f 39 I_Z =0.2*10^ -3; // Z e n e r t be a t t h e e d g e o f 40 41 42 43 44 breakdown I Z=I ZK V_Z =6.7; // V Z=V ZK I_Lmin =(9 -6.7) /0.5; // Lowest c u r r e n t s u p p l i e d t o R I_L = I_Lmin - I_Z ; // l o a d c u r r e n t R_L = V_Z / I_L ; disp ( R_L , ” R L ( ohm ) ” ) Scilab code Exa 3.9 Value of capacitance C that will result in peak pe 1 2 3 4 5 6 7 8 9 10 11 12 13 // Example 3 . 9 : V a l u e o f c a p a c i t a n c e C t h a t w i l l r e s u l t i n peak−peak r i p p l e o f 2V V_P =100; // (V) V_r =2; // (V) f =60; // ( Hz ) R =10*10^3; // ( ohm ) I_L = V_P / R ; C = V_P /( V_r * f * R ) ; disp (C , ”C (V) ” ) wdeltat = sqrt (2* V_r / V_P ) ; disp ( wdeltat , ” C o n d u c t i o n a n g l e ( r a d ) ” ) i_Dav = I_L *(1+ %pi * sqrt (2* V_P / V_r ) ) ; disp ( i_Dav , ” i D a v (A) ” ) i_Dmax = I_L *(1+2* %pi * sqrt (2* V_P / V_r ) ) ; 19 14 disp ( i_Dmax , ” i Dmax (A) ” ) 20 Chapter 4 MOS Field Effect Transistors Scilab code Exa 4.1 To determine operating point parameters 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 // Example 4 . 1 : To d e t e r m i n e o p e r a t i n g p o i n t parameters L_min =0.4*10^ -6; // (m) t_ox =8*10^ -9; // ( s ) u_n =450*10^ -4; // (A/Vˆ 2 ) V_t =0.7; // (V) e_ox =3.45*10^ -11; // 4 . 1 a C_ox = e_ox / t_ox ; disp ( C_ox , ” C ox ( F/mˆ 2 ) ” ) k_n = u_n * C_ox ; disp ( k_n , ” k n (A/Vˆ 2 ) ” ) // 4 . 1 b // O p e r a t i o n i n s a t u r a t i o n r e g i o n W =8*10^ -6; // (m) L =0.8*10^ -6; // (m) i_D =100*10^ -6; // (A) V_GS = sqrt (2* L * i_D /( k_n * W ) ) + V_t ; disp ( V_GS , ”V GS (V) ” ) 21 21 22 23 24 25 26 27 28 V_DSmin = V_GS - V_t ; disp ( V_DSmin , ” V DSmin (V) ” ) // 4 . 1 c // MOSFET i n t r i o d e r e g i o n r_DS =1000; // ( ohm ) V_GS =1/( k_n *( W / L ) * r_DS ) + V_t ; disp ( V_GS , ”V GS (V) ” ) Scilab code Exa 4.2 Design of given circuit 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 // Example 4 . 2 : D e s i g n o f g i v e n c i r c u i t t o o b t a i n I D =0.4mA and V D=0.5V // NMOS t r a n s i s t o r i s o p e r a t i n g i n s a t u r a t i o n r e g i o n I_D =0.4*10^ -3; // (A) V_D =0.5; // (V) V_t =0.7; // (V) uC_n =100*10^ -6; // (A/Vˆ 2 ) L =1*10^ -6; // (m) W =32*10^ -6; // (m) V_SS = -2.5; // (V) V_DD =2.5; // (V) V_OV = sqrt ( I_D *2* L /( uC_n * W ) ) ; V_GS = V_t + V_OV ; disp ( V_GS , ” V t (V) ” ) V_S = -1.2; // (V) R_S =( V_S - V_SS ) / I_D ; disp ( R_S , ” R S ( ohm ) ” ) V_D =0.5; // (V) R_D =( V_DD - V_D ) / I_D ; disp ( R_D , ”R D ( ohm ) ” ) Scilab code Exa 4.3 Design of given circuit 22 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 // Example 4 . 3 : D e s i g n o f g i v e n c i r c u i t t o o b t a i n I D =80uA // FET i s o p e r a t i n g i n s a t u r a t i o n r e g i o n I_D =80*10^ -6; // (A) V_t =0.6; // (V) uC_n =200*10^ -6; // (A/Vˆ 2 ) L =0.8*10^ -6; // (m) W =4*10^ -6; // (m) V_DD =3; // (V) V_OV = sqrt (2* I_D /( uC_n *( W / L ) ) ) ; V_GS = V_t + V_OV ; V_DS = V_GS ; V_D = V_DS ; disp ( V_D , ”V D (V) ” ) R =( V_DD - V_D ) / I_D ; disp (R , ”R ( ohm ) ” ) Scilab code Exa 4.4 Design of given circuit 1 2 3 4 5 6 7 8 9 10 11 12 13 14 // Example 4 . 4 : Design of given c i r c u i t to obtain V D=0.1V // MOSFET i s o p e r a t i n g i n t r i o d e r e g i o n V_D =0.1; // (V) V_DD =5; // (V) V_t =1; // (V) K =1*10^ -3; // K=k ’ n (W/L ) V_GS =5; // (V) V_DS =0.1; // (V) I_D = K *(( V_GS - V_t ) * V_DS -( V_DS ^2) /2) ; disp ( I_D , ” I D (A) ” ) R_D =( V_DD - V_D ) / I_D ; disp ( R_D , ”R D ( ohm ) ” ) r_DS = V_DS / I_D ; disp ( r_DS , ” r DS ( ohm ) ” ) 23 Scilab code Exa 4.5 To determine all node voltages and currents throug 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 // Example 4 . 5 : To d e t e r m i n e a l l node v o l t a g e s and c u r r e n t s through a l l branches V_t =1; // (V) K =1*10^ -3; // K=k ’ n (W/L ) V_DD =10; // (V) R_G1 =10*10^6; // ( ohm ) R_G2 =10*10^6; // ( ohm ) R_D =6*10^3; // ( ohm ) R_S =6*10^3; // ( ohm ) p = poly ([8 -25 18] , ’ I D ’ , ’ c o e f f ’ ) ; I_D = roots ( p ) ; // I D =0.89mA w i l l r e s u l t i n t r a n s i s t o r c u t o f f h e n c e we t a k e t h e o t h e r r o o t o f t h e e q u a t i o n V_G = V_DD * R_G2 /( R_G2 + R_G1 ) ; I_D = I_D (1) *10^ -3; disp ( I_D , ” I D (A) ” ) V_S = I_D * R_S ; disp ( V_S , ” V S (V) ” ) V_GS = V_G - V_S ; disp ( V_GS , ”V GS (V) ” ) V_D = V_DD - R_D * I_D ; disp ( V_D , ”V D (V) ” ) // V D>V G−V t t h e t r a n s i s t o r i s o p e r a t i n g i n s a t u r a t i o n a s i n i t i a l l y assumed Scilab code Exa 4.6 Design of given circuit // Example 4 . 6 ; Design of given c i r c u i t to obtain I D =0.5mA and V D=3V 2 // MOSFET i s i n s a t u r a t i o n 1 24 V_DD =5; // (V) V_D =3; // (V) I_D =0.5*10^ -3; // (A) V_t = -1; // (V) K =1*10^ -3; // K=k ’ n (W/L ) V_OV = sqrt (2* I_D / K ) ; V_GS = V_t +( - V_OV ) R_D = V_D / I_D ; V_Dmax = V_D - V_t ; // − s i g n a s m a g n i t u d e o f V t i s considered 12 R_D = V_Dmax / I_D ; 13 disp ( R_D , ”R D ( ohm ) ” ) 3 4 5 6 7 8 9 10 11 Scilab code Exa 4.7 To determine drain currents and output voltage 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 // Example 4 . 7 : To d e t e r m i n e d r a i n c u r r e n t s and output v o l t a g e K_n =1*10^ -3; // K n=k n ∗W n/ L n (A/Vˆ 2 ) K_p = 1*10^ -3; // K p=k p ∗W p/ L p (A/Vˆ 2 ) V_tn = 1; // (V) V_tp = -1; // (V) V_I = -2.5:2.5:2.5; // (V) V_DD =2.5; // (V) R =10; // ( k i l o ohm ) // For V I=0 I_DP =( K_p *( V_DD - V_tn ) ^2) /2; I_DN = I_DP ; disp ( I_DP , I_DN , ” I DP (A) and I DN (A) f o r V I=0V” ) disp (0 , ”V O f o r V I =0V” ) // For V I =2.5V // I DN=K N ( V GS−V tn ) V DS // I DN=v O /R // S o l v i n g t h e two e q u a t i o n s we g e t I_DN =0.244*10^ -3; // (V) V_O = -2.44; // (V) 25 20 disp ( I_DN , V_O , ”V O and I DN f o r V I =2.5V” ) 21 // For V I =−2.5V Q N i s c u t o f f 22 I_DP =2.44*10^ -3; // (A) 23 V_O =2.44; // (V) 24 disp (0 , I_DP , V_O , ”V O (V) , I DP (A) and I DN (A) f o r V I =−2.5V” ) Scilab code Exa 4.9 Design of given circuit 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 // Example 4 . 9 : D e s i g n o f g i v e n c i r c u i t t o o b t a i n I D =0.5mA I_d =0.5*10^ -3; // (A) I_S =0.5*10^ -3; // (A) V_t =1:0.5:1.5; // (V) K_n =1*10^ -3; // K n=k n ∗W/L (A/Vˆ 2 ) V_DD =15; // (V) V_D =10; // (V) V_S =5; // (V) R_D =( V_DD - V_D ) / I_d ; R_S = V_S / I_S ; V_OV = sqrt ( I_d *2/ K_n ) ; V_GS = V_t + V_OV ; V_G = V_S + V_GS ; // V t =1.5V // I D=K( V GS−V t ) ˆ 2 / 2 // 7=V GS+10 I D // s o l v i n g a b o v e e q u a t i o n s I_D =0.455*10^ -3; deltaI_D = I_D - I_d ; // Change i n I D (A) change = deltaI_D *100/ I_d ; // Change i n % disp ( change , ” Change i n I D (%) ” ) Scilab code Exa 4.10 Small signal analysis 26 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 // Example 4 . 1 0 : S m a l l s i g n a l a n a l y s i s V_t =1.5; // (V) K =0.00025; //K= k nW/L (A/Vˆ 2 ) V_A =50; // (V) I_D =1.06*10^ -3; // (A) V_D =4.4; // (V) R_D =10000; // ( ohm ) R_L =10000; // ( ohm ) V_GS = V_D ; g_m = K *( V_GS - V_t ) ; r_o = V_A / I_D ; A_v = - g_m *( R_L * R_D * r_o ) /( R_D * R_L + R_D * r_o + R_L * r_o ) ; disp ( A_v , ” V o l t a g e g a i n (V/V) ” ) R_G =10*10^6; // ( ohm ) // i i = v i ∗(1 − A v ) /R G R_in = R_G /(1 -( A_v ) ) ; disp ( R_in , ” I n p u t r e s i s t a n c e ( ohm ) ” ) // v DSmin=v GSmin−V t v_i = V_t /(1+( - A_v ) ) ; // − s i g n t o make A v p o s i t i v e disp ( v_i , ” L a r g e s t a l l o w a b l e i n p u t s i g n a l (V) ” ) Scilab code Exa 4.11 To determine all parameters of transistor amplifie 1 2 3 4 5 6 7 8 9 10 11 // Example 4 . 1 1 : To d e t e r m i n e a l l p a r a m e t e r s o f transistor amplifier v_o =90; // (V) v_i =9; // (V) R_sig =100*10^3; // ( ohm ) R_L =10*10^3; // ( ohm ) v_sig =10; // (V) A_vo = v_o / v_i ; disp ( A_vo , ” A vo (V/V) ” ) G_vo = v_o / A_vo ; disp ( G_vo , ” G vo (V/V) ” ) R_i = G_vo * R_sig /( A_vo - G_vo ) 27 disp ( R_i , ” R i ” ) disp ( ” assume R L = 10 k i l o ohm i s c o n n e c t e d ” ) v_o =70; // (V) v_i =8; // (V) A_v = v_o / v_i ; disp ( A_v , ” A v (V/V) ” ) G_v = v_o / A_vo ; disp ( G_v , ” G v (V/V) ” ) R_o = R_L *( A_vo - A_v ) / A_v ; disp ( R_o , ” R o ( ohm ) ” ) R_out = R_L *( G_vo - G_v ) / G_v ; disp ( R_out , ” R out ( ohm ) ” ) R_in =( v_i *100) /( v_sig - v_i ) ; disp ( R_in , ” R i n ( ohm ) ” ) G_m = A_vo / R_o ; disp ( G_m , ”G m ( mho ) ” ) A_i = A_v * R_in / R_L ; disp ( A_i , ” A i (V/V) ” ) R_inL0 = R_sig /((1+ R_sig / R_i ) *( R_out / R_o ) -1) ; // R i n | R L=0 ( ohm ) 31 disp ( R_inL0 , ” R i n a t R L=0” ) 32 A_is = A_vo * R_inL0 / R_o ; 33 disp ( A_is , ” A i s (A/A) ” ) 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 Scilab code Exa 4.12 Midband gain and upper 3dB frequency 1 2 3 4 5 6 7 8 // Example 4 . 1 2 : Midband g a i n and u p p e r 3dB frequency R_sig = 100*10^3; // ( ohm ) R_G =4.7*10^6; // ( ohm ) R_D =15*10^3; // ( ohm ) R_l =15*10^3; // ( ohm ) g_m =1*10^ -3; // ( mho ) r_o =150*10^3; // ( ohm ) C_gs =1*10^ -12; // ( F ) 28 9 C_gd =0.4*10^ -12; // ( F ) 10 R_L = 1/(1/ r_o + 1/ R_D + 1/ R_l ) 11 A_M = R_G /( R_G + R_sig ) * g_m * R_L ; 12 disp ( A_M , ” midband g a i n A M (V/V) ” ) 13 C_eq =(1+ g_m * R_L ) * C_gd ; 14 C_in = C_gs + C_eq ; 15 f_H =( R_G + R_sig ) /(2* %pi * C_in * R_sig * R_G ) ; 16 disp ( f_H , ” f H ( Hz ) ” ) Scilab code Exa 4.13 Coupling capacitor values 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 // Example 4 . 1 3 : C o u p l i n g c a p a c i t o r v a l u e s R_G =4.7*10^6; // ( ohm ) R_D =15*10^3; // ( ohm ) R_L =15*10^3; // ( ohm ) R_sig =100*10^3; // ( ohm ) g_m =1*10^ -3; // ( mho ) f_L =100; // ( Hz ) C_S = g_m /(2* %pi * f_L ) disp ( C_S , ” C S ( F ) ” ) f_P2 =1/(2* %pi * C_S / g_m ) ; f_P1 =10; // ( Hz ) f_P2 =10; // ( Hz ) C_C1 =1/(2* %pi *( R_G + R_sig ) *10) disp ( C_C1 , ” C C1 ( F ) ” ) C_C2 =1/(2* %pi *( R_D + R_L ) *10) disp ( C_C2 , ” C C2 ( F ) ” ) 29 Chapter 5 Bipolar Junction Transistor Scilab code Exa 5.1 Design of given circuit with current 2mA 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 // Example 5 . 1 : D e s i g n o f g i v e n c i r c u i t w i t h c u r r e n t 2mA // BJT w i l l be o p e r a t i n g i n a c t i v e mode B =100; // B i s b e t a v a l u e a = B /( B +1) ; // a i s a l p h a v a l u e v_BE =0.7; // v BE (V) a t i C =1mA i_C =1*10^ -3:1*10^ -3:2*10^ -3; // (A) I_C =2*10^ -3; // (A) V_T =25*10^ -3; // (V) V_C =5; // (V) V_CC =15; // (V) V_B =0; // (V) V_RC = V_CC - V_C ; // V RC i s t h e v o l t a g e d r o p a c r o s s resistor R C R_C = V_RC / I_C ; disp ( R_C , ” C o l l e c t o r R e s i s t a n c e R C ( ohm ) ” ) V_BE = v_BE + V_T * log ( i_C (2) / i_C (1) ) ; disp ( V_BE , ” Base e m i t t e r v o l t a g e V BE (V) a t i C =2mA” ) V_E = V_B - V_BE ; disp ( V_E , ” E m i t t e r v o l t a g e V E (V) ” ) 30 19 I_E = I_C / a ; 20 disp ( I_E , ” E m i t t e r c u r r e n t I E (A) ” ) 21 R_E =( V_E -( - V_CC ) ) / I_E ; 22 disp ( R_E , ” E m i t t e r r e s i s t a n c e R C ( ohm ) ” ) Scilab code Exa 5.2 Consider a common Emitter circuit 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 // Example 5 . 2 : C o n s i d e r a common E m i t t e r c i r c u i t I_S =10^ -15; // (A) R_C =6.8*10^3; // ( ohm ) V_CC =10; // (V) V_CE =3.2; // (V) V_T =25*10^ -3; // (V) // 5 . 2 a I_C =( V_CC - V_CE ) / R_C ; disp ( I_C , ” C o l l e c t o r c u r r e n t (A) ” ) V_BE = V_T * log ( I_C / I_S ) ; disp ( V_BE , ”V BE (V) ” ) // 5 . 2 b V_in =5*10^ -3; // s i n u o s o i d a l i n p u t 0 f peak a m p l i t i d e 5mv A_v = -( V_CC - V_CE ) / V_T ; disp ( A_v , ” V o l t a g e g a i n ” ) V_o = - A_v * V_in ; // n e g a t i v e s i g n t o make p o s i t i v e value of voltage gain disp ( V_o , ” A m p l i t u d e o f o u t p u t v o l t a g e (V) ” ) 19 20 21 // 5 . 2 c 22 v_CE =0.3 // (V) 23 i_C =( V_CC - v_CE ) / R_C ; 24 disp ( i_C , ” i C (A) ” ) 25 v_be = V_T * log ( i_C / I_C ) ; // v BE i s i n v BE 31 p o s i t i v e increment 26 27 28 29 30 31 32 33 34 35 disp ( v_be , ” r e q u i r e d i n c r e m e n t (V) ” ) // 5 . 2 d v_O =0.99* V_CC ; R_C =6.8*10^3; // ( ohm ) i_C =( V_CC - v_O ) / R_C ; I_C =1*10^ -3; // (A) disp ( i_C , ” i C (A) ” ) v_be = V_T * log ( i_C / I_C ) ; disp ( v_be , ” n e g a t i v e i n c r e m e n t i n v BE (V) ” ) Scilab code Exa 5.3 Determine RB 1 2 3 4 5 6 7 8 9 10 11 12 13 // Example 5 . 3 : D e t e r m i n e R B // t r a n s i s t o r i s s p e c i f i e d t o have B v a l u e i n t h e r a n g e o f 50 t o 150 V_C =0.2; // V C=V CEsat V_CC =10; // (V) R_C =10^3; // ( ohm ) V_BB =5; // (V) V_BE =0.7; // (V) bmin =50; // r a n g e o f b e t e i s 50 t o 150 I_Csat =( V_CC - V_C ) / R_C ; I_BEOS = I_Csat / bmin ; // I B (EOS)=I BEOS I_B =10* I_BEOS ; // b a s e c u r r e n t f o r an o v e r d r i v e f a c t o r 10 R_B =( V_BB - V_BE ) / I_B ; disp ( R_B , ” V a l u e o f R B ( ohm ) ” ) Scilab code Exa 5.4 Analyse the circuit to find node voltages and bran 1 // Example 5 . 4 : A n a l y s e t h e c i r c u i t t o f i n d node v o l t a g e s and b r a n c h c u r r e n t s 32 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 V_BB = 4; // (V) V_CC =10; // (V) V_BE =0.7; // (V) b =100; // b e t a = 100 R_E =3.3*10^3; // ( ohm ) R_C =4.7*10^3; // ( ohm ) V_E = V_BB - V_BE ; disp ( V_E , ” E m i t t e r v o l t a g e (V) ” ) I_E =( V_E -0) / R_E ; disp ( I_E , ” E m i t t e r c u r r e n t (A) ” ) a = b /( b +1) // a l p h a v a l u e I_C = I_E * a ; disp ( I_C , ” C o l l e c t o r c u r r e n t (A) ” ) V_C = V_CC - I_C * R_C ; // A p p l y i n g ohm ’ s law disp ( V_C , ” C o l l e c t o r v o l t a g e (V) ” ) I_B = I_E /( b +1) ; disp ( I_B , ” Base c u r r e n t (A) ” ) Scilab code Exa 5.5 Analyse the circuit to find node voltages and bran 1 2 3 4 5 6 7 8 9 10 11 12 13 14 // Example 5 . 5 : A n a l y s e t h e c i r c u i t t o f i n d node v o l t a g e s and b r a n c h c u r r e n t s disp ( ” Assuming a c t i v e mode o p e r a t i o n ” ) V_CC =10; // (V) R_C =4.7*10^3; // (V) R_E =3.3*10^3; // ( ohm ) V_BE =0.7; // (V) V_BB =6; // (V) V_CEsat =0.2; // (V) V_E = V_BB - V_BE ; disp ( V_E , ” E m i t t e r v o l t a g e (V) ” ) I_E = V_E / R_E ; disp ( I_E , ” E m i t t e r c u r r e n t (A) ” ) V_C = V_CC - I_E * R_C ; // I E=I C disp ( V_C , ” C o l l e c t o r v o l t a g e (V) ” ) 33 15 16 17 18 19 20 21 22 23 24 25 26 27 disp ( ” S i n c e V C < V B o u r a s s u m p t i o n i s wrong \n Hence i t s s a t u r a t i o n mode o p e r a t i o n ” ) V_E = V_BB - V_BE ; disp ( V_E , ” E m i t t e r v o l t a g e (V) ” ) I_E = V_E / R_E ; disp ( I_E , ” E m i t t e r c u r r e n t (A) ” ) V_C = V_E + V_CEsat ; disp ( V_C , ” C o l l e c t o r v o l t a g e (V) ” ) I_C =( V_CC - V_C ) / R_C ; disp ( I_C , ” C o l l e c t o r c u r r e n t (A) ” ) I_B = I_E - I_C ; disp ( I_B , ” Base c u r r e n t (A) ” ) Bforced = I_C / I_B ; // t r a n s i s t o r i s made t o o p e r a t e a t a forced beta value disp ( Bforced , ” f o r c e d b e t a ” ) Scilab code Exa 5.7 Analyse the circuit to find node voltages and bran 1 2 3 4 5 6 7 8 9 10 11 12 13 // Example 5 . 7 : A n a l y s e t h e c i r c u i t t o f i n d node v o l t a g e s and b r a n c h c u r r e n t s V_CC = -10; // (V) R_E =2000; // ( ohm ) R_C =1000; // ( ohm ) V_EE =10; // (V) V_E =0.7; // (V) e m i t t e r b a s e j u n c t i o n w i l l be f o r w a r d b i a s e d w i t h V E=V EB=0.7V disp ( V_E , ” E m i t t e r b a s e j u n c t i o n i s f o r w a r d b i a s e d w i t h V E (V) ” ) I_E =( V_EE - V_E ) / R_E ; disp ( I_E , ” E m i t t e r c u r r e n t (A) ” ) B =100; // Assuming b e t a 100 a = B /( B +1) ; I_C = a * I_E ; // Assuming t h e t r a n s i s t o r t o o p e r a t e i n a c t i v e mode disp ( I_C , ” C o l l e c t o r c u r r e n t (A) ” ) 34 14 V_C = V_CC + I_C * R_C ; 15 disp ( V_C , ” C o l l e c t o r v o l t a g e (V) ” ) 16 I_B = I_E /( B +1) ; 17 disp ( I_B , ” Base c u r r e n t (A) ” ) Scilab code Exa 5.8 Analyse the circuit to find node voltages and bran 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 // Example 5 . 8 : A n a l y s e t h e c i r c u i t t o f i n d node v o l t a g e s and b r a n c h c u r r e n t s V_CC = 10; // (V) R_C =2000; // ( ohm ) V_BB =5; // (V) R_B =100*10^3; // ( ohm ) B =100; // b e t a v a l u e I_B =( V_BB - V_BE ) / R_B ; disp ( I_B , ” Base c u r r e n t (A) ” ) I_C = B * I_B ; disp ( I_C , ” C o l l e c t o r c u r r e n t (A) ” ) V_C = V_CC - I_C * R_C ; disp ( V_C , ” C o l l e c t o r v o l t a g e (V) ” ) V_B =0.7 ; // V B=V BE disp ( V_B , ” Base v o l t a g e (V) ” ) I_E =( B +1) * I_B ; disp ( I_E , ” E m i t t e r c u r r e n t (A) ” ) Scilab code Exa 5.9 Analyse the circuit to find node voltages and bran 1 2 3 4 5 // Example 5 . 9 : A n a l y s e t h e c i r c u i t t o f i n d node v o l t a g e s and b r a n c h c u r r e n t s // a s s u m i n g t h a t t h e t r a n s i s t o r i s s a t u r a t e d V_CC = -5; // (V) V_EE =5; // (V) R_B =10000; // ( ohm ) 35 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 R_C =10000; // ( ohm ) R_E =1000; // ( ohm ) V_EB =0.7; // (V) V_ECsat =0.2; // (V) // u s i n g t h e r e l a t i o n I E=I C+I B V_B =3.75/1.2; // (V) disp ( V_B , ” Base v o l t a g e (V) ” ) V_E = V_B + V_EB ; disp ( V_E , ” E m i t t e r v o l t a g e (V) ” ) V_C = V_E - V_ECsat ; disp ( V_C , ” C o l l e c t o r v o l t a g e (V) ” ) I_E =( V_EE - V_E ) / R_E ; disp ( I_E , ” E m i t t e r c u r r e n t (A) ” ) I_B = V_B / R_B ; disp ( I_B , ” Base c u r r e n t (A) ” ) I_C =( V_C - V_CC ) / R_C ; disp ( I_C , ” C o l l e c t o r c u r r e n t (A) ” ) Bforced = I_C / I_B ; // V a l u e o f f o r c e d b e t a disp ( Bforced , ” F o r c e d Beta v a l u e ” ) Scilab code Exa 5.10 Analyse the circuit to find node voltages and bran 1 2 3 4 5 6 7 8 9 10 11 12 // Exampe 5 . 1 0 : A n a l y s e t h e c i r c u i t t o f i n d node v o l t a g e s and b r a n c h c u r r e n t s V_CC =15; // (V) R_C =5000; // ( ohm ) R_B1 =100*10^3; // ( ohm ) R_B2 =50*10^3; // ( ohm ) R_E =3000; // ( ohm ) V_BE =0.7; // (V) B =100; // b e t a v a l u e V_BB = V_CC * R_B2 /( R_B1 + R_B2 ) ; disp ( V_BB , ”V BB (V) ” ) R_BB = R_B1 * R_B2 /( R_B1 + R_B2 ) ; disp ( R_BB , ”R BB ( ohm ) ” ) 36 13 14 15 16 17 18 19 20 21 22 23 24 25 I_B = I_E /( B +1) ; disp ( I_B , ” Base c u r r e n t (A) ” ) I_E =( V_BB - V_BE ) /( R_E +( R_BB /( B +1) ) ) disp ( I_E , ” E m i t e r c u r r e n t (A) ” ) I_B = I_E /( B +1) disp ( I_B , ” Base c u r r e n t (A) ” ) V_B = V_BE + I_E * R_E ; disp ( V_B , ” Base v o l t a g e (V) ” ) a = B /( B +1) ; // a l p h a v a l u e I_C = a * I_E disp ( I_C , ” C o l l e c t o r c u r r e n t (A) ” ) V_C = V_CC - I_C * R_C ; disp ( V_C , ” C o l l e c t o r v o l t a g e (V) ) ” ) Scilab code Exa 5.11 Analyse the circuit to find node voltages and bran 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 // Example 5 . 1 1 : A n a l y s e t h e c i r c u i t t o f i n d node v o l t a g e s and b r a n c h c u r r e n t s V_CC =15; // (V) R_C1 =5000; // ( ohm ) R_B1 =100*10^3; // ( ohm ) R_B2 =50*10^3; // ( ohm ) R_E =3000; // ( ohm ) V_BE =0.7; // (V) R_E2 =2000; // ( ohm ) R_C2 =2700; // ( ohm ) V_EB =0.7; // (V) B =100; // b e t a v a l u e V_BB = V_CC * R_B2 /( R_B1 + R_B2 ) ; R_BB = R_B1 * R_B2 /( R_B1 + R_B2 ) ; I_E1 =( V_BB - V_BE ) /( R_E +( R_BB /( B +1) ) ) disp ( I_E1 , ” I E 1 (A) ” ) I_B1 = I_E1 /( B +1) disp ( I_B1 , ” I B 1 (A) ” ) V_B1 = V_BE + I_E * R_E ; 37 19 disp ( V_B1 , ” V B1 (V) ” ) 20 a = B /( B +1) ; // a l p h a v a l u e 21 // b e t a and a l p h a v a l u e s a r e same f o r t h e two 22 23 24 25 26 27 28 29 30 31 32 33 34 35 transistors I_C1 = a * I_E disp ( I_C1 , ” IC1 (A) ” ) V_C1 = V_CC - I_C1 * R_C1 ; disp ( V_C1 , ” V C1 (V) ) ” ) V_E2 = V_C1 + V_EB ; disp ( V_E2 , ” V E2 (V) ” ) I_E2 =( V_CC - V_E2 ) / R_E2 ; disp ( I_E2 , ” I E 2 (A) ” ) I_C2 = a * I_E2 ; disp ( I_C2 , ” I C 2 (A) ” ) V_C2 = I_C2 * R_C2 ; disp ( V_C2 , ” V C2 (V) ” ) I_B2 = I_E2 /( B +1) ; disp ( I_B2 , ” I B 2 (A) ” ) Scilab code Exa 5.13 Design of bias network of the amplifier 1 2 3 4 5 6 7 8 9 10 11 12 13 // Example 5 . 1 3 : D e s i g n o f b i a s n e t w o r k o f t h e amplifier I_E =1*10^ -3; // (A) V_CC =12; // (V) B =100; // b e t a v a l u e V_B =4; // (V) V_BE =0.7; // (V) R1 =80; // ( ohm ) R2 =40; // ( ohm ) V_C =8; // (V) V_E = V_B - V_BE ; disp ( V_E , ” E m i t t e r v o l t a g e (V) ” ) R_E = V_E / I_E ; disp ( R_E , ” E m i t t e r r e s i s t a n c e ( ohm ) ” ) 38 14 I_E =( V_B - V_BE ) /( R_E +( R1 * R2 /( R1 + R2 ) ) /( B +1) ) ; 15 disp ( I_E , ” more a c c u r a t e v a l u e f o r I E (A) f o r R1=80 16 17 18 19 20 21 ohm and R2=40 ohm” ) R1 =8; // ( ohm ) R2 =4; // ( ohm ) I_E =( V_B - V_BE ) /( R_E +( R1 * R2 /( R1 + R2 ) ) /( B +1) ) ; disp ( I_E , ” more a c c u r a t e v a l u e f o r I E (A) f o r R1=8 ohm and R2=4 ohm” ) R_C =( V_CC - V_C ) / I_E ; // I E=I C disp ( R_C , ” C o l l e c t o r r e s i s t o r ( ohm ) ” ) Scilab code Exa 5.14 Analysis of transistor amplifier 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 // Example 5 . 1 4 : A n a l y s i s o f t r a n s i s t o r a m p l i f i e r V_CC =10; // (V) R_C =3000; // ( ohm ) R_BB =100*10^3; // ( ohm ) V_BB =3; // (V) V_BE =0.7; // (V) V_T =25*10^ -3; // (V) I_B =( V_BB - V_BE ) / R_BB ; disp ( I_B , ” Base c u r r e n t (A) ” ) I_C = B * I_B ; disp ( I_C , ” C o l l e c t o r c u r r e n t (A) ” ) V_C = V_CC - I_C * R_C ; disp ( V_C , ” C o l l e c o r v o l t a g e (V) ” ) I_E = B * I_C /( B +1) ; r_e = V_T / I_E ; disp ( r_e , ” r e ( ohm ) ” ) g_m = I_C / V_T ; disp ( g_m , ” g m ( mho ) ” ) r_pi = B / g_m ; disp ( r_pi , ” r p i ( ohm ) ” ) // v i i s i n p u t v o l t a g e l e t u s assume i t t o be 1 V v_i =1; 39 23 v_be = v_i * r_pi /( r_pi + R_BB ) 24 disp ( v_be , ” v b e ” ) 25 v_o = - g_m * R_C * v_be ; 26 disp ( v_o , ” Output v o l t a g e (V) ” ) 27 A_v = v_o / v_i ; 28 disp ( A_v , ” V o l t a g e g a i n ” ) Scilab code Exa 5.17 Amplifier parameters 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 // Example 5 . 1 7 : A m p l i f i e r p a r a m e t e r s // T r a n s i s t o r a m p l i f i e r i s h a v i n g a open c i r c u i t v o l t a g e o f v s i g o f 10mV v_sig =10*10^ -3; // (V) R_L =10*10^3; // ( ohm ) R_sig =100*10^3; // ( ohm ) disp ( ” C a l c u l a t i o n w i t h R L i n f i n i t e ” ) v_i =9; // (V) v_o =90; // (V) A_vo = v_o / v_i ; disp ( A_vo , ” A vo (V/V) ” ) G_vo = v_o / A_vo ; disp ( G_vo , ” G vo (V/V) ” ) R_i = G_vo * R_sig /( A_vo - G_vo ) disp ( R_i , ” R i ( ohm ) ” ) disp ( ” C a l c u l a t i o n s w i t h R L = 10 k ohm” ) v_o =70*10^ -3; // (V) v_i =8*10^ -3; // (V) A_v = v_o / v_i ; disp ( A_v , ” V o l t a g e g a i n A v (V/V) ” ) G_v = v_o *10^3/10; disp ( G_v , ” G v (V/V) ” ) R_o =( A_vo - A_v ) * R_L / A_v ; disp ( R_o , ” R o ( ohm ) ” ) R_out =( G_vo - G_v ) * R_L / G_v ; disp ( R_out , ” R out ( ohm ) ” ) 40 26 R_in = v_i * R_sig /( v_sig - v_i ) ; 27 disp ( R_in , ” R i n ( ohm ) ” ) 28 G_m = A_vo / R_o ; 29 disp ( G_m , ”G m (A/V) ” ) 30 A_i = A_v * R_in / R_L ; 31 disp ( A_i , ” A i (A/A) ” ) 32 R_ino = R_sig /((1+ R_sig / R_i ) *( R_out / R_o ) -1) ; // R i n o i s R i n a t R L=0 33 disp ( R_ino , ” R i n a t R L =0” ) 34 A_is = A_vo * R_ino / R_o ; 35 disp ( A_is , ” A i s (A/A) ” ) Scilab code Exa 5.18 Midband gain and 3dB frequency 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 // Example 5 . 1 8 : Midband g a i n and 3dB f r e q u e n c y // T r a n s i s t o r i s b i a s e d a t I C =1mA V_CC =10; // (V) V_EE =10; // (V) I =0.001; // (A) R_B =100000; // ( ohm ) R_C =8000; // ( ohm ) R_sig =5000; // ( ohm ) R_L =5000; // ( ohm ) B =100; // b e t a v a l u e V_A =100; // (V) C_u =1*10^ -12; // ( F ) f_T =800*10^6; // ( Hz ) I_C =0.001; // (A) r_x =50; // ( ohm ) // V a l u e s o f h y b r i d p i model p a r a m e t e r s g_m = I_C / V_T ; r_pi = B / g_m ; r_o = V_A / I_C ; w_T =2* %pi * f_T ; CpiplusCu = g_m / w_T ; // C u+C p i 41 22 C_pi = CpiplusCu - C_u ; 23 R_l = r_o * R_C * R_L /( r_o * R_C + R_C * R_L + R_L * r_o ) // R l=R L 24 25 26 27 28 29 ’ A_M = R_B * r_pi * g_m * R_l /(( R_B + R_sig ) *( r_pi + r_x +( R_B * R_sig /( R_B + R_sig ) ) ) ) ; disp ( A_M , ” Midband g a i n (V/V) ” ) R_seff =( r_pi *( r_x + R_B * R_sig /( R_B + R_sig ) ) ) /( r_pi + r_x + R_B * R_sig /( R_B + R_sig ) ) ; // E f f e c t i v e s o u r c e r e s i s t a n c e R s e f f =R ’ s i g C_in = C_pi + C_u *(1+ R_l * g_m ) ; f_H =1/(2* %pi * C_in * R_seff ) ; disp ( f_H , ” 3dB f r e q u e n c y ( Hz ) ” ) Scilab code Exa 5.19 To select values of capacitance required 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 // Example 5 . 1 9 : To s e l e c t v a l u e s o f c a p a c i t a n c e required R_B =100000; // ( ohm ) r_pi =2500; // ( ohm ) R_C =8000; // ( ohm ) R_L =5000; // ( ohm ) R_sig =5000; // ( ohm ) B =100; // b e t a v a l u e g_m =0.04; // (A/V) r_pi =2500; // ( ohm ) f_L =100; // ( Hz ) r_e =25; // ( ohm ) R_C1 = R_B * r_pi /( R_B + r_pi ) + R_sig ; // R e s i s t a n c e s e e n by C C1 R_E = r_e + R_B * R_sig /(( R_B + R_sig ) *( B +1) ) ; // R e s i s t a n c e s e e n by C E R_C2 = R_C + R_L ; // R e s i s t a n c e s e e n by C C2 w_L =2* %pi * f_L ; C_E =1/( R_E *0.8* w_L ) ; // C E i s t o c o n t r i b u t e o n l y 80% of the value of w L 42 disp ( C_E , ”C E ( F ) ” ) C_C1 =1/( R_C1 *0.1* w_L ) ; // C C1 i s t o c o n t r i b u t e o n l y 10% o f t h e v a l u e o f f L 19 disp ( C_C1 , ” C C1 ( F ) ” ) 20 C_C2 =1/( R_C2 *0.1* w_L ) ; // C C2 s h o u l d c o n t r i b u t e o n l y 10% o f t h e v a l u e o f f L 21 disp ( C_C2 , ” C C2 ( F ) ” ) 17 18 43 Chapter 6 single stage integrated circuit amplifiers Scilab code Exa 6.1 To find the operating point of NMOS transistor // Example 6 . 1 : To f i n d t h e o p e r a t i n g p o i n t o f NMOS transistor 2 // C o n s i d e r NMOS t r a n s i s t o r 1 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 // 6 . 1 a I_D =100*10^ -6; // (A) K_n =387*10^ -6*10; // K n=u n ∗ C ox (W/L ) (A/Vˆ 2 ) V_th =0.48; // (V) V_OV = sqrt (2* I_D / K_n ) ; disp ( V_OV , ”V OV (V) ” ) V_GS = V_th + V_OV ; disp ( V_GS , ”V GS (V) ” ) // 6 . 1 b I_C =100*10^ -6; // (A) I_S =6*10^ -18 // (A) V_T =0.025; // (V) V_BE = V_T * log ( I_C / I_S ) ; disp ( V_BE , ”V BE (V) ” ) 44 Scilab code Exa 6.2 Comparison between NMOS transistor and npn transis 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 // Example 6 . 2 : Comparison b e t w e e n NMOS t r a n s i s t o r and npn t r a n s i s t o r disp ( ” For NMOS t r a n s i s t o r ” ) I_D =100*10^ -6; // (A) V_a =5; // V’ A=V a (A) L =0.4; // (um) K_n =267*4/0.4*10^ -6; // K n=u n ∗ C ox ∗ (W/L ) (A/Vˆ 2 ) V_OV = sqrt (2* I_D / K_n ) ; g_m = sqrt (2* K_n * I_D ) disp ( g_m , ” g m (A/V) ” ) disp ( ” R i n i s i n f i n i t e ” ) r_o = V_a * L / I_D ; disp ( r_o , ” r o ( ohm ) ” ) A_O = g_m * r_o ; disp ( A_O , ”A O (V/V) ” ) disp ( ” For npn t r a n s i s t o r ” ) I_C =0.1*10^ -3; // c o l l e c t o r c u r r e n t B_o =100; // b e t a v a l u e V_A =35; // (V) g_m = I_C / V_T ; disp ( g_m , ” g m (A/V) ” ) R_in = B_o / g_m ; disp ( R_in , ” R i n ( ohm ) ” ) r_o = V_A / I_C ; disp ( r_o , ” r o ( ohm ) ” ) A_O = g_m * r_o ; disp ( A_O , ”A O (V/V) ” ) 45 Scilab code Exa 6.3 Comparison between NMOS transistor and npn transis 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 // Example 6 . 3 : Comparison b e t w e e n NMOS t r a n s i s t o r and npn t r a n s i s t o r // For npn t r a n s i s t o r disp ( ” For npn t r a n s i s t o r ” ) I_C =10*10^ -6; // (A) V_T =0.025; // (V) V_A =35; // (V) C_jeO =5*10^ -15; // ( F ) C_uO =5*10^ -15; // ( F ) C_L =1*10^ -12; // ( F ) disp ( ” The d a t a c a l c u l a t e d f o r I C =10uA” ) g_m = I_C / V_T ; disp ( g_m , ” g m (A/V) ” ) r_o = V_A / I_C ; disp ( r_o , ” r o ( ohm ) ” ) A_O = V_A / V_T ; disp ( A_O , ”A O (V/V) ” ) T_F =10*10^ -12; C_de = T_F * g_m ; disp ( C_de , ” C de ( F ) ” ) C_je =2* C_jeO ; disp ( C_je , ” C j e ( F ) ” ) C_pi = C_de + C_je ; disp ( C_pi , ” C p i ( F ) ” ) C_u = C_uO ; disp ( C_u , ” C u ( F ) ” ) f_T = g_m /(2* %pi *( C_pi + C_u ) ) ; disp ( f_T , ” f T ( Hz ) ” ) f_t = g_m /(2* %pi * C_L ) ; disp ( f_t , ” f t ( Hz ) ” ) disp ( ” The d a t a c a l c u l a t e d f o r I C =100uA” ) I_C =100*10^ -6; g_m = I_C / V_T ; disp ( g_m , ” g m (A/V) ” ) r_o = V_A / I_C ; 46 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 disp ( r_o , ” r o ( ohm ) ” ) A_O = V_A / V_T ; disp ( A_O , ”A O (V/V) ” ) T_F =10*10^ -12; C_de = T_F * g_m ; disp ( C_de , ” C de ( F ) ” ) C_je =2* C_jeO ; disp ( C_je , ” C j e ( F ) ” ) C_pi = C_de + C_je ; disp ( C_pi , ” C p i ( F ) ” ) C_u = C_uO ; disp ( C_u , ” C u ( F ) ” ) f_T = g_m /(2* %pi *( C_pi + C_u ) ) ; disp ( f_T , ” f T ( Hz ) ” ) f_t = g_m /(2* %pi * C_L ) ; disp ( f_t , ” f t ( Hz ) ” ) disp ( ” The d a t a c a l c u l a t e d f o r I C =1mA” ) I_C =1*10^ -3; g_m = I_C / V_T ; disp ( g_m , ” g m (A/V) ” ) r_o = V_A / I_C ; disp ( r_o , ” r o ( ohm ) ” ) A_O = V_A / V_T ; disp ( A_O , ”A O (V/V) ” ) T_F =10*10^ -12; C_de = T_F * g_m ; disp ( C_de , ” C de ( F ) ” ) C_je =2* C_jeO ; disp ( C_je , ” C j e ( F ) ” ) C_pi = C_de + C_je ; disp ( C_pi , ” C p i ( F ) ” ) C_u = C_uO ; disp ( C_u , ” C u ( F ) ” ) f_T = g_m /(2* %pi *( C_pi + C_u ) ) ; disp ( f_T , ” f T ( Hz ) ” ) f_t = g_m /(2* %pi * C_L ) ; disp ( f_t , ” f t ( Hz ) ” ) // For NMOS t r a n s i s t o r 47 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 L =0.4*10^ -6; // (m) C_L =1*10^ -12; // ( F ) disp ( ” The d a t a c a l c u l a t e d f o r I D = 10uA” ) I_D =10*10^ -6; // (A) WbyL =0.12* I_D ; // WbyL=(W/L ) disp ( WbyL *10^6 , ” (W/L ) ” ) g_m =8* I_D ; disp ( g_m , ” g m (A/V) ” ) r_o =2/ I_D ; disp ( r_o , ” r o ( ohm ) ” ) A_O = g_m * r_o ; disp ( A_O , ”A O (V/V) ” ) C_gs =(2/3) * WbyL *0.4*0.4*5.8+0.6* WbyL *0.4; disp ( C_gs , ” C g s ( fF ) ” ) C_gd =0.6* WbyL *0.4; disp ( C_gd , ” C gd ( fF ) ” ) f_T = g_m /(2* %pi *( C_gs *10^ -15+ C_gd *10^ -15) ) ; disp ( f_T , ” f T ( Hz ) ” ) f_t = g_m /(2* %pi * C_L ) disp ( f_t , ” f t ( Hz ) ” ) disp ( ” The d a t a c a l c u l a t e d f o r I D = 100uA” ) I_D =100*10^ -6; // (A) WbyL =0.12* I_D ; // WbyL=(W/L ) disp ( WbyL *10^6 , ” (W/L ) ” ) g_m =8* I_D ; disp ( g_m , ” g m (A/V) ” ) r_o =2/ I_D ; disp ( r_o , ” r o ( ohm ) ” ) A_O = g_m * r_o ; disp ( A_O , ”A O (V/V) ” ) C_gs =(2/3) * WbyL *0.4*0.4*5.8+0.6* WbyL *0.4; disp ( C_gs , ” C g s ( fF ) ” ) C_gd =0.6* WbyL *0.4; disp ( C_gd , ” C gd ( fF ) ” ) f_T = g_m /(2* %pi *( C_gs *10^ -15+ C_gd *10^ -15) ) ; disp ( f_T , ” f T ( Hz ) ” ) f_t = g_m /(2* %pi * C_L ) disp ( f_t , ” f t ( Hz ) ” ) 48 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 disp ( ” The d a t a c a l c u l a t e d f o r I D = 1mA” ) I_D =1*10^ -3; // (A) WbyL =0.12* I_D ; // WbyL=(W/L ) disp ( WbyL *10^6 , ” (W/L ) ” ) g_m =8* I_D ; disp ( g_m , ” g m (A/V) ” ) r_o =2/ I_D ; disp ( r_o , ” r o ( ohm ) ” ) A_O = g_m * r_o ; disp ( A_O , ”A O (V/V) ” ) C_gs =(2/3) * WbyL *0.4*0.4*5.8+0.6* WbyL *0.4; disp ( C_gs , ” C g s ( fF ) ” ) C_gd =0.6* WbyL *0.4; disp ( C_gd , ” C gd ( fF ) ” ) f_T = g_m /(2* %pi *( C_gs *10^ -15+ C_gd *10^ -15) ) ; disp ( f_T , ” f T ( Hz ) ” ) f_t = g_m /(2* %pi * C_L ) disp ( f_t , ” f t ( Hz ) ” ) Scilab code Exa 6.4 Design of the circuit with output current 100uA 1 2 3 4 5 6 7 8 9 10 11 12 13 // Example 6 . 4 : D e s i g n o f t h e c i r c u i t w i t h o u t p u t c u r r e n t =100uA V_DD =3; // (V) I_REF =100*10^ -6; // (A) I_D1 =100*10^ -6; // (A) L =1*10^ -6; // (m) W =10*10^ -6; // (m) V_t =0.7; // (V) k_n =200*10^ -6; // k n=k ’ n (A/Vˆ 2 ) V_A =20; // V A=V’ A (V) V_OV = sqrt ( I_D1 *2* L /( k_n * W ) ) ; V_GS = V_t + V_OV ; R =( V_DD - V_GS ) / I_REF ; 49 14 V_Omin = V_OV ; 15 disp ( V_Omin , ” V min (V) ” ) 16 r_o2 = V_A / I_REF ; 17 disp ( r_o2 , ” r o 2 ( ohm ) ” ) 18 V_O = V_GS ; 19 deltaV_O =1; // Change i n V O (V) 20 deltaI_O = deltaV_O / r_o2 ; // C o r r e s p o n d i n g c h a n g e i n I O (A) 21 disp ( deltaI_O , ” The c o r r e s p o n d n g c h a n g e i n I O (A) ” ) Scilab code Exa 6.5 Determine 3dB frequency // Example 6 . 5 : D e t e r m i n e 3dB f r e q u e n c y // High f r e q u e n c y r e s p o n s e o f an a m p l i f i e r can be c h a r a c t e r i z e d by t h t r a n s f e r f u n c t i o n 3 // F H ( s ) =(1− s / 1 0 ˆ 5 ) /(1+ s / 1 0 ˆ 4 ) (1+ s / 4 ∗ 1 0 ˆ 4 ) 4 w_H =1/ sqrt (1/10^8+1/(16*10^8) -2/10^10) ; // w H=1/ s q r t ( 1 / w P1 ˆ2+1/ w P2 ˆ2 −2/ w Z1 ˆ2−2 w Z2 ˆ 2 ) 5 disp ( w_H , ”w H ( r a d / s ) ” ) 1 2 Scilab code Exa 6.6 To determine midband gain and upper 3dB frequency 1 2 3 4 5 6 7 8 9 10 // Example 6 . 6 : To d e t e r m i n e midband g a i n and u p p e r 3dB f r e q u e n c y R_in =420*10^3; // ( ohm ) R_sig =100*10^3; // ( ohm ) g_m =4*10^ -3; // ( mho ) R_L =3.33*10^3; // R L=R ’ L ( ohm ) C_gs =1*10^ -12; // F C_gd = C_gs ; A_M = - R_in * g_m * R_L /( R_in + R_sig ) disp ( A_M , ” Midband f r e q u e n c y g a i n A M (V/V) ” ) R_gs = R_in * R_sig /( R_in + R_sig ) ; 50 11 R = R_gs ; //R=R ’ 12 T_gs = C_gs * R_gs ; // Oen c i r c u i t 13 14 15 16 17 time c o n s t a n t o f C gs (s) R_gd = R + R_L + g_m * R_L * R ; T_gd = R_gd * C_gd ; // open c i r c u i t t i m e c o n s t a n t o f C gd ( s ) w_H =1/( T_gs + T_gd ) ; // u p p e r 3dB f r e q u e n c y w H f_H = w_H /(2* %pi ) ; disp ( f_H , ” Upper 3dB f r e q u e n c y f H ( Hz ) ” ) Scilab code Exa 6.7 Application of miller theorem 1 2 3 4 5 6 7 8 9 10 11 12 // Example 6 . 7 : A p p l i c a t i o n o f m i l l e r ’ s t h e o r e m // 6 . 7 a // By m i l l e r ’ s t h e o r e m Z =1000*10^3; // ( ohm ) K = -100; // (V/V) R_sig =10*10^3; // ( ohm ) Z_1 = Z /(1 - K ) ; disp ( Z_1 , ” Z 1 ( ohm ) ” ) Z_2 = Z /(1 -(1/ K ) ) ; disp ( Z_2 , ” Z 2 ( ohm ) ” ) VobyVsig = -100* Z_1 /( Z_1 + R_sig ) ; // VobyVsig =(V o / V sig ) 13 disp ( VobyVsig , ” ( V o / V s i g ) (V/V) ” ) 14 15 16 17 18 // 6 . 7 b // A p p l y i n g m i l l e r ’ s t h e o r e m f_3dB =1/(2* %pi *1.01*10^ -6) ; disp ( f_3dB , ” f 3 d B ( Hz ) ” ) Scilab code Exa 6.8 Analysis of CMOS CS amplifier 51 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 // Example 6 . 8 : A n a l y s i s o f CMOS CS a m p l i f i e r k_n =200*10^ -6; // (A/Vˆ 2 ) W =4*10^ -6; // (m) L =0.4*10^ -6; // (m) I_REF =100*10^ -6; // (A) V_An =20; // (A) I_D1 =0.1*10^ -3; // (A) V_Ap =10; // (V) V_DD =3; // (V) I_D2 =0.1*10^ -3; // (A) V_tp =0.6; // (V) V_tn =0.6; // (V) g_m1 = sqrt (2* k_n *( W / L ) * I_REF ) ; disp ( g_m1 , ” g m1 (A/V) ” ) r_o1 = V_An / I_D1 ; disp ( r_o1 , ” r o 1 ( ohm ) ” ) r_o2 = V_Ap / I_D2 ; disp ( r_o2 , ” r o 2 ( ohm ) ” ) A_v = - g_m1 * r_o1 * r_o2 /( r_o1 + r_o2 ) ; disp ( A_v , ” A v ( v /V) ” ) I_D =100*10^ -6; // (A) k_n =65*10^ -6; // (A/Vˆ 2 ) V_OV3 =0.53; // (V) V_SG = V_tp + V_OV3 ; disp ( V_SG , ”V SG (V) ” ) V_OA = V_DD - V_OV3 ; disp ( V_OA , ”V OA (V) ” ) V_IB =0.93; // (V) V_IA =0.88; // (V) disp ( V_IA , V_IB , ” C o o r d i n a t e s o f t h e e x t r e m i t i e s o f t h e a m p l i f i e r V IB and V IA ” ) deltavI = V_IB - V_IA ; // w i d t h o f a m p l i f i e r r e g i o n V_OB =0.33; // (V) deltavO = V_OB - V_OA ; // c o r r e s p o n d i n g o u t p u t r a n g e (V) deltavObydeltavI = - deltavO / deltavI ; // L a r g e s i g n a l v o l t a g e g a i n (V/V) disp ( deltavObydeltavI , ” L a r g e s i g n a l v o l t a g e g a i n (V/ V) ” ) 52 Scilab code Exa 6.9 Analysis of CMOS CS amplifier 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 // Example 6 . 9 : A n a l y s i s o f CMOS CS a m p l i f i e r // C o n s i d e r CMOS open s o u r c e a m p l i f i e r I_D =100*10^ -6; // (A) I_REF = I_D ; uC_n =387*10^ -6; // u n ∗ C ox=uC n (A/Vˆ 2 ) uC_p =86*10^ -6; // u n ∗ C ox=uC n (A/Vˆ 2 ) W =7.2*10^ -6; // (m) L =0.36*10^ -6; // (m) V_An =5*10^ -6; // (A) R_sig =10*10^3; // ( ohm ) V_OV = sqrt (2* I_D * L /( W * uC_n ) ) ; g_m = I_D /( V_OV /2) ; disp ( g_m , ” g m (A/V) ” ) r_o1 =5*0.36/(0.1*10^ -3) ; disp ( r_o1 , ” r o 1 ( ohm ) ” ) r_o2 =6*0.36/(.1*10^ -3) ; disp ( r_o2 , ” r o 2 ( ohm ) ” ) R_L = r_o1 * r_o2 /( r_o1 + r_o2 ) ; disp ( R_L , ” R L ( ohm ) ” ) A_m = - g_m * R_L ; disp ( A_m , ”A m (V/V) ” ) C_gs =20*10^ -15; // ( F ) C_gd =5*10^ -15; // ( F ) C_in = C_gs + C_gd *(1+ g_m * R_L ) ; // u s i n g m i l l e r equivalence disp ( C_in , ” C i n ( F ) ” ) f_H =1/(2* %pi * C_in * R_sig ) ; disp ( f_H , ” f H ( Hz ) ” ) R_gs =10*10^3; // ( ohm ) u s i n g open c i r c u i t time c o n s t a n t s methods R_L =9.82*10^3; // ( ohm ) R_gd = R_sig *(1+ g_m * R_L ) + R_L ; 53 disp ( R_gd , ” R gd ( ohm ) ” ) R_CL = R_L ; T_gs = C_gs * R_gs ; disp ( T_gs , ” T g s ( s ) ” ) T_gd = C_gd * R_gd ; disp ( T_gd , ” T gd ( s ) ” ) C_L =25*10^ -15; T_CL = C_L * R_CL ; disp ( T_CL , ”T CL ( s ) ” ) T_H = T_gs + T_gd + T_CL ; disp ( T_H , ”T H ( s ) ” ) f_H =1/(2* %pi * T_H ) ; // 3dB f r e q u e n c y disp ( f_H , ” f H ( Hz ) ” ) f_Z = g_m /(2* %pi * C_gd ) ; // f r e q u e n c y o f t h e z e r o disp ( f_Z , ” f Z ( Hz ) ” ) // D enom inat or p o l y n o m i a l p = poly ([1 1.16*10^ -9 0.0712*10^ -18] , ’ s ’ , ’ c o e f f ’ ) disp (p , ” De nomi nat or p o l y n o m i a l ” ) s = roots ( p ) ; f_P2 = s (2) /( -2* %pi ) ; f_P1 = s (1) /( -2* %pi ) disp ( f_P2 , f_P1 , ” The f r e q u e n c i e s f P 1 ( Hz ) and f P 2 ( Hz ) a r e f o u n d a s t h e r o o t s o f t h e d e n o m i n a t o r frequency ”) 53 f_H = f_P1 ; 54 disp ( f_H , ” A n o t h e r e s t i m a t e f o r f H ( Hz ) ” ) 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 Scilab code Exa 6.10 To determine AM ft fZ f3dB 1 // Example 6 . 1 0 : To d e t e r m i n e A M , f t , f Z , f 3 d B 2 // C o n s i d e r t h e CS a m p l i f i e r 3 A_M = -12.3; // (V/V) f o u n d from Example 6 . 9 4 C_L =25*10^ -15; // ( F ) 5 C_gd =5*10^ -15; // ( F ) 6 R_L =9.82*10^3; // ( F ) 54 7 g_m =1.25*10^ -3; // ( mho ) 8 f_H =1/(2* %pi *( C_L + C_gd ) * R_L ) ; // 3dB f r e q u e n c y 9 disp ( f_H , ” f H ( Hz ) ” ) 10 f_t = - A_M * f_H ; // Unity −g a i n f r e q u e n c y − s i g n t o make 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 gain p o s i t i v e as only magnitude i s c o n s i d e r e d disp ( f_t , ” f t ( Hz ) ” ) f_Z = g_m /(2* %pi * C_gd ) ; // f r e q u e n c y o f t h e z e r o disp ( f_Z , ” f Z ( Hz ) ” ) I_D =400*10^ -6; // I D must be q u a d r u p l e d by c h a n g i n g I REF t o 400 uF V_OV =0.32; g_m = I_D /( V_OV /2) ; disp ( g_m , ” g m (A/V) ” ) r_o1 =5*0.36/(0.4*10^ -3) ; disp ( r_o1 , ” r o 1 ( ohm ) ” ) r_o2 =6*0.36/(0.4*10^ -3) ; disp ( r_o2 , ” r o 2 ( ohm ) ” ) R_L =( r_o1 * r_o2 ) /( r_o1 + r_o2 ) ; disp ( R_L , ” R L ( ohm ) ” ) A_M = - g_m * R_L ; disp ( A_M , ”A M (V/V) ” ) f_H =1/(2* %pi *( C_L + C_gd ) * R_L ) ; disp ( f_H , ” f H ( Hz ) ” ) f_t = f_H * - A_M ; // U n i t y g a i n f r e q u e n c y disp ( f_t , ” f t ( Hz ) ” ) Scilab code Exa 6.11 Avo Rin Rout Gi Gis Gv fH 1 2 3 4 5 6 7 // Example 6 . 1 1 : Avo Rin Rout Gi G i s Gv fH // C o n s i d e r t h e common g a t e a m p l i f i e r g_m =1.25*10^ -3; // (A/V) r_o =18000; // ( ohm ) I_D =100*10^ -6; // (A) X =0.2; R_S =10*10^3; // ( ohm ) 55 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 R_L =100*10^3; // ( ohm ) C_gs =20*10^ -15; // ( F ) C_gd =5*10^ -15; // ( F ) C_L =0; // ( F ) gmplusgmb = g_m +0.2* g_m ; // gmplusgmb=g m+g mb A_vo =1+( gmplusgmb ) * r_o ; disp ( A_vo , ” A vo (V/V) ” ) R_in =( r_o + R_L ) / A_vo ; disp ( R_in , ” R i n ( ohm ) ” ) R_out = r_o + A_vo * R_S ; disp ( R_out , ”ohm” ) G_v = A_vo * R_L /( R_L + R_out ) ; disp ( G_v , ” G v (V/V) ” ) G_is = A_vo * R_S / R_out ; disp ( G_is , ” G i s (A/A) ” ) G_i = G_is * R_out /( R_out + R_L ) disp ( G_i , ” G i (A/A) ” ) R_gs = R_S * R_in /( R_S + R_in ) ; R_gd = R_L * R_out /( R_L + R_out ) ; T_H = C_gs * R_gs + C_gd * R_gd ; f_H =1/(2* %pi * T_H ) ; disp ( f_H , ” f H ( Hz ) ” ) Scilab code Exa 6.12 Comparison between Cascode amplifier and CS amplif 1 2 3 4 5 6 7 8 // Example 6 . 1 2 : Comparison b e t w e e n C a s c o d e a m p l i f i e r and CS a m p l i f i e r // 6 . 1 2 a // CS a m p l i f i e r g_m =1.25*10^ -3; r_o =20*10^3; R_L = r_o * r_o /( r_o + r_o ) ; C_gs =20*10^ -15; R_sig =10000; 56 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 C_gd =5*10^ -15; C_L =5*10^ -15; C_db =5*10^ -15; A_o = g_m * r_o ; disp ( A_o , ” A o (V/V) ” ) A_v = - A_o /2; disp ( A_v , ” A v (V/V) ” ) T_H = C_gs * R_sig + C_gd *[(1+ g_m * R_L ) * R_sig + R_L ]+( C_L + C_db ) * R_L ; disp ( T_H , ”T H ( s ) ” ) f_H =1/(2* %pi * T_H ) ; disp ( f_H , ” f H ( Hz ) ” ) f_t = - A_v * f_H ; disp ( f_t , ” f t ( Hz ) ” ) // C a s c o d e a m p l i f i e r g_m1 =1.25*10^ -3; r_o1 =20000; X =0.2; r_o2 =20000; R_L =20000; A_o1 = g_m1 * r_o1 ; disp ( A_o1 , ” A o1 (V/V) ” ) gm2plusgmb2 = g_m1 + X * g_m ; A_vo2 =1+( gm2plusgmb2 ) * r_o2 ; disp ( A_vo2 , ” A vo2 (V/V) ” ) R_out1 = r_o1 ; R_in2 =1/( gm2plusgmb2 ) + R_L / A_vo2 ; disp ( R_in2 , ” R i n 2 ( ohm ) ” ) R_d1 = R_out1 * R_in2 /( R_out1 + R_in2 ) ; disp ( R_d1 , ” R d1 ( ohm ) ” ) R_out = r_o2 + A_vo2 * r_o1 ; disp ( R_out , ” R out ( ohm ) ” ) vo1byvi = - g_m1 * R_d1 ; disp ( vo1byvi , ” ( v o 1 / v i ) (V/V) ” ) A_v = - A_o1 * A_vo2 * R_L /( R_L + R_out ) ; disp ( A_v , ” A v (V/V) ” ) C_gs1 =20*10^ -15; R_sig =10*10^3; 57 46 gm1Rd1 =1.5; 47 C_gd1 =5*10^ -15; 48 C_gs2 =20*10^ -15; 49 C_db2 =5*10^ -15; 50 C_gd2 =5*10^ -15; 51 C_db1 =5*10^ -15; 52 T_H = R_sig *[ C_gs1 + C_gd1 *(1+ gm1Rd1 ) ]+ R_d1 *( C_gd1 + C_db1 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 + C_gs2 ) +(( R_L * R_out ) /( R_L + R_out ) ) *( C_L + C_db2 + C_gd2 ) ; f_H =1/(2* %pi * T_H ) ; disp ( T_H , ”T H ( s ) ” ) disp ( f_H , ” f H ( Hz ) ” ) f_t = - A_v * f_H ; disp ( f_t , ” f t ( Hz ) ” ) // 6 . 1 2 b // CS a m p l i f i e r A_v = -12.5; R_L =10*10^3; disp ( A_v , ” A v (V/V) ” ) T_H =( C_gd + C_L + C_db ) * R_L ; disp ( T_H , ”T H ( s ) ” ) f_H =1/(2* %pi * T_H ) ; disp ( f_H , ”F H ( Hz ) ” ) f_t = - A_v * f_H ; disp ( f_t , ” f t ( Hz ) ” ) // C a s c o d e a m p l i f i e r R_L =640*10^3; R_out =640*10^3; R_out1 =20*10^3; A_v = - A_o1 * A_vo2 * R_L /( R_L + R_out ) ; disp ( A_v , ” A v (V/V) ” ) R_in2 =1/ gm2plusgmb2 + R_L / A_vo2 ; disp ( R_in2 , ” R i n 2 ( ohm ) ” ) R_d1 = R_in2 * R_out1 /( R_in2 + R_out1 ) ; disp ( R_d1 , ” R d1 ( ohm ) ” ) T_H = R_d1 *( C_gd1 + C_db1 + C_gs2 ) +( R_L * R_out /( R_L + R_out ) ) *( C_L + C_gd2 + C_db2 ) ; disp ( T_H , ”T H ( s ) ” ) 58 81 f_H =1/(2* %pi * T_H ) ; 82 disp ( f_H , ” f H ( Hz ) ” ) 83 f_t = - A_v * f_H ; 84 disp ( f_t , ” f t ( Hz ) ” ) Scilab code Exa 6.13 Analysis of CC CE amplifier 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 // Example 6 . 1 3 : A n a l y s i s o f CC−CE a m p l i f i e r // C o n s i d e r a CC−CE a m p l i f i e r // a t an e m i t t e r b i a s c u r r e n t o f 1mA f o r Q 1 and Q 2 g_m =40*10^ -3; // (A/V) r_e =25; // ( ohm ) B =100; // b e t a v a l u e C_u =2*10^ -12; // ( F ) f_T =400*10^6 // ( Hz ) r_pi = B / g_m ; disp ( r_pi , ” r p i ( ohm ) ” ) C_pi = g_m /(2* %pi * f_T ) - C_u ; disp ( C_pi , ” C p i ( F ) ” ) R_in2 =2500; // ( ohm ) r_pi2 =2500; // ( ohm ) r_pi1 =2500; // ( ohm ) r_e1 =0.025; // ( ohm ) B_1 =100; // b e t a v a l u e R_in =( B_1 +1) *( r_e1 + R_in2 ) ; disp ( R_in , ” R i n ( ohm ) ” ) R_sig =4*10^3; // ( ohm ) R_L =4000; // ( ohm ) Vb1byVsig = R_in /( R_in + R_sig ) ; // ( V b1 / V s i g ) disp ( Vb1byVsig , ” ( V b1 / V s i g ) (V/V) ” ) Vb2plusVb1 = R_in2 /( R_in2 + r_e1 ) ; // ( V b2 / V b1 ) disp ( Vb2plusVb1 , ” ( V b2 / V b1 ) (V/V) ” ) VobyVb2 = - g_m * R_L ; // ( V o / V b2 ) disp ( VobyVb2 , ” ( V o / V b2 ) (V/V) ” ) A_M = VobyVb2 * Vb2plusVb1 * Vb2plusVb1 ; 59 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 disp ( A_M , ”A M (V/V) ” ) R_u1 = R_sig * R_in /( R_sig + R_in ) ; disp ( R_u1 , ” R u1 ( ohm ) ” ) R_pi1 =( R_sig + R_in2 ) /(1+( R_sig / r_pi1 ) +( R_in2 / r_e1 ) ) ; // C p i 1 s e e s a r e s i s t a n c e R p i 1 disp ( R_pi1 , ” R p i 1 ( ohm ) ” ) R_out1 =25+4000/101; R_pi2 = R_in2 * R_out1 /( R_in2 + R_out1 ) ; // C p i 2 s e e s a r e s i s t a n c e R pi2 disp ( R_pi2 , ” R p i 2 ( ohm ) ” ) R_u2 =(1+ g_m * R_L ) * R_pi2 + R_L ; disp ( R_u2 , ” R u2 ( ohm ) ” ) C_u1 =2*10^ -12; // ( F ) R_u1 =3940; // ( ohm ) C_pi1 =13.9*10^ -12; // ( F ) C_u2 =2*10^ -12; // ( F ) C_pi2 =13.9*10^ -12; // ( F ) T_H = C_u1 * R_u1 + C_pi1 * R_pi1 + C_u2 * R_u2 + C_pi2 * R_pi2 ; disp ( T_H , ”T H ( s ) ” ) f_H =1/(2* %pi * T_H ) ; disp ( f_H , ” f H ( Hz ) ” ) A_M = r_pi *( - g_m * R_L ) /( r_pi + R_sig ) ; disp ( A_M , ”A M (V/V) ” ) R_pi = r_pi * R_sig /( r_pi + R_sig ) ; disp ( R_pi , ” R p i ( ohm ) ” ) R_u =(1+ g_m * R_L ) * R_pi + R_L ; disp ( R_u , ” R u ( ohm ) ” ) T_H = C_pi * R_pi + C_u * R_u ; disp ( T_H , ”T H ( s ) ” ) f_H =1/(2* %pi * T_H ) ; disp ( f_H , ” f H ( Hz ) ” ) Scilab code Exa 6.14 To determine required resistor values 60 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 // Example 6 . 1 4 : To d e t e r m i n e r e q u i r e d r e s i s t o r values // The c i r c u i t s g e n e r a t e a c o n s t a n t c u r r e n t I D =10 uA which o p e r a t e a t a s u p p l y o f 10V V_BE =0.7; // (V) V_t =0.025; // (V) I_REF =10*10^ -6; // (A) V_DD =10; // (V) I =1*10^ -3; // (A) V_BE1 = V_BE + V_t * log ( I_REF / I ) ; // V o l t a g e d r o p a c r o s s Q 1 disp ( V_BE1 , ”V BE1 (V) ” ) R_1 =( V_DD - V_BE1 ) /( I_REF ) ; // For t h e W i d l a r c i r c u i t we d e c i d e I REF=1mA and V BE1 =0.7V disp ( R_1 , ” R 1 ( ohm ) ” ) R_2 =( V_DD - V_BE ) / I ; disp ( R_2 , ” R 2 ( ohm ) ” ) R_3 =( V_t / I_REF ) * log ( I / I_REF ) ; disp ( R_3 , ” R 3 ( ohm ) ” ) 61 Chapter 7 Differential and multistage amplifier Scilab code Exa 7.1 Analysis of differential amplifier 1 2 3 4 5 6 7 8 9 10 11 12 13 // Example 7 . 1 A n a l y s i s o f d i f f e r e n t i a l // C o n s i d e r t h e d i f f e r e n t i a l a m p l i f i e r B =100; // b e t a v a l u e amplifier // 7 . 1 a V_T =0.025; // (V) I_E =0.0005; // (A) R_E =150; // ( ohm ) r_e1 = V_T / I_E ; // e m i t t e r r e s i s t a n c e ( ohm ) r_e2 = r_e1 ; // e m i t t e r r e s i s t a n c e ( ohm ) r_e = r_e1 ; R_id =2*( B +1) *( r_e + R_E ) ; disp ( R_id , ” The i n p u t d i f f e r e n t i a l r e s i s t a n c e R i d ( ohm ) ” ) 14 15 // 7 . 1 b 16 R_id =40000; // ( ohm ) 17 R_sig =5000; // ( ohm ) 18 R_C =10000; // ( ohm ) 62 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 R_E =150; // ( ohm ) A_v = R_id /( R_id + R_sig ) ; // A v= v o / v s i g (V/V) A_V =2* R_C /(2*( r_e + R_E ) ) ; // A V= v o / v i d (V/ v ) A_d = A_v * A_V ; // A d=v o / v s i g (V/V) disp ( A_d , ” O v e r a l l d i f f e r e n t i a l v o l t a g e g a i n (V/V) ” ) // 7 . 1 c R_EE =200000; // ( ohm ) deltaR_C =0.02* R_C ; // i n t h e w o r s t c a s e A_cm = R_C * deltaR_C /(2* R_EE * R_C ) disp ( A_cm , ” Worst c a s e common mode g a i n (V/V) ” ) // 7 . 1 d CMRR =20* log10 ( A_d / A_cm ) disp ( CMRR , ”CMRR i n dB” ) // 7 . 1 e r_o =200000; // ( ohm ) R_icm =( B +1) *( R_EE * r_o /2) /( R_EE + r_o /2) ; disp ( R_icm , ” I n p u t common mode r e s i s t a n c e ( ohm ) ” ) Scilab code Exa 7.2 Analysis of Active loaded MOS differential amplifi 1 2 3 4 5 6 7 8 9 10 11 // Example 7 . 2 : A n a l y s i s o f A c t i v e l o a d e d MOS differential amplifier W =7.2*10^ -6; // (m) L =0.36*10^ -6; // (m) C_gs =29*10^ -15; // ( F ) C_gd =5*10^ -15; // ( F ) C_db =5*10^ -15; // ( F ) uC_n =387*10^ -6; // uC n=u n C o x (A/Vˆ 2 ) uC_p =86*10^ -6; // uC p=u p C o x (A/Vˆ 2 ) V_an =5; // V an=V’ An (V/um) (V) V_ap =6; // V ap=V’ Ap (V/um) (V) I =0.2*10^ -3; // (A) 63 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 R_SS =25000; // ( ohm ) C_SS =0.2*10^ -12; // ( F ) C_S =25*10^ -15; // ( F ) K_n = uC_n * W / L ; I_D =100*10^ -6; // b i a s c u r r e n t (A) V_OV = sqrt (2* I_D / K_n ) ; g_m = I / V_OV ; g_m1 = g_m ; g_m2 = g_m ; r_o1 = V_an *0.36/(0.1*10^ -3) ; r_o2 = r_o1 ; K_p = uC_p * W / L ; V_OV34 = sqrt (2* I_D / K_p ) ; // V OV3 , 4 g_m3 =2*0.1*10^ -3/ V_OV34 ; g_m4 = g_m3 ; r_o3 = V_ap *0.36/(0.1*10^ -3) ; r_o4 = r_o3 ; A_d = g_m *( r_o2 * r_o4 ) /( r_o2 + r_o4 ) ; disp ( A_d , ” A d (V/V) ” ) A_cm = -1/(2* g_m3 * R_SS ) ; disp ( A_cm , ”A cm (V/V) ” ) CMRR =20* log10 ( - A_d / A_cm ) ; // n e g a t i v e s i g n t o make A cm p o s i t i v e disp ( CMRR , ”CMRR i n dB” ) C_gd1 =5*10^ -15; // ( F ) C_db1 =5*10^ -15; // ( F ) C_db3 =5*10^ -15; // ( F ) C_gs3 =20*10^ -15; // ( F ) C_gs4 =20*10^ -15; // ( F ) C_m = C_gd1 + C_db1 + C_db3 + C_gs3 + C_gs4 ; C_gd2 =5*10^ -15; // ( F ) C_db2 =5*10^ -15; // ( F ) C_gd4 =5*10^ -15; // ( F ) C_db4 =5*10^ -15; // ( F ) C_x =25*10^ -15; // ( F ) C_L = C_gd2 + C_db2 + C_gd4 + C_db4 + C_x ; disp ( ” p o l e s and z e r o e s o f A d ” ) R_o = r_o2 * r_o4 /( r_o2 + r_o4 ) 64 49 f_p1 =1/(2* %pi * C_L * R_o ) ; 50 disp ( f_p1 , ” f p 1 ( Hz ) ” ) 51 f_p2 = g_m3 /(2* %pi * C_m ) ; 52 disp ( f_p2 , ” f p 2 ( Hz ) ” ) 53 f_Z =2* f_p2 ; 54 disp ( f_Z , ” f Z ( Hz ) ” ) 55 disp ( ” Dominant p o l e o f CMRR i s a t l o c a t i o n o f commom −mode g a i n z e r o ” ) 56 f_Z =1/(2* %pi * C_SS * R_SS ) ; 57 disp ( f_Z , ” f Z ( Hz ) ” ) Scilab code Exa 7.3 To determine all parameters for different transist 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 // Example 7 . 3 : To d e t e r m i n e a l l p a r a m e t e r s f o r different transistor I_REF =90*10^ -6; // (A) V_tn =0.7; // (V) V_tp =0.8; // Magnitude i s c c o n s i d e r e d uC_n =160*10^ -6; // uC n=u n ∗ C ox uC_p =40*10^ -6; // uC p=u p ∗ C ox V_A =10; // (V) V_DD =2.5; // (V) V_SS =2.5; // (V) L =0.8*10^ -6; // (m) r_o2 =222; // ( ohm ) r_o4 =222; // ( ohm ) g_m1 =0.3; // ( mho ) A_1 = - g_m1 * r_o2 * r_o4 /( r_o2 + r_o4 ) ; disp ( A_1 , ” A 1 (V/V) ” ) r_o6 =111; // ( ohm ) r_o7 =111; // ( ohm ) g_m6 =0.6; // ( mho ) A_2 = - g_m6 * r_o6 * r_o7 /( r_o6 + r_o7 ) ; disp ( A_2 , ” A 2 (V/V) ” ) disp ( ” For Q 1 ” ) 65 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 W =20*10^ -6; // (m) I_D = I_REF /2; // (A) disp ( I_D , ” I D (A) ” ) K_p = uC_p * W / L ; V_OV = sqrt (2* I_D / K_p ) ; disp ( V_OV , ”V OV (V) ” ) V_GS = V_tp + V_OV ; disp ( V_GS , ”V GS (V) ” ) g_m =2* I_D / V_OV ; disp ( g_m , ” g m (A/V) ” ) r_o = V_A / I_D ; disp ( r_o , ” r o ( ohm ) ” ) disp ( ” For Q 2 ” ) W =20*10^ -6; // (m) I_D = I_REF /2; // (A) disp ( I_D , ” I D (A) ” ) K_p = uC_p * W / L ; V_OV = sqrt (2* I_D / K_p ) ; disp ( V_OV , ”V OV (V) ” ) V_GS = V_tp + V_OV ; disp ( V_GS , ”V GS (V) ” ) g_m =2* I_D / V_OV ; disp ( g_m , ” g m (A/V) ” ) r_o = V_A / I_D ; disp ( r_o , ” r o ( ohm ) ” ) disp ( ” For Q 3 ” ) W =5*10^ -6; // (m) I_D = I_REF /2; // (A) disp ( I_D , ” I D (A) ” ) K_n = uC_n * W / L ; V_OV = sqrt (2* I_D / K_n ) ; disp ( V_OV , ”V OV (V) ” ) V_GS = V_tn + V_OV ; disp ( V_GS , ”V GS (V) ” ) g_m =2* I_D / V_OV ; disp ( g_m , ” g m (A/V) ” ) r_o = V_A / I_D ; disp ( r_o , ” r o ( ohm ) ” ) 66 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 disp ( ” For Q 4 ” ) W =5*10^ -6; // (m) I_D = I_REF /2; // (A) disp ( I_D , ” I D (A) ” ) K_n = uC_n * W / L ; V_OV = sqrt (2* I_D / K_n ) ; disp ( V_OV , ”V OV (V) ” ) V_GS = V_tn + V_OV ; disp ( V_GS , ”V GS (V) ” ) g_m =2* I_D / V_OV ; disp ( g_m , ” g m (A/V) ” ) r_o = V_A / I_D ; disp ( r_o , ” r o ( ohm ) ” ) disp ( ” For Q 5 ” ) W =40*10^ -6; // (m) I_D = I_REF ; // (A) disp ( I_D , ” I D (A) ” ) K_p = uC_p * W / L ; V_OV = sqrt (2* I_D / K_p ) ; disp ( V_OV , ”V OV (V) ” ) V_GS = V_tp + V_OV ; disp ( V_GS , ”V GS (V) ” ) g_m =2* I_D / V_OV ; disp ( g_m , ” g m (A/V) ” ) r_o = V_A / I_D ; disp ( r_o , ” r o ( ohm ) ” ) disp ( ” For Q 6 ” ) W =10*10^ -6; // (m) I_D = I_REF ; disp ( I_D , ” I D (A) ” ) K_n = uC_n * W / L ; V_OV = sqrt (2* I_D / K_n ) ; disp ( V_OV , ”V OV (V) ” ) V_GS = V_tn + V_OV ; disp ( V_GS , ”V GS (V) ” ) g_m =2* I_D / V_OV ; disp ( g_m , ” g m (A/V) ” ) r_o = V_A / I_D ; 67 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 disp ( r_o , ” r o ( ohm ) ” ) disp ( ” For Q 7 ” ) W =40*10^ -6; // (m) I_D = I_REF ; disp ( I_D , ” I D (A) ” ) K_p = uC_p * W / L ; V_OV = sqrt (2* I_D / K_p ) ; disp ( V_OV , ”V OV (V) ” ) V_GS = V_tp + V_OV ; disp ( V_GS , ”V GS (V) ” ) g_m =2* I_D / V_OV ; disp ( g_m , ” g m (A/V) ” ) r_o = V_A / I_D ; disp ( r_o , ” r o ( ohm ) ” ) disp ( ” For Q 8 ” ) W =40*10^ -6; // (m) I_D = I_REF ; disp ( I_D , ” I D (A) ” ) K_p = uC_p * W / L ; V_OV = sqrt (2* I_D / K_p ) ; disp ( V_OV , ”V OV (V) ” ) V_GS = V_tp + V_OV ; disp ( V_GS , ”V GS (V) ” ) g_m =2* I_D / V_OV ; disp ( g_m , ” g m (A/V) ” ) r_o = V_A / I_D ; disp ( r_o , ” r o ( ohm ) ” ) A_O = A_1 * A_2 ; disp (20* log10 ( A_O ) ,” The dc open l o o p g a i n i n dB” ) v_ICMmin = -2.5+1; disp ( v_ICMmin , ” Lower l i m i t o f i n p u t common−mode (V) ” ) v_ICMmax =2.2 -1.1; disp ( v_ICMmax , ” Upper l i m i t o f i n p u t common−mode (V) ” ) v_Omax = V_DD - V_OV ; disp ( v_Omax , ” H i g h e s t a l l o w a b l e o u t p u t v o l t a g e (V) ” ) v_Omin = - V_SS + V_OV ; 68 134 disp ( v_Omin , ” Lowest a l l o w a b l e o u t p u t v o l t a g e (V) ” ) Scilab code Exa 7.5 Analysis of given circuit 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 // Example 7 . 5 : A n a l y s i s o f g i v e n c i r c u i t B =100; // b e t a v a l u e I_E =0.2510^ -3; // (A) R_1 =20000; // ( ohm ) R_2 =20000; // ( ohm ) R_3 =3000; // ( ohm ) R_4 =2300; // ( ohm ) R_5 =15700; // ( ohm ) R_6 =3000; // ( ohm ) r_e1 =25/0.25; // ( ohm ) r_e2 = r_e1 ; // ( ohm ) r_pi1 =( B +1) * r_e1 ; r_pi2 =( B +1) * r_e2 ; R_id = r_pi1 + r_pi2 ; disp ( R_id , ” I n p u t d i f f e r e n t i a l r e s i s t a n c e ( ohm ) ” ) I_E =1*10^ -3; r_e4 =25/1; r_e5 = r_e4 ; r_pi4 =( B +1) * r_e4 ; r_pi5 =( B +1) * r_e5 ; R_i2 = r_pi4 + r_pi5 ; disp ( R_i2 , ” I n p u t r e s i s t a n c e o f t h e s e c o n d s t a g e R i 2 ( ohm ) ” ) A_1 =( R_i2 *( R_1 + R_2 ) /(( R_i2 + R_1 + R_2 ) *( r_e1 + r_e2 ) ) ) disp ( A_1 , ” V o l t a g e g a i n o f t h e f i r s t s t a g e (V/V) ” ) r_e7 =25/1; R_i3 =( B +1) *( R_4 + r_e7 ) ; disp ( R_i3 , ” I n p u t r e s i s t a n c e o f t h e t h i r d s t a g e R i 3 ( ohm ) ” ) A_2 =( - R_3 * R_i3 ) /(( R_3 + R_i3 ) *( r_e4 + r_e5 ) ) ; disp ( A_2 , ” V o l t a g e g a i n o f t h e s e c o n d s t a g e (V/V) ” ) 69 30 31 32 33 34 35 36 37 38 39 40 41 r_e8 =25/5; R_i4 =( B +1) *( r_e8 + R_6 ) ; disp ( R_i4 , ” I n p u t r e s i s t a n c e o f t h e t h i r d s t a g e R i 2 ( ohm ) ” ) A_3 =( - R_5 * R_i4 ) /(( R_5 + R_i4 ) *( r_e7 + R_4 ) ) ; disp ( A_3 , ” V o l t a g e g a i n o f t h e t h i r d s t a g e (V/V) ” ) A_4 = R_6 /( R_6 + r_e8 ) ; disp ( A_4 , ” V o l t a g e g a i n o f t h e f o u r t h s t a g e (V/V) ” ) A = A_1 * A_2 * A_3 * A_4 ; // A=v o / v i d (V/V) disp (A , ” O v e r a l l o u t p u t g a i n (V/V) ” ) disp (20* log10 ( A ) ,” O v e r a l l o u t p u t g a i n i n dB” ) R_o = R_6 *( r_e8 + R_5 /( B +1) ) /( R_6 + r_e8 + R_5 /( B +1) ) disp ( R_o , ” Output r e s i s t a n c e ( ohm ) ” ) 70 Chapter 8 Feedback Scilab code Exa 8.1 Analysis of op amp connected in an inverting conf 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 // Example 8 . 1 : A n a l y s i s o f op amp c o n n e c t e d i n an inverting configuration // By i n s p e c t i o n we can w r i t e down t h e e x p r e s s i o n s f o r A, B , c l o s e d l o o p g a i n , t h e i n p u t r e s i s t a n c e and t h e o u t p u t r e s i s t a n c e u =10^4; // ( ohm ) R_id =100*10^3; // ( ohm ) r_o =1000; // ( ohm ) R_L =2000; // ( ohm ) R_1 =1000; // ( ohm ) R_2 =10^6; // ( ohm ) R_S =10000; // ( ohm ) A = u *( R_L *( R_1 + R_2 ) /( R_L + R_1 + R_2 ) ) * R_id /((( R_L *( R_1 + R_2 ) ) /( R_L + R_1 + R_2 ) + r_o ) *( R_id + R_S +( R_1 * R_2 ) /( R_1 + R_2 ) ) ) disp (A , ” V o l t a g e g a i n w i t h o u t f e e d b a c k (V/V) ” ) B = R_1 /( R_1 + R_2 ) ; // Beta v a l u e disp (B , ” Beta v a l u e ” ) A_f = A /(1+ A * B ) ; disp ( A_f , ” V o l t a g e g a i n w i t h f e e d b a c k (V/V) ” ) R_i = R_S + R_id +( R_1 * R_2 /( R_1 + R_2 ) ) // I n p u t r e s i s t a n c e 71 17 18 19 20 21 22 23 of the A c i r c u i t in f i g 8.12 a of textbook R_if = R_i *7; R_in = R_if - R_S ; disp ( R_in , ” I n p u t r e s i s t a n c e ( ohm ) ” ) R_o =1/(1/ r_o +1/ R_L +1/( R_1 + R_2 ) ) ; R_of = R_o /(1+ A * B ) ; R_out = R_of * R_L /( R_L - R_of ) ; disp ( R_out , ” t h e o u t p u t r e s i s t a n c e ( ohm ) ” ) Scilab code Exa 8.2 Feedback triple 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 // Example 8 . 2 : Feedback t r i p l e // C o n s i d e r t h e g i v e n t h r e e s t a g e s e r i e s − s e r i e s feedback h_fe =100; g_m2 =40*10^ -3; // (A/V) r_e1 =41.7; // ( ohm ) a_1 =0.99; // a l p h a v a l u e R_C1 =9000; // ( ohm ) R_E1 =100; // ( ohm ) R_F =640; // ( ohm ) R_E2 =100; // ( ohm ) r_pi2 = h_fe / g_m2 ; R_C2 =5000; // ( ohm ) r_e3 =6.25; // ( ohm ) R_C3 =800; // ( ohm ) // F i r s t s t a g e g a i n A 1=V c1 / V i A_1 = - a_1 * R_C1 * r_pi2 /(( R_C1 + r_pi2 ) *( r_e1 +(( R_E1 *( R_F + R_E2 ) ) /( R_E1 + R_F + R_E2 ) ) ) ) disp ( A_1 , ” The v o l t a g e g a i n o f t h e f i r s t s t a g e (V/V) ” ) // Gain o f t h e s e c o n d s t a g e A 2=Vc2 / V c1 A_2 = - g_m2 *{( R_C2 *( h_fe +1) /( R_C2 + h_fe +1) ) *[ r_e3 +( R_E2 *( R_F + R_E1 ) ) /( R_E2 + R_F + R_E1 ) ]} disp ( A_2 , ” The s e c o n d s t a g e g a i n (V/V) ” ) 72 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 // T h i r d s t a g e g a i n A 3 I O / V i A_3 =1/( r_e3 +( R_E2 *( R_F + R_E1 ) /( R_E2 + R_F + R_E1 ) ) ) ; disp ( A_3 , ” The t h i r d s t a g e g a i n (V/V) ” ) A = A_1 * A_2 * A_3 ; // combined g a i n disp (A , ” Combined g a i n (V/V) ” ) B = R_E1 * R_E2 /( R_E2 + R_F + R_E1 ) ; disp (B , ” Beta v a l u e ” ) A_f = A /(1+ A * B ) ; disp ( A_f , ” C l o s e d l o o p g a i n (A/V) ” ) A_v = - A_f * R_C3 ; // V o l t a g e g a i n disp ( A_v , ” V o l t a g e g a i n (V/V) ” ) R_i =( h_fe +1) *( r_e1 +( R_E1 *( R_F + R_E2 ) ) /( R_E1 + R_F + R_E2 ) ); R_if = R_i *(1+ A * B ) ; disp ( R_if , ” I n p u t r e s i s t a n c e ( ohm ) ” ) R_o =( R_E2 *( R_F + R_E1 ) /( R_F + R_E1 + R_E2 ) ) + r_e3 + R_C2 /( h_fe +1) ; R_of = R_o *(1+ A * B ) ; disp ( R_of , ” Output v o l t a g e ( ohm ) ” ) r_o =25000; // ( ohm ) g_m3 =160*10^ -3; // ( mho ) r_pi3 =625; // ( ohm ) R_out = r_o +(1+ g_m3 * r_o ) * R_of * r_pi3 /( R_of + r_pi3 ) ; disp ( R_out , ” R out ( ohm ) ” ) Scilab code Exa 8.3 Small signal analysis 1 2 3 4 5 6 7 8 // Example 8 . 3 : S m a l l s i g n a l a n a l y s i s B =100; // b e t a v a l u e I_B =0.015*10^ -3; // (A) I_C =1.5*10^ -3; // (A) V_C =4.7; // (V) g_m =40*10^ -3; R_f =47000; R_S =10000; 73 9 R_C =4700; 10 r_pi = B / g_m ; 11 A = -358.7*10^3; // V o / I i = −g m ( R f | | R C ) ( R S | | R F | | 12 13 14 15 16 17 18 19 20 21 r pi ) R_i =1400; // R i=R S | | R f | | r p i ( ohm ) R_o = R_C * R_f /( R_C + R_f ) ; B = -1/ R_f ; A_f = A /(1+ A * B ) ; // V o / I s A_v = A_f / R_S ; // V o / V s disp ( A_v , ” The g a i n (V/V) ” ) R_if = R_i /(1+ A * B ) ; disp ( R_if , ” R i f ( ohm ) ” ) R_of = R_o /(1+ A * B ) ; disp ( R_of , ” R o f ( ohm ) ” ) Scilab code Exa 8.4 Small signal analysis 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 // Example 8 . 4 : S m a l l s i g n a l a n a l y s i s R_S =10*10^3; // ( ohm ) R_B1 =100*10^3; // ( ohm ) R_B2 =15*10^3; // ( ohm ) R_C1 =10*10^3; // ( ohm ) R_E1 =870; // ( ohm ) R_E2 =3400; // ( ohm ) R_C2 =8000; // ( ohm ) R_L =1000; // ( ohm ) R_f =10000; // ( ohm ) B =100; // b e t a v a l u e V_A =75; // (V) A = -201.45 // I o / I i (A/A) R_i =1535; // ( ohm ) R_o =2690; // ( ohm ) B = - R_E2 /( R_E2 + R_f ) ; R_if = R_i /(1+ A * B ) ; disp ( R_if ) 74 19 R_in =1/((1/ R_if ) -(1/ R_S ) ) ; 20 disp ( R_in , ” R i n ( ohm ) ” ) 21 A_f = A /(1+ A * B ) ; // I o / I S 22 gain = R_C2 * A_f /( R_C2 + R_L ) ; // I o / I S 23 disp ( gain , ” I o / I S (A/A) ” ) 24 R_of = R_o *(1+ A * B ) ; // ( ohm ) 25 r_o2 =75/0.0004; // ( ohm ) 26 g_m2 =0.016; // (A/V) 27 r_pi2 =6250; // ( ohm ) 28 R_out = r_o2 *[1+ g_m2 *( r_pi2 * R_of /( r_pi2 + R_of ) ) ] 29 disp ( R_out , ” R out ( ohm ) ” ) 75 Chapter 9 Operational amplifier and data converter circuits Scilab code Exa 9.1 Design of two stage CMOS op amp 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 // Example 9 . 1 D e s i g n o f two−s t a g e CMOS op−amp A_v =4000; // (V/V) V_A =20; // (V) k_p =80*10^ -6; // k ’ n=k n (A/Vˆ 2 ) k_n =200*10^ -6; // k ’ p=k P (A/Vˆ 2 ) V_SS =1.65; // (V) V_DD =1.65; // (V) V_tn =0.5; // (V) V_tp =0.5; // (V) C_1 =0.2*10^ -12; // ( F ) C_2 =0.8*10^ -12; // ( F ) I_D =100*10^ -6; // (A) V_OV = sqrt ( V_A ^2/ A_v ) ; WbyL_1 = I_D *2/( V_OV ^2* k_p ) ; // WbyL 1=(W/L ) 1 disp ( WbyL_1 , ” R e q u i r e d (W/L ) r a t i o f o r Q 1 ” ) WbyL_2 = WbyL_1 ; // WbyL 2=(W/L ) 2 disp ( WbyL_2 , ” R e q u i r e d (W/L ) r a t i o f o r Q 2 ” ) WbyL_3 = I_D *2/( V_OV ^2* k_n ) ; // WbyL 3=(W/L ) 3 disp ( WbyL_3 , ” R e q u i r e d (W/L ) r a t i o f o r Q 3 ” ) 76 20 WbyL_4 = WbyL_3 ; // WbyL 4=(W/L ) 4 21 disp ( WbyL_4 , ” R e q u i r e d (W/L ) r a t i o f o r Q 4 ” ) 22 I_D =200*10^ -6; 23 WbyL_5 = I_D *2/( V_OV ^2* k_p ) ; // WbyL 5=(W/L ) 5 24 disp ( WbyL_5 , ” R e q u i r e d (W/L ) r a t i o f o r Q 5 ” ) 25 I_D =500*10^ -6; 26 WbyL_7 =2.5* WbyL_5 ; // WbyL 7=(W/L ) 7 27 disp ( WbyL_7 , ” R e q u i r e d (W/L ) r a t i o f o r Q 7 ” ) 28 WbyL_6 = I_D *2/( V_OV ^2* k_n ) ; // WbyL 6=(W/L ) 6 29 disp ( WbyL_6 , ” R e q u i r e d (W/L ) r a t i o f o r Q 6 ” ) 30 WbyL_8 =0.1* WbyL_5 ; // WbyL 8=(W/L ) 8 31 disp ( WbyL_8 , ” R e q u i r e d (W/L ) r a t i o f o r Q 8 ” ) 32 V_ICMmin = - V_SS + V_OV + V_tn - V_tp ; 33 disp ( V_ICMmin , ” The l o w e s t v a l u e o f i n p u t common mode 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 v o l t a g e ”) V_ICMmax = V_DD - V_OV - V_OV - V_tp ; disp ( V_ICMmax , ” The h i g h e s t v a l u e o f i n p u t common mode v o l t a g e ” ) v_omin = - V_SS + V_OV ; disp ( v_omin , ” The l o w e s t v a l u e o f o u t p u t s w i n g a l l o w a b l e ”) v_omax = V_DD - V_OV ; disp ( v_omax , ” The h i g h e s t v a l u e o f o u t p u t s w i n g a l l o w a b l e ”) R_o =20/(2*0.5) ; disp ( R_o , ” I n p u t r e s i s t a n c e i s p r a c t i c a l l y i n f i n i t e and o u t p u t r e i s t a n c e i s ( ohm ) ” ) G_m2 =2* I_D / V_OV ; disp ( G_m2 , ”G m2 (A/V) ” ) f_P2 =3.2*10^ -3/(2* %pi * C_2 ) ; disp ( f_P2 , ” f P 2 ( Hz ) ” ) R =1/ G_m2 ; disp (R , ”To move t h e t r a n s m i s s i o n z e r o t o s= i n f i n i t e , r v a l u e s e l e c t e d a s ( ohm ) ” ) f_t = f_P2 * tand (15) ; // Phase m a r g i n o f 75 d e g r e e s , t h u s p h a s e s h i f t due t o s e c c o n d p o l e must be 15 degrees disp ( f_t , ” f t ( Hz ) ” ) 77 50 G_m1 =2*100*10^ -6/ V_OV ; // I D = 100uA 51 C_C1 = G_m1 /(2* %pi * f_t ) ; 52 disp ( C_C1 , ” C C1 ( F ) ” ) 53 SR =2* %pi * f_t * V_OV ; 54 disp ( SR , ”SR (V/ s ) ” ) Scilab code Exa 9.2 To determine Av ft fP SR and PD of folded casc 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 // Example 9 . 2 : To d e t e r m i n e A v , f t , f P , SR and P D of folded cascode amplifier // C o n s i d e r a d e s i g n o f t h e f o l d e d −c a s c o d e op amp I =200*10^ -6; // (A) I_B =250*10^ -6; // (A) V_OV =0.25; // (V) k_n =100*10^ -6; // k n=k ’ n (A/Vˆ 2 ) k_p =40*10^ -6; // k p=k ’ p (A/Vˆ 2 ) V_A =20; // V A=V’ A (V/um) V_DD =2.5; // (V) V_SS =2.5; // (V) V_t =0.75; // (V) L =1*10^ -6; // (m) C_L =5*10^ -12; // ( F ) disp ( ” Data c a l c u l a t e d f o r Q1” ) I_D = I /2; disp ( I_D , ” I D (A) ” ) g_m =2* I_D / V_OV ; disp ( g_m , ” g m (A/V) ” ) r_o = V_A / I_D ; disp ( r_o , ” r o ( ohm ) ” ) WbyL =2* I_D /( k_n * V_OV ^2) ; // WbyL =W/L disp ( WbyL , ”W/L” ) disp ( ” Data c a l c u l a t e d f o r Q2” ) I_D = I /2; disp ( I_D , ” I D (A) ” ) g_m =2* I_D / V_OV ; 78 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 disp ( g_m , ” g m (A/V) ” ) r_o = V_A / I_D ; disp ( r_o , ” r o ( ohm ) ” ) WbyL =2* I_D /( k_n * V_OV ^2) ; // WbyL disp ( WbyL , ”W/L” ) disp ( ” Data c a l c u l a t e d f o r Q3” ) I_D = I_B - I /2; disp ( I_D , ” I D (A) ” ) g_m =2* I_D / V_OV ; disp ( g_m , ” g m (A/V) ” ) r_o = V_A / I_D ; disp ( r_o , ” r o ( ohm ) ” ) WbyL =2* I_D /( k_p * V_OV ^2) ; // WbyL disp ( WbyL , ”W/L” ) disp ( ” Data c a l c u l a t e d f o r Q4” ) I_D = I_B - I /2; disp ( I_D , ” I D (A) ” ) g_m =2* I_D / V_OV ; disp ( g_m , ” g m (A/V) ” ) r_o = V_A / I_D ; disp ( r_o , ” r o ( ohm ) ” ) WbyL =2* I_D /( k_p * V_OV ^2) ; // WbyL disp ( WbyL , ”W/L” ) disp ( ” Data c a l c u l a t e d f o r Q5” ) I_D = I_B - I /2; disp ( I_D , ” I D (A) ” ) g_m =2* I_D / V_OV ; disp ( g_m , ” g m (A/V) ” ) r_o = V_A / I_D ; disp ( r_o , ” r o ( ohm ) ” ) WbyL =2* I_D /( k_n * V_OV ^2) ; // WbyL disp ( WbyL , ”W/L” ) disp ( ” Data c a l c u l a t e d f o r Q6” ) I_D = I_B - I /2; disp ( I_D , ” I D (A) ” ) g_m =2* I_D / V_OV ; disp ( g_m , ” g m (A/V) ” ) r_o = V_A / I_D ; 79 =W/L =W/L =W/L =W/L 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 disp ( r_o , ” r o ( ohm ) ” ) WbyL =2* I_D /( k_n * V_OV ^2) ; // WbyL disp ( WbyL , ”W/L” ) disp ( ” Data c a l c u l a t e d f o r Q7” ) I_D = I_B - I /2; disp ( I_D , ” I D (A) ” ) g_m =2* I_D / V_OV ; disp ( g_m , ” g m (A/V) ” ) r_o = V_A / I_D ; disp ( r_o , ” r o ( ohm ) ” ) WbyL =2* I_D /( k_n * V_OV ^2) ; // WbyL disp ( WbyL , ”W/L” ) disp ( ” Data c a l c u l a t e d f o r Q8” ) I_D = I_B - I /2; disp ( I_D , ” I D (A) ” ) g_m =2* I_D / V_OV ; disp ( g_m , ” g m (A/V) ” ) r_o = V_A / I_D ; disp ( r_o , ” r o ( ohm ) ” ) WbyL =2* I_D /( k_n * V_OV ^2) ; // WbyL disp ( WbyL , ”W/L” ) disp ( ” Data c a l c u l a t e d f o r Q9” ) I_D = I_B ; disp ( I_D , ” I D (A) ” ) g_m =2* I_D / V_OV ; disp ( g_m , ” g m (A/V) ” ) r_o = V_A / I_D ; disp ( r_o , ” r o ( ohm ) ” ) WbyL =2* I_D /( k_p * V_OV ^2) ; // WbyL disp ( WbyL , ”W/L” ) disp ( ” Data c a l c u l a t e d f o r Q10” ) I_D = I_B ; disp ( I_D , ” I D (A) ” ) g_m =2* I_D / V_OV ; disp ( g_m , ” g m (A/V) ” ) r_o = V_A / I_D ; disp ( r_o , ” r o ( ohm ) ” ) WbyL =2* I_D /( k_p * V_OV ^2) ; // WbyL 80 =W/L =W/L =W/L =W/L =W/L 103 disp ( WbyL , ”W/L” ) 104 disp ( ” Data c a l c u l a t e d f o r Q11” ) 105 I_D = I ; 106 disp ( I_D , ” I D (A) ” ) 107 g_m =2* I_D / V_OV ; 108 disp ( g_m , ” g m (A/V) ” ) 109 r_o = V_A / I_D ; 110 disp ( r_o , ” r o ( ohm ) ” ) 111 WbyL =2* I_D /( k_n * V_OV ^2) ; // WbyL =W/L 112 disp ( WbyL , ”W/L” ) 113 gmro =160; // gmro=g m ∗ r o 114 disp ( gmro , ” g m ∗ r o f o r a l l t r a n s i s t o r s i s (V/V) ” ) 115 V_GS =1; 116 disp ( V_GS , ”V GS f o r a l l t r a n s i s t o r s i s (V) ” ) 117 V_ICMmin = - V_SS + V_OV + V_OV + V_t ; 118 disp ( V_ICMmin , ” The l o w e s t v a l u e o f i n p u t common mode 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 v o l t a g e (V) ” ) V_ICMmax = V_DD - V_OV + V_t ; disp ( V_ICMmax , ” The h i g h e s t v a l u e o f i n p u t common mode v o l t a g e (V) ” ) v_omin = - V_SS + V_OV + V_OV + V_t ; disp ( v_omin , ” The l o w e s t v a l u e o f o u t p u t s w i n g a l l o w a b l e (V) ” ) v_omax = V_DD - V_OV - V_OV ; disp ( v_omax , ” The h i g h e s t v a l u e o f o u t p u t s w i n g a l l o w a b l e (V) ” ) r_o2 =200*10^3; // r o c a l c u l a t e d f o r Q2 r_o10 =80*10^3; // r o c a l c u l a t e d f o r Q10 R_o4 = gmro *( r_o2 * r_o10 ) /( r_o2 + r_o10 ) ; r_o8 =133333; // r o c a l c u l a t e d f o r Q8 R_o6 = gmro * r_o8 ; R_o = R_o4 * R_o6 /( R_o4 + R_o6 ) ; disp ( R_o , ” Output r e s i s t a n c e ( ohm ) ” ) G_M =0.0008; A_v = G_M * R_o ; disp ( A_v , ” V o l t a g e g a i n (V/V) ” ) f_t = G_M /(2* %pi * C_L ) ; disp ( f_t , ” U n i t y g a i n bandwidth ( Hz ) ” ) 81 137 138 139 140 141 142 143 144 f_P = f_t / A_v ; disp ( f_P , ” Dominant p o l e f r e q u e n c y ( Hz ) ” ) SR = I / C_L ; disp ( SR , ” S l e w Rate (V/ s ) ” ) I_t =0.5*10^ -3; // t o t a l c u r r e n t V_S =5; // S u p p l y v o l t a g e P_D = I_t * V_S ; disp ( P_D , ” Power d i s s i p a t e d (W) ” ) Scilab code Exa 9.3 To determine input offset voltage 1 // Example 9 . 3 : To d e t e r m i n e i n p u t o f f s e t v o l t a g e 2 r_e =2.63*10^3; // ( ohm ) 3 R =1000; // ( ohm ) 4 I =9.5*10^ -6; // (A) 5 deltaRbyR =0.02; // 2% mismatch b e t w e e n R 1 and R 2 6 G_m1 =10^ -3/5.26; // (A/V) 7 deltaI = deltaRbyR /(1+ deltaRbyR + r_e / R ) ; // Change o f 8 9 d e l t a I i n I E (A) V_OS = deltaI / G_m1 ; disp ( V_OS , ” O f f s e t v o l t a g e (V) ” ) 82 Chapter 10 Digital CMOS logic circuits Scilab code Exa 10.1 To determine tPHL tPLH and tP 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 // Example 1 0 . 1 : To d e t e r m i n e t PHL , t PLH and t P // C o n s i d e r CMOS i n v e r t e r C_ox =6*10^ -15; // ( F/umˆ 2 ) uC_n =115*10^ -6; // uC n=u n ∗ C ox (A/Vˆ 2 ) uC_p =30*10^ -6; // uC p=u p ∗ C ox (A/Vˆ 2 ) V_tn =0.4; // (V) V_tp = -0.4; // (V) V_DD =2.5; // (V) W_n =0.375*10^ -6; // W f o r Q N L_n =0.25*10^ -6; // L f o r Q N W_p =1.125*10^ -6; // W f o r Q P L_p =0.25*10^ -6; // L f o r Q P C_gd1 =0.3* W_n *10^ -9; // ( F ) C_gd2 =0.3* W_p *10^ -9; // ( F ) C_db1 =10^ -15; // ( F ) C_db2 =10^ -15; // ( F ) C_g3 = 0.375*0.25*6*10^ -15+2*0.3*0.375*10^ -15; // ( F ) C_g4 =1.125*0.25*6*10^ -15+2*0.3*1.125*10^ -15; // ( F ) C_w =0.2*10^ -15; // ( F ) C =2* C_gd1 +2* C_gd2 + C_db1 + C_db2 + C_g3 + C_g4 + C_w ; // ( F ) i_DN0 = uC_n * W_n *( V_DD - V_tn ) ^2/(2* L_n ) ; // i DN0 = 83 22 23 24 25 26 27 28 29 i DN ( 0 ) (A) i_DNtPHL = uC_n * W_n *(( V_DD - V_tn ) * V_DD /2 -(( V_DD /2) ^2) /2) / L_n ; // i DNtPHL = i DN ( t PHL ) (A) i_DNav =( i_DN0 + i_DNtPHL ) /2; // i DN | av (A) t_PHL = C *( V_DD /2) / i_DNav ; disp ( t_PHL , ” t PHL ( s ) ” ) t_PLH =1.3* t_PHL ; // S i n c e W p/W n=3 and u n / u p =3.83 t h u s t PLH i s g r e a t e r t h a n t PHL by 3 . 8 3 / 3 disp ( t_PLH , ” t PLH ( s ) ” ) t_P =( t_PHL + t_PLH ) /2; disp ( t_P , ” t P ( s ) ” ) Scilab code Exa 10.2 WbyL ratios for the logic circuit 1 // Example 1 0 . 2 : W/L r a t i o s f o r t h e l o g i c 2 // For b a s i c i n v e r t e r 3 n =1.5; 4 p =5; 5 L =0.25*10^ -6; // (m) 6 WbyL =2* n ; // W/L f o r Q NB , Q NC , Q ND 7 disp ( WbyL , ”W/L r a t i o f o r Q NB” ) 8 disp ( WbyL , ”W/L r a t i o f o r Q NC” ) 9 disp ( WbyL , ”W/L r a t i o f o r Q ND” ) 10 WbyL = n ; // W/L r a t i o f o r Q NA 11 disp ( WbyL , ”W/L r a t i o f o r Q NA” ) 12 WbyL =3* p ; // W/L f o r Q PA , Q PC , Q PD 13 disp ( WbyL , ”W/L r a t i o f o r Q PA” ) 14 disp ( WbyL , ”W/L r a t i o f o r Q PC” ) 15 disp ( WbyL , ”W/L r a t i o f o r Q PD” ) circuit Scilab code Exa 10.3 To determine the parameters of pseudo NMOS inverte 84 1 // Example 1 0 . 3 : To d e t e r m i n e t h e p a r a m e t e r s o f p s e u d o NMOS i n v e r t e r // C o n s i d e r a p s e u d o NMOS i n v e r t e r uC_n =115*10^ -6; // uC n=u n ∗ C ox (A/Vˆ 2 ) uC_p =30*10^ -6; // uC p=u p ∗ C ox (A/Vˆ 2 ) V_tn =0.4; // (V) V_tp = -0.4; // (V) V_DD =2.5; // (V) W_n =0.375*10^ -6; // W f o r Q N (m) L_n =0.25*10^ -6; // L f o r Q N (m) r =9; 2 3 4 5 6 7 8 9 10 11 12 // 1 0 . 3 a 13 V_OH = V_DD ; 14 disp ( V_OH , ”V OH (V) ” ) 15 V_OL =( V_DD - V_tn ) *(1 - sqrt (1 -1/ r ) ) ; 16 disp ( V_OL , ”V OL (V) ” ) 17 V_IL = V_tn +( V_DD - V_tn ) / sqrt ( r *( r +1) ) ; 18 disp ( V_IL , ” V IL (V) ” ) 19 V_IH = V_tn +2*( V_DD - V_tn ) /( sqrt (3* r ) ) ; 20 disp ( V_IH , ” V IH (V) ” ) 21 V_M = V_tn +( V_DD - V_tn ) / sqrt ( r +1) ; 22 disp ( V_M , ”V M (V) ” ) 23 NM_H = V_OH - V_IH ; 24 NM_L = V_IL - V_OL ; 25 disp ( NM_L , NM_H , ” The h i g h e s t and t h e l o w e s t values of a l l o w a b l e n o i s e m a r g i n (V) ” ) 26 27 // 1 0 . 3 b 28 WbyL_p = uC_n *( W_n / L_n ) /( uC_p * r ) ; // WbyL p=(W/L ) p 29 disp ( WbyL_p , ” (W/L ) p ” ) 30 31 // 1 0 . 3 c 32 I_stat =( uC_p * WbyL_p *( V_DD - V_tn ) ^2) /2; 33 disp ( I_stat , ” I s t a t (A) ” ) 34 P_D = I_stat * V_DD ; 35 disp ( P_D , ” S t a t i c power d i s s i p a t i o n P D (W) ” ) 36 85 37 // 1 0 . 3 d 38 C =7*10^ -15; 39 t_PLH =1.7* C /( uC_p * WbyL_p * V_DD ) ; 40 disp ( t_PLH , ” t PLH ( s ) ” ) 41 t_PHL =1.7* C /( uC_n *( W_n / L_n ) * sqrt (1 -0.46/ r ) * V_DD ) ; 42 disp ( t_PHL ,( ” t PHL ( s ) ” ) ) 43 t_p =( t_PHL + t_PLH ) /2; 44 disp ( t_p , ” t p ( s ) ” ) Scilab code Exa 10.4 To determine parameters for NMOS transistor 1 // Example 1 0 . 4 : To d e t e r m i n e p a r a m e t e r s f o r NMOS transistor // C o n s i d e r NMOS t r a n s i s t o r s w i t c h uC_n =50*10^ -6; // uC n=u n ∗ C ox (A/Vˆ 2 ) ‘= u p ∗ C ox (A/Vˆ 2 ) uC_p =20*10^ -6; // uC px V_tO =1; // (V) y =0.5; // (Vˆ 1 / 2 ) fie_f =0.6/2; // (V) V_DD =5; // (V) W_n =4*10^ -6; // (m) L_n =2*10^ -6; // (m) C =50*10^ -15; // ( F ) 2 3 4 5 6 7 8 9 10 11 12 13 // 1 0 . 4 a 14 V_t =1.6; // (V) 15 V_OH = V_DD - V_t ; // V OH i s t h e v a l u e o f v O a t which Q s t o p s c o n d u c t i n g (V) 16 disp ( V_OH , ”V OH (V) ” ) 17 18 // 1 0 . 4 b 19 W_p =10*10^ -6; // (m) 20 L_p =2*10^ -6; // (m) 21 i_DP = uC_p * W_p *(( V_DD - V_OH - V_tO ) ^2) /(2* L_p ) ; 22 disp ( i_DP , ” S t a t i c c u r r e n t o f t h e i n v e r t e r (A) ” ) 86 23 P_D = V_DD * i_DP ; 24 disp ( P_D , ” Power d i s s i p a t e d (W) ” ) 25 V_O =0.08; // Output v o l t a g e (V) f o u n d by e q u a t i n g 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 t h e c u r r e n t o f Q N=18uA disp ( V_O , ” The o u t p u t v o l t a g e o f t h e i n v e r t e r (V) ” ) // 1 0 . 4 c i_D0 = uC_n * W_n *(( V_DD - V_tO ) ^2) /(2*2*10^ -6) ; // i D 0= i D ( 0 ) (A) c u r r e n t i D a t t =0 v_O =2.5; // (V) V_t = V_tO +0.5*( sqrt ( v_O +2* fie_f ) - sqrt (2* fie_f ) ) ; // a t v O =2.5V i_DtPLH =( uC_n * W_n *( V_DD - v_O - V_t ) ^2) /(2* L_n ) ; // i DtPLH=i D ( t PLH ) (A) c u r r e n t i D a t t=t PLH i_Dav =( i_D0 + i_DtPLH ) /2; // i D a v=i D | av (A) a v e r a g e discharge current t_PLH = C *( V_DD /2) / i_Dav ; disp ( t_PLH , ” t PHL ( s ) ” ) // 1 0 . 4 d // Case w i t h v t g o i n g low i_D0 = uC_n * W_n *(( V_DD - V_tO ) ^2) /(2*2*10^ -6) ; // i D 0= i D ( 0 ) (A) c u r r e n t i D a t t =0 i_DtPHL = uC_n * W_n *(( V_DD - V_tO ) * v_O -( v_O ^2) /2) /( L_n ) ; // i DtPHL=i D ( t PHL ) (A) c u r r e n t i D a t t=T PHL i_Dav =( i_D0 + i_DtPHL ) /2; // i D a v=i D | av (A) a v e r a g e discarge current t_PHL = C *( V_DD /2) / i_Dav ; disp ( t_PHL , ” t PHL ( s ) ” ) 42 43 44 45 // 1 0 . 4 e 46 t_P =( t_PHL + t_PLH ) /2; 47 disp ( t_P , ” t P ( s ) ” ) 87 Chapter 11 Memory and advanced digital circuits Scilab code Exa 11.1 Min WbyL ratio to ensure flip flop will switch 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 // Example 1 0 . 1 : To d e t e r m i n e t PHL , t PLH and t P // C o n s i d e r CMOS i n v e r t e r C_ox =6*10^ -15; // ( F/umˆ 2 ) uC_n =115*10^ -6; // uC n=u n ∗ C ox (A/Vˆ 2 ) uC_p =30*10^ -6; // uC p=u p ∗ C ox (A/Vˆ 2 ) V_tn =0.4; // (V) V_tp = -0.4; // (V) V_DD =2.5; // (V) W_n =0.375*10^ -6; // W f o r Q N L_n =0.25*10^ -6; // L f o r Q N W_p =1.125*10^ -6; // W f o r Q P L_p =0.25*10^ -6; // L f o r Q P C_gd1 =0.3* W_n *10^ -9; // ( F ) C_gd2 =0.3* W_p *10^ -9; // ( F ) C_db1 =10^ -15; // ( F ) C_db2 =10^ -15; // ( F ) C_g3 = 0.375*0.25*6*10^ -15+2*0.3*0.375*10^ -15; // ( F ) C_g4 =1.125*0.25*6*10^ -15+2*0.3*1.125*10^ -15; // ( F ) C_w =0.2*10^ -15; // ( F ) 88 20 C =2* C_gd1 +2* C_gd2 + C_db1 + C_db2 + C_g3 + C_g4 + C_w ; // ( F ) 21 i_DN0 = uC_n * W_n *( V_DD - V_tn ) ^2/(2* L_n ) ; // i DN0 = 22 23 24 25 26 27 28 29 i DN ( 0 ) (A) i_DNtPHL = uC_n * W_n *(( V_DD - V_tn ) * V_DD /2 -(( V_DD /2) ^2) /2) / L_n ; // i DNtPHL = i DN ( t PHL ) (A) i_DNav =( i_DN0 + i_DNtPHL ) /2; // i DN | av (A) t_PHL = C *( V_DD /2) / i_DNav ; disp ( t_PHL , ” t PHL ( s ) ” ) t_PLH =1.3* t_PHL ; // S i n c e W p/W n=3 and u n / u p =3.83 t h u s t PLH i s g r e a t e r t h a n t PHL by 3 . 8 3 / 3 disp ( t_PLH , ” t PLH ( s ) ” ) t_P =( t_PHL + t_PLH ) /2; disp ( t_P , ” t P ( s ) ” ) Scilab code Exa 11.2 Design of two stage CMOS op amp 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 // Example 1 1 . 2 D e s i g n o f two−s t a g e CMOS op−amp uC_n =50*10^ -6; // u n ∗ C ox (A/Vˆ 2 ) uC_p =20*10^ -6; // u p ∗ C ox (A/Vˆ 2 ) V_tn0 =1; // (V) V_tp0 = -1; // (V) fie_f =0.6/2; // (V) y =0.5; // (Vˆ 1 / 2 ) V_DD =5; // (V) W_n =4*10^ -6; // (m) L_n =2*10^ -6; // (m) W_p =10*10^ -6; // (m) L_p =2*10^ -6; // (m) W =10*10^ -6; // (m) L =10*10^ -6; // (m) C_B =1*10^ -12; // b i t l i n e c a p a c i t a n c e ( F ) deltaV =0.2; // 0 . 2 V d e c r e m e n t WbyL_eq =1/( L_p / W_p + L_n / W_n ) ; // WbyL eq=(W/L ) e q // E q u i v a l e n t t r a n s i s t o r w i l l o p e r a t e i n s a t u r a t i o n 89 20 I =( uC_n * WbyL_eq *( V_DD - V_tn0 ) ^2) /2 21 r_DS =1/( uC_n *( W_n / L_n ) *( V_DD - V_tn0 ) ) ; 22 v_Q = r_DS * I ; // v Q=r DS ∗ I 23 I_5 =0.5*10^ -3; // (A) 24 deltat = C_B * deltaV / I_5 ; 25 disp ( deltat , ” The t i m e ( s ) r e q u i r e d t o d e v e l o p an o u t p u t v o l t a g e o f 0 . 2V” ) Scilab code Exa 11.3 Time required 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 // Example 1 1 . 3 : Time r e q u i r e d f o r v B t o r e a c h 4 . 5 V // C o n s i d e r s e n s e −a m p l i f i e r c i r c u i t uC_n =50*10^ -6; // uC n=u n ∗ C ox (A/Vˆ 2 ) uC_p =20*10^ -6; // uC p=u p ∗ C ox (A/Vˆ 2 ) W_n =12*10^ -6; // (m) L_n =4*10^ -6; // (m) W_p =30*10^ -6; // (m) L_p =4*10^ -6; // (m) v_B =4.5; // (V) C_B =1*10^ -12; // ( F ) V_GS =2.5; // (V) V_t =1; // (V) deltaV =0.1; // (V) g_mn = uC_n *( W_n / L_n ) *( V_GS - V_t ) ; // (A/V) g_mp = uC_p *( W_p / L_p ) *( V_GS - V_t ) ; // (A/V) G_m = g_mn + g_mp ; // (A/V) T = C_B / G_m ; // ( s ) deltat = T *( log ( v_B / V_GS ) - log ( deltaV ) ) ; disp ( deltat , ” The t i m e f o r v B t o r e a c h 4 . 5V ( s ) ” ) 90 Chapter 12 Filters and tuned amplifiers Scilab code Exa 12.4 To design tuned amplifier 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 // Example 1 2 . 4 To d e s i g n t u n e d a m p l i f i e r cfg = -10; // C e n t e r f r e q u e n c y g a i n (V/V) g_m =0.005; // (A/V) r_o =10000; // ( ohm ) f_o =1*10^6; // ( Hz ) B =2* %pi *10^4; // Bandwidth R = - cfg / g_m ; R_L = R * r_o /( r_o - R ) ; disp ( R_L , ” R L ( ohm ) ” ) C =1/( R * B ) disp (C , ”C ( F ) ” ) w_o =2* %pi * f_o ; L =1/( w_o ^2* C ) ; disp (L , ”L (H) ” ) 91 Chapter 14 Output Stages and amplifier Scilab code Exa 14.1 To design a Class B Output Amplifier 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 // Example 1 4 . 1 To d e s i g n a C l a s s B Output A m p l i f i e r P_L =20; // A v e r a g e power (W) R_L =8; // Load r e s i s t a n c e ( ohm ) V_o = sqrt (2* P_L * R_L ) ; disp ( V_o , ” S u p p l y v o l t a g e r e q u i r e d (V) ” ) V_CC =23; // We s e l e c t t h i s v o l t a g e (V) I_o = V_o / R_L ; disp ( I_o , ” Peak c u r r e n t drawn from e a c h s u p p l y (A) ” ) P_Sav = V_CC * I_o / %pi ; // P S+ = P S− = P Sav P_S = P_Sav + P_Sav ; // T o t a l s u p p l y power disp ( P_S , ” The t o t a l power s u p p l y (W) ” ) n = P_L / P_S ; // n i s power c o n v e r s i o n e f f i c i e n c y disp ( n *100 , ” Power c o n v e r s i o n e f f i c i e n c y %” ) P_DPmax = V_CC ^2/( %pi ^2* R_L ) ; P_DNmax = P_DPmax ; disp ( P_DPmax , ”Maximun power d i s s i p a t e d i n e a c h t r a n s i s t o r (W) ” ) 92 Scilab code Exa 14.2 To determine quiescent current and power 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 // Example 1 4 . 2 To d e t e r m i n e q u i e s c e n t c u r r e n t and power // C o n s i d e r C l a s s AB A m p l i f i e r V_CC =15; // (V) R_L =100; // ( ohm ) v_O = -10:10:10; // A m p l i t u d e o f s i n u s o i d a l o u t p u t v o l t a g e (V) I_S =10^ -13; // (A) V_T =25*10^ -3; // (V) B =50; // Beta v a l u e i_Lmax =10/(0.1*10^3) ; // Maximum c u r r e n t t h r o u g h Q N (A) // I m p l i e s max b a s e c u r e n t in Q N i s approximately 2mA I_BIAS =3*10^ -3; // We s e l e c t I BIAS=3mA i n o r d e r t o m a i n t a i n a minimum o f 1mA t h r o u g h t h e d i o d e s I_Q =9*10^ -3; // The a r e a r a t i o o f 3 y e i l d s q u i e s c e n t c u r r e n t o f 9mA P_DQ =2* V_CC * I_Q ; disp ( P_DQ , ” Q u i e s c e n t power d i s s i p a t i o n (W) ” ) // For v O=0V b a s e c u r r e n t o f Q N i s 9 / 5 1 = 0 . 1 8 mA // L e a v e s a c u r r e n t o f 3 −0.18=2.83mA t o f l o w t h r o u g h the diodes I_S = (10^ -13) /3; // D i o d e s have I S = (1 ∗10ˆ −13) /3 V_BB =2* V_T * log ((2.83*10^ -3) / I_S ) ; disp ( V_BB , ”V BB (V) f o r v O = 0V” ) // For v O=+10V, c u r r e n t t h r o u g h t h e d i o d e s w i l l d e c r e a s e t o 1mA V_BB =2* V_T * log ((1*10^ -3) / I_S ) ; disp ( V_BB , ”V BB (V) f o r v O = +10V” ) // For v O=−10V , Q N w i l l c o n d u c t v e r y s m a l l current thus base current i s n e g l i g i b l e // A l l o f t h e I BIAS ( 3mA) f l o w s t h r o u g h t h e d i o d e s V_BB =2* V_T * log ((3*10^ -3) / I_S ) ; disp ( V_BB , ”V BB (V) f o r v O = −10V” ) 93 Scilab code Exa 14.3 Redesign the output stage of Example 2 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 // Example 1 4 . 3 R e d e s i g n t h e o u t p u t s t a g e o f Example 14.2 V_T =25*10^ -3; // (V) I_S =10^ -14; // (A) I_Q =2*10^ -3; // R e q u i r e d q u i e s c e n t c u r r e n t (A) // We s e l e c t I BIAS=3mA which i s d i v i d e d b e t w e e n I R and I C 1 // Thus we s e l e c t I R =0.5mA and I C 1 =2.5mA V_BB =2* V_T * log ( I_Q /10^ -13) ; disp ( V_BB , ”V BB (V) ” ) I_R =0.5*10^ -3; R1plusR2 = V_BB / I_R ; // R1plusR2 = R 1+R 2 I_C1 =2.5*10^ -3; V_BE1 = V_T * log ( I_C1 / I_S ) ; disp ( V_BE1 , ”V BE1 (V) ” ) R_1 = V_BE1 / I_R ; disp ( R_1 , ” R 1 ( ohm ) ” ) R_2 = R1plusR2 - R_1 ; disp ( R_2 , ” R 2 ( ohm ) ” ) Scilab code Exa 14.4 To determine thermal resistance junction temperat 1 2 3 4 5 // Example 1 4 . 4 To d e t e r m i n e t h e r m a l r e s i s t a n c e , junction temperature // C o n s i d e r BJT w i t h f o l l o w i n g specifications P_D0 =2; // Maximum power d i s s i p a t i o n (W) T_A0 =25; // Ambient t e m p e r a t u r e ( d e g r e e c e l c i u s ) T_Jmax =150; // maximum j u n c t i o n t e m p e r a t u r e ( d e g r e e celcius ) 6 94 7 8 9 // 1 4 . 4 a theta_JA =( T_Jmax - T_A0 ) / P_D0 ; // Thermal r e s i s t a n c e disp ( theta_JA , ” The t h e r m a l r e s i s t a n c e ( d e g r e e c e l s i u s /W) ” ) 10 11 // 1 4 . 4 b 12 T_A =50; // ( d e g r e e c e l c i u s ) 13 P_Dmax =( T_Jmax - T_A ) / theta_JA ; 14 disp ( P_Dmax , ”Maximum power t h a t can be d i s s i p a t e d at an a m b i e n t t e m p e r a t u r e o f 50 d e g r e e c e l s i u s (W) ” ) 15 16 // 1 4 . 4 c 17 T_A =25; // ( d e g r e e c e l c i u s ) 18 P_D =1; // (W) 19 T_J = T_A + theta_JA * P_D ; 20 disp ( T_J , ” J u n c t i o n t e m p e r a t u r e ( d e g r e e celcius ) if t h e d e v i c e i s o p e r a t i n g a t T A=25 d e g r e e c e l s i u s and i s d i s s i p a t i n g 1W” ) Scilab code Exa 14.5 To determine the maximum power dissipated // Example 1 4 . 5 To d e t e r m i n e t h e maximum power dissipated 2 // C o n s i d e r a BJT w i t h f o l l o w i n g s p e c i f i c a t i o n s 3 T_Jmax =150; // ( d e g r e e c e l c i u s ) 4 T_A =50; // ( d e g r e e c e l c i u s ) 1 5 6 7 8 9 // 1 4 . 5 a theta_JA =62.5; // ( d e g r e e c e l c i u s /W) P_Dmax =( T_Jmax - T_A ) / theta_JA ; disp ( P_Dmax , ” The maximum power (W) t h a t can be d i s s i p a t e d s a f e l y by t h e t r a n s i s t o r when o p e r a t e d in f r e e a i r ”) 10 95 11 12 13 14 15 16 17 18 19 20 21 22 // 1 4 . 5 b theta_CS =0.5; // ( d e g r e e c e l c i u s /W) theta_SA =4; // ( d e g r e e c e l c i u s /W) theta_JC =3.12; // ( d e g r e e c e l c i u s /W) theta_JA = theta_JC + theta_CS + theta_SA ; P_Dmax =( T_Jmax - T_A ) / theta_JA disp ( P_Dmax , ” The maximum power (W) t h a t can be d i s s i p a t e d s a f e l y by t h e t r a n s i s t o r when o p e r a t e d a t an a m b i e n t t e m p e r a t u r e o f 50 d e g r e e c e l c i u s but w i t h a h e a t s i n k f o r which t h e t a C S= 0 . 5 ( d e g r e e c e l c i u s /W) and t h e t a S A = 4 ( d e g r e e c e l c i u s /W) (W) ” ) // 1 4 . 5 c theta_CA =0 // s i n c e i n f i n i t e h e a t s i n k P_Dmax =( T_Jmax - T_A ) / theta_JC ; disp ( P_Dmax , ” The maximum power (W) t h a t can be d i s s i p a t e d s a f e l y i f an i n f i n i t e h e a t s i n k i s u s e d and T A=50 ( d e g r e e c e l c i u s ) ” ) 96