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
450
451
452
|
{
"metadata": {
"name": "",
"signature": "sha256:5f773c85e1dfab84f7a94d7a8dae80fafd68f7320fe878d3eb9f67c265c3b4c6"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{
"cell_type": "heading",
"level": 1,
"metadata": {},
"source": [
"Ch2 : The p-n junction diode"
]
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example 2.1: Page 185"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"from __future__ import division\n",
"print \"Part (a)\" \n",
"# Applying Thevnin's theorem at XX', in Fig. 2.5(a)\n",
"Vth=15*20e3/(10e3+20e3) # Thevnin equivalent voltage in volts\n",
"Zth=10e3*20e3/(10e3+20e3) # Thevnin equivalent resistance in ohms\n",
"# From the figure 2.5(c)\n",
"I=Vth/(Zth+20e3) # Labelled current in amperes\n",
"Vo=I*20e3 # Labelled voltage in volts\n",
"I=I*1e3 # Labelled current in miliamperes\n",
"print \"Labelled current I = %0.2f mA\"%I \n",
"print \"Labelled voltage Vo = %0.2f V\" %Vo\n",
"\n",
"print \"Part (b)\" \n",
"# Applying Thevnin's theorem at XX' and YY', in Fig. 2.5(b)\n",
"Vth1=15*10e3/(10e3+10e3) # Thevnin equivalent voltage at XX' in volts\n",
"Zth1=10e3*10e3/(10e3+10e3) # Thevnin equivalent resistance at YY' in ohms\n",
"Vth2=5 # Thevnin equivalent voltage at YY' in volts\n",
"Zth2=5e3 # Thevnin equivalent resistance at YY' in ohms\n",
"# From the figure 2.5(d)\n",
"I=0 # Labelled current in amperes\n",
"Vo=5-7.5 # Labelled voltage in volts\n",
"print \"Labelled current I = %0.2f mA\"%I \n",
"print \"Labelled voltage Vo = %0.2f V\" %Vo "
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"Part (a)\n",
"Labelled current I = 0.38 mA\n",
"Labelled voltage Vo = 7.50 V\n",
"Part (b)\n",
"Labelled current I = 0.00 mA\n",
"Labelled voltage Vo = -2.50 V\n"
]
}
],
"prompt_number": 4
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example 2.2: Page 186"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"from math import log\n",
"ID1=1 # Let the initial diode current be 1 A\n",
"ID2=15*ID1 # Final diode current\n",
"VT=25e-3 # Voltage equivalent to temperatue at room temperature in volts\n",
"eta=1 # for Ge\n",
"deltaVD=eta*VT*log(ID2/ID1) # Change in diode voltage in volts\n",
"deltaVD=deltaVD*1e3 # Change in diode voltage in milivolts\n",
"print \"Change in diode voltage (for Ge) = %0.2f mV\"%deltaVD\n",
"eta=2 # for Si\n",
"deltaVD=eta*VT*log(ID2/ID1) # Change in diode voltage in volts\n",
"deltaVD=deltaVD*1e3 # Change in diode voltage in milivolts\n",
"print \"Change in diode voltage (for Si) = %0.3f mV\" %deltaVD"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"Change in diode voltage (for Ge) = 67.70 mV\n",
"Change in diode voltage (for Si) = 135.403 mV\n"
]
}
],
"prompt_number": 7
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example 2.3: Page 187"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"from math import exp\n",
"print \"Part (a)\" \n",
"eta=1 # for Ge\n",
"T=300 # Room temperature in kelvins\n",
"VT=T/11600 # Voltage equivalent to temperatue at room temperature in volts\n",
"IS=1 # Let reverse saturation current be 1 A\n",
"I=-0.9*IS # Reverse current\n",
"V=eta*VT*log(1+(I/IS)) # Voltagei in volts\n",
"V=V*1e3 # Voltage in milivolts\n",
"print \"Voltage = %0.2f mV \" %V\n",
"\n",
"print \"Part (b)\" \n",
"V=0.05 # Voltage in volts\n",
"If_Ir=(exp(V/(eta*VT))-1)/(exp(-V/(eta*VT))-1) # Ratio of current in forward bias to that in reverse bias\n",
"print \"Ratio of current in forward bias to that in reverse bias = %0.3f\"%If_Ir \n",
"\n",
"print \"Part (c)\" \n",
"IS=10e-6 # Reverse saturation current in amperes\n",
"V=0.1 # Voltage in volts\n",
"ID=IS*(exp(V/(eta*VT))-1) # Forward current for 0.1 V in amperes\n",
"ID=ID*1e6 # Forward current for 0.1 V in micro-amperes\n",
"print \"Forward current for 0.1 V = %0.2f \u03bcA \" %ID\n",
"V=0.2 # Voltage in volts\n",
"ID=IS*(exp(V/(eta*VT))-1) # Forward current for 0.1 V in amperes\n",
"ID=ID*1e3 # Forward current for 0.1 V in miliamperes\n",
"print \"Forward current for 0.1 V = %0.2f mA\"%ID \n",
"V=0.3 # Voltage in volts\n",
"ID=IS*(exp(V/(eta*VT))-1) # Forward current for 0.1 V in amperes\n",
"print \"Forward current for 0.1 V = %0.2f A\" %ID"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"Part (a)\n",
"Voltage = -59.55 mV \n",
"Part (b)\n",
"Ratio of current in forward bias to that in reverse bias = -6.913\n",
"Part (c)\n",
"Forward current for 0.1 V = 467.83 \u03bcA \n",
"Forward current for 0.1 V = 22.82 mA\n",
"Forward current for 0.1 V = 1.09 A\n"
]
}
],
"prompt_number": 13
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example 2.4 Page 187"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"IS=10e-6 # Reverse saturation current in amperes\n",
"eta=1 # for Ge\n",
"VT=25e-3 # Voltage equivalent to temperatue at room temperature in volts\n",
"\n",
"print \"Part (a)\" \n",
"VD=-24 # Reverse bias in volts\n",
"ID=IS*(exp(VD/(eta*VT))-1) # Current in amperes\n",
"ID=ID*1e6 # Current in micro-amperes\n",
"print \"Current = %0.2f \u03bcA \"%ID \n",
"\n",
"print \"Part (b)\" \n",
"VD=-0.02 # Reverse bias in volts\n",
"ID=IS*(exp(VD/(eta*VT))-1) # Current in amperes\n",
"ID=ID*1e6 # Current in micro-amperes\n",
"print \"Current = %0.2f \u03bcA \"%ID \n",
"\n",
"print \"Part (c)\" \n",
"VD=0.3 # Forward bias in volts\n",
"ID=IS*(exp(VD/(eta*VT))-1) # Current in amperes\n",
"print \"Current = %0.2f A \"%ID"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"Part (a)\n",
"Current = -10.00 \u03bcA \n",
"Part (b)\n",
"Current = -5.51 \u03bcA \n",
"Part (c)\n",
"Current = 1.63 A \n"
]
}
],
"prompt_number": 15
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example 2.5: Page 188"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"T=300 # Operating temperature in kelvins\n",
"VT=T/11600 # Voltage equivalent to temperatue at room temperature in volts\n",
"ID1=1 # Let the initial diode current be 1 A\n",
"ID2=10*ID1 # Final diode current\n",
"eta=1 # for Ge\n",
"deltaVD=eta*VT*log(ID2/ID1) # Change in diode voltage in volts\n",
"deltaVD=deltaVD*1e3 # Change in diode voltage in milivolts\n",
"print \"Change in diode voltage (for Ge) = %0.2f mV \" %deltaVD\n",
"eta=2 # for Si\n",
"deltaVD=eta*VT*log(ID2/ID1) # Change in diode voltage in volts\n",
"deltaVD=deltaVD*1e3 # Change in diode voltage in milivolts\n",
"print \"Change in diode voltage (for Si) = %0.2f mV \" %deltaVD"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"Change in diode voltage (for Ge) = 59.55 mV \n",
"Change in diode voltage (for Si) = 119.10 mV \n"
]
}
],
"prompt_number": 16
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example 2.6: Page 188"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"# In the circuit given in Fig. 2.7\n",
"V=50e-3 # Output voltage\n",
"VD1=0.7 # Voltage across diode 1 in volts\n",
"I1=10e-3 # Current through diode 1 at 0.7 V in amperes\n",
"VD2=0.8 # Voltage across diode 2 in volts\n",
"I2=100e-3 # Current through diode 2 at 0.8 V in amperes\n",
"eta_VT=(VD2-VD1)/log(I2/I1) # Product of \u03b7 and VT\n",
"I=10e-3/(exp(V/eta_VT)+1) # Current through diode 1 in amperes\n",
"R=V/I \n",
"print \"R = %0.2f \u03a9 \"%R "
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"R = 20.81 \u03a9 \n"
]
}
],
"prompt_number": 18
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example 2.7: Page 189"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"VDD=5 # Applied voltage in volts\n",
"VD=0.7 # Diode voltage in volts\n",
"I1=1e-3 # Current in amperes at diode voltage = 0.7 V\n",
"R=1000 # R in ohms\n",
"deltaVD=0.1 # Change in diode voltage in volts for every decade change in current\n",
"ratioI=10 # Decade change in current\n",
"eta_VT=deltaVD/log(ratioI) # Product of \u03b7 and VT\n",
"ID=(VDD-VD)/R # Diode current in amperes\n",
"VD2=VD+eta_VT*log(ID/I1) # Diode voltage in volts\n",
"ID=ID*1e3 # Diode current in miliamperes\n",
"print \"Diode current = %0.2f mA\" %ID\n",
"print \"Diode voltage = %0.2f V \"%VD2"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"Diode current = 4.30 mA\n",
"Diode voltage = 0.76 V \n"
]
}
],
"prompt_number": 19
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example 2.8: Page 190"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"print \"Part (a)\" \n",
"# Since both the diodes are in OFF state\n",
"Vo=5 # Output voltage in volts\n",
"print \"Output voltage = %0.2f V \"%Vo \n",
"\n",
"print \"Part (b)\" \n",
"#Since diode D1 is in OFF state and diode D2 is in ON state\n",
"# From Fig. 2.16(C)\n",
"I=(5-0.6)/(4.7e3+300) # Current flowing through the diode D2 in amperes\n",
"Vo=5-I*4.7e3 # Output voltage in volts\n",
"print \"Output voltage = %0.2f V \"%Vo\n",
"\n",
"print \"Part (c)\" \n",
"# Since both diodes are in ON state\n",
"# Applying KVL in Fig. 2.16(d)\n",
"I=(5-0.6)/(2*4.7e3+300) # Current flowing through diode D1 or diode D2 in amperes\n",
"Vo=5-2*I*4.7e3 # Output voltage in volts\n",
"print \"Output voltage = %0.2f V \"%Vo"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"Part (a)\n",
"Output voltage = 5.00 V \n",
"Part (b)\n",
"Output voltage = 0.86 V \n",
"Part (c)\n",
"Output voltage = 0.74 V \n"
]
}
],
"prompt_number": 20
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example 2.9 Page 190"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"Vy=0.7 # Cut-in voltage in volts\n",
"# In the Fig. 2.17\n",
"R1=5e3 \n",
"R2=10e3 \n",
"\n",
"print \"Part (a)\" \n",
"# Since diode D1 is OFF and diode D2 is ON\n",
"ID1=0 # A\n",
"ID2=(5-Vy-(-5))/(R1+R2) # Current through diode D2 in amperes\n",
"Vo=5-ID2*R1 # Output voltage\n",
"ID2=ID2*1e3 # Current through diode D2 in miliamperes\n",
"print \"Output voltage = %0.2f V \" %Vo\n",
"print \"Current through diode D1 = %0.2f mA\"%ID1 \n",
"print \"Current through diode D2 = %0.2f mA \"%ID2 \n",
"\n",
"print \"Part (b)\" \n",
"# Since both the diodes are ON\n",
"VA=4-Vy # In the fig.\n",
"Vo=VA+Vy # Output voltage\n",
"ID2=(5-Vo)/R1 # Current through diode D2 in amperes\n",
"IR2=(VA-(-5))/R2 # Current through diode R2 in amperes\n",
"ID1=IR2-ID2 # Current through diode D1 in amperes\n",
"ID1=ID1*1e3 # Current through diode D1 in miliamperes\n",
"ID2=ID2*1e3 # Current through diode D2 in miliamperes\n",
"print \"Output voltage = %0.2f V \" %Vo\n",
"print \"Current through diode D1 = %0.2f mA\"%ID1 \n",
"print \"Current through diode D2 = %0.2f mA \"%ID2 "
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"Part (a)\n",
"Output voltage = 1.90 V \n",
"Current through diode D1 = 0.00 mA\n",
"Current through diode D2 = 0.62 mA \n",
"Part (b)\n",
"Output voltage = 4.00 V \n",
"Current through diode D1 = 0.63 mA\n",
"Current through diode D2 = 0.20 mA \n"
]
}
],
"prompt_number": 21
}
],
"metadata": {}
}
]
}
|