summaryrefslogtreecommitdiff
path: root/Linear_Integrated_Circuits_by_J._B._Gupta/chapter07.ipynb
blob: a1dee94750de6341f5e3ba06dd875fcc2a696af4 (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
{
 "metadata": {
  "name": ""
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "Chapter-7 : Oscillators (Sinusoidal As Well As Non-Sinusoidal)"
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example : 7.1 - Page No 232"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "from numpy import pi\n",
      "from math import sqrt\n",
      "# Given data\n",
      "f=200 # in Hz\n",
      "# Let us take\n",
      "C=0.1 # in micro F\n",
      "C=C*10**-6 # in F\n",
      "R=1/(2*pi*f*C*sqrt(6)) # in ohm\n",
      "R=R*10**-3 # in k ohm\n",
      "# R1>=10*R, Let\n",
      "R1=10*R # in kohm\n",
      "R_f= 29*R1 # in k ohm\n",
      "R_f=R_f*10**-3  # in M ohm\n",
      "R_f=math.ceil(R_f) \n",
      "print \"Resistor of phase-shift oscillator = %0.f Mohm\" %R_f"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Resistor of phase-shift oscillator = 1 Mohm\n"
       ]
      }
     ],
     "prompt_number": 2
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example : 7.2 - Page No 232"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Given data\n",
      "f=1 # in kHz\n",
      "f=f*10**3 # in Hz\n",
      "V_CC= 10 # in volt\n",
      "I_B_max= 500 # in nA (for 741 IC op-amp)\n",
      "I_B_max= I_B_max*10**-9 # in A\n",
      "I1= 100*I_B_max # in A\n",
      "V_out= (V_CC-1) # in volt\n",
      "V_in= V_out/29 \n",
      "R1= V_in/I1 # in ohm\n",
      "R1=R1*10**-3 #in k ohm\n",
      "# 5.6 k ohm resistor may be used for R1, being standard value resistor\n",
      "R1=5.6 # in k ohm (standard value)\n",
      "A=29 \n",
      "R_f= A*R1 \n",
      "# 180 k ohm resistor may be used to provide A > 29\n",
      "R_f=180 # in k ohm (standard value)\n",
      "R_comp= R_f \n",
      "R=R1 # in k ohm\n",
      "R=R*10**3 # in ohm\n",
      "C=1/(2*pi*f*R*sqrt(6)) # in F\n",
      "C=C*10**6 # in micro F\n",
      "print \"Value of R_comp = R_f = %0.f kohm\" %R_comp\n",
      "print \"Value of R = R1 = %0.1f in kohm\" %(R*10**-3)\n",
      "print \"Value of capacitor = %0.2f micro F\" %C"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Value of R_comp = R_f = 180 kohm\n",
        "Value of R = R1 = 5.6 in kohm\n",
        "Value of capacitor = 0.01 micro F\n"
       ]
      }
     ],
     "prompt_number": 3
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example : 7.3 - Page No 235"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Given data\n",
      "f=10 # in kHz\n",
      "f=f*10**3 # in Hz\n",
      "I_Bmax= 500 # in nA\n",
      "I_Bmax= I_Bmax*10**-9 # in amphere\n",
      "# Let current through resistor R1 be equal to 100 times I_Bmax, so\n",
      "I_1= 100*I_Bmax # in amp\n",
      "Vcc= 10 # in volt\n",
      "Vout= Vcc-1 # in volt\n",
      "Addition_RfR1= Vout/(500*10**-6) # value of Rf+R1 in ohm\n",
      "Addition_RfR1=Addition_RfR1*10**-3 # in kohm\n",
      "# Rf= 2*R1, So\n",
      "R1= Addition_RfR1/3 # (used 5.6 kohm Standard value resistor)\n",
      "print \"Value of R1 = %0.f kohm (Standard value 5.6 k ohm)\" %R1\n",
      "R1= 5.6 # in kohm     (used 5.6 kohm Standard value resistor)\n",
      "Rf= 2*R1 # in kohm# (used 12 kohm standard value resistor)\n",
      "print \"Value of Rf = %0.1f kohm (Standard value 12 k ohm)\" %Rf\n",
      "Rf= 12 # k ohm (used 12 kohm standard value resistor)\n",
      "R=R1 # in kohm\n",
      "C= 1/(2*pi*f*R) # in F (Used 2700pF standard value)\n",
      "C=2700 # in pF \n",
      "print \"Value of R  = %0.1f kohm\" %R\n",
      "print \"Value of C  = %0.f pF\" %C"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Value of R1 = 6 kohm (Standard value 5.6 k ohm)\n",
        "Value of Rf = 11.2 kohm (Standard value 12 k ohm)\n",
        "Value of R  = 5.6 kohm\n",
        "Value of C  = 2700 pF\n"
       ]
      }
     ],
     "prompt_number": 12
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example : 7.4 - Page No 235"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Given data\n",
      "R= 1 # in kohm\n",
      "R=R*10**3 # in ohm\n",
      "C= 4.7 # in micro F\n",
      "C=C*10**-6 # in F\n",
      "omega=1/(R*C) # in radians/second\n",
      "f=omega/(2*pi) # in Hz\n",
      "print \"Frequency of the oscillation of the circuit = %0.2f Hz\" %f"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Frequency of the oscillation of the circuit = 33.86 Hz\n"
       ]
      }
     ],
     "prompt_number": 13
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example : 7.6 - Page No 236"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Given data\n",
      "R= 10 # in kohm\n",
      "R=R*10**3 # in ohm\n",
      "C= 100 # in pF\n",
      "C=C*10**-12 # in F\n",
      "f=1/(2*pi*R*C) # in Hz\n",
      "print \"Frequency of the oscillation of the circuit = %0.2f kHz\" %(f*10**-3)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Frequency of the oscillation of the circuit = 159.15 kHz\n"
       ]
      }
     ],
     "prompt_number": 15
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example : 7.7 - Page No 238"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Given data\n",
      "fo= 318 # in Hz\n",
      "C= 0.015 # in microF\n",
      "C=C*10**-6 # in F\n",
      "R=0.159/(fo*C) # in ohm\n",
      "R=R*10**-3 # in kohm\n",
      "R=int(R) \n",
      "print \"Value of C1 = C2 = C3 = %0.3f micro F\" %(C*10**6)\n",
      "print \"Value of R1 = R2 = R3 = %0.f in kohm\" %R"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Value of C1 = C2 = C3 = 0.015 micro F\n",
        "Value of R1 = R2 = R3 = 33 in kohm\n"
       ]
      }
     ],
     "prompt_number": 16
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example : 7.8 - Page No 238"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Given data\n",
      "fo= 1.5 # in kHz\n",
      "fo=fo*10**3 # in Hz\n",
      "C= 0.01 # in microF\n",
      "C=C*10**-6 # in F\n",
      "R=0.159/(fo*C) # in ohm\n",
      "R=R*10**-3 # in kohm\n",
      "R=int(R) \n",
      "print \"Value of C1 = C2 = C3 = %0.2f micro F\" %(C*10**6)\n",
      "print \"Value of R1 = R2 = R3 = %0.f in kohm\" %R"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Value of C1 = C2 = C3 = 0.01 micro F\n",
        "Value of R1 = R2 = R3 = 10 in kohm\n"
       ]
      }
     ],
     "prompt_number": 17
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example : 7.9 - Page No 245"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Given data\n",
      "C= 0.1 # in microF\n",
      "C=C*10**-6 # in F\n",
      "R=12 # in kohm\n",
      "R=R*10**3 # in ohm\n",
      "R1=120 # in kohm\n",
      "R1=R1*10**3 # in ohm\n",
      "Rf=1 # in Mohm\n",
      "Rf=Rf*10**6 # in ohm\n",
      "V_sat= 10 # in volt\n",
      "# Part(i)\n",
      "f=Rf/(4*R1*R*C) #in Hz\n",
      "print \"(i)   : Signal Frequency = %0.3f kHz\" %(f*10**-3)\n",
      "\n",
      "# Part(ii)\n",
      "Vp_p= float(2*R1*V_sat)/Rf # in Vp_p\n",
      "\n",
      "print \"(ii)  : Amplitude of the triangular wave = %0.1f Vp_p\" %Vp_p\n",
      "\n",
      "# Part(iii)\n",
      "Vp_p= (V_sat)-(-V_sat) \n",
      "print \"(iii) : Amplitude of the square wave = %0.f Vp_p\" %Vp_p"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "(i)   : Signal Frequency = 1.736 kHz\n",
        "(ii)  : Amplitude of the triangular wave = 2.4 Vp_p\n",
        "(iii) : Amplitude of the square wave = 20 Vp_p\n"
       ]
      }
     ],
     "prompt_number": 18
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example : 7.11 - Page No 246"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Given data\n",
      "C1= 0.01 # in microF\n",
      "C1=C1*10**-6 # in F\n",
      "R1=120 # in kohm\n",
      "R1=R1*10**3 # in ohm\n",
      "R2=1.2 # in kohm\n",
      "R2=R2*10**3 # in ohm\n",
      "R3=6.8 # in kohm\n",
      "R3=R3*10**3 # in ohm\n",
      "V_sat= 15 # in volt\n",
      "# Part(a)\n",
      "Vp_p= 2*(R2/R3)*V_sat #in volt\n",
      "print \"(a) : Peak to peak amplitude of triangular wave = %0.3f volt\" %Vp_p\n",
      "\n",
      "# Part(b)\n",
      "fo= R3/(4*R1*C1*R2) #in Hz\n",
      "print \"(b) : Frequency of triangular wave = %0.2f kHz\" %(fo*10**-3)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "(a) : Peak to peak amplitude of triangular wave = 5.294 volt\n",
        "(b) : Frequency of triangular wave = 1.18 kHz\n"
       ]
      }
     ],
     "prompt_number": 32
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example : 7.12 - Page No 249"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "from math import log\n",
      "# Given data\n",
      "T= 100 # in micro sec\n",
      "T=T*10**-6 #in se\n",
      "V_sat= 12 # in volt\n",
      "V1= 0.7 # in volt\n",
      "V= 0.7 # in volt\n",
      "V_D1= V \n",
      "V_D2=V_D1 \n",
      "C1= 0.1 # in microF\n",
      "C1=C1*10**-6 # in F\n",
      "Bita1= 0.1 \n",
      "# Formula T= R3*C1*log((1+V1/V_sat)/(1-Bita1))\n",
      "R3= T/(C1*log((1+V1/V_sat)/(1-Bita1))) # in ohm\n",
      "print \"Value of R3 = %0.3f kohm (Standard value 6.8 kohm)\" %(R3*10**-3)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Value of R3 = 6.171 kohm (Standard value 6.8 kohm)\n"
       ]
      }
     ],
     "prompt_number": 21
    }
   ],
   "metadata": {}
  }
 ]
}