summaryrefslogtreecommitdiff
path: root/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter07.ipynb
blob: ef03f35611d02f37b6c73bf5b9200b3d23c900e0 (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
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
{
 "metadata": {
  "name": "",
  "signature": "sha256:df8de903c993d95a64f446dabb646c726ccbd74d5f5097708ab83278555b0cb9"
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "Chapter07:Small Signal SIngle-Stage Amplifier"
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example E1 - Pg 229"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Calculate max current and check will the capacitor act as short for given frequency\n",
      "#given\n",
      "import math\n",
      "C=100.*10.**-6.;#Farad\n",
      "Rs=1.*10.**3.;#ohm\n",
      "Rl=4.*10.**3.;#ohm\n",
      "Vs=1.;#V\n",
      "Imax=Vs/(Rs+Rl);\n",
      "fc=1./(2.*math.pi*(Rs+Rl)*C)     #critical frequency\n",
      "fh=10.*fc;                  #Border frequency\n",
      "print '%s %.f %s' %(\"Maximum current is =\",Imax*10**6,\"uA\\n\");\n",
      "print '%s %.2f %s' %(\"fh =\",fh,\"Hz\\n\");\n",
      "print '%s %.2f %s %s' %(\"As long as source frequency is greater than\",fh,\"Hz\",\"the coupling capacitor acts like an ac short for 20Hz to 20kHz\")\n",
      "\n",
      "#In book Imax is 200mA but there is misprinting of 'm' in mA it should be uA\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Maximum current is = 200 uA\n",
        "\n",
        "fh = 3.18 Hz\n",
        "\n",
        "As long as source frequency is greater than 3.18 Hz the coupling capacitor acts like an ac short for 20Hz to 20kHz\n"
       ]
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example E2 - Pg 230"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Check whether the capacitor is an effective bypass for the signal currents of lowest frequency 20 Hz\n",
      "#given\n",
      "import math\n",
      "C=100.*10.**-6.;#Farad\n",
      "Rs=1.*10.**3.;#ohm\n",
      "Rl=4.*10.**3.;#ohm\n",
      "f=20.;#Hz          #lowest frequency\n",
      "Xc=1./(2.*math.pi*f*C)         #reactance of capacitor at 20Hz\n",
      "Rth=Rs*Rl/(Rs+Rl);      #Thevenins equivalent resistance\n",
      "print '%s %.1f %s %.f %s ' %(\"Xc < Rth/10 is satisfied\",Xc,\"ohm\",Rth/10,\"ohm\\n\");\n",
      "print '%s' %(\"The capacitor of 100uF will work as a good bypass for frequencies greater than 20 Hz \")\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Xc < Rth/10 is satisfied 79.6 ohm 80 ohm\n",
        " \n",
        "The capacitor of 100uF will work as a good bypass for frequencies greater than 20 Hz \n"
       ]
      }
     ],
     "prompt_number": 2
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example E3 - Pg 231"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Calculate the value of capacitor required\n",
      "#given\n",
      "import math\n",
      "Rs1=20.*10.**3.;#ohm\n",
      "Rs2=30.*10.**3.;#ohm\n",
      "Rl1=40.*10.**3.;#ohm\n",
      "Rl2=80.*10.**3.;#ohm\n",
      "Rl3=80.*10.**3.;#ohm\n",
      "Rth=Rs1*Rs2/(Rs1+Rs2);          #Thevenins equivalent resistance\n",
      "Rl_=Rl2*Rl3/(Rl2+Rl3);\n",
      "Rl=Rl1*Rl_/(Rl1+Rl_);    #Equivalent load\n",
      "f=50.;#Hz          #lowest frequency\n",
      "R=Rth+Rl;\n",
      "C=10./(2.*math.pi*f*R)\n",
      "print '%s %.f %s' %(\"The required value of coupling capacitor is =\",C*10**6,\"uF\");\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The required value of coupling capacitor is = 1 uF\n"
       ]
      }
     ],
     "prompt_number": 3
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example E4 - Pg 247"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Calculate voltage and current gain and input and output resistance\n",
      "def  prll(r1,r2):\n",
      "\tz=r1*r2/(r1+r2)#\n",
      "\treturn z\n",
      "#given\n",
      "\n",
      "#DC analysis\n",
      "Vcc=12.;#V\n",
      "Rb=200.*10.**3.;#ohm\n",
      "Rc=1.*10.**3.;#ohm\n",
      "B=100.;# beta\n",
      "Ib=Vcc/Rb;\n",
      "Ic=B*Ib;\n",
      "Icsat=Vcc/Rc;\n",
      "Vce=Vcc-Ic*Rc;\n",
      "print '%s %.2f %s %.2f %s' %(\"The Q point of DC analysis=\",Vce,\"V\",Ic*1000,\"mA\");\n",
      "\n",
      "#AC analysis\n",
      "Rl=1.*10.**3.;#ohm\n",
      "hfe=B;\n",
      "hie=2.*10.**3.;#ohm\n",
      "hoe_1=40.*10.**3.;#ohm      # 1/hoe\n",
      "Rac=prll(Rc,Rl);\n",
      "Av=-hfe*Rac/hie;\n",
      "print '%s %.2f %s' %(\"\\nThe voltage gain =\",Av,\"\\n\");\n",
      "\n",
      "#Siince (1/hoe) > Rac therefore entire current will flows through Rac\n",
      "Io=-100.*Ib;\n",
      "Ac=Io/Ib;\n",
      "print '%s %.2f %s' %(\"The current gain =\",Ac,\"\\n\");\n",
      "\n",
      "Ri=prll(Rb,hie);\n",
      "Ro=prll(Rl,prll(Rc,hoe_1));\n",
      "print '%s %.f %s' %(\"The input resistance =\",Ri/1000,\"kohm\\n\");\n",
      "print '%s %.1f %s' %(\"The output resistance =\",Ro/1000,\"kohm\");\n",
      "\n",
      "#In book the voltage gain is 25 due to skipping of '-' in printing\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The Q point of DC analysis= 6.00 V 6.00 mA\n",
        "\n",
        "The voltage gain = -25.00 \n",
        "\n",
        "The current gain = -100.00 \n",
        "\n",
        "The input resistance = 2 kohm\n",
        "\n",
        "The output resistance = 0.5 kohm\n"
       ]
      }
     ],
     "prompt_number": 4
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example E5 - Pg 249"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Solve previous example using hybrid pie model\n",
      "#soltion\n",
      "#given\n",
      "def  prll(r1,r2):\n",
      "\tz=r1*r2/(r1+r2)#\n",
      "\treturn z\n",
      "Vcc=12.##V\n",
      "Rb=200.*10.**3.##ohm\n",
      "Rc=1.*10.**3.##ohm\n",
      "Rl=1.*10.**3.##ohm\n",
      "B=100.## beta\n",
      "hie=2.*10.**3.##ohm\n",
      "hoe_1=40.*10.**3.##ohm      # 1/hoe\n",
      "\n",
      "Ib=Vcc/Rb#\n",
      "Ic=B*Ib#\n",
      "Rac=prll(Rc,Rl)#\n",
      "gm=Ic/(25.*10.**-3.)#\n",
      "rpi=B/gm#\n",
      "ri=hie#\n",
      "rb=ri-rpi#\n",
      "ro=hoe_1#\n",
      "Vpi=rpi/(rpi+rb)#\n",
      "Vo=-gm*Vpi*Rac#    #output voltage\n",
      "Av=Vo#\n",
      "print '%s %.2f' %(\"The voltage gain\",Av)#\n",
      "#In book voltage gain is -24.96 due to appraoximation\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The voltage gain -25.00\n"
       ]
      }
     ],
     "prompt_number": 5
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example E6 - Pg 250"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Determine the value of output voltage\n",
      "#given\n",
      "Vcc=12.;#V\n",
      "Rb=150.*10.**3.;#ohm\n",
      "Rc=5.*10.**3.;#ohm\n",
      "B=200.;# beta\n",
      "hie=2.*10.**3.;#ohm\n",
      "ro=60.*10.**3.;#ohm      # 1/hoe\n",
      "Vi=1.*10.**-3.;#V\n",
      "Ib=Vcc/Rb;\n",
      "Ic=B*Ib;\n",
      "Icsat=Vcc/Rc;\n",
      "# Icsat < Ic therefore transistor is in saturation mode and outpuut voltage wil be zero\n",
      "Vo=0;\n",
      "print '%s %.f %s' %(\"The output voltage=\",Vo,\"V\");\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The output voltage= 0 V\n"
       ]
      }
     ],
     "prompt_number": 6
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example E7 - Pg 250"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Calculate voltage gain and input resistance\n",
      "# Function definition is here\n",
      "#given\n",
      "def  prll(r1,r2):\n",
      "\tz=r1*r2/(r1+r2);\n",
      "\treturn z\n",
      "\n",
      "R1=75.*10.**3.;#ohm\n",
      "R2=7.5*10.**3.;#ohm\n",
      "Rc=4.7*10.**3.;#ohm\n",
      "Re=1.2*10.**3.;#ohm\n",
      "Rl=12.*10.**3.;#ohm\n",
      "B=150.;\n",
      "ri=2.*10.**3.;#ohm\n",
      "Vcc=15.;#V\n",
      "Vb=Vcc*R2/(R1+R2);\n",
      "Ve=Vb;        #since Vbe=0\n",
      "Ie=Ve/Re;\n",
      "Ic=Ie;\n",
      "Icsat=Vcc/(Rc+Re);\n",
      "# Ic < Icsat therefore transistor is in active mode\n",
      "Vce=Vcc-Ic*(Rc+Re);\n",
      "print '%s %.2f %s %.2f %s' %(\"The Q point of DC analysis=\",Vce,\"V\",Ic*1000,\"mA\");\n",
      "\n",
      "Rac=prll(Rc,Rl);\n",
      "Av=-B*Rac/ri;\n",
      "print '%s %.1f %s' %(\"\\nThe voltage gain =\",Av,\"\\n\");\n",
      "Ri_=prll(ri,R2);\n",
      "print '%s %.2f %s' %(\"The input resistance=\",Ri_/1000,\"kohm\\n\");\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The Q point of DC analysis= 8.30 V 1.14 mA\n",
        "\n",
        "The voltage gain = -253.3 \n",
        "\n",
        "The input resistance= 1.58 kohm\n",
        "\n"
       ]
      }
     ],
     "prompt_number": 7
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example E8 - Pg 253"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Calculate the value of gm at different values of Vgs\n",
      "#given\n",
      "\n",
      "Idss=8.*10.**-3.;#A\n",
      "Vp=4;#V\n",
      "#At Vgs= -0.5 V\n",
      "Vgs= -0.5;#V\n",
      "gmo=2.*Idss/(abs(Vp));\n",
      "gm=gmo*(1.-(Vgs/(-Vp)));\n",
      "print '%s %.f %s' %(\"gmo =\",gmo*1000,\"mS\\n\");\n",
      "print '%s %.1f %s' %(\"gm (At Vgs = -0.5V) =\",gm*1000,\"mS\\n\");\n",
      "\n",
      "#At Vgs= -1.5 V\n",
      "Vgs= -1.5;#V\n",
      "gmo=2.*Idss/(abs(Vp));\n",
      "gm=gmo*(1.-(Vgs/(-Vp)));\n",
      "print '%s %.1f %s' %(\"gm (At Vgs = -1.5V) =\",gm*1000,\"mS\\n\");\n",
      "\n",
      "#At Vgs= -2.5 V\n",
      "Vgs= -2.5;#V\n",
      "gmo=2.*Idss/(abs(Vp));\n",
      "gm=gmo*(1.-(Vgs/(-Vp)));\n",
      "print '%s %.1f %s' %(\"gm (At Vgs = -2.5V) =\",gm*1000,\"mS\\n\");\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "gmo = 4 mS\n",
        "\n",
        "gm (At Vgs = -0.5V) = 3.5 mS\n",
        "\n",
        "gm (At Vgs = -1.5V) = 2.5 mS\n",
        "\n",
        "gm (At Vgs = -2.5V) = 1.5 mS\n",
        "\n"
       ]
      }
     ],
     "prompt_number": 8
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example E9 - Pg 255"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Find the output signal voltage of the amplifier\n",
      "#given\n",
      "import math\n",
      "Rd=12.*10.**3.;#ohm\n",
      "Rg=1.*10.**6.;#ohm\n",
      "Rs=1.*10.**3.;#ohm\n",
      "Cs=25.*10.**-6.;#F\n",
      "u=80.;      #amplification factor\n",
      "rd=200.*10.**3.;#ohm\n",
      "Vi=0.1;#V\n",
      "f=1.*10.**3.;#Hz      #input frequency\n",
      "Xcs=1./(2.*math.pi*f*Cs);\n",
      "#This is much smaller than Rs therefore it is bypassed\n",
      "\n",
      "gm=u/rd;\n",
      "Av=gm*(rd*Rd/(rd+Rd));\n",
      "Vo=Av*Vi;\n",
      "print '%s %.3f %s' %(\"The output voltage is =\",Vo,\"V\");\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The output voltage is = 0.453 V\n"
       ]
      }
     ],
     "prompt_number": 9
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example E10 - Pg 256"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Determine the small signal voltage gain and input and output resistance\n",
      "#given\n",
      "Rd=2.*10.**3.;#ohm\n",
      "rd=100.*10.**3.;#ohm\n",
      "Rg=1.*10.**6.;#ohm\n",
      "gm=2.*10.**-3.;#S\n",
      "Av=-gm*(rd*Rd/(rd+Rd));\n",
      "Ri=Rg;\n",
      "Ro=rd*Rd/(rd+Rd);\n",
      "print '%s %.f %s %.f %s %s %.f %s' %(\"The small signal voltage gain =\",Av,\"\\ninput resistance=\",Ri/10**6,\"Mohm\",\"\\noutput resistance =\",Ro/1000,\"kohm\");\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The small signal voltage gain = -4 \n",
        "input resistance= 1 Mohm \n",
        "output resistance = 2 kohm\n"
       ]
      }
     ],
     "prompt_number": 10
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example E11 - Pg 256"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Determine the small signal voltage gain and input and output resistance\n",
      "#given\n",
      "R1=500.*10.**3.;#ohm\n",
      "R2=50.*10.**3.;#ohm\n",
      "Rd=5.*10.**3.;#ohm\n",
      "Rs=100.;#ohm\n",
      "Rl=5.*10.**3.;#ohm\n",
      "gm=1.5*10.**-3.;#S\n",
      "rd=200.*10.**3.;#ohm\n",
      "Rg=R1*R2/(R1+R2);\n",
      "Rac=Rd*Rl/(Rd+Rl);\n",
      "Av=-gm*Rac;\n",
      "Ri=Rg;\n",
      "Ro=(rd*Rac/(rd+Rac));\n",
      "print '%s %.2f %s %.2f %s %s %.1f %s' %(\"The small signal voltage gain =\",Av,\"\\nInput resistance =\",Ri/1000,\"kohm\",\"\\nOutput resistance =\",Ro/1000,\"kohm\");\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The small signal voltage gain = -3.75 \n",
        "Input resistance = 45.45 kohm \n",
        "Output resistance = 2.5 kohm\n"
       ]
      }
     ],
     "prompt_number": 11
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example E12 - Pg 257"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Calculate the voltage gain of the FET\n",
      "#given\n",
      "Idss=8.*10.**-3.##A\n",
      "Vp=4.##V\n",
      "rd=25.*10.**3.##ohm\n",
      "Rd=2.2*10.**3.##ohm     #by the help of figure\n",
      "Vgs=-1.8##V\n",
      "gmo=2.*Idss/(abs(Vp))#\n",
      "gm=gmo*(1.-(Vgs/(-Vp)))#\n",
      "Av=-gm*(rd*Rd/(rd+Rd))#\n",
      "print '%s %.2f' %(\"The voltage gain of the FET =\",Av)#\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The voltage gain of the FET = -4.45\n"
       ]
      }
     ],
     "prompt_number": 12
    }
   ],
   "metadata": {}
  }
 ]
}