Lecture Notes on Basic Electronics for Students in Computer Science John Kar-kin Zao and Wen-Hsiao Peng Department of Computer Science, National Chiao-Tung Univeristy 1001 Ta-Hsueh Rd., 30010 HsinChu, Taiwan August 2006 Contents 1 Preamble 1.1 Goal of This Course . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1.2 Content of This Course . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1.3 Relationship with Other Disciplines . . . . . . . . . . . . . . . . . . . . . . 1 1 1 1 I 2 System and Circuit Analysis 2 Signals and Systems 2.1 Basic Concepts . . . . . . . . . . . . . . . . . . . . 2.2 Types of Systems . . . . . . . . . . . . . . . . . . . 2.3 Axiomatic Properties of Systems . . . . . . . . . . 2.4 Time-Domain Analysis . . . . . . . . . . . . . . . . 2.4.1 Impulse Response . . . . . . . . . . . . . . . 2.4.2 Step Response . . . . . . . . . . . . . . . . . 2.4.3 Sinusoidal Response . . . . . . . . . . . . . 2.4.4 Initial Value/Driving Free/Natural Response 2.4.5 Transient Response . . . . . . . . . . . . . . 2.4.6 Steady-State Response . . . . . . . . . . . . 2.5 Frequency-Domain Analysis . . . . . . . . . . . . . 2.5.1 Phasor . . . . . . . . . . . . . . . . . . . . . 2.5.2 Spectrum and Fourier Transform . . . . . . 2.5.3 System Transfer Function Kv ($) . . . . . . . 2.5.4 Time Domain versus Frequency Domain . . 3 Electrical Circuits 3.1 Basic Concepts . . 3.2 Circuit Elements . 3.3 Circuit Laws . . . . 3.4 Network Theorems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ii . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 3 4 5 6 6 8 8 12 12 12 13 13 13 14 16 . . . . 17 17 17 20 21 CONTENTS 3.4.1 Equivalent Circuits of One-Port Networks . . . . . . . . . . . . . . 23 3.4.2 Equivalent Circuits of Two-Port Networks . . . . . . . . . . . . . . 25 3.5 Laplace Transforms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30 3.6 Equivalent Circuits in Laplace Domain . . . . . . . . . . . . . . . . . . . . 31 3.7 System Transfer Function in Time and Laplace Domains . . . . . . . . . . 33 3.8 Bode Plots . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42 II Devices — Diode, BJT, MOSFETs 4 Semiconductor 49 50 4.1 Intrinsic Silicon . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50 4.2 Doped Silicon . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53 5 Diode 55 5.1 Physical Structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55 5.1.1 The sq Junction Under Open Circuit . . . . . . . . . . . . . . . . . 55 5.1.2 The sq Junction Under Reverse-Bias . . . . . . . . . . . . . . . . . 57 5.1.3 The sq Junction in the Breakdown Region . . . . . . . . . . . . . . 59 5.1.4 The sq Junction Under Forward Bias Conditions . . . . . . . . . . 59 5.2 Characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61 5.2.1 Forward Bias . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61 5.2.2 Reverse Bias . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62 5.2.3 Breakdown Region . . . . . . . . . . . . . . . . . . . . . . . . . . . 63 5.3 Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63 5.3.1 Large Signal Model . . . . . . . . . . . . . . . . . . . . . . . . . . . 63 5.3.2 Small Signal Model . . . . . . . . . . . . . . . . . . . . . . . . . . . 67 5.3.3 Circuit Analysis with Diodes . . . . . . . . . . . . . . . . . . . . . . 70 5.4 Special Diodes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71 5.4.1 Zener diode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71 5.4.2 Switching Controlled Rectifier (SCR) . . . . . . . . . . . . . . . . . 72 5.4.3 LED/Varactors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72 5.5 Applications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72 5.5.1 Regulator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72 5.5.2 Rectifier . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74 5.5.3 Limiting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78 5.5.4 Clamping . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78 5.5.5 Digital Logic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80 iii CONTENTS 6 MOS Field-Egect Transistors (MOSFETs) 6.1 Structure . . . . . . . . . . . . . . . . . . . . 6.1.1 Physical Structure . . . . . . . . . . . 6.2 Characteristics of NMOS Transistor . . . . . . 6.2.1 Cut-og Region (yJV ? Yw ) . . . . . . . 6.2.2 Triode (yJV A Yw , 0 ? yGV ? yJV Yw ) 6.2.3 Saturation (yJV A Yw > yGV A yJV Yw ) 6.3 Characteristics of PMOS Transistor . . . . . . 6.3.1 Body Egect . . . . . . . . . . . . . . . 6.3.2 Internal Capacitances . . . . . . . . . . 6.3.3 Temperature Egect . . . . . . . . . . . 6.3.4 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 Bipolar Junction Transistor (BJT) 7.1 Structure . . . . . . . . . . . . . . . . . . . . . . 7.1.1 NPN Transistor . . . . . . . . . . . . . . . 7.1.2 PNP Transistor . . . . . . . . . . . . . . . 7.2 Operations of NPN Transistor . . . . . . . . . . . 7.2.1 Active Mode . . . . . . . . . . . . . . . . . 7.2.2 Reverse Active Mode . . . . . . . . . . . . 7.2.3 Ebers-Moll (EM) Model . . . . . . . . . . 7.2.4 Saturation Mode . . . . . . . . . . . . . . 7.3 Operations of PNP Transistor . . . . . . . . . . . 7.3.1 Active Mode . . . . . . . . . . . . . . . . . 7.3.2 Reverse Active Mode . . . . . . . . . . . . 7.3.3 Saturation Mode . . . . . . . . . . . . . . 7.3.4 Summary of the lF > lE > lH Relationships in 7.4 The l y Characteristics of NPN Transistor . . . 7.4.1 Common Base (lF yFE ) . . . . . . . . . 7.4.2 Common Emitter (lF yFH ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Active . . . . . . . . . . . . 8 Comparisons of BJT and MOSFET 8.1 NMOS and NPN Transistors . . . . . . . . . . . . . 8.1.1 NMOS Triode v.s. NPN Saturation . . . . . 8.1.2 NMOS Saturation v.s. NPN Forward Active 8.1.3 NMOS Cut-og v.s. NPN Cut-og . . . . . . . 8.2 PMOS and PNP Transistors . . . . . . . . . . . . . 8.2.1 PMOS Triode v.s. PNP Saturation . . . . . 8.2.2 PMOS Saturation v.s. PNP Forward Active 8.2.3 PMOS Cut-og v.s. PNP Cut-og . . . . . . . iv . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81 82 82 83 83 83 87 90 91 92 93 93 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95 95 95 97 98 98 102 103 105 106 106 108 108 108 109 109 110 . . . . . . . . 115 . 115 . 116 . 117 . 118 . 118 . 119 . 120 . 121 . . . . . . . . . . . 1 Preamble 1.1 Goal of This Course • Analysis and design of electronic circuits. 1.2 Content of This Course • Electric circuit (Passive Circuit ) analysis. — Only containing Resistor (U), Capacitor (F), and Inductor (O). — No signal amplification. • Electronic circuit (Active Circuit ) analysis. — Containing transistor. — Single transistor circuit. — Signal amplification. • Operational amplifier and application. 1.3 Relationship with Other Disciplines 1 Part I System and Circuit Analysis 2 2 Signals and Systems 2.1 Basic Concepts Table 2.1: Signals and Systems in Time and Frequency Domains. Signals Systems Time Domain Waveforms, {(w) Impulse Response, k(w) Frequency Domain Spectrum, [($) Frequency Response, K($) Definition 2.1 System stands for the transformation of signal from one to another. It can be viewed as a process in which input signals are transformed by the system or cause the system to respond in some way, resulting in other signals as outputs. Objects Abstraction Systems Composition Systems Decomposition Analysis Synthesis Components System characteristics /brhaviors Formalization Models Figure 2.1: System from engineering perspective. • Approach — Abstraction Representing a real object by its special characteristics; that is, the relation between its inputs and outputs, which becomes a system. 3 Sec 2.2. Types of Systems — Decomposition Dividing a system into several smaller systems (components) and studying them to understand the large system. — Composition Putting several systems together to form a larger system and studying it. • Model Inputs LTI Systems Outputs States • Relative Input States Output • Perspectives — Time domain. — Frequency domain. 2.2 Types of Systems • Temporal characteristic — Continuous-Time Systems Inputs/outputs of the systems are functions defined at continuous time. Input x(t) Continuous-Time Output y(t) System Magnitude t Figure 2.2: Continuous-time systems. — Discrete-Time Systems 4 Lecture 2. Signals and Systems Input x[n] Discrete-Time Output y[n] System Magnitude 6 7 8 9 t 0 1 2 3 4 5 Figure 2.3: Discrete-time systems. Input x(t) Output y(t) Digital System Magnitude t Figure 2.4: Digital system. Inputs/outputs of the systems are functions defined at discrete time. • Magnitude — Analog systems Inputs/outputs of the system have continuously varying values. — Digital systems Inputs/outputs of the system have discrete values. 2.3 Axiomatic Properties of Systems • Linearity — If an input consists of the weighted sum of several signals, then the output is the superposition of the responses of the system to each of those signals. |1(w) = K{{1(w)} |2(w) = K{{2(w)} d × |1(w) + e × |2(w) = K{d × {1(w) + e × {2(w)} 5 (2.1) Sec 2.4. Time-Domain Analysis y(t) x(t) Inverse System System x(t) Figure 2.5: Inverse system. • Time-Invariant — The behavior and characteristics of the system are fixed over time. — For example, the magnitudes of resistors and capacitors of a circuit are unchanged over time. |(w) = K{{(w)} |(w ) = K{{(w )} (2.2) • Causality — The output of the system depends only on the inputs at the present time and in the past. Z w {( )g = — For example, |(w) = 0 • Invertability — Distinct inputs of the system lead to distinct outputs, and an inverse system exists. — For example, a system which is |(w) = 2{(w), for which the inverse system is |(w) = 12 {(w). • Stability — If the input of the system is bounded, then the output must be bounded. 2.4 Time-Domain Analysis Definition 2.2 The analysis of a LTI system that is based on the relationship between time-varying inputs and their corresponding time-varying outputs. • Inputs/outputs are time functions (waveforms). 2.4.1 Impulse Response • Output of the system with a fictitious input of Direc-Delta function (w). — For LTI systems, the system characteristic in time domain is the system impulse response. 6 Lecture 2. Signals and Systems • Direc-Delta function (w). ( (w) = Z 0 li w 6= 0 = 4 li w = 0 (2.3) W (w)gw = 1> ;W A 0= (2.4) 3W f Magnitude 1/T Magnitude t -T/2 T/2 t 0 Figure 2.6: Direc-Delta function — Signal sampling using Direc-Delta function. Z " {(w)(w )gw {( ) = (2.5) 3" G (t W ) x (W ) 1 T ³ x(t )G (t W )dt lim T o0 x (W ) u 1 uT T x (W ) x (t ) t W T 2 W T W 2 Figure 2.7: Sampling using Direc-Delta function. — Signal reconstruction: any real time-functions can be represented by using the integrals of Delta functions as in Eq. (2.6). Z " {( )( w)g {(w) = 3" — Convolution 7 (2.6) Sec 2.4. Time-Domain Analysis x (W 1 )G (t W 1 ) Magnitude x (W 2 )G (t W 2 ) x (t ) t W1 W2 Figure 2.8: A time function represented by a set of delta functions. Outputs of the LTI system is the convolution of the input and the system impulse response. Z " |(w) = {(w) k(w) = {( )k(w )g (2.7) 3" 2.4.2 Step Response • Output of the system w.r.t. an input {(w) of step function. P( t ) 1 t 0 ( {(w) = x(w) = 0 li w ? 0 = 1 li w 0 gx(w) = (w)= gw 2.4.3 (2.8) (2.9) Sinusoidal Response • Output of the system w.r.t. sinusoidal function input {(w). {(w) = cos(2w) with $ = 2i (2.10) i is frequency. $ = 2i is the angular frequency. W = i1 is period. — For a real LTI system with a sinusoidal input function, the output is also a sinusoidal function but with changes in both magnitude and phase. — 8 Lecture 2. Signals and Systems x (W 1 )G (t W 1 ) Magnitude x (W 2 )G ( t W 2 ) x (t ) t W1 W2 Magnitude 1 LTI System h(t ) Impulse Response t 0 Time-Invariant W1 t W2 Linearity y (t ) x (W 2 )h (t W 2 ) x(W 1 ) h (t W 1 ) W1 t W2 Figure 2.9: Continuous time convolution operation. k(w) {(w) = cos $w $ |(w) = kK($)k cos ($w + ]K($)) > Z " where K($) = k( )h3m$ g = kK($)k hm]K($) 3" †Advanced Topics Proof. k(w) {(w) = cos $w $ |(w) = kK($)k cos ($w + ]K($)) 9 (2.11) Sec 2.4. Time-Domain Analysis x [ 1]G [ n 1] x [ 2 ]G [ n 2 ] x [ 0 ]G [ n ] 5 x [ 3 ]G [ n 3 ] 4 Magnitude 4 3 0 1 2 Input x [n ] n 3 Magnitude 4 3 LTI System h [n ] 2 1 Impulse Response 0 1 2 3 n 16 12 8 x [ 0 ]G [ n ] o x [ 0 ]h [ n ] 4 n 0 1 2 3 20 15 10 x [1 ]G [ n 1 ] o x [1 ] h [ n 1] 5 n 0 1 2 3 4 16 12 x [ 2 ]G [ n 2 ] o x [ 2 ] h [ n 2 ] 8 4 n 0 1 2 3 4 5 12 9 6 x [ 3 ]G [ n 3 ] o x [ 3 ]h [ n 3 ] 3 n 0 1 2 3 4 5 6 39 38 32 Output 22 16 10 3 y[n] n 0 1 2 3 4 5 6 ¦ x [ k ]h [n k ] k Figure 2.10: Discrete time convolution operation. 10 Lecture 2. Signals and Systems x(t)=cos(Ȧt) 1 0.5 0 -5 -2.5 0 2.5 5 t -0.5 -1 Figure 2.11: Sinusoidal waveform. |(w) = {(w) k(w) Z " {( )k(w )g = 3" Z " cos($ )k(w )g = 3" Z 1 " m$ (h + h3m$ )k(w )g = 2 3" Z Z 1 " 3m$ 1 " m$ h k(w )g + h k(w )g = 2 3" 2 3" 0 By defining = w > the equation above can be written as follows: 1 |(w) = 2 Z " Z " 0 m$(w3 ) h 3" 0 1 k( )g + 2 0 0 Z " 0 h3m$(w3 ) k( 0 )g 0 3" 0 h3m$ k( )g 0 = kK($)k hm]K($) as a complex function of $= Its 3" Z " 0 W 0 W complex conjugate is K ($) = hm$ k ( )g 0 = kK($)k h3m]K($) =Since k(w) is a real Define K($) = W 0 0 3" function, k ( ) = k( )= Thus, |(w) can be formulized as follows: Z Z 1 m$w " 3m$ 0 1 3m$w " m$ 0 0 0 |(w) = h h k( )g + h h k( 0 )g 0 2 2 3" 3" 1 m$w 1 = h × kK($)k hm]K($) + h3m$w × kK($)k h3m]K($) 2 2 = kK($)k cos ($w + ]K($)) • More generally, it is the output of the system w.r.t. complex exponential function input {(w). (2.12) {(w) = hm$w = cos($w) + m sin($w) 11 Sec 2.4. Time-Domain Analysis — Complex exponential function hm$w is the eigenfunction of any LTI systems. k(w) {(w) = hm$w $ |(w) = K($)hm$w (2.13) = kK($)k cos ($w + ]K($)) + m kK($)k sin ($w + ]K($)) Z " k(w)h3m$w gw= K($) = 3" h(t ) f x (t ) Input time function LTI y (t ) ³f x (W )h (t W )dW System Output time function h(t) x( t ) e jZt jZt LTI y (t ) De ,D System H (Z ) ³ h ( t )e jZt dt h (t ) x ( t) X (Z) e jZt jZt LTI y(t ) D ' e , D ' H (Z) X (Z) System Figure 2.12: The output of a LTI system with exponential complex function. 2.4.4 Initial Value/Driving Free/Natural Response • Output |(w) w.r.t. null input {(w) = 0 and possibly non-zero initial system states. Equivalently, it is solution of Homogeneous System Equation. 2.4.5 Transient Response • The part of system output that will disappear (die down) as time progress. |W (w) $ 0 as w $ 4= (2.14) — For Linear Time-Invariant (LTI) circuits, |W (w) = impulse response (with necessary scaling and time-shifting). 2.4.6 Steady-State Response • The part of system output that will remain after transient response dies down. |V (w) = |(w) |W (w)= 12 (2.15) Lecture 2. Signals and Systems — For Linear Time-Invariant (LTI) circuits, |W (w) = impulse response (with necessary scaling and time-shifting). 2.5 Frequency-Domain Analysis Definition 2.3 Determination of system output(s) w.r.t complex sinusoidal inputs at different frequencies and with specific initial system state. Results are often displayed along frequency axis or expression as functions of angular frequency ($). • Input X and Output Y are complex functions of angular frequency. Input Output x (Z) y( Z) LTI Systems States 2.5.1 Phasor • An electrical-engineering representation of sinusoidal signals in frequency domain. • A constant complex number that encodes the magnitude and the phase of the sinusoidal signals. Example 2.4 Given sinusoidal signal {(w) = N cos($w + !)> S kdvru [ = Nhm! , where ° ° °[ ° = N and phase ][ = !. • {(w) = <{[hm$w } = N cos($w + !)= Im[X] K X M 0 2.5.2 Re[X] Spectrum and Fourier Transform • Any finite-energy signal can be represented by sinusoidal functions (including both sin and cos waveforms) of digerent frequencies. 13 Sec 2.5. Frequency-Domain Analysis — The principle of Inverse Fourier Transform. Z 1 {(w) = 2 Z 1 = 2 Z 1 = 2 " 3" " 3" " [($)hm$w g$= k[($)k hm][($) hm$w g$= (2.16) {k[($)k cos ($w + ]K($)) + m k[($)k sin($w + ][($))} g$= 3" — [($) is a complex function of angular frequency $, which expresses the values of the signal phasor in digerent frequencies. [($) = k[($)k hm][($) = (2.17) k[($)k is called magnitude spectrum, specifying the magnitude for digerent sinusoidal components. ][($) is called phase spectrum, specifying the phase for digerent sinusoidal components. — [($) can be obtained by taking the Fourier Transform of {(w). Definition 2.5 Given i (w), its Fourier Transform, which is defined as follows, is a complex function of the angular frequency $. Z I ($) =[i (w)] = " i (w)h3m$w gw= (2.18) 3" • Fourier Transform of i(w) is the projection of i(w) on the basis functions hm$w = Definition 2.6 Correspondingly, the Inverse Fourier Transform is as follows: 1 i(w) = [I ($)] = 2 31 2.5.3 Z " I ($)hm$w g$= (2.19) 3" System Transfer Function Kv ($) • A ratio between the spectra of input and output signals of a linear time-invariant circuit. 14 Lecture 2. Signals and Systems Time-Domain Analysis h(t ) x(t ) Input time function x( t) 1 2S LTI System y (t ) ³ X (Z )e dZ LTI System f f x (W )h (t W )dW Output time function h(t ) jZt ³ y (t ) 1 2S ³ X (Z) H (Z )e jZ t dZ H (Z ) X (Z) Input Spectrum LTI Y (Z) H (Z ) X (Z ) System Output Spectrum Frequency-Domain Analysis Figure 2.13: Relationship between time-domain analysis and frequency-domain analysis. — It is also known as the frequency response of a LTI system. \ ($) [($) k\ ($)k hm]\ ($) = k[($)k hm][($) k\ ($)k m(]\ ($)3][($)) h = k[($)k = kKv ($)k hm]Kv ($) Kv ($) (2.20) kKv ($)k = k\ ($)k @ k[($)k is the magnitude response of the system. ]Kv ($) = ]\ ($) ][($) is the phase response of the system. • From Eq. (2.13) and Eq. (2.16), each sinusoidal component [($)hm$w produces an output signal of \ ($)hm$w = [($)K($)hm$w , as shown in Figure 2.13. Thus, |(w) can be written as follows. Z " Z " 1 1 m$w \ ($)h g$ = [($)K($)hm$w g$= (2.21) |(w) = 2 3" 2 3" • The system transfer function Kv ($) = K($), which is the Fourier Transform of the system impulse response k(w). 15 Sec 2.5. Frequency-Domain Analysis 2.5.4 Time Domain versus Frequency Domain • The frequency response of a LTI system is the Fourier transform of the system impulse response. K($) = = {k(w)} (2.22) • The convolution of two signals in time domain is equivalent to the multiplication of their representations in frequency domain. = |(w) = {(w) k(w) #$ K($)[($) 16 (2.23)