summaryrefslogtreecommitdiff
path: root/Integrated_Circuits/Chapter7.ipynb
blob: 92e5e7d45c5754854dae829a25e497e785eb32b6 (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
{

 "metadata": {

  "name": "",

  "signature": "sha256:841a88d7e9e844c5ea929c5620ee175fbc10b920d638293263fe8c73afe043c7"

 },

 "nbformat": 3,

 "nbformat_minor": 0,

 "worksheets": [

  {

   "cells": [

    {

     "cell_type": "heading",

     "level": 1,

     "metadata": {},

     "source": [

      "Chapter7: Integrated Circuit Timer And Phase Locked Loops (PLL) "

     ]

    },

    {

     "cell_type": "heading",

     "level": 2,

     "metadata": {},

     "source": [

      "Ex7.1:pg-339"

     ]

    },

    {

     "cell_type": "code",

     "collapsed": false,

     "input": [

      "#Ex 7.1\n",

      "RA=6.8  #kohm\n",

      "RB=3.3  #kohm\n",

      "C=0.1  #micro F\n",

      "VCC=5  #V\n",

      "t_high=0.695*(RA+RB)*C  #ms\n",

      "print round(t_high,1),\" =(a) t_high(ms)  \" \n",

      "t_low=0.695*RB*C  #ms\n",

      "print round(t_low,2),\" =(b) t_low(ms)  \" \n",

      "f=1.44/(RA+2*RB)/(C)  #kHz\n",

      "print round(f,2),\" =(c) Frequency of oscillation(kHz)  \" \n"

     ],

     "language": "python",

     "metadata": {},

     "outputs": [

      {

       "output_type": "stream",

       "stream": "stdout",

       "text": [

        "0.7  =(a) t_high(ms)  \n",

        "0.23  =(b) t_low(ms)  \n",

        "1.07  =(c) Frequency of oscillation(kHz)  \n"

       ]

      }

     ],

     "prompt_number": 20

    },

    {

     "cell_type": "heading",

     "level": 2,

     "metadata": {},

     "source": [

      "Ex7.2:pg-339"

     ]

    },

    {

     "cell_type": "code",

     "collapsed": false,

     "input": [

      "#Ex 7.2\n",

      "RA=10  #kohm\n",

      "C=0.1  #micro F\n",

      "t=1.1*RA*C  #ms\n",

      "print t,\"= Timing interval(ms)  \" \n"

     ],

     "language": "python",

     "metadata": {},

     "outputs": [

      {

       "output_type": "stream",

       "stream": "stdout",

       "text": [

        "1.1 = Timing interval(ms)  \n"

       ]

      }

     ],

     "prompt_number": 21

    },

    {

     "cell_type": "heading",

     "level": 2,

     "metadata": {},

     "source": [

      "Ex7.3:pg-352"

     ]

    },

    {

     "cell_type": "code",

     "collapsed": false,

     "input": [

      "#Ex 7.3 \n",

      "fc=500  #kHz(Free running frequuency)\n",

      "fi=600  #kHz(Input signal frequuency)\n",

      "BW=10  #kHz\n",

      "out1=fi+fc  #kHz(Phase detector output)\n",

      "out2=fi-fc  #kHz(Phase detector output)\n",

      "print out2,out1,\"= Output of phase detector will be(kHz)  \" \n",

      "print \"Both components are not lying in the passband(i.e. 10 kHz). Hence loop will not acquire lock.  \" \n",

      " #fi+fc is calculated wrong in the book.\n"

     ],

     "language": "python",

     "metadata": {},

     "outputs": [

      {

       "output_type": "stream",

       "stream": "stdout",

       "text": [

        "100 1100 = Output of phase detector will be(kHz)  \n",

        "Both components are not lying in the passband(i.e. 10 kHz). Hence loop will not acquire lock.  \n"

       ]

      }

     ],

     "prompt_number": 7

    },

    {

     "cell_type": "heading",

     "level": 2,

     "metadata": {},

     "source": [

      "Ex7.4:pg-352"

     ]

    },

    {

     "cell_type": "code",

     "collapsed": false,

     "input": [

      "#Ex 7.4\n",

      "import math \n",

      "fo=10.0  #kHz\n",

      "V=12.0  #V\n",

      "fL=round(8*fo/(V-(-V)),2)  #kHz(both +ve & -ve value)\n",

      "C=10  #micro F(Assumed)\n",

      "fC=round(math.sqrt(fL*10**3/(2*math.pi*3.6*10**3*C*10**-6)),2)  #Fz(both +ve & -ve value)\n",

      "print fC,fL,\"= Frequency fL & fC in kHz  \" \n",

      "LR=2*fL  #kHz(Lock Range)\n",

      "print round(LR,1),\"= Lock Range(kHz)  \" \n",

      "CR=2*fC  #kHz(Capture rage)\n",

      "print round(CR,1),\"= Capture Range(Hz)  \" \n"

     ],

     "language": "python",

     "metadata": {},

     "outputs": [

      {

       "output_type": "stream",

       "stream": "stdout",

       "text": [

        "121.33 3.33 = Frequency fL & fC in kHz  \n",

        "6.7 = Lock Range(kHz)  \n",

        "242.7 = Capture Range(Hz)  \n"

       ]

      }

     ],

     "prompt_number": 28

    },

    {

     "cell_type": "heading",

     "level": 2,

     "metadata": {},

     "source": [

      "Ex7.5:pg-353"

     ]

    },

    {

     "cell_type": "code",

     "collapsed": false,

     "input": [

      "#Ex 7.5\n",

      "import math\n",

      " \n",

      "fo=100.0  #kHz(Free running frequency)\n",

      "V=6.0  #V(both +ve & -ve value)\n",

      "C=1  #micro F(Demodulation capacitor)\n",

      "fL=round(8*fo/(V-(-V)),3) #Hz(both +ve & -ve value)\n",

      "fC=math.sqrt(fL*1000/(2*math.pi*3.6*10**3*C*10**-6))  #kHzz(both +ve & -ve value)\n",

      "LR=round(2*fL,2)  #kHz(Lock range)\n",

      "print LR,\"= Lock Range(kHz)\" \n",

      "CR=round(2*fC/1000,2)  #kHz(Capture range)\n",

      "print CR,\"= Capture Range(kHz)  \" \n",

      "RT=10  #kohm(Assumed)\n",

      "CT=1.2/(4*RT*1000*fo*10**3)  #F\n",

      "print \"Design values are:\" \n",

      "print \"Resistance RT can be chooosen as 10 kohm.  \"  \n",

      "print CT,\" =Capacitance CT(F)  \" \n"

     ],

     "language": "python",

     "metadata": {},

     "outputs": [

      {

       "output_type": "stream",

       "stream": "stdout",

       "text": [

        "133.33 = Lock Range(kHz)\n",

        "3.43 = Capture Range(kHz)  \n",

        "Design values are:\n",

        "Resistance RT can be chooosen as 10 kohm.  \n",

        "3e-10  =Capacitance CT(F)  \n"

       ]

      }

     ],

     "prompt_number": 39

    },

    {

     "cell_type": "heading",

     "level": 2,

     "metadata": {},

     "source": [

      "Ex7.7:pg-355"

     ]

    },

    {

     "cell_type": "code",

     "collapsed": false,

     "input": [

      " #Ex 7.7\n",

      "import math\n",

      "C=1  #nF\n",

      "T=10  #micro seconds(Output pulse duration)\n",

      "R=round(T*10**-6/(C*10**-9*math.log(3))/1000,1)  #kohm\n",

      "print R,\" =(a) Value of R(kohm)  \" \n",

      "VCC=15  #V\n",

      "T=20  #micro seconds(Output pulse duration)\n",

      "VTH=VCC*(1-exp(-T*10**-6/(R*1000*C*10**-9)))  #V\n",

      "print round(VTH,1),\" =(b) Value of VTH(V)  \" \n"

     ],

     "language": "python",

     "metadata": {},

     "outputs": [

      {

       "output_type": "stream",

       "stream": "stdout",

       "text": [

        "9.1  =(a) Value of R(kohm)  \n",

        "13.3  =(b) Value of VTH(V)  \n"

       ]

      }

     ],

     "prompt_number": 41

    },

    {

     "cell_type": "heading",

     "level": 2,

     "metadata": {},

     "source": [

      "Ex7.8:pg-355"

     ]

    },

    {

     "cell_type": "code",

     "collapsed": false,

     "input": [

      " #Ex 7.8\n",

      "import math\n",

      "C=680.0  #pF\n",

      "f=50.0  #kHz(Square wave frequency)\n",

      "D=75.0/100.0  #duty cycle\n",

      "T=1/f*1000  #micro seconds\n",

      "tHIGH=D*T  #micro seconds\n",

      "print tHIGH,\" = Value of tHIGH  \"\n",

      "tLOW=T-tHIGH  #micro seconds\n",

      "print tLOW,\" = Value of tLOW  \" \n",

      "RB=(tLOW*10**-6)/(0.69*C*10**-12)  #ohm\n",

      "RA=(tHIGH*10**-6)/(0.695*C*10**-12)-RB  #ohm\n",

      "print round(RA/1000,1),\" = Value of RA(kohm)  \" \n",

      "print round(RB/1000,2),\" = Value of RB(kohm)  \" \n",

      "# Answer in the book is wrong for RA i.e. 21.2"

     ],

     "language": "python",

     "metadata": {},

     "outputs": [

      {

       "output_type": "stream",

       "stream": "stdout",

       "text": [

        "15.0  = Value of tHIGH  \n",

        "5.0  = Value of tLOW  \n",

        "21.1  = Value of RA(kohm)  \n",

        "10.66  = Value of RB(kohm)  \n"

       ]

      }

     ],

     "prompt_number": 62

    }

   ],

   "metadata": {}

  }

 ]

}