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
|
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Chapter 12 - Waveshaping and Waveform Generation"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Example 12_1 Page No. 370"
]
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"VEE= 15.00 volts\n",
"VCC= 15.00 volts\n",
"VHI= 5.00 volts\n",
"VLO= -5.00 volts\n",
"IZmin= 0.00 A\n",
"SR= 500000.00 volts/seconds\n",
"RB= 100.00 ohm\n",
"RA= 10000.00 ohm\n",
"A = 5000.00\n",
"VREF= 1.00 volts\n",
"part(i)\n",
"RD=(VCC-Vo)/IZmin= 10000.00 ohm\n",
"part(ii)\n",
"t=(VHI-VLO)/SR= 2.00e-05 seconds\n",
"tp=(VHI-VLO)/SR= 2.00e-04 seconds\n",
"fmax=1/(2*tp) = 2500.00 Hz\n",
"part(iii)\n",
"B=RB/(RA+RB)= 0.01\n",
"VLTP=(VLO*B)+[VREF*(RA/(RA+RB))]= 0.94 volts\n",
"VUTP=(VHI*B)+[VREF*(RA/(RA+RB))]= 1.04 volts\n",
"VH=VUTP-VLTP= 0.10 volts\n"
]
}
],
"source": [
"from __future__ import division \n",
"VEE=15\n",
"print \"VEE= %0.2f\"%(VEE),\" volts\" # voltage supply \n",
"VCC=15\n",
"print \"VCC= %0.2f\"%(VCC),\" volts\" # voltage supply\n",
"VHI=+5\n",
"print \"VHI= %0.2f\"%(VHI),\" volts\" # output voltage upper limit\n",
"VLO=-5\n",
"print \"VLO= %0.2f\"%(VLO),\" volts\" # output voltage Lower limit\n",
"Vo=-VLO\n",
"IZmin=1*10**(-3)\n",
"print \"IZmin= %0.2f\"%(IZmin),\" A\" # Zener diode current rating\n",
"SR=0.5*10**(6)\n",
"print \"SR= %0.2f\"%(SR),\" volts/seconds\"#Slew rate\n",
"RB=100\n",
"print \"RB= %0.2f\"%(RB)+ \" ohm\" # resistance\n",
"RA=10*10**(3) \n",
"print \"RA= %0.2f\"%(RA)+ \" ohm\" # resistance\n",
"A = 5000\n",
"print \"A = %0.2f\"%(A)#op-amp gain\n",
"VREF=1\n",
"print \"VREF= %0.2f\"%(VREF),\" volts\" # Reference- voltage \n",
"print \"part(i)\"\n",
"RD=(VCC-Vo)/IZmin\n",
"print \"RD=(VCC-Vo)/IZmin= %0.2f\"%(RD)+ \" ohm\" # Series dropping-resistance\n",
"\n",
"print \"part(ii)\"\n",
"t=(VHI-VLO)/SR\n",
"print \"t=(VHI-VLO)/SR= %0.2e\"%(t),\" seconds\"# Time required to swing the output\n",
"tp=10*t\n",
"print \"tp=(VHI-VLO)/SR= %0.2e\"%(tp),\" seconds\"# Pulse width\n",
"fmax=1/(2*tp) \n",
"print \"fmax=1/(2*tp) = %0.2f\"%(fmax),\" Hz\"# Maximum frequency of operation of OP-AMP comparator\n",
"print \"part(iii)\"\n",
"B=RB/(RA+RB)\n",
"print \"B=RB/(RA+RB)= %0.2f\"%(B)#Feedback factor\n",
"VLTP=(VLO*B)+(VREF*(RA/(RA+RB)))\n",
"print \"VLTP=(VLO*B)+[VREF*(RA/(RA+RB))]= %0.2f\"%(VLTP),\" volts\" # Lower trigger point\n",
"VUTP=(VHI*B)+(VREF*(RA/(RA+RB)))\n",
"print \"VUTP=(VHI*B)+[VREF*(RA/(RA+RB))]= %0.2f\"%(VUTP),\" volts\" # Upper trigger point\n",
"VH=VUTP-VLTP\n",
"print \"VH=VUTP-VLTP= %0.2f\"%(VH),\" volts\" # Hysteresis voltage "
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Example 12_2 Page No. 372"
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Vo= 14.00 volts\n",
"f = 500.00 Hz\n",
"IB2= 5.00e-07 A\n",
"B=0.50\n",
"vf=B*Vo= +7.00 , -7.00 volts\n",
"IR=100*IB2= 5.00e-05 A\n",
"RB=vf/IR= 140000.00 ohm\n",
"RA=RB*((1/B)-1)= 140000.00 ohm\n",
"RF= 100000.00 ohm\n",
"C1=1/[2*RF*f*log(1+(2*RB/RA))]= 9.10e-09 farad\n"
]
}
],
"source": [
"from math import log\n",
"from __future__ import division \n",
"Vo=14\n",
"print \"Vo= %0.2f\"%(Vo),\" volts\" # output voltage\n",
"f=500 \n",
"print \"f = %0.2f\"%(f),\" Hz\"#frequency\n",
"IB2=500*10**(-9)\n",
"print \"IB2= %0.2e\"%(IB2),\" A\" #base- Current\n",
"B=0.5\n",
"print \"B=%0.2f\"%(B)#Feedback factor\n",
"vf=B*Vo\n",
"print \"vf=B*Vo= +%0.2f\"%(vf),\", -%0.2f\"%(vf),\" volts\" # Feedback voltage\n",
"IR=100*IB2# Taking IR as 100 times that of IB2\n",
"print \"IR=100*IB2= %0.2e\"%(IR),\" A\" # Current in RB resistor\n",
"RB=vf/IR\n",
"print \"RB=vf/IR= %0.2f\"%(RB)+ \" ohm\" # resistance\n",
"RA=RB*((1/B)-1)# Using formulae B=RA/(RA+RB)\n",
"print \"RA=RB*((1/B)-1)= %0.2f\"%(RA)+ \" ohm\" # resistance\n",
"RF=100*10**(3)#Choosing RF=100k\n",
"print \"RF= %0.2f\"%(RF)+ \" ohm\" #Feedback resistance\n",
"C1=1/(2*RF*f*log(1+(2*RB/RA)))\n",
"print \"C1=1/[2*RF*f*log(1+(2*RB/RA))]= %0.2e\"%(C1),\" farad\" # calculated capacitance value"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Example 12_3 Page No. 373"
]
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Vo= 14.00 volts\n",
"f = 500.00 Hz\n",
"R2= 10000.00 ohm\n",
"VTW= 14.00 volts\n",
"C2=(Vo*T)/(2*VTW*R2)= 1.00e-07 farad\n"
]
}
],
"source": [
"from __future__ import division \n",
"Vo=14\n",
"print \"Vo= %0.2f\"%(Vo),\" volts\" # output voltage\n",
"f=500 \n",
"print \"f = %0.2f\"%(f),\" Hz\"#frequency\n",
"R2=10*10**(3)\n",
"print \"R2= %0.2f\"%(R2)+ \" ohm\" # resistance\n",
"VTW=14\n",
"print \"VTW= %0.2f\"%(VTW),\" volts\" # Triangular peak-peak output voltage\n",
"T=1/f\n",
"C2=(Vo*T)/(2*VTW*R2)\n",
"print \"C2=(Vo*T)/(2*VTW*R2)= %0.2e\"%(C2),\" farad\" # calculated capacitance value for deriving triangular wave from square wave astable multivibrator"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Example 12_4 Page No. 374"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"VI= -15.00 volts\n",
"TSW= 2.00e-03 seconds\n",
"R= 10000.00 ohm\n",
"C= 5.00e-07 farad\n",
"Sweep rate=VI/(R*C)=3000.00 V/s\n",
"VSW=TSW*S= 6.00 volts\n"
]
}
],
"source": [
"from __future__ import division \n",
"VI=-15\n",
"print \"VI= %0.2f\"%(VI),\" volts\" # Input voltage\n",
"TSW=2*10**(-3)\n",
"print \"TSW= %0.2e\"%(TSW),\" seconds\"# triangular wave Sweep time\n",
"R=10*10**(3)\n",
"print \"R= %0.2f\"%(R)+ \" ohm\" # resistance as ckt. parameter\n",
"C=0.5*10**(-6)\n",
"print \"C= %0.2e\"%(C),\" farad\" # capacitance as ckt. parameter\n",
"S=-VI/(R*C)\n",
"print \"Sweep rate=VI/(R*C)=%0.2f\"%(S)+ \" V/s\" # Sweep rate for sweep generator\n",
"VSW=TSW*S\n",
"print \"VSW=TSW*S= %0.2f\"%(VSW),\" volts\" # Sweep voltage amplitude\n",
"\n",
"\n",
"# note in book author has not provided any variable for sweep rate ... but here I have used 'S' for it ."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Example 12_5 Page No. 375"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"VEE= 15.00 volts\n",
"VCC= 15.00 volts\n",
"R1= 10000.00 ohm\n",
"RF= 20000.00 ohm\n",
"R1= 10000.00 ohm\n",
"RF1= 1000.00 ohm\n",
"Av= 1000.00\n",
"part(i)\n",
"VBR1=VBR2=(VCC*RF1)/RB1= 5.00 volts\n",
"So=-RF/R1= -2.00\n",
"S1=S2=-RF1/R1= -0.10\n",
"VSL=VSU=(-VBR1/So)= 2.50 volts\n",
"part(ii)\n",
"VSU=VSL=(VBR2/Av)= -0.01 , +0.01 volts\n"
]
}
],
"source": [
"from __future__ import division \n",
"VEE=15\n",
"print \"VEE= %0.2f\"%(VEE),\" volts\" # voltage supply \n",
"VCC=15\n",
"print \"VCC= %0.2f\"%(VCC),\" volts\" # voltage supply\n",
"R1=10*10**(3)\n",
"print \"R1= %0.2f\"%(R1)+ \" ohm\" # resistance\n",
"RF=20*10**(3) \n",
"print \"RF= %0.2f\"%(RF)+ \" ohm\" # Feedback resistance\n",
"RB1=3*10**(3)\n",
"print \"R1= %0.2f\"%(R1)+ \" ohm\" # resistance\n",
"RB2=RB1\n",
"RF1=1*10**(3) \n",
"print \"RF1= %0.2f\"%(RF1)+ \" ohm\" # Feedback resistance\n",
"RF2=RF1\n",
"Av=1*10**(3)\n",
"print \"Av= %0.2f\"%(Av) \n",
"print \"part(i)\"\n",
"VBR1= (VCC*RF1)/RB1\n",
"VBR2 = VBR1\n",
"print \"VBR1=VBR2=(VCC*RF1)/RB1= %0.2f\"%(VBR1),\" volts\" #Limit values at the break points and VBR=VBR1=VBR2\n",
"So=-RF/R1\n",
"print \"So=-RF/R1= %0.2f\"%(So) # slope of Transfer characteristic at zero crossings \n",
"S1=-(RF1/R1)\n",
"print \"S1=S2=-RF1/R1= %0.2f\"%(S1)# slope of Transfer characteristic at the extreme ends\n",
"VSL=(-VBR1/So)\n",
"print \"VSL=VSU=(-VBR1/So)= %0.2f\"%(VSL),\" volts\" # magnitude of input voltage required to produce vo=VBR\n",
"VSU=VSL\n",
"print \"part(ii)\"\n",
"VSU=(VBR2/Av)#Formulae\n",
"print \"VSU=VSL=(VBR2/Av)= -%0.2f\"%(VSU),\", +%0.2f\"%(VSU),\" volts\" # magnitude of input voltage required to produce vo=VBR in case gain Av is very large"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 2",
"language": "python",
"name": "python2"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 2
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython2",
"version": "2.7.9"
}
},
"nbformat": 4,
"nbformat_minor": 0
}
|