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
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
|
{
"metadata": {
"name": "",
"signature": "sha256:f2f02a9bc5831c7f367935142b66b71aa0da896891093c898bfa38d6e16cd05d"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{
"cell_type": "heading",
"level": 1,
"metadata": {},
"source": [
"Chapter05: Bipolar Junction\n",
"Transistors (BJTs)"
]
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Ex5.1:pg-395"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"# Example 5.1 : Design of given circuit with current 2mA\n",
"# BJT will be operating in active mode\n",
"B=100.0; # B is beta value\n",
"a=B/(B+1); # a is alpha value\n",
"v_BE=0.7; # v_BE (V) at i_C=1mA\n",
"i_C1=1*10.0**-3; # (A)\n",
"I_C2=2*10.0**-3; # (A)\n",
"V_T=25*10.0**-3; # (V)\n",
"V_C=5; # (V)\n",
"V_CC=15.0; # (V)\n",
"V_B=0; # (V)\n",
"V_RC=V_CC-V_C;# V_RC is the voltage drop across resistor R_C\n",
"R_C=V_RC/I_C;\n",
"print R_C/1000,\"=Collector Resistance R_C (Kohm)\"\n",
"V_BE=v_BE+V_T*math.log(I_C2/i_C1);\n",
"print round(V_BE,3),\"=Base emitter voltage V_BE (V) at i_C=2mA\"\n",
"V_E=V_B-V_BE;\n",
"print round(V_E,3),\"=Emitter voltage V_E (V)\"\n",
"I_E=I_C2/a;\n",
"print I_E*1000,\"=Emitter current I_E (mA)\"\n",
"R_E=(V_E-(-V_CC))/I_E;\n",
"print round(R_E/1000,2),\"= Emitter resistance R_C (Kohm)\""
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"5.0 =Collector Resistance R_C (Kohm)\n",
"0.717 =Base emitter voltage V_BE (V) at i_C=2mA\n",
"-0.717 =Emitter voltage V_E (V)\n",
"2.02 =Emitter current I_E (mA)\n",
"7.07 = Emitter resistance R_C (Kohm)\n"
]
}
],
"prompt_number": 10
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Ex5.2:pg-413"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"# Example 5.2 : Consider a common Emitter circuit\n",
"I_S=10.0**-15; # (A)\n",
"R_C=6.8*10**3; # (ohm)\n",
"V_CC=10.0; # (V)\n",
"V_CE=3.2; # (V)\n",
"V_T=25.0*10**-3; # (V)\n",
"\n",
"# 5.2a\n",
"I_C=(V_CC-V_CE)/R_C;\n",
"print I_C*1000,\"= Collector current (A)\"\n",
"V_BE=V_T*math.log(I_C/I_S);\n",
"print round(V_BE*1000,1),\"= V_BE (mV)\"\n",
"\n",
"# 5.2b\n",
"V_in=5*10**-3; # sinuosoidal input 0f peak amplitide 5mv\n",
"A_v=-(V_CC-V_CE)/V_T;\n",
"print A_v,\"= Voltage gain\"\n",
"V_o=-A_v*V_in; # negative sign to make positive value of voltage gain\n",
"print V_o,\"= Amplitude of output voltage (V)\"\n",
"\n",
"# 5.2c\n",
"v_CE=0.3# (V)\n",
"i_C=(V_CC-v_CE)/R_C;\n",
"print round(i_C*1000,2),\"= i_C (mA)\"\n",
"v_be=V_T*math.log(i_C/I_C); # v_BE is positive increment in v_BE\n",
"print round(v_be*1000),\"= required increment (mV)\"\n",
"\n",
"# 5.2d\n",
"v_O=0.99*V_CC;\n",
"R_C=6.8*10**3; # (ohm)\n",
"i_C=(V_CC-v_O)/R_C;\n",
"I_C=1*10**-3; # (A)\n",
"print round(i_C*1000,4),\"= i_C (mA)\"\n",
"v_be=V_T*math.log(i_C/I_C);\n",
"print round(v_be*1000,1),\"= negative increment in v_BE (mV)\"\n",
"\n",
"# the answer for the C part is incorrect in the textbook"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"1.0 = Collector current (A)\n",
"690.8 = V_BE (mV)\n",
"-272.0 = Voltage gain\n",
"1.36 = Amplitude of output voltage (V)\n",
"1.43 = i_C (mA)\n",
"9.0 = required increment (mV)\n",
"0.0147 = i_C (mA)\n",
"-105.5 = negative increment in v_BE (mV)\n"
]
}
],
"prompt_number": 20
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Ex5.3:pg-420"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"# Example 5.3 :Determine R_B \n",
"# transistor is specified to have B value in the range of 50 to 150\n",
"V_C=0.2; # V_C=V_CEsat\n",
"V_CC=10; # (V)\n",
"R_C=10**3; # (ohm)\n",
"V_BB=5; # (V)\n",
"V_BE=0.7; # (V)\n",
"bmin=50; # range of bete is 50 to 150\n",
"I_Csat=(V_CC-V_C)/R_C;\n",
"I_BEOS=I_Csat/bmin; # I_B(EOS)=I_BEOS\n",
"I_B=10*I_BEOS; # base current for an overdrive factor 10\n",
"R_B=(V_BB-V_BE)/I_B;\n",
"print round(R_B/1000,1),\"= Value of R_B (Kohm)\""
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"2.2 = Value of R_B (Kohm)\n"
]
}
],
"prompt_number": 3
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Ex5.4:pg-422"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"# Example 5.4 : Analyse the circuit to find node voltages and branch currents\n",
"V_BB= 4; # (V)\n",
"V_CC=10; # (V)\n",
"V_BE=0.7; # (V)\n",
"b=100; # beta = 100\n",
"R_E=3.3*10**3; # (ohm)\n",
"R_C=4.7*10**3; # (ohm)\n",
"V_E=V_BB-V_BE;\n",
"print V_E,\"= Emitter voltage (V)\"\n",
"I_E=(V_E-0)/R_E;\n",
"print I_E*1000,\"= Emitter current (mA)\"\n",
"a=b/(b+1.0) # alpha value\n",
"I_C=I_E*a;\n",
"print round(I_C*1000,2),\"= Collector current (mA)\"\n",
"V_C=V_CC-I_C*R_C; # Applying ohm's law \n",
"print round(V_C,1),\"= Collector voltage (V)\"\n",
"I_B=I_E/(b+1);\n",
"print round(I_B*1000,2),\"= Base current (mA)\""
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"3.3 = Emitter voltage (V)\n",
"1.0 = Emitter current (mA)\n",
"0.99 = Collector current (mA)\n",
"5.3 = Collector voltage (V)\n",
"0.01 = Base current (mA)\n"
]
}
],
"prompt_number": 11
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Ex5.5:pg-423"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"# Example 5.5 : Analyse the circuit to find node voltages and branch currents\n",
"print \"Assuming active mode operation\"\n",
"V_CC=10.0; # (V)\n",
"R_C=4.7*10**3; # (V)\n",
"R_E=3.3*10**3; # (ohm)\n",
"V_BE=0.7; # (V)\n",
"V_BB=6.0; # (V)\n",
"V_CEsat=0.2; # (V)\n",
"V_E=V_BB-V_BE; \n",
"print V_E,\"= Emitter voltage (V)\"\n",
"I_E=V_E/R_E;\n",
"print round(I_E*1000,1),\"= Emitter current (mA)\"\n",
"V_C=V_CC-I_E*R_C; # I_E=I_C\n",
"print round(V_C,2),\"= Collector voltage (V)\"\n",
"print \"Since V_C < V_B our assumption is wrong\\n Hence its saturation mode operation\"\n",
"V_E=V_BB-V_BE;\n",
"print V_E,\"= Emitter voltage (V)\"\n",
"I_E=V_E/R_E;\n",
"print round(I_E*1000,1),\"= Emitter current (mA)\"\n",
"V_C=V_E+V_CEsat;\n",
"print V_C,\"= Collector voltage (V)\"\n",
"I_C=(V_CC-V_C)/R_C;\n",
"print round(I_C*1000,2),\"= Collector current (mA)\"\n",
"I_B=I_E-I_C;\n",
"print round(I_B*1000,2),\"=Base current (mA)\"\n",
"Bforced=I_C/I_B; # transistor is made to operate at a forced beta value\n",
"print round(Bforced,1),\"= forced beta\""
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"Assuming active mode operation\n",
"5.3 = Emitter voltage (V)\n",
"1.6 = Emitter current (mA)\n",
"2.45 = Collector voltage (V)\n",
"Since V_C < V_B our assumption is wrong\n",
" Hence its saturation mode operation\n",
"5.3 = Emitter voltage (V)\n",
"1.6 = Emitter current (mA)\n",
"5.5 = Collector voltage (V)\n",
"0.96 = Collector current (mA)\n",
"0.65 =Base current (mA)\n",
"1.5 = forced beta\n"
]
}
],
"prompt_number": 25
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Ex5.6:pg-426"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"# Example 5.7: Analyse the circuit to find node voltages and branch currents\n",
"V_CC=-10; # (V)\n",
"R_E=2000; # (ohm)\n",
"R_C=1000; # (ohm)\n",
"V_EE=10; # (V)\n",
"V_E=0.7; # (V) emitter base junction will be forward biased with V_E=V_EB=0.7V\n",
"print V_E,\"= Emitter base junction is forward biased with V_E (V)\"\n",
"I_E=(V_EE-V_E)/R_E;\n",
"print round(I_E*1000,2),\"= Emitter current (mA)\"\n",
"B=100; # Assuming beta 100\n",
"a=B/(B+1.0);\n",
"I_C=a*I_E; # Assuming the transistor to operate in active mode\n",
"print round(I_C*1000,1),\"= Collector current (mA)\"\n",
"V_C=V_CC+I_C*R_C;\n",
"print round(V_C,1),\"= Collector voltage (V)\"\n",
"I_B=I_E/(B+1);\n",
"print round(I_B*1000,2),\"= Base current (mA)\""
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"0.7 = Emitter base junction is forward biased with V_E (V)\n",
"4.65 = Emitter current (mA)\n",
"4.6 = Collector current (mA)\n",
"-5.4 = Collector voltage (V)\n",
"0.05 = Base current (mA)\n"
]
}
],
"prompt_number": 32
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Ex5.8:pg-428"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"# Example 5.8 : Analyse the circuit to find node voltages and branch currents\n",
"V_CC= 10; # (V)\n",
"R_C=2000.0; # (ohm)\n",
"V_BB=5.0; # (V)\n",
"R_B=100.0*10**3; # (ohm)\n",
"B=100.0; # beta value\n",
"I_B=(V_BB-V_BE)/R_B;\n",
"print round(I_B*1000,3),\"= Base current (mA)\"\n",
"I_C=B*I_B;\n",
"print round(I_C*1000,1),\"= Collector current (mA)\"\n",
"V_C=V_CC-I_C*R_C;\n",
"print V_C,\"= Collector voltage (V)\"\n",
"V_B=0.7 ; # V_B=V_BE\n",
"print V_B,\"= Base voltage (V)\"\n",
"I_E=(B+1.0)*I_B;\n",
"print round(I_E*1000,1),\"= Emitter current (mA)\""
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"0.043 = Base current (mA)\n",
"4.3 = Collector current (mA)\n",
"1.4 = Collector voltage (V)\n",
"0.7 = Base voltage (V)\n",
"4.3 = Emitter current (mA)\n"
]
}
],
"prompt_number": 39
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Ex5.9:pg-429"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"# Example 5.9 :Analyse the circuit to find node voltages and branch currents\n",
"# assuming that the transistor is saturated \n",
"V_CC=-5; # (V)\n",
"V_EE=5; # (V)\n",
"R_B=10000; # (ohm)\n",
"R_C=10000; # (ohm)\n",
"R_E=1000; # (ohm)\n",
"V_EB=0.7; # (V)\n",
"V_ECsat=0.2; # (V)\n",
"# using the relation I_E=I_C+I_B\n",
"V_B=3.75/1.2; #(V)\n",
"print round(V_B,2),\"= Base voltage (V)\"\n",
"V_E=V_B+V_EB;\n",
"print round(V_E,2),\"= Emitter voltage (V)\"\n",
"V_C=V_E-V_ECsat;\n",
"print round(V_C,2),\"= Collector voltage (V)\"\n",
"I_E=(V_EE-V_E)/R_E;\n",
"print round(I_E*1000,2),\"= Emitter current (mA)\"\n",
"I_B=V_B/R_B;\n",
"print round(I_B*1000,2),\"= Base current (mA)\"\n",
"I_C=(V_C-V_CC)/R_C;\n",
"print round(I_C*1000,2),\"= Collector current (mA)\"\n",
"Bforced=I_C/I_B; # Value of forced beta\n",
"print round(Bforced,1), \"= Forced Beta value\""
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"3.13 = Base voltage (V)\n",
"3.83 = Emitter voltage (V)\n",
"3.63 = Collector voltage (V)\n",
"1.17 = Emitter current (mA)\n",
"0.31 = Base current (mA)\n",
"0.86 = Collector current (mA)\n",
"2.8 = Forced Beta value\n"
]
}
],
"prompt_number": 43
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Ex5.10:pg-430"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"# Exampe 5.10 : Analyse the circuit to find node voltages and branch currents\n",
"V_CC=15; # (V)\n",
"R_C=5000; # (ohm)\n",
"R_B1=100*10**3; # (ohm)\n",
"R_B2=50*10**3; # (ohm)\n",
"R_E=3000; # (ohm)\n",
"V_BE=0.7; # (V)\n",
"B=100; # beta value\n",
"V_BB=V_CC*R_B2/(R_B1+R_B2);\n",
"print V_BB,\"=V_BB (V)\"\n",
"R_BB=R_B1*R_B2/(R_B1+R_B2);\n",
"print round(R_BB/1000.0,1),\"=R_BB (Kohm)\"\n",
"I_B=I_E/(B+1.0);\n",
"print round(I_B*1000,4),\"=Base current (mA)\"\n",
"I_E=(V_BB-V_BE)/(R_E +(R_BB/(B+1)))\n",
"print round(I_E*1000,2),\"=Emiter current (mA)\"\n",
"I_B=I_E/(B+1.0)\n",
"print round(I_B*1000,4),\"=Base current (mA)\"\n",
"V_B=V_BE+I_E*R_E;\n",
"print round(V_B,2),\"=Base voltage (V)\"\n",
"a=B/(B+1.0); # alpha value\n",
"I_C=a*I_E\n",
"print round(I_C*1000,2),\"=Collector current (mA)\"\n",
"V_C=V_CC-I_C*R_C;\n",
"print V_C,\"=Collector voltage (V))\""
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"5 =V_BB (V)\n",
"33.3 =R_BB (Kohm)\n",
"0.0128 =Base current (mA)\n",
"1.29 =Emiter current (mA)\n",
"0.0128 =Base current (mA)\n",
"4.57 =Base voltage (V)\n",
"1.28 =Collector current (mA)\n",
"8.60746885499 =Collector voltage (V))\n"
]
}
],
"prompt_number": 62
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Ex5.11:pg-432"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"# Example 5.11 :Analyse the circuit to find node voltages and branch currents\n",
"V_CC=15.0; # (V)\n",
"R_C1=5000.0; # (ohm)\n",
"R_B1=100.0*10**3; # (ohm)\n",
"R_B2=50.0*10**3; # (ohm)\n",
"R_E=3000.0; # (ohm)\n",
"V_BE=0.7; # (V)\n",
"R_E2=2000.0; # (ohm)\n",
"R_C2=2700.0; # (ohm)\n",
"V_EB=0.7; # (V)\n",
"B=100.0; # beta value\n",
"V_BB=V_CC*R_B2/(R_B1+R_B2);\n",
"R_BB=R_B1*R_B2/(R_B1+R_B2);\n",
"I_E1=(V_BB-V_BE)/(R_E +(R_BB/(B+1.0)))\n",
"print round(I_E1*1000,2),\"= I_E1 (mA)\"\n",
"I_B1=I_E1/(B+1.0)\n",
"print round(I_B1*1000,2),\"I_B1 (mA)\"\n",
"V_B1=V_BE+I_E*R_E;\n",
"print round(V_B1,2),\"=V_B1 (V)\"\n",
"a=B/(B+1.0); # alpha value\n",
"# beta and alpha values are same for the two transistors\n",
"I_C1=a*I_E\n",
"print round(I_C1*1000,2),\"= IC1 (mA)\"\n",
"V_C1=V_CC-I_C1*R_C1;\n",
"print round(V_C1,1),\"V_C1 (V))\"\n",
"V_E2=V_C1+V_EB;\n",
"print round(V_E2,1),\"V_E2(V)\"\n",
"I_E2=(V_CC-V_E2)/R_E2;\n",
"print round(I_E2*1000,2),\"I_E2 (mA)\"\n",
"I_C2=a*I_E2;\n",
"print round(I_C2*1000,2),\"I_C2 (mA)\"\n",
"V_C2=I_C2*R_C2;\n",
"print round(V_C2,2),\"V_C2 (V)\"\n",
"I_B2=I_E2/(B+1.0);\n",
"print round(I_B2*1000,3),\"I_B2 (mA)\""
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"1.29 = I_E1 (mA)\n",
"0.01 I_B1 (mA)\n",
"4.57 =V_B1 (V)\n",
"1.28 = IC1 (mA)\n",
"8.6 V_C1 (V))\n",
"9.3 V_E2(V)\n",
"2.85 I_E2 (mA)\n",
"2.82 I_C2 (mA)\n",
"7.61 V_C2 (V)\n",
"0.028 I_B2 (mA)\n"
]
}
],
"prompt_number": 77
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Ex5.13:pg-438"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"# Example 5.13 : Design of bias network of the amplifier\n",
"I_E=1*10**-3; # (A)\n",
"V_CC=12; # (V)\n",
"B=100; # beta value\n",
"V_B=4; # (V)\n",
"V_BE=0.7; # (V)\n",
"R1=80; # (ohm)\n",
"R2=40; # (ohm)\n",
"V_C=8; # (V)\n",
"V_E=V_B-V_BE;\n",
"print V_E,\"= Emitter voltage (V)\"\n",
"R_E=V_E/I_E;\n",
"print R_E/1000,\"= Emitter resistance (Kohm)\"\n",
"I_E=(V_B-V_BE)/(R_E+(R1*R2/(R1+R2))/(B+1));\n",
"print I_E*1000,\"= more accurate value for I_E (mA) for R1=80 ohm and R2=40 ohm\"\n",
"R1=8; # (ohm)\n",
"R2=4; # (ohm)\n",
"I_E=(V_B-V_BE)/(R_E+(R1*R2/(R1+R2))/(B+1));\n",
"print I_E*1000,\"= more accurate value for I_E (mA) for R1=8 ohm and R2=4 ohm\"\n",
"R_C=(V_CC-V_C)/I_E; # I_E=I_C\n",
"print round(R_C/1000.0),\"= Collector resistor (Kohm)\""
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"3.3 = Emitter voltage (V)\n",
"3.3 = Emitter resistance (Kohm)\n",
"1.0 = more accurate value for I_E (mA) for R1=80 ohm and R2=40 ohm\n",
"1.0 = more accurate value for I_E (mA) for R1=8 ohm and R2=4 ohm\n",
"4.0 = Collector resistor (Kohm)\n"
]
}
],
"prompt_number": 81
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Ex5.14:pg-450"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"# Example 5.14 : Analysis of transistor amplifier\n",
"V_CC=10; # (V)\n",
"R_C=3000; # (ohm)\n",
"R_BB=100*10**3; # (ohm)\n",
"V_BB=3; # (V)\n",
"V_BE=0.7; # (V)\n",
"V_T=25*10**-3; # (V)\n",
"I_B=(V_BB-V_BE)/R_BB;\n",
"print round(I_B*1000,2),\"= Base current (mA)\"\n",
"I_C=B*I_B;\n",
"print round(I_C*1000,2),\"= Collector current (mA)\"\n",
"V_C=V_CC-I_C*R_C;\n",
"print V_C,\"= Collecor voltage (V)\"\n",
"I_E=B*I_C/(B+1);\n",
"r_e=V_T/I_E;\n",
"print round(r_e,2),\"= r_e (ohm)\"\n",
"g_m=I_C/V_T;\n",
"print g_m*1000,\"= g_m (mA/V)\"\n",
"r_pi=B/g_m;\n",
"print round(r_pi/1000,2),\"= r_pi (Kohm)\"\n",
"# v_i is input voltage let us assume it to be 1 V\n",
"v_i=1;\n",
"v_be=v_i*r_pi/(r_pi+R_BB)\n",
"print round(v_be,3),\"= v_be\"\n",
"v_o=-g_m*R_C*v_be;\n",
"print round(v_o),\"= Output voltage (V)\"\n",
"A_v=v_o/v_i;\n",
"print round(A_v),\"= Voltage gain\""
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"0.02 = Base current (mA)\n",
"2.3 = Collector current (mA)\n",
"3.1 = Collecor voltage (V)\n",
"10.98 = r_e (ohm)\n",
"92.0 = g_m (mA/V)\n",
"1.09 = r_pi (Kohm)\n",
"0.011 = v_be\n",
"-3.0 = Output voltage (V)\n",
"-3.0 = Voltage gain\n"
]
}
],
"prompt_number": 92
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Ex5.17:pg-464"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"# Example 5.17 : Amplifier parameters\n",
"# Transistor amplifier is having a open circuit voltage of v_sig of 10mV\n",
"v_sig=10*10.0**-3; # (V)\n",
"R_L=10*10.0**3; # (ohm)\n",
"R_sig=100*10.0**3; # (ohm)\n",
"print \"Calculation with R_L infinite\"\n",
"v_i=9.0; # (V)\n",
"v_o=90.0; # (V)\n",
"A_vo=v_o/v_i;\n",
"print A_vo,\"= A_vo (V/V)\"\n",
"G_vo=v_o/A_vo;\n",
"print G_vo,\"= G_vo (V/V)\"\n",
"R_i=G_vo*R_sig/(A_vo-G_vo)\n",
"print (R_i/1000),\"= R_i (Kohm)\"\n",
"print \"Calculations with R_L = 10k ohm\"\n",
"v_o=70*10**-3; # (V)\n",
"v_i=8*10**-3; # (V)\n",
"A_v=v_o/v_i;\n",
"print A_v,\"= Voltage gain A_v (V/V)\"\n",
"G_v=v_o*10**3/10.0;\n",
"print G_v,\"= G_v (V/V)\"\n",
"R_o=(A_vo-A_v)*R_L/A_v;\n",
"print round(R_o/1000,2),\"= R_o (Kohm)\"\n",
"R_out=(G_vo-G_v)*R_L/G_v;\n",
"print round(R_out/1000,2),\"= R_out (Kohm)\"\n",
"R_in=v_i*R_sig/(v_sig-v_i);\n",
"print R_in/1000,\"= R_in (Kohm)\"\n",
"G_m=A_vo/R_o;\n",
"print round(G_m*1000),\"= G_m (mA/V)\"\n",
"A_i=A_v*R_in/R_L;\n",
"print A_i,\"= A_i (A/A)\"\n",
"R_ino=R_sig/((1+R_sig/R_i)*(R_out/R_o)-1); # R_ino is R_in at R_L=0\n",
"print round(R_ino/1000,1),\"= R_in at R_L =0\"\n",
"A_is=A_vo*R_ino/R_o;\n",
"print int(A_is),\"= A_is (A/A)\""
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"Calculation with R_L infinite\n",
"10.0 = A_vo (V/V)\n",
"9.0 = G_vo (V/V)\n",
"900.0 = R_i (Kohm)\n",
"Calculations with R_L = 10k ohm\n",
"8.75 = Voltage gain A_v (V/V)\n",
"7.0 = G_v (V/V)\n",
"1.43 = R_o (Kohm)\n",
"2.86 = R_out (Kohm)\n",
"400.0 = R_in (Kohm)\n",
"7.0 = G_m (mA/V)\n",
"350.0 = A_i (A/A)\n",
"81.8 = R_in at R_L =0\n",
"572 = A_is (A/A)\n"
]
}
],
"prompt_number": 103
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Ex5.18:pg-497"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"#Example 5.18 : Midband gain and 3dB frequency\n",
"# Transistor is biased at I_C=1mA\n",
"V_CC=10.0; # (V)\n",
"V_EE=10.0; # (V)\n",
"I=0.001; # (A)\n",
"R_B=100000.0; # (ohm)\n",
"R_C=8000.0; # (ohm)\n",
"R_sig=5000.0; #(ohm)\n",
"R_L=5000.0; # (ohm)\n",
"B=100.0; # beta value\n",
"V_A=100.0; # (V)\n",
"C_u=1*10.0**-12; # (F)\n",
"f_T=800.0*10**6; # (Hz)\n",
"I_C=0.001; # (A)\n",
"r_x=50.0; # (ohm)\n",
"# Values of hybrid pi model parameters\n",
"g_m=I_C/V_T;\n",
"r_pi=B/g_m;\n",
"r_o=V_A/I_C;\n",
"w_T=2*math.pi*f_T;\n",
"CpiplusCu=g_m/w_T; # C_u+C_pi\n",
"C_pi=CpiplusCu-C_u;\n",
"R_l=r_o*R_C*R_L/(r_o*R_C+R_C*R_L+R_L*r_o) # R_l=R_L'\n",
"A_M=R_B*r_pi*g_m*R_l/((R_B+R_sig)*(r_pi+r_x+(R_B*R_sig/(R_B+R_sig))));\n",
"print round(A_M),\"= Midband gain (V/V)\"\n",
"R_seff=(r_pi*(r_x+R_B*R_sig/(R_B+R_sig)))/(r_pi+r_x+R_B*R_sig/(R_B+R_sig)); # Effective source resistance R_seff=R'_sig\n",
"C_in=C_pi+C_u*(1+R_l*g_m);\n",
"f_H=1/(2*math.pi*C_in*R_seff);\n",
"print int(f_H/1000),\"= 3dB frequency (KHz)\"\n",
"\n",
"# the answer is the book is slightly different due to approximation"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"39.0 = Midband gain (V/V)\n",
"759 = 3dB frequency (KHz)\n"
]
}
],
"prompt_number": 109
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Ex5.19:pg-502"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"# Example 5.19 : To select values of capacitance required\n",
"R_B=100000.0; # (ohm)\n",
"r_pi=2500.0; # (ohm)\n",
"R_C=8000.0; # (ohm)\n",
"R_L=5000.0; # (ohm)\n",
"R_sig=5000.0; # (ohm)\n",
"B=100.0; # beta value\n",
"g_m=0.04; # (A/V)\n",
"r_pi=2500.0; #(ohm)\n",
"f_L=100.0; # (Hz)\n",
"r_e=25.0; # (ohm)\n",
"R_C1=R_B*r_pi/(R_B+r_pi)+R_sig; # Resistance seen by C_C1 \n",
"R_E=r_e+R_B*R_sig/((R_B+R_sig)*(B+1)); # Resistance seen by C_E\n",
"R_C2=R_C+R_L;# Resistance seen by C_C2\n",
"w_L=2*math.pi*f_L;\n",
"C_E=1/(R_E*0.8*w_L); #C_E is to contribute only 80% of the value of w_L\n",
"print round(C_E*1e6,1),\"= C_E (microF)\" \n",
"C_C1=1/(R_C1*0.1*w_L); #C_C1 is to contribute only 10% of the value of f_L\n",
"print round(C_C1*1e6,1),\"= C_C1 (microF)\"\n",
"C_C2=1/(R_C2*0.1*w_L); #C_C2 should contribute only 10% of the value of f_L\n",
"print round(C_C2*1e6,1),\"= C_C2 (microF)\""
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"27.6 = C_E (microF)\n",
"2.1 = C_C1 (microF)\n",
"1.2 = C_C2 (microF)\n"
]
}
],
"prompt_number": 116
}
],
"metadata": {}
}
]
}
|