summaryrefslogtreecommitdiff
path: root/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/chapter08.ipynb
blob: 7ccf524bee2e09d3f6be267332277f5ad60e69b0 (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
{
 "metadata": {
  "name": "",
  "signature": "sha256:5a78eb3c7cc2f82cd21ccad707b4376bdb45f22452d4892c16308b1bdd58f45f"
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "chapter08:Multistage Amplifiers"
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example E1 - Pg 276"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Express the gain in decibel\n",
      "#given\n",
      "#Powere gain of 1000\n",
      "import math\n",
      "Pg1=1000.;\n",
      "Pgd1=10.*math.log10(Pg1);\n",
      "print '%s %.f %s' %(\"Power gain (in dB)=\",Pgd1,\"dB\\n\");\n",
      "\n",
      "#Voltage gain of 1000\n",
      "Vg1=1000.;\n",
      "Vgd1=20.*math.log10(Vg1);\n",
      "print '%s %.f %s' %(\"Voltage gain (in dB)=\",Vgd1,\"dB\\n\");\n",
      "\n",
      "#Powere gain of 1/100\n",
      "Pg2=1./100.;\n",
      "Pgd2=10.*math.log10(Pg2);\n",
      "print '%s %.f %s' %(\"Power gain (in dB)=\",Pgd2,\"dB\\n\");\n",
      "\n",
      "#Voltage gain of 1/100\n",
      "Vg2=1./100.;\n",
      "Vgd2=20.*math.log10(Vg2);\n",
      "print '%s %.f %s' %(\"Voltage gain (in dB)=\",Vgd2,\"dB\\n\");\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Power gain (in dB)= 30 dB\n",
        "\n",
        "Voltage gain (in dB)= 60 dB\n",
        "\n",
        "Power gain (in dB)= -20 dB\n",
        "\n",
        "Voltage gain (in dB)= -40 dB\n",
        "\n"
       ]
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example E2 - Pg 276"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Determine power and voltage gain\n",
      "#given\n",
      "#For  Gain = 10 dB\n",
      "G=10.;#dB\n",
      "Pg1=10.**(G/10.);       #taking antilog\n",
      "Vg1=10.**(G/20.);       #taking antilog\n",
      "print '%s %.f %s' %(\"For Gain\",G,\"dB\\n\")\n",
      "print '%s %.f %s' %(\"Power gain ratio =\",Pg1,\"\\n\");\n",
      "print '%s %.2f %s' %(\"Voltage gain ratio =\",Vg1,\"\\n\");\n",
      "\n",
      "#For Gain 3 dB\n",
      "G=3.;#dB\n",
      "Pg2=10.**(G/10.);       #taking antilog\n",
      "Vg2=10.**(G/20.);       #taking antilog\n",
      "print '%s %.f %s' %(\"For Gain\",G,\"dB\\n\")\n",
      "print '%s %.2f %s' %(\"Power gain ratio =\",Pg2,\"\\n\");\n",
      "print '%s %.3f %s' %(\"Voltage gain ratio =\",Vg2,\"\\n\");\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "For Gain 10 dB\n",
        "\n",
        "Power gain ratio = 10 \n",
        "\n",
        "Voltage gain ratio = 3.16 \n",
        "\n",
        "For Gain 3 dB\n",
        "\n",
        "Power gain ratio = 2.00 \n",
        "\n",
        "Voltage gain ratio = 1.413 \n",
        "\n"
       ]
      }
     ],
     "prompt_number": 2
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example E3 - Pg 277"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Calculate the overall voltage gain\n",
      "#given\n",
      "import math\n",
      "A1=80.\n",
      "A2=50.\n",
      "A3=30.\n",
      "Ad=20.*math.log10(A1)+20.*math.log10(A2)+20.*math.log10(A3);\n",
      "\n",
      "#Alternatively\n",
      "A=A1*A2*A3;\n",
      "Ad=20.*math.log10(A);\n",
      "print '%s %.2f %s' %(\"The Voltage gain is =\",Ad,\"dB\");\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The Voltage gain is = 101.58 dB\n"
       ]
      }
     ],
     "prompt_number": 3
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example E4 - Pg 283"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Calculate quiescent output voltage and small signal voltage gain\n",
      "#given\n",
      "#At input Voltage =3V\n",
      "Vi1=3.##V      #input voltage\n",
      "Vbe=0.7##V\n",
      "B=250.#\n",
      "Vcc=10.##V     #Supply\n",
      "Re1=1.*10.**3.##ohm\n",
      "Rc1=3.*10.**3.##ohm\n",
      "Re2=2.*10.**3.##ohm\n",
      "Rc2=4.*10.**3.##ohm\n",
      "Vb1=Vi1#        #Voltage at the base of transistor T1\n",
      "Ve1=Vb1-Vbe#      #Voltage at the emitter of transistor T1\n",
      "Ie1=Ve1/Re1#\n",
      "Ic1=Ie1#\n",
      "Vc1=Vcc-Ic1*Rc1#\n",
      "Vb2=Vc1#\n",
      "Ve2=Vb2-Vbe#\n",
      "Ie2=Ve2/Re2#\n",
      "Ic2=Ie2#\n",
      "Vo1=Vcc-Ic2*Rc2#\n",
      "print '%s %.1f %s' %(\"The quiescent output voltage(At input Voltage = 3V) is =\",Vo1,\"V\\n\")#\n",
      "\n",
      "#At input Voltage =3.2 V\n",
      "Vi2=3.2##V      #input voltage\n",
      "Vb1=Vi2#        #Voltage at the base of transistor T1\n",
      "Ve1=Vb1-Vbe#      #Voltage at the emitter of transistor T1\n",
      "Ie1=Ve1/Re1#\n",
      "Ic1=Ie1#\n",
      "Vc1=Vcc-Ic1*Rc1#\n",
      "Vb2=Vc1#\n",
      "Ve2=Vb2-Vbe#\n",
      "Ie2=Ve2/Re2#\n",
      "Ic2=Ie2#\n",
      "Vo2=Vcc-Ic2*Rc2#\n",
      "print '%s %.1f %s' %(\"The quiescent output voltage (At input Voltage =3.2 V) is =\",Vo2,\"V\\n\")#\n",
      "\n",
      "#Small Signal input and output voltage\n",
      "vi=Vi2-Vi1#\n",
      "vo=Vo2-Vo1#\n",
      "Av=vo/vi#\n",
      "print '%s %.f' %(\"The small signal voltage gain is =\",Av)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The quiescent output voltage(At input Voltage = 3V) is = 5.2 V\n",
        "\n",
        "The quiescent output voltage (At input Voltage =3.2 V) is = 6.4 V\n",
        "\n",
        "The small signal voltage gain is = 6\n"
       ]
      }
     ],
     "prompt_number": 4
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example E5 - Pg 296"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Calculate the maximum voltage gain and bandwidth of multistage amplifier\n",
      "#FUNCTIONS\n",
      "#given\n",
      "def  prll(r1,r2):\n",
      "\tz=r1*r2/(r1+r2)#\n",
      "\treturn z\n",
      "\n",
      "import math\n",
      "rin=10.*10.**6.;#ohm #input resistance of JFET\n",
      "Rd=10.*10.**3.;#ohm\n",
      "Rs=500.;#ohm\n",
      "Rg=470.*10.**3.;#ohm\n",
      "Rl=470.*10.**3.;#ohm\n",
      "Cc=0.01*10.**-6.;#Farad\n",
      "Csh=100.*10.**-12.;#Farad\n",
      "Cs=50.*10.**-6.;#Farad\n",
      "rd=100.*10.**3.;#ohm\n",
      "gm=2.*10.**-3.;#S\n",
      "Rac2=prll(Rd,Rl);\n",
      "Rac1=prll(Rd,Rg);\n",
      "Req=prll(rd,prll(Rd,Rl));\n",
      "Am=math.ceil(gm*Req);\n",
      "Am2=Am*Am;       #Voltage gain of two stage amplifier\n",
      "print '%s %.f %s' %(\"Voltage gain of two stage amplifier=\",Am2,\"\\n\");\n",
      "R_=prll(rd,Rd)+prll(Rg,rin);\n",
      "f1=1./(2.*math.pi*Cc*R_);      #lower cutoff frequency\n",
      "f1_=f1/(math.sqrt(math.sqrt(2.)-1.));\n",
      "f2=1./(2.*math.pi*Csh*Req);      #upper cutoff frequency\n",
      "f2_=f2*(math.sqrt(math.sqrt(2.)-1.));\n",
      "BW=f2_-f1_;\n",
      "print '%s %.f %s' %(\"Bandwidth=\",BW/1000.,\"kHz\\n\");\n",
      "#There is a slight error in f1 due to use of R'(here R_)=479 kohm and in f2 due to approaximation of Req there is a slight variation\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Voltage gain of two stage amplifier= 324 \n",
        "\n",
        "Bandwidth= 115 kHz\n",
        "\n"
       ]
      }
     ],
     "prompt_number": 5
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example E6 - Pg 298"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Calculate the midband voltage gain and bandwidth of cascade amplifier\n",
      "#given\n",
      "import math\n",
      "Am=8.##midband voltage gain of individual MOSFET\n",
      "BW=500.*10.**3.#Hz\n",
      "f2=BW#\n",
      "n=4.#\n",
      "A2m=Am**n#\n",
      "f2_=f2*(math.sqrt((2.**(1./n))-1.))#\n",
      "print '%s %.f %s' %(\"Midband voltage gain =\",A2m,\"\\n\")#\n",
      "print '%s %.1f %s' %(\"Overall Bandwidth =\",f2_/1000,\"kHz\")#\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Midband voltage gain = 4096 \n",
        "\n",
        "Overall Bandwidth = 217.5 kHz\n"
       ]
      }
     ],
     "prompt_number": 6
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example E7 - Pg 298"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Calculate the input and output impedance and voltage gain\n",
      "#FUNCTIONS\n",
      "\n",
      "def  prll(r1,r2):\n",
      "\tz=r1*r2/(r1+r2)#\n",
      "\treturn z\n",
      "\n",
      "import math\n",
      "hie=1.1*10.**3.;#ohm=rin\n",
      "hfe=120.;#=B\n",
      "#the values of Rac2, Zi, Zo are as per diagram\n",
      "Rac2=prll(3.3*10**3,2.2*10**3);\n",
      "Rac1=prll(6.8*10**3,prll(56*10**3,prll(5.6*10**3,1.1*10**3)));\n",
      "Zi=prll(5.6*10**3,prll(56*10**3,1.1*10**3));\n",
      "Zo=prll(3.3*10**3,2.2*10**3);\n",
      "print '%s %.3f %s %s %.2f %s' %(\"Input Resistance =\",Zi/1000,\"kohm\\n\",\"\\nOutput Resistance =\",Zo/1000,\"kohm\");\n",
      "Am2=-hfe*Rac2/(hie);\n",
      "Am1=-hfe*Rac1/(hie);\n",
      "Am=Am1*Am2;\n",
      "Am=20.*math.log10(Am);\n",
      "print '%s %.2f %s' %(\"\\nThe Overall Voltage gain is\",Am,\"dB\");\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Input Resistance = 0.905 kohm\n",
        " \n",
        "Output Resistance = 1.32 kohm\n",
        "\n",
        "The Overall Voltage gain is 81.97 dB\n"
       ]
      }
     ],
     "prompt_number": 7
    }
   ],
   "metadata": {}
  }
 ]
}