summaryrefslogtreecommitdiff
path: root/Electronic_Devices_by_Thomas_L._Floyd/Chapter8.ipynb
blob: 8cb0d972ce821b3cc8c8408e3dbb9ce0e38a4ec2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
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
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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
{
 "metadata": {
  "name": "Chapter_8"
 }, 
 "nbformat": 2, 
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "markdown", 
     "source": [
      "<h1>Chapter 8: FET Amplifiers<h1>"
     ]
    }, 
    {
     "cell_type": "markdown", 
     "source": [
      "<h3>Example 8.1, Page Number: 253<h3>"
     ]
    }, 
    {
     "cell_type": "code", 
     "collapsed": false, 
     "input": [
      "", 
      "# variable declaration", 
      "g_m=4.0*10**-3; #gm value", 
      "R_d=1.5*10**3;  #resistance", 
      "", 
      "#calculation", 
      "A_v=g_m*R_d;     #voltage gain", 
      "", 
      "#result", 
      "print \"Voltage gain = %.2f\" %A_v"
     ], 
     "language": "python", 
     "outputs": [
      {
       "output_type": "stream", 
       "stream": "stdout", 
       "text": [
        "Voltage gain = 6.00"
       ]
      }
     ], 
     "prompt_number": 1
    }, 
    {
     "cell_type": "markdown", 
     "source": [
      "<h3>Example 8.2, Page Number: 253<h3>"
     ]
    }, 
    {
     "cell_type": "code", 
     "collapsed": false, 
     "input": [
      "", 
      "# variable declaration", 
      "r_ds=10.0*10**3;", 
      "R_d=1.5*10**3;    #from previous question", 
      "g_m=4.0*10**-3;   #from previous question", 
      "", 
      "#calculation", 
      "A_v=g_m*((R_d*r_ds)/(R_d+r_ds));  #voltage gain", 
      "", 
      "#result", 
      "print \"Voltage gain = %.2f\" %A_v"
     ], 
     "language": "python", 
     "outputs": [
      {
       "output_type": "stream", 
       "stream": "stdout", 
       "text": [
        "Voltage gain = 5.22"
       ]
      }
     ], 
     "prompt_number": 2
    }, 
    {
     "cell_type": "markdown", 
     "source": [
      "<h3>Example 8.3, Page Number:254<h3>"
     ]
    }, 
    {
     "cell_type": "code", 
     "collapsed": false, 
     "input": [
      "", 
      "# variable declaration", 
      "R_s=560;       #resistance in ohm", 
      "R_d=1.5*10**3;  #resistance in ohm", 
      "g_m=4*10**-3;   #g_m value", 
      "", 
      "#calculation", 
      "A_v=(g_m*R_d)/(1+(g_m*R_s))  #voltage gain", 
      "", 
      "#result", 
      "print \"Voltage gain = %.2f\" %A_v"
     ], 
     "language": "python", 
     "outputs": [
      {
       "output_type": "stream", 
       "stream": "stdout", 
       "text": [
        "Voltage gain = 1.85"
       ]
      }
     ], 
     "prompt_number": 3
    }, 
    {
     "cell_type": "markdown", 
     "source": [
      "<h3>Example 8.4, Page Number: 257<h3>"
     ]
    }, 
    {
     "cell_type": "code", 
     "collapsed": false, 
     "input": [
      "", 
      "#Variable declaration", 
      "vdd=12.0 #volts", 
      "Id=1.96*10**-3 #Amp", 
      "Rd=3.3*10**3 #ohm", 
      "Idss=12.0*10**-3 #Amp", 
      "Rs=910           # Ohm", 
      "vgsoff= 3         #v", 
      "vin=0.1          #V", 
      "", 
      "#calculation", 
      "vd=vdd-(Id*Rd)", 
      "vgs=-Id*Rs", 
      "gm0=2*Idss/(abs(vgsoff))", 
      "gm=0.00325         #mS", 
      "vout=gm*Rd*vin", 
      "vout=vout*2*1.414", 
      "#Result", 
      "print\"Total output ac voltage(peak-to-peak) = %f V \\nridig on DC value of %fV \"%(vout,vd)"
     ], 
     "language": "python", 
     "outputs": [
      {
       "output_type": "stream", 
       "stream": "stdout", 
       "text": [
        "Total output ac voltage(peak-to-peak) = 3.033030 V ", 
        "ridig on DC value of 5.532000V "
       ]
      }
     ], 
     "prompt_number": 4
    }, 
    {
     "cell_type": "markdown", 
     "source": [
      "<h3>Example 8.5, Page Number: 258<h3>"
     ]
    }, 
    {
     "cell_type": "code", 
     "collapsed": false, 
     "input": [
      "", 
      "# variable declaration", 
      "R_D=3.3*10**3;    #resistance in ohm", 
      "R_L=4.7*10**3;    #load resistance in ohm", 
      "g_m=3.25*10**-3;   #from previous question", 
      "V_in=100.0*10**-3;   #previous question", 
      "", 
      "#calculation", 
      "R_d=(R_D*R_L)/(R_D+R_L);    #Equivalent drain resistance", 
      "V_out=g_m*R_d*V_in;         #output RMS voltage in volt", 
      "", 
      "#result", 
      "print \"Output voltage rms value = %.2f Volts\" %V_out"
     ], 
     "language": "python", 
     "outputs": [
      {
       "output_type": "stream", 
       "stream": "stdout", 
       "text": [
        "Output voltage rms value = 0.63 Volts"
       ]
      }
     ], 
     "prompt_number": 5
    }, 
    {
     "cell_type": "markdown", 
     "source": [
      "<h3>Example 8.6, Page Number: 259<h3>"
     ]
    }, 
    {
     "cell_type": "code", 
     "collapsed": false, 
     "input": [
      "", 
      "# variable declaration", 
      "I_GSS=30.0*10**-9;           #current in ampere", 
      "V_GS=10.0;                   #ground-source voltage", 
      "R_G=10.0*10**6;              #resistance in ohm", 
      "", 
      "#calculation", 
      "R_IN_gate=V_GS/I_GSS;                    #gate input resistance", 
      "R_in=(R_IN_gate*R_G)/(R_IN_gate+R_G);    #parallel combination", 
      "", 
      "#result", 
      "print \"Input resistance as seen by signal source = %.2f ohm\" %R_in"
     ], 
     "language": "python", 
     "outputs": [
      {
       "output_type": "stream", 
       "stream": "stdout", 
       "text": [
        "Input resistance as seen by signal source = 9708737.86 ohm"
       ]
      }
     ], 
     "prompt_number": 6
    }, 
    {
     "cell_type": "markdown", 
     "source": [
      "<h3>Example 8.7, Page Number: 260<h3>"
     ]
    }, 
    {
     "cell_type": "code", 
     "collapsed": false, 
     "input": [
      "", 
      "# variable declaration", 
      "I_DSS=200.0*10**-3;", 
      "g_m=200.0*10**-3;", 
      "V_in=500.0*10**-3;", 
      "V_DD=15.0;", 
      "R_D=33.0;", 
      "R_L=8.2*10**3;", 
      "", 
      "#calculation", 
      "I_D=I_DSS;    #Amplifier is zero biased", 
      "V_D=V_DD-I_D*R_D;", 
      "R_d=(R_D*R_L)/(R_D+R_L);", 
      "V_out=g_m*R_d*V_in;", 
      "", 
      "#result", 
      "print \"DC output voltage = %.2f Volts\" %V_D", 
      "print \"AC output voltage = %.2f volts\" %V_out"
     ], 
     "language": "python", 
     "outputs": [
      {
       "output_type": "stream", 
       "stream": "stdout", 
       "text": [
        "DC output voltage = 8.40 Volts", 
        "AC output voltage = 3.29 volts"
       ]
      }
     ], 
     "prompt_number": 7
    }, 
    {
     "cell_type": "markdown", 
     "source": [
      "<h3>Example 8.8, Page Number: 262<h3>"
     ]
    }, 
    {
     "cell_type": "code", 
     "collapsed": false, 
     "input": [
      "", 
      "# Theoretical example", 
      "# result", 
      "", 
      "print \"Part A:\\nQ point: V_GS=-2V I_D=2.5mA. At V_GS=-1V, I_D=3.4mA,\"", 
      "print \"At V_GS=-3V, I_D=1.8mA. So peak to peak drain current is\" ", 
      "print \"the difference of the two drain currents=1.6mA\"", 
      "print \"\\nPart B:\\nQ point: V_GS=0V I_D=4mA. At V_GS=1V, I_D=5.3mA,\"", 
      "print \"At V_GS=-1V, I_D=2.5mA. So peak to peak drain current is\"", 
      "print\" the difference of the two drain currents=2.8mA\"", 
      "print \"\\nPart C:\\nQ point: V_GS=8V I_D=2.5mA. At V_GS=9V, I_D=3.9mA,\"", 
      "print \" At V_GS=7V, I_D=1.7mA. So peak to peak drain current is\"", 
      "print \" the difference of the two drain currents=2.2mA\""
     ], 
     "language": "python", 
     "outputs": [
      {
       "output_type": "stream", 
       "stream": "stdout", 
       "text": [
        "Part A:", 
        "Q point: V_GS=-2V I_D=2.5mA. At V_GS=-1V, I_D=3.4mA,", 
        "At V_GS=-3V, I_D=1.8mA. So peak to peak drain current is", 
        "the difference of the two drain currents=1.6mA", 
        "", 
        "Part B:", 
        "Q point: V_GS=0V I_D=4mA. At V_GS=1V, I_D=5.3mA,", 
        "At V_GS=-1V, I_D=2.5mA. So peak to peak drain current is", 
        " the difference of the two drain currents=2.8mA", 
        "", 
        "Part C:", 
        "Q point: V_GS=8V I_D=2.5mA. At V_GS=9V, I_D=3.9mA,", 
        " At V_GS=7V, I_D=1.7mA. So peak to peak drain current is", 
        " the difference of the two drain currents=2.2mA"
       ]
      }
     ], 
     "prompt_number": 8
    }, 
    {
     "cell_type": "markdown", 
     "source": [
      "<h3>Example 8.9, Page Number:263 <h3>"
     ]
    }, 
    {
     "cell_type": "code", 
     "collapsed": false, 
     "input": [
      "", 
      "# variable declaration", 
      "R_1=47.0*10**3;", 
      "R_2=8.2*10**3;", 
      "R_D=3.3*10**3;", 
      "R_L=33.0*10**3;", 
      "I_D_on=200.0*10**-3;", 
      "V_GS=4.0;", 
      "V_GS_th=2.0;", 
      "g_m=23*10**-3;", 
      "V_in=25*10**-3;", 
      "V_DD=15.0;", 
      "", 
      "#calculation", 
      "V_GSnew=(R_2/(R_1+R_2))*V_DD;", 
      "K=I_D_on/((V_GS-V_GS_th)**2)", 
      "#K=value_of_K(200*10**-3,4,2);", 
      "K=K*1000;", 
      "I_D=K*((V_GSnew-V_GS_th)**2);", 
      "V_DS=V_DD-I_D*R_D/1000;", 
      "R_d=(R_D*R_L)/(R_D+R_L);", 
      "V_out=g_m*V_in*R_d;", 
      "", 
      "#result", 
      "print \"Drain to source voltage = %.2f volts\" %V_GSnew", 
      "print \"Drain current = %.2f mA\" %I_D", 
      "print \"Gate to source voltage = %.2f volts\" %V_DS", 
      "print \"AC output voltage = %.2f volts\" %V_out", 
      "print \"Answer in textbook are approximated\""
     ], 
     "language": "python", 
     "outputs": [
      {
       "output_type": "stream", 
       "stream": "stdout", 
       "text": [
        "Drain to source voltage = 2.23 volts", 
        "Drain current = 2.61 mA", 
        "Gate to source voltage = 6.40 volts", 
        "AC output voltage = 1.72 volts", 
        "Answer in textbook are approximated"
       ]
      }
     ], 
     "prompt_number": 9
    }, 
    {
     "cell_type": "markdown", 
     "source": [
      "<h3>Example 8.10, Page Number: 266<h3>"
     ]
    }, 
    {
     "cell_type": "code", 
     "collapsed": false, 
     "input": [
      "", 
      "# variable declaration", 
      "V_DD=-15.0;    #p=channel MOSFET", 
      "g_m=2000.0*10**-6;    #minimum value from datasheets", 
      "R_D=10.0*10**3;", 
      "R_L=10.0*10**3;", 
      "R_S=4.7*10**3;", 
      "", 
      "#calculation", 
      "R_d=(R_D*R_L)/(R_D+R_L);    #effective drain resistance", 
      "A_v=g_m*R_d;", 
      "R_in_source=1.0/g_m;", 
      "#signal souce sees R_S in parallel with ip rest at source terminal(R_in_source)", 
      "R_in=(R_in_source*R_S)/(R_in_source+R_S);   ", 
      "", 
      "#result ", 
      "print \"minimum voltage gain = %.2f\" %A_v", 
      "print \"Input resistance seen from signal source = %.2f ohms\" %R_in"
     ], 
     "language": "python", 
     "outputs": [
      {
       "output_type": "stream", 
       "stream": "stdout", 
       "text": [
        "minimum voltage gain = 10.00", 
        "Input resistance seen from signal source = 451.92 ohms"
       ]
      }
     ], 
     "prompt_number": 10
    }
   ]
  }
 ]
}