summaryrefslogtreecommitdiff
path: root/Analog_Integrated_Circuits_by_R.S._Tomar/Chapter7.ipynb
blob: 2e5c30d1874ed5ed3bff565215f8b7eec96e10b5 (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
{
 "metadata": {
  "name": "",
  "signature": "sha256:da9731a08909e4ad4cafbaaa3667ca4e507b854221c0c6168fb27a7fc7f1c9cc"
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "Chapter7 - The 555 timer"
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Ex 7.1 - page : 233"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "from __future__ import division\n",
      "th=4 #ms\n",
      "VCC=10 #V\n",
      "C=0.05 #micro F(choosen between 0.01<=C<=1)\n",
      "R=th*10**-3/(1.1*C*10**-6)/1000 #kohm\n",
      "C1=0.01 #micro F(assumed)\n",
      "C2=0.01 #micro F(choosen between 0.01<=C<=1)\n",
      "R2=th*10**-3/(10*C2*10**-6)/1000 #kohm\n",
      "C3=10 #micro F\n",
      "print \"Design values are : \"\n",
      "print \"Capacitance C = %0.2f micro F \" %C \n",
      "print \"Resistance R = %0.1f kohm \" %R \n",
      "print \"Capacitance C1 = %0.2f micro F \" %C1 \n",
      "print \"Capacitance C2 = %0.2f micro F \" %C2 \n",
      "print \"Resistance R2 = %0.2f kohm \" %R2 \n",
      "print \"Capacitance C3 = %0.2f micro F \" %C3 \n",
      "#Answer of R2 is wrong in the book."
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Design values are : \n",
        "Capacitance C = 0.05 micro F \n",
        "Resistance R = 72.7 kohm \n",
        "Capacitance C1 = 0.01 micro F \n",
        "Capacitance C2 = 0.01 micro F \n",
        "Resistance R2 = 40.00 kohm \n",
        "Capacitance C3 = 10.00 micro F \n"
       ]
      }
     ],
     "prompt_number": 2
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Ex 7.2 - page : 236"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "from __future__ import division\n",
      "ft=2 #kHz\n",
      "C=0.01 #micro F\n",
      "T=1/ft #ms\n",
      "n=3 #for divide-by-3 circuit\n",
      "th=(0.2+(n-1))*T #ms\n",
      "R=th/(1.1*C) #kohm\n",
      "print \"Value of Resistance R = %0.2f kohm \" %R"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Value of Resistance R = 100.00 kohm \n"
       ]
      }
     ],
     "prompt_number": 3
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Ex 7.3 - page 239"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "from __future__ import division\n",
      "fo=2 #kHz\n",
      "D=70 #%(duty cycle)\n",
      "T=1/fo #ms\n",
      "VCC=12 #V\n",
      "tC=D*T/100 #ms\n",
      "tD=T-tC #ms\n",
      "C=0.05 #micro F(choosen between 0.01<=C<=1)\n",
      "RB=tD*10**-3/(0.69*C*10**-6)/1000 #kohm\n",
      "RA=tC*10**-3/(0.69*C*10**-6)/1000-RB #kohm\n",
      "print \"Design values are : \"\n",
      "print \"Capacitance C = %0.2f micro F \" %C  \n",
      "print \"Resistance RA = %0.1f kohm \" %RA \n",
      "print \"Resistance RB = %0.1f kohm \" %RB\n",
      "#Answer is not accurate in the textbook."
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Design values are : \n",
        "Capacitance C = 0.05 micro F \n",
        "Resistance RA = 5.8 kohm \n",
        "Resistance RB = 4.3 kohm \n"
       ]
      }
     ],
     "prompt_number": 6
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Ex 7.4 : page 243"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "from __future__ import division\n",
      "fo=2 #kHz\n",
      "D=50 #%(duty cycle)\n",
      "T=1/fo #ms\n",
      "VCC=10 #V\n",
      "tC=D*T/100 #ms\n",
      "tD=T-tC #ms\n",
      "C=0.1 #micro F(choosen between 0.01<=C<=1)\n",
      "RB=tD*10**-3/(0.69*C*10**-6)/1000 #kohm\n",
      "RA=T*10**-3*1.45/(C*10**-6)/1000-RB #kohm\n",
      "print \"Design values are : \"\n",
      "print \"Capacitance C= %0.2f micro F \" %C \n",
      "print \"Resistance RA = %0.1f kohm \" % RA \n",
      "print \"Resistance RB = %0.1f kohm \" %RB \n",
      "# RA & RB should be equal for 50% duty cycle."
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Design values are : \n",
        "Capacitance C= 0.10 micro F \n",
        "Resistance RA = 3.6 kohm \n",
        "Resistance RB = 3.6 kohm \n"
       ]
      }
     ],
     "prompt_number": 8
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Ex 7.5 - page : 244"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "from __future__ import division\n",
      "fo=2 #kHz\n",
      "D=40 #%(duty cycle)\n",
      "T=1/fo #ms\n",
      "VCC=10 #V\n",
      "tC=D*T/100 #ms\n",
      "tD=T-tC #ms\n",
      "C=0.22 #micro F(choosen between 0.01<=C<=1)\n",
      "RB=tD*10**-3/(0.69*C*10**-6)/1000 #kohm\n",
      "RA=T*10**-3*1.45/(C*10**-6)/1000-RB #kohm\n",
      "print \"Design values are : \" \n",
      "print \"Capacitance C = %0.2f micro F \" %C \n",
      "print \"Resistance RA = %0.1f kohm \" %RA \n",
      "print \"Resistance RB = %0.f kohm \" %round(RB) "
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Design values are : \n",
        "Capacitance C = 0.22 micro F \n",
        "Resistance RA = 1.3 kohm \n",
        "Resistance RB = 2 kohm \n"
       ]
      }
     ],
     "prompt_number": 11
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Ex 7.6 - page : 245"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "from __future__ import division\n",
      "fo=700 #Hz\n",
      "D=50 #%(duty cycle)\n",
      "T=1/fo*1000 #ms\n",
      "VCC=10 #V\n",
      "tC=D*T/100 #ms\n",
      "tD=T-tC #ms\n",
      "C=0.05 #micro F(choosen between 0.01<=C<=1)\n",
      "RB=tD*10**-3/(0.69*C*10**-6)/1000 #kohm\n",
      "RA=T*10**-3*1.45/(C*10**-6)/1000-RB #kohm\n",
      "print \"Design values are : \"\n",
      "print \"Capacitance C = %0.2f micro F \" %C \n",
      "print \"Resistance RA = %0.2f kohm \" %round(RA) \n",
      "print \"Resistance RB = %0.2f kohm \" %round(RB) "
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Design values are : \n",
        "Capacitance C = 0.05 micro F \n",
        "Resistance RA = 21.00 kohm \n",
        "Resistance RB = 21.00 kohm \n"
       ]
      }
     ],
     "prompt_number": 12
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Ex 7.7 - page : 246"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "from __future__ import division\n",
      "fo=800 #Hz\n",
      "D=60 #%(duty cycle)\n",
      "T=1/fo*1000 #ms\n",
      "VCC=10 #V\n",
      "tC=D*T/100 #ms\n",
      "tD=T-tC #ms\n",
      "C=0.047 #micro F(choosen between 0.01<=C<=1)\n",
      "RB=tD*10**-3/(0.69*C*10**-6)/1000 #kohm\n",
      "RA=tC*10**-3*1.45/(C*10**-6)/1000-RB #kohm\n",
      "print \"Design values are : \"\n",
      "print \"Capacitance C = %0.3f micro F \" %C \n",
      "print \"Resistance RA = %0.2f kohm \" %round(RA) \n",
      "print \"Resistance RB = %0.2f kohm \" %round(RB)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Design values are : \n",
        "Capacitance C = 0.047 micro F \n",
        "Resistance RA = 8.00 kohm \n",
        "Resistance RB = 15.00 kohm \n"
       ]
      }
     ],
     "prompt_number": 14
    }
   ],
   "metadata": {}
  }
 ]
}