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
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
|
{
"metadata": {
"name": "",
"signature": "sha256:aa3033a597a0bf06128c3fae6fc134561fe0b608c1a6f342b1690de7caed5ad0"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{
"cell_type": "heading",
"level": 1,
"metadata": {},
"source": [
"Chapter07:Differential and Multistage amlplifiers"
]
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Ex7.1:pg-690"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"# Example 7.1 Analysis of differential amplifier\n",
"# Consider the differential amplifier\n",
"\n",
"B=100.0; # beta value\n",
"\n",
"# 7.1a\n",
"V_T=0.025; # (V)\n",
"I_E=0.0005; # (A)\n",
"R_E=150.0; # (ohm)\n",
"r_e1=V_T/I_E; # emitter resistance (ohm)\n",
"r_e2=r_e1; # emitterA resistance (ohm)\n",
"r_e=r_e1;\n",
"R_id=2*(B+1)*(r_e+R_E);\n",
"print round(R_id/1000.0),\"The input differential resistance R_id (kohm)\"\n",
"\n",
"# 7.1b\n",
"R_id=40000.0; # (ohm)\n",
"R_sig=5000.0; # (ohm)\n",
"R_C=10000.0; # (ohm)\n",
"R_E=150.0; # (ohm)\n",
"A_v=R_id/(R_id+R_sig); # A_v= v_o/v_sig (V/V)\n",
"A_V=2*R_C/(2.0*(r_e+R_E)); # A_V= v_o/v_id (V/v)\n",
"A_d=A_v*A_V; # A_d=v_o/v_sig (V/V)\n",
"print \"Overall differential voltage gain (V/V)\",round(A_d,-1)\n",
"\n",
"# 7.1c\n",
"R_EE=200000.0; # (ohm)\n",
"deltaR_C=0.02*R_C; # in the worst case\n",
"A_cm=R_C*deltaR_C/(2.0*R_EE*R_C)\n",
"print A_cm,\"Worst case common mode gain (V/V)\"\n",
"\n",
"# 7.1d\n",
"CMRR=20*math.log10(A_d/A_cm)\n",
"print int(CMRR),\"CMRR in dB\"\n",
"\n",
"# 7.1e\n",
"r_o=200000.0; #(ohm)\n",
"R_icm=(B+1)*(R_EE*r_o/2.0)/(R_EE+r_o/2.0);\n",
"print round(R_icm/1e6,1),\"Input common mode resistance (kohm)\""
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"40.0 The input differential resistance R_id (kohm)\n",
"Overall differential voltage gain (V/V) 40.0\n",
"0.0005 Worst case common mode gain (V/V)\n",
"98 CMRR in dB\n",
"6.7 Input common mode resistance (kohm)\n"
]
}
],
"prompt_number": 15
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Ex7.2:pg-747"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"# Example 7.2 : Analysis of Active loaded MOS differential amplifier\n",
"W=7.2*10**-6; # (m)\n",
"L=0.36*10**-6; # (m)\n",
"C_gs=29*10**-15; # (F)\n",
"C_gd=5*10**-15; # (F)\n",
"C_db=5*10**-15; # (F)\n",
"uC_n=387*10**-6; # uC_n=u_nC_ox (A/V**2)\n",
"uC_p=86*10**-6; # uC_p=u_pC_ox (A/V**2)\n",
"V_an=5; # V_an=V'_An (V/um) (V)\n",
"V_ap=6; # V_ap=V'_Ap (V/um) (V)\n",
"I=0.2*10**-3; # (A)\n",
"R_SS=25000; # (ohm)\n",
"C_SS=0.2*10**-12; # (F)\n",
"C_S=25*10**-15; # (F)\n",
"K_n=uC_n*W/L;\n",
"I_D=100*10**-6; # bias current (A)\n",
"V_OV=math.sqrt(2*I_D/K_n);\n",
"g_m=I/V_OV;\n",
"g_m1=g_m;\n",
"g_m2=g_m;\n",
"r_o1=V_an*0.36/(0.1*10**-3);\n",
"r_o2=r_o1;\n",
"K_p=uC_p*W/L;\n",
"V_OV34=math.sqrt(2*I_D/K_p); # V_OV3,4\n",
"g_m3=2*0.1*10**-3/V_OV34;\n",
"g_m4=g_m3;\n",
"r_o3=V_ap*0.36/(0.1*10**-3);\n",
"r_o4=r_o3;\n",
"A_d=g_m*(r_o2*r_o4)/(r_o2+r_o4);\n",
"print round(A_d,1),\"A_d (V/V)\"\n",
"A_cm=-1/(2*g_m3*R_SS);\n",
"print round(A_cm,3),\"A_cm (V/V)\"\n",
"CMRR=20*log10(-A_d/A_cm); # negative sign to make A_cm positive\n",
"print round(CMRR,1),\"CMRR in dB\"\n",
"C_gd1=5*10**-15; # (F)\n",
"C_db1=5*10**-15; # (F)\n",
"C_db3=5*10**-15; # (F)\n",
"C_gs3=20*10**-15; # (F)\n",
"C_gs4=20*10**-15; # (F)\n",
"C_m=C_gd1+C_db1+C_db3+C_gs3+C_gs4;\n",
"C_gd2=5*10**-15; # (F)\n",
"C_db2=5*10**-15; # (F)\n",
"C_gd4=5*10**-15; # (F)\n",
"C_db4=5*10**-15; # (F)\n",
"C_x=25*10**-15; # (F)\n",
"C_L=C_gd2+C_db2+C_gd4+C_db4+C_x;\n",
"print \"poles and zeroes of A_d\"\n",
"R_o=r_o2*r_o4/(r_o2+r_o4)\n",
"f_p1=1/(2*math.pi*C_L*R_o);\n",
"print int(f_p1/1e6),\"f_p1 (MHz)\"\n",
"f_p2=g_m3/(2*math.pi*C_m);\n",
"print round(f_p2/1e9,2),\"f_p2 (GHz)\"\n",
"f_Z=2*f_p2;\n",
"print round(f_Z/1e9,1),\"f_Z (GHz)\"\n",
"print \"Dominant pole of CMRR is at location of commom-mode gain zero\"\n",
"f_Z=1/(2*math.pi*C_SS*R_SS);\n",
"print round(f_Z/1e6,1),\"f_Z (MHz)\""
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"12.2 A_d (V/V)\n",
"-0.034 A_cm (V/V)\n",
"51.1 CMRR in dB\n",
"poles and zeroes of A_d\n",
"360 f_p1 (MHz)\n",
"1.7 f_p2 (GHz)\n",
"3.4 f_Z (GHz)\n",
"Dominant pole of CMRR is at location of commom-mode gain zero\n",
"31.8 f_Z (MHz)\n"
]
}
],
"prompt_number": 28
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Ex7.3:pg-751"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"# Example 7.3 : To determine all parameters for different transistor\n",
"I_REF=90*10.0**-6; # (A)\n",
"V_tn=0.7; # (V)\n",
"V_tp=0.8; # Magnitude is cconsidered\n",
"uC_n=160.0*10**-6; # uC_n=u_n*C_ox\n",
"uC_p=40*10.0**-6; # uC_p=u_p*C_ox\n",
"V_A=10.0; # (V)\n",
"V_DD=2.5; # (V)\n",
"V_SS=2.5; # (V)\n",
"L=0.8*10**-6; # (m)\n",
"r_o2=222.0; # (ohm)\n",
"r_o4=222.0; # (ohm)\n",
"g_m1=0.3; # (mho)\n",
"A_1=-g_m1*r_o2*r_o4/(r_o2+r_o4);\n",
"print round(A_1,2),\"=A_1 (V/V)\"\n",
"r_o6=111.0; # (ohm)\n",
"r_o7=111.0; # (ohm)\n",
"g_m6=0.6; # (mho)\n",
"A_2=-g_m6*r_o6*r_o7/(r_o6+r_o7);\n",
"print round(A_2,2),\"=A_2 (V/V)\"\n",
"print \"For Q_1\"\n",
"W=20*10.0**-6; # (m)\n",
"I_D=I_REF/2.0; # (A)\n",
"print round(I_D/(10.0**-6),2),\"=I_D (microA)\"\n",
"K_p=uC_p*W/L;\n",
"V_OV=math.sqrt(2*I_D/K_p);\n",
"print round(V_OV,2),\"=V_OV (V)\"\n",
"V_GS=V_tp+V_OV;\n",
"print round(V_GS,2),\"=V_GS (V)\"\n",
"g_m=2*I_D/V_OV;\n",
"print round(g_m/(10.0**-3),2),\"=g_m (mA/V)\"\n",
"r_o=V_A/I_D;\n",
"print int(r_o/1e3),\"=r_o (kohm)\"\n",
"print \"For Q_2\"\n",
"W=20*10.0**-6; # (m)\n",
"I_D=I_REF/2; # (A)\n",
"print round(I_D/(10.0**-6),2),\"=I_D (microA)\"\n",
"K_p=uC_p*W/L;\n",
"V_OV=math.sqrt(2*I_D/K_p);\n",
"print round(V_OV,2),\"=V_OV (V)\"\n",
"V_GS=V_tp+V_OV;\n",
"print round(V_GS,2),\"=V_GS (V)\"\n",
"g_m=2*I_D/V_OV;\n",
"print round(g_m/(10.0**-3),2),\"=g_m (mA/V)\"\n",
"r_o=V_A/I_D;\n",
"print round(r_o/1e3),\"=r_o (kohm)\"\n",
"print \"For Q_3\"\n",
"W=5*10**-6; # (m)\n",
"I_D=I_REF/2; # (A)\n",
"print round(I_D/(10.0**-6),2),\"=I_D (microA)\"\n",
"K_n=uC_n*W/L;\n",
"V_OV=math.sqrt(2*I_D/K_n);\n",
"print round(V_OV,2),\"=V_OV (V)\"\n",
"V_GS=V_tn+V_OV;\n",
"print round(V_GS,2),\"=V_GS (V)\"\n",
"g_m=2*I_D/V_OV;\n",
"print round(g_m/(10.0**-3),2),\"=g_m (mA/V)\"\n",
"r_o=V_A/I_D;\n",
"print round(r_o/1e3),\"=r_o (kohm)\"\n",
"print \"For Q_4\"\n",
"W=5*10**-6; # (m)\n",
"I_D=I_REF/2; # (A)\n",
"print round(I_D/(10.0**-6),2),\"=I_D (microA)\"\n",
"K_n=uC_n*W/L;\n",
"V_OV=math.sqrt(2*I_D/K_n);\n",
"print round(V_OV,2),\"=V_OV (V)\"\n",
"V_GS=V_tn+V_OV;\n",
"print round(V_GS,2),\"=V_GS (V)\"\n",
"g_m=2*I_D/V_OV;\n",
"print round(g_m/(10.0**-3),2),\"=g_m (mA/V)\"\n",
"r_o=V_A/I_D;\n",
"print round(r_o/1e3),\"=r_o (kohm)\"\n",
"print \"For Q_5\"\n",
"W=40*10.0**-6; # (m)\n",
"I_D=I_REF; # (A)\n",
"print round(I_D/(10.0**-6),2),\"=I_D (microA)\"\n",
"K_p=uC_p*W/L;\n",
"V_OV=math.sqrt(2*I_D/K_p);\n",
"print round(V_OV,2),\"=V_OV (V)\"\n",
"V_GS=V_tp+V_OV;\n",
"print round(V_GS,2),\"=V_GS (V)\"\n",
"g_m=2*I_D/V_OV;\n",
"print round(g_m/(10.0**-3),2),\"=g_m (mA/V)\"\n",
"r_o=V_A/I_D;\n",
"print round(r_o/1e3),\"=r_o (kohm)\"\n",
"print \"For Q_6\"\n",
"W=10*10**-6; # (m)\n",
"I_D=I_REF; #A\n",
"print round(I_D/(10.0**-6),2),\"=I_D (microA)\"\n",
"K_n=uC_n*W/L;\n",
"V_OV=math.sqrt(2*I_D/K_n);\n",
"print round(V_OV,2),\"=V_OV (V)\"\n",
"V_GS=V_tn+V_OV;\n",
"print round(V_GS,2),\"=V_GS (V)\"\n",
"g_m=2*I_D/V_OV;\n",
"print round(g_m/(10.0**-3),2),\"=g_m (mA/V)\"\n",
"r_o=V_A/I_D;\n",
"print round(r_o/1e3),\"=r_o (kohm)\"\n",
"print \"For Q_7\"\n",
"W=40*10**-6; # (m)\n",
"I_D=I_REF;#A\n",
"print round(I_D/(10.0**-6),2),\"=I_D (microA)\"\n",
"K_p=uC_p*W/L;\n",
"V_OV=math.sqrt(2*I_D/K_p);\n",
"print round(V_OV,2),\"=V_OV (V)\"\n",
"V_GS=V_tp+V_OV;\n",
"print round(V_GS,2),\"=V_GS (V)\"\n",
"g_m=2*I_D/V_OV;\n",
"print round(g_m/(10.0**-3),2),\"=g_m (mA/V)\"\n",
"r_o=V_A/I_D;\n",
"print round(r_o/1e3),\"=r_o (kohm)\"\n",
"print \"For Q_8\"\n",
"W=40*10**-6; # (m)\n",
"I_D=I_REF; # A\n",
"print round(I_D/(10.0**-6),2),\"=I_D (microA)\"\n",
"K_p=uC_p*W/L;\n",
"V_OV=math.sqrt(2*I_D/K_p);\n",
"print round(V_OV,2),\"=V_OV (V)\"\n",
"V_GS=V_tp+V_OV;\n",
"print round(V_GS,2),\"=V_GS (V)\"\n",
"g_m=2*I_D/V_OV;\n",
"print round(g_m/(10.0**-3),2),\"=g_m (mA/V)\"\n",
"r_o=V_A/I_D;\n",
"print int(r_o/1e3),\"=r_o (kohm)\"\n",
"A_O=A_1*A_2;\n",
"print round(20*log10(A_O)),\"=The dc open loop gain in dB\"\n",
"v_ICMmin=-2.5+1;\n",
"print round(v_ICMmin,2),\"=Lower limit of input common-mode (V)\"\n",
"v_ICMmax=2.2-1.1;\n",
"print round(v_ICMmax,2),\"=Upper limit of input common-mode (V)\"\n",
"v_Omax=V_DD-V_OV;\n",
"print round(v_Omax,2),\"=Highest allowable output voltage (V)\"\n",
"v_Omin=-V_SS+V_OV;\n",
"print round(v_Omin,2),\"=Lowest allowable output voltage (V)\""
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"-33.3 =A_1 (V/V)\n",
"-33.3 =A_2 (V/V)\n",
"For Q_1\n",
"45.0 =I_D (microA)\n",
"0.3 =V_OV (V)\n",
"1.1 =V_GS (V)\n",
"0.3 =g_m (mA/V)\n",
"222 =r_o (kohm)\n",
"For Q_2\n",
"45.0 =I_D (microA)\n",
"0.3 =V_OV (V)\n",
"1.1 =V_GS (V)\n",
"0.3 =g_m (mA/V)\n",
"222.0 =r_o (kohm)\n",
"For Q_3\n",
"45.0 =I_D (microA)\n",
"0.3 =V_OV (V)\n",
"1.0 =V_GS (V)\n",
"0.3 =g_m (mA/V)\n",
"222.0 =r_o (kohm)\n",
"For Q_4\n",
"45.0 =I_D (microA)\n",
"0.3 =V_OV (V)\n",
"1.0 =V_GS (V)\n",
"0.3 =g_m (mA/V)\n",
"222.0 =r_o (kohm)\n",
"For Q_5\n",
"90.0 =I_D (microA)\n",
"0.3 =V_OV (V)\n",
"1.1 =V_GS (V)\n",
"0.6 =g_m (mA/V)\n",
"111.0 =r_o (kohm)\n",
"For Q_6\n",
"90.0 =I_D (microA)\n",
"0.3 =V_OV (V)\n",
"1.0 =V_GS (V)\n",
"0.6 =g_m (mA/V)\n",
"111.0 =r_o (kohm)\n",
"For Q_7\n",
"90.0 =I_D (microA)\n",
"0.3 =V_OV (V)\n",
"1.1 =V_GS (V)\n",
"0.6 =g_m (mA/V)\n",
"111.0 =r_o (kohm)\n",
"For Q_8\n",
"90.0 =I_D (microA)\n",
"0.3 =V_OV (V)\n",
"1.1 =V_GS (V)\n",
"0.6 =g_m (mA/V)\n",
"111 =r_o (kohm)\n",
"61.0 =The dc open loop gain in dB\n",
"-1.5 =Lower limit of input common-mode (V)\n",
"1.1 =Upper limit of input common-mode (V)\n",
"2.2 =Highest allowable output voltage (V)\n",
"-2.2 =Lowest allowable output voltage (V)\n"
]
}
],
"prompt_number": 49
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Ex7.5:pg-760"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"# Example 7.5 : Analysis of given circuit\n",
"B=100.0; # beta value\n",
"I_E=0.2510**-3; # (A)\n",
"R_1=20000.0; # (ohm)\n",
"R_2=20000; # (ohm)\n",
"R_3=3000; # (ohm)\n",
"R_4=2300; # (ohm)\n",
"R_5=15700; # (ohm)\n",
"R_6=3000; # (ohm)\n",
"r_e1=25/0.25; # (ohm)\n",
"r_e2=r_e1; # (ohm)\n",
"r_pi1=(B+1)*r_e1;\n",
"r_pi2=(B+1)*r_e2;\n",
"R_id=r_pi1+r_pi2;\n",
"print round(R_id/1e3,2),\"Input differential resistance (kohm)\"\n",
"I_E=1*10.0**-3;\n",
"r_e4=25/1.0;\n",
"r_e5=r_e4;\n",
"r_pi4=(B+1)*r_e4;\n",
"r_pi5=(B+1)*r_e5;\n",
"R_i2=r_pi4+r_pi5;\n",
"print round(R_i2/1e3,2),\"Input resistance of the second stage R_i2 (kohm)\"\n",
"A_1=(R_i2*(R_1+R_2)/((R_i2+R_1+R_2)*(r_e1+r_e2)))\n",
"print round(A_1,1),\"Voltage gain of the first stage (V/V)\"\n",
"r_e7=25/1.0;\n",
"R_i3=(B+1)*(R_4+r_e7);\n",
"print round(R_i3/1e3,1),\"Input resistance of the third stage R_i3 (kohm)\"\n",
"A_2=(-R_3*R_i3)/((R_3+R_i3)*(r_e4+r_e5));\n",
"print round(A_2,1),\"Voltage gain of the second stage (V/V)\"\n",
"r_e8=25/5.0;\n",
"R_i4=(B+1)*(r_e8+R_6);\n",
"print round(R_i4/1e3,2),\"Input resistance of the third stage R_i2 (kohm)\"\n",
"A_3=(-R_5*R_i4)/((R_5+R_i4)*(r_e7+R_4));\n",
"print round(A_3,2),\"Voltage gain of the third stage (V/V)\"\n",
"A_4=R_6/(R_6+r_e8);\n",
"print round(A_4,2),\"Voltage gain of the fourth stage (V/V)\"\n",
"A=A_1*A_2*A_3*A_4 ; # A=v_o/v_id (V/V)\n",
"print round(A),\"Overall output gain (V/V)\"\n",
"print round(20*log10(A),1),\"Overall output gain in dB\"\n",
"R_o=R_6*(r_e8+R_5/(B+1))/(R_6+r_e8+R_5/(B+1))\n",
"print round(R_o),\"Output resistance (ohm)\""
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"20.2 Input differential resistance (kohm)\n",
"5.05 Input resistance of the second stage R_i2 (kohm)\n",
"22.4 Voltage gain of the first stage (V/V)\n",
"234.8 Input resistance of the third stage R_i3 (kohm)\n",
"-59.2 Voltage gain of the second stage (V/V)\n",
"303.5 Input resistance of the third stage R_i2 (kohm)\n",
"-6.42 Voltage gain of the third stage (V/V)\n",
"1.0 Voltage gain of the fourth stage (V/V)\n",
"8514.0 Overall output gain (V/V)\n",
"78.6 Overall output gain in dB\n",
"152.0 Output resistance (ohm)\n"
]
}
],
"prompt_number": 56
}
],
"metadata": {}
}
]
}
|