summaryrefslogtreecommitdiff
path: root/Electronic_Devices_and_Circuits_by_D._C._Kulshreshtha/Chapter14.ipynb
blob: 31604c9748afd39d8436a1b0d648df508b930f56 (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
{
 "metadata": {
  "name": "",
  "signature": "sha256:22a4fbff9c8897e342a78bd9c8e48f9f093d2131b002f5667d92f4929ec8b5e4"
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "Chapter14:Operational Amplifiers"
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example E1 - Pg 474"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Calculate voltage gain and input and output resistance\n",
      "#given\n",
      "R1=20.*10.**3.;#ohm\n",
      "Rf=2000.*10.**3.;#ohm\n",
      "Acl=-Rf/R1;\n",
      "Ricl=R1;\n",
      "Ro=0;\n",
      "print '%s %.f %s' %(\"The voltage gain =\",Acl,\"\\n\");\n",
      "print '%s %.f %s' %(\"The input resistance =\",R1/1000,\"kohm\\n\");\n",
      "print '%s %.f %s' %(\"The output resistance =\",Ro,\"ohm\\n\");\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The voltage gain = -100 \n",
        "\n",
        "The input resistance = 20 kohm\n",
        "\n",
        "The output resistance = 0 ohm\n",
        "\n"
       ]
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example E2 - Pg 474"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Find the output voltage\n",
      "#given\n",
      "R1=20.*10.**3.;#ohm\n",
      "Rf=2000.*10.**3.;#ohm\n",
      "v1=4.;#V\n",
      "v2=3.8;#V\n",
      "vo=v2*(1.+Rf/R1)-(Rf/R1)*v1;\n",
      "print '%s %.1f %s' %(\"The output voltage =\",vo,\"V\");\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The output voltage = -16.2 V\n"
       ]
      }
     ],
     "prompt_number": 2
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example E4 - Pg 475"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Design an adder circuit using an op amp\n",
      "#given\n",
      "#Vo=-(V1+10*V2+100*V3)\n",
      "Rf=100.*10.**3.;#ohm\n",
      "C1=1.;#coefficient of V1\n",
      "C2=10.;#coefficient of V2\n",
      "C3=100.;#coefficient of V3\n",
      "R1=Rf/C1;\n",
      "R2=Rf/C2;\n",
      "R3=Rf/C3;\n",
      "print '%s %.f %s' %(\"R1 =\",R1/1000,\"kohm\\n\");\n",
      "print '%s %.f %s' %(\"R2 =\",R2/1000,\"kohm\\n\");\n",
      "print '%s %.f %s' %(\"R3 =\",R3/1000,\"kohm\\n\");\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "R1 = 100 kohm\n",
        "\n",
        "R2 = 10 kohm\n",
        "\n",
        "R3 = 1 kohm\n",
        "\n"
       ]
      }
     ],
     "prompt_number": 3
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example E5 - Pg 484"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Calculate CMRR in dB\n",
      "#given\n",
      "import math\n",
      "Ad=100.;#differential mode gain\n",
      "Ac=0.01;#common mode gain\n",
      "CMRR=20.*math.log10(Ad/Ac);\n",
      "print '%s %.f %s' %(\"The CMRR in dB =\",CMRR,\"dB\");\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The CMRR in dB = 80 dB\n"
       ]
      }
     ],
     "prompt_number": 4
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example E6 - Pg 484"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Calculate the output voltage\n",
      "#given\n",
      "Ad=2000.;#differential mode gain\n",
      "CMRR=10000.;\n",
      "V1=10.**-3.;#V\n",
      "V2=0.9*10.**-3.;#V\n",
      "Vd=V1-V2;\n",
      "Vc=(V1+V2)/2.;\n",
      "Vo=Ad*Vd*(1.+Vc/(CMRR*Vd));\n",
      "print '%s %.2f %s' %(\"The output voltage is =\",Vo*1000,\"mV\");\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The output voltage is = 200.19 mV\n"
       ]
      }
     ],
     "prompt_number": 5
    }
   ],
   "metadata": {}
  }
 ]
}