summaryrefslogtreecommitdiff
path: root/Linear_Integrated_Circuits/Chapter_7.ipynb
blob: ff558ee500b53d088be40cc127088f252f9f741e (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
{
 "metadata": {
  "name": "ch_7"
 }, 
 "nbformat": 2, 
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "markdown", 
     "source": [
      "<h1>Chapter 7: Waveform Generators<h>"
     ]
    }, 
    {
     "cell_type": "markdown", 
     "source": [
      "<h3>Example No.7.1 , Page NO: 324<h3>"
     ]
    }, 
    {
     "cell_type": "code", 
     "collapsed": false, 
     "input": [
      "", 
      "#Variable Declarartion:", 
      "import math", 
      "f=300.0                        #frequency in hertz", 
      "C=0.1*10**-6                   #capacitance in farad", 
      "", 
      "#Calculations:", 
      "t=f*C                           ", 
      "R=1/(2*math.pi*t*math.sqrt(6))  #Calculating resistance value", 
      "R=R/1000                        #Calculating resistance value", 
      "R1=22000.0                      #Calculating resistance value", 
      "Rf=29.0*R1                      #Calculating resistance value", 
      "Rf=Rf/1000.0                    #Calculating resistance value", 
      "", 
      "#Results:", 
      "print('R= %.2f kohm'%R)", 
      "print('\\nLet R=2.2 kohm, hence R1=22 kohm')", 
      "print('\\nRf= %d kohm'%Rf)"
     ], 
     "language": "python", 
     "outputs": [
      {
       "output_type": "stream", 
       "stream": "stdout", 
       "text": [
        "R= 2.17 kohm", 
        "", 
        "Let R=2.2 kohm, hence R1=22 kohm", 
        "", 
        "Rf= 638 kohm"
       ]
      }
     ], 
     "prompt_number": 1
    }, 
    {
     "cell_type": "markdown", 
     "source": [
      "<h3>Example No. 7.2, Page No: 326<h3>"
     ]
    }, 
    {
     "cell_type": "code", 
     "collapsed": false, 
     "input": [
      "", 
      "#Variable Declaration:", 
      "import math", 
      "f=2000.0                     #Frequency in hertz", 
      "C=0.05*10**-6                #Capacitance in farad", 
      "", 
      "#Calculations:", 
      "t=f*C", 
      "R=1/(2*math.pi*t)            #Calculating resistance value", 
      "R=R/1000.0                   #Calculating resistance value", 
      "R1=1800.0                    #Calculating resistance value", 
      "Rf=2.0*R1                    #Calculating resistance value", 
      "Rf=Rf/1000.0                 #Calculating resistance value", 
      "", 
      "#Results:", 
      "print('R= %.3f kohm'%R)", 
      "print('\\nLet R=1.8 kohm')", 
      "print('\\nRf= %3f kohm'%Rf)", 
      "print('\\nStandard value Rf= 3.3 kohm')"
     ], 
     "language": "python", 
     "outputs": [
      {
       "output_type": "stream", 
       "stream": "stdout", 
       "text": [
        "R= 1.592 kohm", 
        "", 
        "Let R=1.8 kohm", 
        "", 
        "Rf= 3.600000 kohm", 
        "", 
        "Standard value Rf= 3.3 kohm"
       ]
      }
     ], 
     "prompt_number": 4
    }, 
    {
     "cell_type": "markdown", 
     "source": [
      "<h3>Example No.7.3, Page No: 329<h3>"
     ]
    }, 
    {
     "cell_type": "code", 
     "collapsed": false, 
     "input": [
      "", 
      "#Variable Declaration:", 
      "R1=116.0*10**3          #Resistance in ohm", 
      "R2=100.0*10**3          #Resistance in ohm", 
      "Vsat=14.0               #Voltage in volt", 
      "", 
      "#Calculations:", 
      "# Part A", 
      "f=1000.0                #Frequency in hertz     ", 
      "", 
      "T=1/f               ", 
      "# As log value is approx 1", 
      "RC=T/2                  #Calculating time constant", 
      "RC1=RC*1000.0           #Calculating time constant", 
      "", 
      "# Part B", 
      "C=0.01*10**-6           #Capacitance in farad", 
      "R=RC/C                  #Calculating resistance", 
      "Rn=R/1000.0             #Calculating resistance", 
      "", 
      "# Part C", 
      "Vmax=2*Vsat*(R2/(R1+R2))     #Calculating maximum value of differential voltage", 
      "", 
      "#Results:", 
      "print('RC= %.1f *10^-3 sec'%RC1)", 
      "print('\\nR= %d kohm'%Rn)", 
      "print('\\nMaximum value of differential input voltage= %.2f V'%Vmax)"
     ], 
     "language": "python", 
     "outputs": [
      {
       "output_type": "stream", 
       "stream": "stdout", 
       "text": [
        "RC= 0.5 *10^-3 sec", 
        "", 
        "R= 50 kohm", 
        "", 
        "Maximum value of differential input voltage= 12.96 V"
       ]
      }
     ], 
     "prompt_number": 3
    }, 
    {
     "cell_type": "markdown", 
     "source": [
      "<h3>Exa ple NO. 7.4,Page NO: 330<h3>"
     ]
    }, 
    {
     "cell_type": "code", 
     "collapsed": false, 
     "input": [
      "", 
      "#Variable Declaration:", 
      "fo=1000.0                 #Frequency in hertz", 
      "Vcc=12.0                  #Voltage Vcc in volt", 
      "R1=10.0*10**3             #Resistance in ohm", 
      "R2=10.0*10**3             #Resistance in ohm", 
      "C=0.1*10**-6              #Capacitance value in farad", 
      "", 
      "#Calculations:", 
      "R=1/(2.2*C*fo)            #Calulating resistance value", 
      "R=R/1000.0                #Calculating resistance value", 
      "", 
      "#Results:", 
      "print('R= %.3f kohm'%R)"
     ], 
     "language": "python", 
     "outputs": [
      {
       "output_type": "stream", 
       "stream": "stdout", 
       "text": [
        "R= 4.545 kohm"
       ]
      }
     ], 
     "prompt_number": 4
    }, 
    {
     "cell_type": "markdown", 
     "source": [
      "<h3>Example No. 7.5, Page No: 334<h3>"
     ]
    }, 
    {
     "cell_type": "code", 
     "collapsed": false, 
     "input": [
      "", 
      "#Variable Declaration:", 
      "R1=100.0*10**3           #Resistance in ohm", 
      "R3=20.0*10**3            #Resistance in ohm", 
      "C1=0.01*10**-6           #Capacitance in farad", 
      "Vsat=14.0                #Voltage in volt", 
      "", 
      "#Calculations:", 
      "# Part A", 
      "T=4*R1*R2*C1/R3          #Calculating time period", 
      "Tn=T*1000                #Calculating time period", 
      "", 
      "# Part B", 
      "f=1/T                    #Calculating frequency", 
      "", 
      "# Part C", 
      "", 
      "# Part D", 
      "Vp=R2*Vsat/R3           #Calculating peak value of the triangular wave", 
      "", 
      "#Results:", 
      "print('Time period T= %d ms'%Tn)", 
      "print('\\nfrequency f= %d Hz'%f)", 
      "print('\\nPeak value is +14V and -14V')", 
      "print('\\nTriangular wave oscillates between  %d V and - %d V'%(Vp,Vp))"
     ], 
     "language": "python", 
     "outputs": [
      {
       "output_type": "stream", 
       "stream": "stdout", 
       "text": [
        "Time period T= 2 ms", 
        "", 
        "frequency f= 500 Hz", 
        "", 
        "Peak value is +14V and -14V", 
        "", 
        "Triangular wave oscillates between  7 V and - 7 V"
       ]
      }
     ], 
     "prompt_number": 2
    }, 
    {
     "cell_type": "markdown", 
     "source": [
      "<h3>Example NO. 7.6, Page No: 336<h3>"
     ]
    }, 
    {
     "cell_type": "code", 
     "collapsed": false, 
     "input": [
      "", 
      "#Variable Declaration:", 
      "Ri=10.0*10**3              #Resitance in ohm", 
      "Vp=10.0                    #Voltage in volt", 
      "Vref=10.0                  #Voltage in volt", 
      "fo=200.0                   #Frequency in hertz", 
      "C1=0.1*10**-6              #Capacitance in farad", 
      "Vi=2.0                     #Voltage in volt", 
      "", 
      "#Calculations:", 
      "t=Vi/Vref                  ", 
      "f=t/(Ri*C1)               #Calculating frequency", 
      "", 
      "#Result:", 
      "print('Frequency f= %d Hz'%f)"
     ], 
     "language": "python", 
     "outputs": [
      {
       "output_type": "stream", 
       "stream": "stdout", 
       "text": [
        "Frequency f= 200 Hz"
       ]
      }
     ], 
     "prompt_number": 6
    }, 
    {
     "cell_type": "markdown", 
     "source": [
      "<h3>Example No. 7.7, Page no: 345<h3>"
     ]
    }, 
    {
     "cell_type": "code", 
     "collapsed": false, 
     "input": [
      "# Answer in textbook is wrong", 
      "#Varible Declaration:", 
      "C=0.1*10**-6          #Capacitance in farad", 
      "t=1*10**-3            #time in second", 
      "", 
      "#Calculations:", 
      "R=t/(1.22*C)          #Calculating resistance value", 
      "R=R/1000              #Calculating resistance value", 
      "", 
      "#Result:", 
      "print('R= %.1f kohm'% R)"
     ], 
     "language": "python", 
     "outputs": [
      {
       "output_type": "stream", 
       "stream": "stdout", 
       "text": [
        "R= 8.2 kohm"
       ]
      }
     ], 
     "prompt_number": 7
    }, 
    {
     "cell_type": "markdown", 
     "source": [
      "<h3>Example No. 7.8, Page No: 351<h3>"
     ]
    }, 
    {
     "cell_type": "code", 
     "collapsed": false, 
     "input": [
      "", 
      "#Variable Declaration:", 
      "D=20.0 # 20 percent            #Duty cycle", 
      "Ton=1.0*10**-3                 #On time period in seconds ", 
      "", 
      "#Calculatins:", 
      "Tonpoff=100.0*Ton/D            #Calculating total time period  ", 
      "Tonpoff1=Tonpoff*1000.0        #Calculating total time period", 
      "f=1/Tonpoff                    #Calculating frequency of oscillation", 
      "", 
      "#Results:", 
      "print('Ton + Toff= %d ms'%Tonpoff1)", 
      "print('\\nFrequency of oscillation= %d Hz'%f)"
     ], 
     "language": "python", 
     "outputs": [
      {
       "output_type": "stream", 
       "stream": "stdout", 
       "text": [
        "Ton + Toff= 5 ms", 
        "", 
        "Frequency of oscillation= 200 Hz"
       ]
      }
     ], 
     "prompt_number": 8
    }, 
    {
     "cell_type": "markdown", 
     "source": [
      "<h3>Example No. 7.9, Page No: 351<h3>"
     ]
    }, 
    {
     "cell_type": "code", 
     "collapsed": false, 
     "input": [
      "", 
      "#Variable Declaration:", 
      "D=0.7                      #Duty cycle ", 
      "f=1000.0                   #Frequency in hertz", 
      "", 
      "RB=10.0**4/(6.43/3.0)  #Resistance value in ohm", 
      "", 
      "#Calculations:", 
      "RA=4.0*RB/2.75              #Calculating resistance value", 
      "RB1=RB/1000.0                #Calculating resistance value", 
      "RA1=RA/1000.0                #Calculating resistance value", 
      "", 
      "#Results:", 
      "print('RB= %.1f kohm'%RB1)", 
      "print('\\nRA= %.1f kohm'%RA1)"
     ], 
     "language": "python", 
     "outputs": [
      {
       "output_type": "stream", 
       "stream": "stdout", 
       "text": [
        "RB= 4.7 kohm", 
        "", 
        "RA= 6.8 kohm"
       ]
      }
     ], 
     "prompt_number": 12
    }, 
    {
     "cell_type": "markdown", 
     "source": [
      "<h3>Example 7.10, Page No: 352<h3>"
     ]
    }, 
    {
     "cell_type": "code", 
     "collapsed": false, 
     "input": [
      "", 
      "#Variable Declaration:", 
      "f1=1070.0                   #Frequency in hertz", 
      "RA=50000.0                  #Resistance in ohm", 
      "C=0.01*10**-6               #Capacitance value in farad", 
      "Rc=76.0#Standard Value      #Resistance in ohm", 
      "", 
      "#Calculations:", 
      "t=1.45/(f1*C)               ", 
      "RB=(t-RA)/2                 #Calculating value of resistance   ", 
      "RB=RB/1000                  #Calculating value of resistance", 
      "", 
      "#Results:", 
      "print('Assuming RA= 50 kohm and C= 0.01 uF')", 
      "print('\\nHence, RB= %.2f kohm'%RB)", 
      "print('\\nRc= %d ohm (Standard Value)'%Rc)"
     ], 
     "language": "python", 
     "outputs": [
      {
       "output_type": "stream", 
       "stream": "stdout", 
       "text": [
        "Assuming RA= 50 kohm and C= 0.01 uF", 
        "", 
        "Hence, RB= 42.76 kohm", 
        "", 
        "Rc= 76 ohm (Standard Value)"
       ]
      }
     ], 
     "prompt_number": 10
    }
   ]
  }
 ]
}