summaryrefslogtreecommitdiff
path: root/OpAmps_And_Linear_Integrated_Circuits_by_Gayakwad/Chapter1.ipynb
blob: e4a0b038b872ed885cdf6726e4297308c2d4fb8c (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
{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {
    "collapsed": true
   },
   "source": [
    "# Chapter 1: Introduction to Operational Amplifiers"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "collapsed": true
   },
   "source": [
    "## Example 1.1_a"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Collector current Ic1 is 0.39 mA\n",
      "Voltage Vc1 is 3.38 V\n",
      "Voltage Ve4 is 2.68 V\n",
      "Current Ie4 is 0.297 mA\n",
      "Current Ic5 is 0.297 mA\n",
      "Voltage Vc5 is 4.87 V\n",
      "Voltage Ve6 is 4.17 V\n",
      "Current Ie6 is 0.678 mA\n",
      "Voltage Ve7 is 4.87 V\n",
      "Current I1 is 2.82 mA\n",
      "Current Ie8 is 2.82 mA\n",
      "Voltage Ve8 at the output terminal is -0.35 V\n"
     ]
    }
   ],
   "source": [
    "\n",
    "\n",
    "#Example 1.1_a\n",
    "#The equivalent circuit of the Motorola op-amp MC 1435 is shown in Figure.No-1.2\n",
    "#Determine the collector current in each transistor and the dc voltage at the\n",
    "#output terminal\n",
    "\n",
    "#Variable declaration\n",
    "Vcc=6                 #Voltage in volts\n",
    "Vbe5=0.7              #Voltage in volts\n",
    "Vee=6                 #Voltage in volts\n",
    "Vbe3=6.7              #Voltage in volts\n",
    "Vbe6=0.7              #Voltage in volts\n",
    "Vbe7=0.7              #Voltage in volts\n",
    "Rc1=6.7*10**3         #Resistance in ohms\n",
    "Ic1=0                 #initialization\n",
    "\n",
    "#Calculation\n",
    "Vc1=Vcc-Rc1*Ic1\n",
    "Ve4=Vc1-Vbe5\n",
    "I4=(Ve4+Vee)/(9.1*10**3+5.5*10**3)\n",
    "Vb3=5.5*10**3*I4-Vee\n",
    "Ve3=Vb3-Vbe3\n",
    "Ie3=(Ve3+Vbe3)/3.3*10**3\n",
    "Ic1=1.08*10**-3/2.765 #Since Ie3=2*Ic1\n",
    "Vc1=Vcc-Rc1*Ic1\n",
    "Ve4=Vc1-Vbe5\n",
    "Ie4=(Ve4+Vee)/(29.2*10**3)\n",
    "Ic5=Ie4\n",
    "Vc5=Vcc-3.8*10**3*Ic5\n",
    "Ve6=Vc5-Vbe6\n",
    "Ie6=(Ve6+Vee)/(15*10**3)\n",
    "Ve7=Ve6+Vbe7\n",
    "I1=(Vcc-Ve7)/400\n",
    "Ie8=I1\n",
    "Ve8=-Vee+2*10**3*Ie8\n",
    "\n",
    "#Result\n",
    "print \"Collector current Ic1 is\",round(Ic1*10**3,2),\"mA\"\n",
    "print \"Voltage Vc1 is\",round(Vc1,2),\"V\" \n",
    "print \"Voltage Ve4 is\",round(Ve4,2),\"V\"\n",
    "print \"Current Ie4 is\",round(Ie4*10**3,3),\"mA\"\n",
    "print \"Current Ic5 is\",round(Ic5*10**3,3),\"mA\"\n",
    "print \"Voltage Vc5 is\",round(Vc5,2),\"V\"\n",
    "print \"Voltage Ve6 is\",round(Ve6,2),\"V\"\n",
    "print \"Current Ie6 is\",round(Ie6*10**3,3),\"mA\"\n",
    "print \"Voltage Ve7 is\",round(Ve7,2),\"V\"\n",
    "print \"Current I1 is\",round(I1*10**3,2),\"mA\"\n",
    "print \"Current Ie8 is\",round(Ie8*10**3,2),\"mA\"\n",
    "print \"Voltage Ve8 at the output terminal is\",round(Ve8,2),\"V\"\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "collapsed": true
   },
   "source": [
    "## Example 1.1_b"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Voltage gain of the dual-input,balanced output-differential amplifier is 82.55\n",
      "Voltage gain of the dual-input,unbalanced output-differential amplifier is 22.6\n",
      "Overall gain of the op-amp is 1866.34\n"
     ]
    }
   ],
   "source": [
    "\n",
    "\n",
    "#Example 1.1_b, Figure.No-1.2\n",
    "#Calculate the Voltage gain of the opamp\n",
    "\n",
    "#Variable decclaration\n",
    "Ie1=0.39*10**-3    #Current in amps\n",
    "Ie4=0.298*10**-3   #Current in amps\n",
    "Ie6=0.678*10**-3   #Current in amps\n",
    "Rc1=6.7*10**3      #Resistance in ohms\n",
    "Rc5=3.8*10**3      #Resistance in ohms\n",
    "beta_ac=150\n",
    "\n",
    "#Calculation\n",
    "re1=(25*10**-3)/Ie1\n",
    "re2=re1\n",
    "re4=(25*10**-3)/Ie4\n",
    "re5=re4\n",
    "re6=(25*10**-3)/Ie6\n",
    "k=(Rc1*2*beta_ac*re4)/(Rc1+2*beta_ac*re4)\n",
    "Ad1=k/re1\n",
    "k1=(Rc5*beta_ac*(re6+15*10**3))/(Rc5+beta_ac*(re6+15*10**3))\n",
    "Ad2=k1/(2*re5)\n",
    "Ad=Ad1*Ad2\n",
    "\n",
    "#Result\n",
    "print \"Voltage gain of the dual-input,balanced output-differential amplifier is\",round(Ad1,2)\n",
    "print \"Voltage gain of the dual-input,unbalanced output-differential amplifier is\",round(Ad2,1)\n",
    "print \"Overall gain of the op-amp is\",round(Ad,2)\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "collapsed": true
   },
   "source": [
    "## Example 1.1_c"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Input resistance Ri is 19.23 kilo ohms\n"
     ]
    }
   ],
   "source": [
    "\n",
    "#Example 1.1_c, Figure.No-1.2\n",
    "#Determine the Input resistance of the opamp\n",
    "\n",
    "#Variable declaration\n",
    "beta_ac=150\n",
    "re1=64.1         #Resistance in ohms\n",
    "\n",
    "#calculation\n",
    "Ri=2*beta_ac*re1\n",
    "\n",
    "#result\n",
    "print \"Input resistance Ri is\",round(Ri/10**3,2),\"kilo ohms\"\n"
   ]
  }
 ],
 "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.6"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 0
}