summaryrefslogtreecommitdiff
path: root/Electronic_Principles_/Chapter_18_New.ipynb
blob: 1fbf37657b7a321dad59e4de46433b18cf651e22 (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
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
{
 "metadata": {
  "name": ""
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "CHAPTER 18 OPERATIONAL AMPLIFIERS"
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 18-1, Page 672"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Example 18.1.py\n",
      "#How much inverting input voltage required to drive the 741C of figure 18-11a into negative saturation?\n",
      "\n",
      "#Variable declaration\n",
      "Vout=13.5                       #As per figure 18-7b(V)\n",
      "Aov=100000                       #open loop voltage gain\n",
      "\n",
      "#Calculation\n",
      "V2=Vout/Aov                      #required input voltage(V)\n",
      "\n",
      "#Result\n",
      "print 'Required input voltage V2 = ',V2*10**6,'uV'"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Required input voltage V2 =  135.0 uV\n"
       ]
      }
     ],
     "prompt_number": 71
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 18-2, Page 672"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Example 18.2.py\n",
      "#What is the CMRR of a 741C when the input frequency is 100KHz?\n",
      "\n",
      "#Variable declaration\n",
      "CMRR_dB=40                          #As per figure 18-7a at 100KHz(dB)\n",
      "\n",
      "#Calculation\n",
      "CMRR=10**(CMRR_dB/20)\n",
      "\n",
      "#Result\n",
      "print 'Common-mode rejection ratio = ',CMRR"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Common-mode rejection ratio =  100\n"
       ]
      }
     ],
     "prompt_number": 76
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 18-3, Page 673"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Example 18.3.py\n",
      "#what is the open loop voltage gain of 741C when input frequency is 1KHz? 10KHZ? 100KHz?\n",
      "\n",
      "#Variable declaration / Calculation\n",
      "\n",
      "Av1=1000                        #Voltage gain as per figure 18-7c for 1KHZ\n",
      "Av10=100                        #Voltage gain as per figure 18-7c for 10KHZ\n",
      "Av100=10                        #Voltage gain as per figure 18-7c for 100KHZ\n",
      "\n",
      "#Result\n",
      "print 'Voltage gain for 1KHZ = ',Av1\n",
      "print 'Voltage gain for 1KHZ = ',Av10\n",
      "print 'Voltage gain for 1KHZ = ',Av100"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Voltage gain for 1KHZ =  1000\n",
        "Voltage gain for 1KHZ =  100\n",
        "Voltage gain for 1KHZ =  10\n"
       ]
      }
     ],
     "prompt_number": 77
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 18-4, Page 673"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Example 18.4.py\n",
      "#the output changes to 0.25 V in 0.1us. What is te slew rate of the op amp?\n",
      "\n",
      "#Variable declaration\n",
      "Vout=0.25                         #output changes in 0.1us (V)\n",
      "t=0.1                             #time for output change(us) \n",
      "\n",
      "#Calculation\n",
      "SR=Vout/t                         #slew rate(V/us)\n",
      "\n",
      "#Result\n",
      "print 'Slew rate SR = ',SR,'V/us'"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Slew rate SR =  2.5 V/us\n"
       ]
      }
     ],
     "prompt_number": 79
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 18-5, Page 673"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Example 18.5.py\n",
      "#The LF411A has a slew ratwe of 15 V/us. what is power bandwidth for peak output voltage of 10V?\n",
      "import math\n",
      "#Variable declaration\n",
      "SR=15                             #slew rate(V/us)\n",
      "Vp=10                             #Peak output voltage(V)\n",
      "\n",
      "#Calculation\n",
      "fmax=1000*SR/(2*math.pi*Vp)        #power bandwidth (KHz) \n",
      "\n",
      "#Result\n",
      "print 'Power bandwidth = ',round(fmax),'KHz'"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Power bandwidth =  239.0 KHz\n"
       ]
      }
     ],
     "prompt_number": 4
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 18-6, Page 673"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Example 18.6.py\n",
      "#What is the power bandwidth for each of following?\n",
      "\n",
      "import math\n",
      "\n",
      "#Variable declaration\n",
      "SR1=0.5                           #Slew rate1(V/us)\n",
      "SR2=5                             #Slew rate2(V/us)\n",
      "SR3=50                            #Slew rate3(V/us)\n",
      "Vp=8                              #peak voltage(V)\n",
      "\n",
      "#Calculation\n",
      "fmax1=1000*SR1/(2*math.pi*Vp)        #power bandwidth1 (KHz) \n",
      "fmax2=1000*SR2/(2*math.pi*Vp)        #power bandwidth2 (KHz) \n",
      "fmax3=SR3/(2*3*math.pi*Vp)             #power bandwidth3 (MHz) \n",
      "\n",
      "#Result\n",
      "print 'Power bandwidth1 = ',math.ceil(fmax1),'KHz'\n",
      "print 'Power bandwidth2 = ',math.ceil(fmax2),'KHz'\n",
      "print 'Power bandwidth3 = ',math.ceil(fmax3),'MHz'"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Power bandwidth1 =  10.0 KHz\n",
        "Power bandwidth2 =  100.0 KHz\n",
        "Power bandwidth3 =  1.0 MHz\n"
       ]
      }
     ],
     "prompt_number": 2
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 18-7, Page 678"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Example 18.7.py\n",
      "#What are closed-loop voltage gain and bandwidth? what is output voltage at 1KHz & 1MHz?\n",
      "\n",
      "#Variable declaration\n",
      "Vin=10                            #input voltage(mV)\n",
      "Rf=75                             #feedback path resistance Rf (KOhm)\n",
      "R1=1.5                            #inverting input resistance R1(KOhm)\n",
      "Funity=1                          #Funity (MHz)\n",
      "\n",
      "#Calculation\n",
      "Av_CL=-Rf/R1                       #closed loop voltage gain\n",
      "f2_CL1=Funity/-Av_CL               #closed loop bandwidth1(KHz)\n",
      "Vout1=Av_CL*Vin                    #output voltage1(mV)\n",
      "Vout2=-Vin                         #output voltage2(mV)\n",
      "\n",
      "#Result\n",
      "print 'Output voltage for 1KHz = ',Vout1,'mVpp'\n",
      "print 'Output voltage for 1MHz = ',Vout2,'mVpp'"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Output voltage for 1KHz =  -500.0 mVpp\n",
        "Output voltage for 1MHz =  -10 mVpp\n"
       ]
      }
     ],
     "prompt_number": 90
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 18-8, Page 679"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Example 18.8.py\n",
      "#What is output voltage in figure 18-17 when Vin=0?\n",
      "\n",
      "#Variable declaration\n",
      "Vin=10                            #input voltage(mV)\n",
      "Rf=75                             #feedback path resistance Rf (KOhm)\n",
      "R1=1.5                            #inverting input resistance R1(KOhm)\n",
      "Iinb=80*10**-9                    #bias current(A)\n",
      "Iino =20*10**-9                   #Iin(off)  (A) \n",
      "Vino=2.0                          #Vin(off) (mV)\n",
      "Av=50                             #voltage gain \n",
      "RB1=0                             #resistance at noninverting input(KOhm) \n",
      "\n",
      "#Calculation\n",
      "RB2=R1*Rf/(Rf+R1)                            #thevenin resistance at inverting input(KOhm) \n",
      "V1err=(RB1-RB2)*Iinb*10**6                   #dc error input1 (mV)\n",
      "V2err=(RB1+RB2)*(Iino/2)*10**6               #dc error input2 (mV)\n",
      "V3err=Vino                                   #dc error input3 (mV)\n",
      "Verror=Av*(abs(V1err)+V2err+V3err)           #output error voltage(mV)\n",
      "\n",
      "#Result\n",
      "print 'output error voltage Verror = ',round(Verror,2),'mV'"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "output error voltage Verror =  106.62 mV\n"
       ]
      }
     ],
     "prompt_number": 2
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 18-9, Page 679"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Example 18.9.py\n",
      "#Iin(bias)=500nA, Iin(off) =200 nA. and Vin(off)= 6mV. \n",
      "#Calculate output voltage for Vin=0.\n",
      "\n",
      "#Variable declaration\n",
      "Vin=10                             #input voltage(mV)\n",
      "Rf=75                              #feedback path resistance Rf (KOhm)\n",
      "R1=1.5                             #inverting input resistance R1(KOhm)\n",
      "Iinb=500*10**-9                    #bias current(A)\n",
      "Iino =200*10**-9                   #Iin(off)  (A) \n",
      "Vino=6.0                           #Vin(off) (mV)\n",
      "Av=50                              #voltage gain \n",
      "RB1=0                              #resistance at noninverting input(KOhm) \n",
      "\n",
      "#Calculation\n",
      "RB2=R1*Rf/(Rf+R1)                            #thevenin resistance at inverting input(KOhm) \n",
      "V1err=(RB1-RB2)*Iinb*10**6                   #dc error input1 (mV)\n",
      "V2err=(RB1+RB2)*(Iino/2)*10**6               #dc error input2 (mV)\n",
      "V3err=Vino                                   #dc error input3 (mV)\n",
      "Verror=Av*(abs(V1err)+V2err+V3err)           #output error voltage(mV)\n",
      "\n",
      "#Result\n",
      "print 'output error voltage Verror = ',round(Verror,2),'mV'"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "output error voltage Verror =  344.12 mV\n"
       ]
      }
     ],
     "prompt_number": 3
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 18-10, Page 683"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Example 18.10.py\n",
      "#In figure 18-22a, What is closed-loop voltage gain, bandwidth and output voltage at 250KHz?\n",
      "\n",
      "import math\n",
      "\n",
      "#Variable declaration\n",
      "Vin=50                            #input voltage(mV)\n",
      "Rf=3.9*10**3                      #feedback path resistance Rf (Ohm)\n",
      "R1=100                            #inverting input resistance R1(Ohm)\n",
      "Funity=1*10**6                    #Funity (Hz)\n",
      "\n",
      "#Calculation\n",
      "Av_CL=1+(Rf/R1)                    #closed loop voltage gain\n",
      "f2_CL1=Funity/Av_CL                #closed loop bandwidth1(KHz)\n",
      "Av_CL1=math.ceil(10**(12/20.0))    #Av for 12 dB at 250 KHz               \n",
      "Vout=Av_CL1*Vin                    #output voltage(mV)\n",
      "\n",
      "#Result\n",
      "print 'Output voltage for 250KHz = ',Vout,'mVpp'"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Output voltage for 250KHz =  200.0 mVpp\n"
       ]
      }
     ],
     "prompt_number": 30
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 18-11, Page 684"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Example 18.11.py\n",
      "#Iin(bias)=500nA, Iin(off) =200 nA. and Vin(off)= 6mV. \n",
      "#What is the output voltage?\n",
      "\n",
      "#Variable declaration\n",
      "Vin=10                             #input voltage(mV)\n",
      "Rf=3.9*10**3                       #feedback path resistance Rf (Ohm)\n",
      "R1=100                             #inverting input resistance R1(Ohm)\n",
      "Iinb=500*10**-9                    #bias current(A)\n",
      "Iino =200*10**-9                   #Iin(off)  (A) \n",
      "Vino=6.0*10**-3                    #Vin(off) (V)\n",
      "Av=40                              #voltage gain \n",
      "RB1=0                              #resistance at noninverting input(KOhm) \n",
      "\n",
      "#Calculation\n",
      "RB2=R1*Rf/(Rf+R1)                            #thevenin resistance at inverting input(KOhm) \n",
      "V1err=(RB1-RB2)*Iinb                         #dc error input1 (mV)\n",
      "V2err=(RB1+RB2)*(Iino/2)                     #dc error input2 (mV)\n",
      "V3err=Vino                                   #dc error input3 (mV)\n",
      "Verror=Av*(abs(V1err)+V2err+V3err)           #output error voltage(mV)\n",
      "\n",
      "#Result\n",
      "print 'output error voltage Verror = ',Verror*1000,'mV'"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "output error voltage Verror =  242.34 mV\n"
       ]
      }
     ],
     "prompt_number": 2
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 18-12, Page 687"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Example 18.12.py\n",
      "#Three audio signals drive the summing amplifier of figure 18-25. What is the ac output voltage?\n",
      "\n",
      "#Variable declaration\n",
      "Vin1=100*10**-3                            #input voltage1(V)\n",
      "Vin2=200*10**-3                            #input voltage2(V)\n",
      "Vin3=300*10**-3                            #input voltage3(V)\n",
      "Rf=100.0                                   #feedback path resistance Rf (KOhm)\n",
      "R1=20.0                                    #inverting input resistance R1(KOhm)\n",
      "R2=10.0                                    #inverting input resistance R2(KOhm)\n",
      "R3=50.0                                    #inverting input resistance R3(KOhm)\n",
      "\n",
      "#Calculation\n",
      "Av1_CL=-Rf/R1                              #closed loop voltage gain\n",
      "Av2_CL=-Rf/R1                              #closed loop voltage gain\n",
      "Av3_CL=-Rf/R1                              #closed loop voltage gain\n",
      "Vout=Av1_CL*Vin1+Av2_CL*Vin2+Av3_CL*Vin3   #output voltage1(mV)\n",
      "RB2=(R1**-1+R2**-1+R3**-1+Rf**-1)**-1      #thevenin resistance at inverting input(KOhm) \n",
      "\n",
      "#Result\n",
      "print 'Output voltage = ',Vout,'Vpp'\n",
      "print 'thevenin resistance at inverting input RB2 = ',round(RB2,2),'KOhm'"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Output voltage =  -3.0 Vpp\n",
        "thevenin resistance at inverting input RB2 =  5.56 KOhm\n"
       ]
      }
     ],
     "prompt_number": 4
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 18-13, Page 688"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Example 18.13.py\n",
      "#An ac voltage source of 10 mVpp with an internal resistance of 100 KOhm drives voltage follower. \n",
      "#RL is 1 Ohm. Find output voltage & bandwidth.\n",
      "\n",
      "#Variable declaration\n",
      "Vin=10                             #ac voltage source (mVpp)\n",
      "Av=1                               #voltage gain\n",
      "Funity=1                           #unity frequency (MHz) \n",
      "\n",
      "#Calculation\n",
      "Vout=Av*Vin                        #output voltage(V) \n",
      "f2_CL=Funity                       #bandwidth(MHz) \n",
      "\n",
      "#Result \n",
      "print 'Output voltage = ',Vout,'mVpp'\n",
      "print 'Bandwidth f2(CL) = ',f2_CL,'MHz'"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Output voltage =  10 mVpp\n",
        "Bandwidth f2(CL) =  1 MHz\n"
       ]
      }
     ],
     "prompt_number": 5
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 18-14, Page 688"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Example 18.14.py\n",
      "#In voltage follower of figure 18-26a, the output voltage across the 1 Ohm load is 9.99 mV. \n",
      "#calculate closed loop output impedance.\n",
      "\n",
      "#Variable declaration\n",
      "RL=1.0                             #load resistance(Ohm)\n",
      "Vout=9.99                          #load voltage(mV)\n",
      "Vz=0.01                            #voltage across Zout(CL) (mV)\n",
      "\n",
      "#Calculation\n",
      "iout=Vout/RL                           #load current(mA)\n",
      "Zout_CL=Vz/iout                        #output impedance(Ohm)\n",
      "\n",
      "#Result\n",
      "print 'Load current iout = ',iout,'mA'\n",
      "print 'closed loop output impedance Zout(CL) = ',round(Zout_CL,3),'Ohm'"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Load current iout =  9.99 mA\n",
        "closed loop output impedance Zout(CL) =  0.001 Ohm\n"
       ]
      }
     ],
     "prompt_number": 5
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [],
     "language": "python",
     "metadata": {},
     "outputs": []
    }
   ],
   "metadata": {}
  }
 ]
}