summaryrefslogtreecommitdiff
path: root/Linear_Integrated_Circuits_by_J._B._Gupta/chapter02_1.ipynb
blob: fe244fefdd168a4f8410838f584aafe17fbefc5f (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
{
 "metadata": {
  "name": ""
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "Chapter- 2 : Introduction To Operational Amplifiers"
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example : 2.2 - Page No 70"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Given data\n",
      "Vin1= 5 # in \u00b5V\n",
      "Vin1= Vin1*10**-6 # in V\n",
      "Vin2= -7 #in \u00b5V\n",
      "Vin2= Vin2*10**-6 # in V\n",
      "Av= 2*10**5 # unit less\n",
      "Rin= 2 # in M\u03a9\n",
      "Vout= (Vin1-Vin2)*Av # in V\n",
      "print \"The output voltage = %0.1f volts\" %Vout"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The output voltage = 2.4 volts\n"
       ]
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example : 2.4 - Page No 71"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "from __future__ import division\n",
      "# Given data\n",
      "Rs= 2 # in k\u03a9\n",
      "RL= 5 # in k\u03a9\n",
      "A= 10**5 # unit less\n",
      "Rin= 100 #in k\u03a9\n",
      "Rout= 50 # in \u03a9\n",
      "Vout= 10 # in V\n",
      "# For Vout = 10 V, V1= V2 = Vout\n",
      "V1= Vout # in V\n",
      "V2= V1 # in V\n",
      "# From equation V1= Vs*Rin/(Rin+Rs)\n",
      "Vs= V1*(Rin+Rs)/Rin # in V\n",
      "Vout_by_Vs= Vout/Vs # value of Vout/Vs\n",
      "print \"The value of Vs =%0.1f volts\" %Vs\n",
      "print \"The value of Vout/Vs = %0.2f\" %Vout_by_Vs\n",
      "print \"The input resistance of the circuit = %0.f k\u03a9\" %Rin"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The value of Vs =10.2 volts\n",
        "The value of Vout/Vs = 0.98\n",
        "The input resistance of the circuit = 100 k\u03a9\n"
       ]
      }
     ],
     "prompt_number": 6
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example : 2.6 - Page No 74"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "# Given data\n",
      "Ad= 100 # differential mode gain\n",
      "Acm= 0.01 # common mode gain\n",
      "CMRR= Ad/Acm \n",
      "CMRR_desh= 20*math.log(CMRR,10) # CMRR in dB\n",
      "print \"CMRR = %0.f dB\" %CMRR_desh"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "CMRR = 80 dB\n"
       ]
      }
     ],
     "prompt_number": 2
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example : 2.7 - Page No 74"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Given data\n",
      "Ad= 10**5 # differential mode gain\n",
      "CMRR= 10**5 \n",
      "# Common-mode gain,\n",
      "Acm= Ad/CMRR \n",
      "print \"The common-mode gain = %0.f\" %Acm"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The common-mode gain = 1\n"
       ]
      }
     ],
     "prompt_number": 11
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example : 2.8 - Page No 74"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Given data\n",
      "V1= 10 # in mV\n",
      "V2= 9 # in mV\n",
      "Ad= 60 # differential voltage gain in dB\n",
      "Ad= 10**(Ad/20) \n",
      "CMRR= 80 # in dB\n",
      "CMRR= 10**(CMRR/20) \n",
      "Vd= V1-V2 # difference signal in mV\n",
      "Vcm= (V1+V2)/2 # common-mode signal in mV\n",
      "# Output voltage,\n",
      "Vout= Ad*Vd*(1+1/CMRR*Vcm/Vd) # in mV\n",
      "AdVd= Ad*Vd # in mV\n",
      "# Error voltage\n",
      "Verror= Vout-AdVd # in mV\n",
      "Per_error= Verror/Vout*100 # percentage error\n",
      "print \"The error voltage = %0.2f mV\" %Verror\n",
      "print \"The percentage error in the output voltage = %0.3f \" %Per_error"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The error voltage = 0.95 mV\n",
        "The percentage error in the output voltage = 0.095 \n"
       ]
      }
     ],
     "prompt_number": 14
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example : 2.9 - Page No 74"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Given data\n",
      "V1= 745 # in \u00b5V\n",
      "V2= 740 # in \u00b5V\n",
      "Ad= 5*10**5 # differential voltage gain\n",
      "CMRR= 80 # in dB\n",
      "CMRR= 10**(CMRR/20) \n",
      "Vd= V1-V2 # difference signal in \u00b5V\n",
      "Vcm= (V1+V2)/2 # common-mode signal in \u00b5V\n",
      "# Output voltage,\n",
      "Vout= Ad*Vd*(1+1/CMRR*Vcm/Vd) # in \u00b5V\n",
      "AdVd= Ad*Vd # in \u00b5V\n",
      "# Error voltage\n",
      "Verror= Vout-AdVd # in \u00b5V\n",
      "Vout= Vout*10**-6 # in V\n",
      "Verror= Verror*10**-6 # in V\n",
      "Per_error= Verror/Vout*100 # percentage error\n",
      "print \"The output voltage = %0.6f V\" %Vout\n",
      "print \"The percentage error in the output voltage= %0.4f\" %Per_error"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The output voltage = 2.537125 V\n",
        "The percentage error in the output voltage= 1.4633\n"
       ]
      }
     ],
     "prompt_number": 16
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example : 2.10 - Page No 76"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Given data\n",
      "Vd= 25 #differential input voltage in \u00b5V\n",
      "Vd= Vd*10**-6 # in V\n",
      "A= 200000 # open loop gain\n",
      "# Output voltage,\n",
      "Vout= A*Vd # in V\n",
      "print \"The output voltage = \u00b1 %0.f \" %Vout"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The output voltage = \u00b1 5 \n"
       ]
      }
     ],
     "prompt_number": 18
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example : 2.11 - Page 83"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Given data\n",
      "dVout= 20 # change in output voltage in V\n",
      "dt= 4 # change in time in \u00b5s\n",
      "SR= dVout/dt # slew rate in V/\u00b5s\n",
      "print \"The slew rate = %0.f V/\u00b5s\" %SR"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The slew rate = 5 V/\u00b5s\n"
       ]
      }
     ],
     "prompt_number": 19
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example : 2.12 - Page No 83"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Given data\n",
      "IB1= 10 # in \u00b5A\n",
      "IB2= 7.5 # in \u00b5A\n",
      "# Input bias current,\n",
      "I_in_bias= (IB1+IB2)/2 # in \u00b5A\n",
      "# Input offset current,\n",
      "I_in_offset= IB1-IB2 # in \u00b5A\n",
      "print \"The input bias current = %0.2f \u00b5A\" %I_in_bias\n",
      "print \"The input offset current = %0.1f \u00b5A\" %I_in_offset"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The input bias current = 8.75 \u00b5A\n",
        "The input offset current = 2.5 \u00b5A\n"
       ]
      }
     ],
     "prompt_number": 20
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example : 2.13 - Page No 83"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "from numpy import pi\n",
      "# Given data\n",
      "SR= 6 # slew rate in V/\u00b5s\n",
      "SR= 6*10**6 # in V/s\n",
      "\n",
      "# Part (i) For Vmax= 1V\n",
      "Vmax= 1 # in V\n",
      "fmax= SR/(2*pi*Vmax) # limiting frequency in Hz\n",
      "fmax= fmax*10**-6 # in MHz\n",
      "print \"Part (i) : The limiting frequency for maximum voltage of 1V = %0.3f MHz\" %fmax\n",
      "\n",
      "# Part (ii) For Vmax= 10V\n",
      "Vmax= 10 # in V\n",
      "fmax= SR/(2*pi*Vmax) # limiting frequency in Hz\n",
      "fmax= fmax*10**-3 # in kHz\n",
      "print \"Part (ii) : The limiting frequency for maximum voltage of 10V = %0.1f kHz\"%fmax"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Part (i) : The limiting frequency for maximum voltage of 1V = 0.955 MHz\n",
        "Part (ii) : The limiting frequency for maximum voltage of 10V = 95.5 kHz\n"
       ]
      }
     ],
     "prompt_number": 3
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example : 2.14 - Page No 84"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Given data\n",
      "Vpp= 3 # output voltage in V\n",
      "del_t= 4 # in \u00b5s\n",
      "del_V= 90*Vpp/100-10*Vpp/100 # in V\n",
      "# Required slew rate,\n",
      "SR= del_V/del_t # in V/\u00b5s\n",
      "print \"The required slew rate = %0.1f V/\u00b5s\" %SR"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The required slew rate = 0.6 V/\u00b5s\n"
       ]
      }
     ],
     "prompt_number": 22
    }
   ],
   "metadata": {}
  }
 ]
}