summaryrefslogtreecommitdiff
path: root/sample_notebooks/PriyankaSaini/chapter-1.ipynb
blob: b9e335d09d7cfb967cb9afb7799097262e5ca167 (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
{
 "metadata": {
  "name": "",
  "signature": "sha256:a1991f0c2ad3cdd162c5a3598633b434636cdfbb3e50ee12bef51cec75158259"
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "Chapter 1 - Differential Amplifiers"
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Exa 1.8 - pg:19"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#given data\n",
      "BETAac=100  #unitless\n",
      "BETAdc=100  #unitless\n",
      "VBE3=0.715  #in volts\n",
      "VD1=0.715  #in Volts\n",
      "VZ=6.2  #in Volts\n",
      "VT=25  #in mVolts\n",
      "IZt=41  #in mA \n",
      "VCC=10  #in Volts\n",
      "VEE=-10  #in Volts\n",
      "RC1=2.7  #in kohm\n",
      "RC=4.7  #in kohm\n",
      "#Part (a)\n",
      "VB3=VEE+VZ+VD1  #in volts\n",
      "VE3=VB3-VBE3\n",
      "IE3=(VE3-VEE)/RC1  #in mA\n",
      "#As the differential amplifier is symmetrical, ICQ1=IE1=ICQ2=IE2\n",
      "IE2=IE3/2  #in mA\n",
      "ICQ1=IE2  #in mA\n",
      "ICQ2=IE2  #in mA\n",
      "IE1=IE2  #in mA\n",
      "VCEQ=VCC+VBE3-RC*ICQ1# formula for VCEQ \n",
      "print \"Operating point for Q1 and Q2 are : \"\n",
      "print \"VCEQ is \",round(VCEQ,2),\" V\"\n",
      "print \"ICQ is \",round(ICQ1,2),\" mA\"\n",
      "print \"and the operating point for Q3 will be : \"\n",
      "VCE3=-VBE3-VE3  #in Volts\n",
      "print \"VCE3 is \",round(VCE3,2),\" V\"\n",
      "IC3=IE3  #in mA\n",
      "print \"IE3 is \",round(IE3,2),\" mA\"\n",
      "#Part (b)\n",
      "re=(2*VT)/IC3  #in ohm\n",
      "Ad=(RC*1000)/re  #unitless\n",
      "print \"Differential voltage gain is \",round(Ad,2)\n",
      "#Part (c)\n",
      "Ri=2*BETAac*re  #in ohm\n",
      "Ri/=1000  # kohm\n",
      "print \"Input resistance is \",round(Ri,2),\" kohm\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Operating point for Q1 and Q2 are : \n",
        "VCEQ is  5.32  V\n",
        "ICQ is  1.15  mA\n",
        "and the operating point for Q3 will be : \n",
        "VCE3 is  3.08  V\n",
        "IE3 is  2.3  mA\n",
        "Differential voltage gain is  215.85\n",
        "Input resistance is  4.35  kohm\n"
       ]
      }
     ],
     "prompt_number": 14
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Exa 1.9 : pg-29"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#given data\n",
      "Io=180  #in uA\n",
      "Vcc=20  #in Volts\n",
      "VBE=0.7  #in Volts\n",
      "BETA=120  #unitless\n",
      "IR=Io*(1+2/BETA)  #in uA\n",
      "R=(Vcc-VBE)/(IR*10**-3)  #in kohm\n",
      "print \"Value of IR is \",round(IR,2),\" uA\"\n",
      "print \"Value of R is \",round(R,2),\" kohm\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Value of IR is  180.0  uA\n",
        "Value of R is  107.22  kohm\n"
       ]
      }
     ],
     "prompt_number": 19
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Exa 1.16 : pg-31"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#given data\n",
      "BETAac=100  #unitless\n",
      "BETAdc=100  #unitless\n",
      "VBEon=0.7  #in volts\n",
      "VCC=5  #in volts\n",
      "VEE=-5  #in volts\n",
      "VT=25  #in mVolts\n",
      "R=18.6  #in kohm\n",
      "Ad=200  #unitless\n",
      "IR=(VCC-VBEon -VEE)/R  #in mA\n",
      "IC1=IR/2  #in mA\n",
      "IC2=IC1  #in mA\n",
      "re1=(2*VT)/IR  #in ohm\n",
      "re2=re1  #in ohm\n",
      "RC=Ad*re1*10**-3  #in kohm\n",
      "print \"Rc is \",round(RC,2),\" kohm\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Rc is  20.0  kohm\n"
       ]
      }
     ],
     "prompt_number": 20
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Exa 1.18 : pg-33"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#given data\n",
      "Iload=20  #in uA\n",
      "VBE=0.7  #in volts\n",
      "VCC=10  #in Volts\n",
      "IR=Iload  #in mA\n",
      "R=(VCC-2*VBE)/(IR*10**-3)  #in kohm\n",
      "print \"R is \",round(R,2),\" kohm\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "R is  430.0  kohm\n"
       ]
      }
     ],
     "prompt_number": 22
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Exa 1.23 : pg-26"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#given data\n",
      "Vo=5  #in volts\n",
      "BETAac=150  #unitless\n",
      "BETAdc=150  #unitless\n",
      "VT=25  #in mV\n",
      "VCC=10  #in mV\n",
      "VD=0.7  #in mV\n",
      "R1=2.7  #in kohm\n",
      "R2=1.5  #in kohm\n",
      "# part (i) #\n",
      "# IC1/IC2=exp((VBE1-VBE2)/VT)\n",
      "# Writing KVL for the loop\n",
      "IR=(VCC-VD)/R1  #in mA\n",
      "IC=(IR-VD/R2)/(1+2/BETAac)  #in mA\n",
      "IC1=IC  #in mA\n",
      "IC2=IC  #in mA\n",
      "RC=(VCC-Vo)/IC  #in kohm\n",
      "print \"IC1 is \",round(IC1,2),\" mA\"\n",
      "print \"IC2 is \",round(IC2,2),\" mA\"\n",
      "print \"RC is \",round(RC,2),\" kohm\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "IC1 is  2.98  mA\n",
        "IC2 is  2.98  mA\n",
        "RC is  1.68  kohm\n"
       ]
      }
     ],
     "prompt_number": 17
    }
   ],
   "metadata": {}
  }
 ]
}