diff options
author | hardythe1 | 2015-05-05 14:21:39 +0530 |
---|---|---|
committer | hardythe1 | 2015-05-05 14:21:39 +0530 |
commit | fba055ce5aa0955e22bac2413c33493b10ae6532 (patch) | |
tree | be70ef4fccd07c9c88de778014219201b4ea971f /Op-amp_and_linear_integrated_circuits_ | |
parent | 67068710030ddd6b6c809518c34af2e04e0bf7ca (diff) | |
download | Python-Textbook-Companions-fba055ce5aa0955e22bac2413c33493b10ae6532.tar.gz Python-Textbook-Companions-fba055ce5aa0955e22bac2413c33493b10ae6532.tar.bz2 Python-Textbook-Companions-fba055ce5aa0955e22bac2413c33493b10ae6532.zip |
add books
Diffstat (limited to 'Op-amp_and_linear_integrated_circuits_')
15 files changed, 8280 insertions, 0 deletions
diff --git a/Op-amp_and_linear_integrated_circuits_/Chapter_1.ipynb b/Op-amp_and_linear_integrated_circuits_/Chapter_1.ipynb new file mode 100755 index 00000000..4ab2c3b1 --- /dev/null +++ b/Op-amp_and_linear_integrated_circuits_/Chapter_1.ipynb @@ -0,0 +1,1301 @@ +{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 1: Introduction to Differential Amplifier and Op-amp"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 1.1, Page No. 4"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# output voltage of differential amplifier\n",
+ "\n",
+ "import math\n",
+ "#Variable declaration\n",
+ "v1 = 300*10**-6 # voltage at terminal 1\n",
+ "v2 = 240*10**-6 # voltage at terminal 2\n",
+ "Aid = 5000.0 # differential gain of amplifier \n",
+ "cmmr1 = 100 # CMMR for case 1\n",
+ "cmmr2 = 10**5 # CMMR for case 2\n",
+ "\n",
+ "\n",
+ "#Calculations\n",
+ "# case 1\n",
+ "Vid = v1-v2\n",
+ "Vcm = (v1+v2)/2\n",
+ "Acm = Aid/cmmr1\n",
+ "Vout = Aid*Vid+Acm*Vcm\n",
+ "Vout = Vout*1000 # mV\n",
+ "\n",
+ "# case 2\n",
+ "Acm2 = Aid/cmmr2\n",
+ "Vout2 = Aid*Vid+Acm2*Vcm\n",
+ "Vout2 = Vout2*1000 # mV\n",
+ "\n",
+ "Vout_ideal = Aid*Vid*1000 # mV\n",
+ "#Result\n",
+ "print(\"(i) CMMR = %d:\\nVout = %.1f mV\\n\\n(ii) CMMR = %d:\\nVout = %.4f mV\\n\\nIdeal Vout = %.0f mV\"%(cmmr1,Vout,cmmr2,Vout2,Vout_ideal))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(i) CMMR = 100:\n",
+ "Vout = 313.5 mV\n",
+ "\n",
+ "(ii) CMMR = 100000:\n",
+ "Vout = 300.0135 mV\n",
+ "\n",
+ "Ideal Vout = 300 mV\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 1.2, Page No.9"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Operating point values\n",
+ "\n",
+ "import math\n",
+ "#Variable declaration\n",
+ "Rc = 4.7*10**3 # collector resistor\n",
+ "Re = 3.3*10**3 # emitter resistor\n",
+ "Vcc = 12 # + supply voltage\n",
+ "Vee = -12 # - supply voltage\n",
+ "Vbe = 0.7 # base-emitter junction voltage\n",
+ "\n",
+ "\n",
+ "#Calculations\n",
+ "Ie = (Vcc-Vbe)/(2*Re)\n",
+ "Ic = Ie\n",
+ "Vce = Vcc+Vbe-(Ic*Rc) \n",
+ "\n",
+ "#Result\n",
+ "print(\"Q point is (%.3f mA, %.3f V)\"%(Ic*1000,Vce))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Q point is (1.712 mA, 4.653 V)\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 1.3, Page No. 14"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# differential amplifier parameters(refer fig. 1.14)\n",
+ "\n",
+ "import math\n",
+ "#Variable declaration\n",
+ "hie = 2.8*10**3 # input impedance\n",
+ "Rc = 4.7*10**3 # collector resistance\n",
+ "Vcc = 15 # supply voltage\n",
+ "hfe = 100 # transistor current gain\n",
+ "Re = 6.8*10**3 # emitter resistance\n",
+ "Vbe = 0.7 # emitter-base junction voltage drop\n",
+ "Rin = 100 # input resistance\n",
+ "v1 = 70*10**-3 # input voltage 1\n",
+ "v2 = 40*10**-3 # input voltage 2\n",
+ "\n",
+ "# Calculations\n",
+ "# Operating point values\n",
+ "Ie = Ic = (Vcc-Vbe)/( (2*Re) + (Rin/hfe))\n",
+ "Vce = Vcc+Vbe-Ic*Rc\n",
+ "# Differential gain\n",
+ "Aid = (hfe*Rc)/(Rin+hie)\n",
+ "Aid = math.floor(Aid*1000)/1000\n",
+ "#Common mode gain\n",
+ "Acm = hfe*Rc/(2*Re*(1+hfe)+Rin+hie)\n",
+ "#CMMR\n",
+ "CMMR = 20*math.log10(Aid/Acm)\n",
+ "CMMR = math.floor(CMMR*1000)/1000\n",
+ "#output voltage\n",
+ "Vid = v1-v2\n",
+ "Vcm = (v1+v2)/2\n",
+ "Vout = Aid*Vid+Acm*Vcm\n",
+ "\n",
+ "#Result\n",
+ "print(\"(i) Operating point values:\\nIcq = %.3f mA\\nVcq = %.3f V\\n\\n(ii) Differential gain:\\nAid = %.3f\"%(Ic*1000,Vce,Aid))\n",
+ "print(\"\\n(iii) Common mode gain:\\nAcm = %.4f\"%(math.floor(Acm*10000)/10000))\n",
+ "print(\"\\n(iv) CMMR:\\nCMMR in dB = %.3f dB\\n\\n(v) Output Voltage:\\nVout = %.2f V\"%(CMMR,Vout))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(i) Operating point values:\n",
+ "Icq = 1.051 mA\n",
+ "Vcq = 10.758 V\n",
+ "\n",
+ "(ii) Differential gain:\n",
+ "Aid = 162.068\n",
+ "\n",
+ "(iii) Common mode gain:\n",
+ "Acm = 0.3414\n",
+ "\n",
+ "(iv) CMMR:\n",
+ "CMMR in dB = 53.527 dB\n",
+ "\n",
+ "(v) Output Voltage:\n",
+ "Vout = 4.88 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 19
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 1.4, Page No. 16"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# operating point , voltage gain and input/output impedance(refer fig 1.15)\n",
+ "\n",
+ "import math\n",
+ "#Variable declaration\n",
+ "Rc = 3.3*10**3 # collector resistor\n",
+ "Rin = 150 # inputr resistance\n",
+ "Re = 8.2*10**3 # emitter resistor\n",
+ "Vcc = 12 # supply voltage\n",
+ "beta = 100 # beta value\n",
+ "Vbe = 0.7 # emitter-base junction voltage drop\n",
+ "\n",
+ "#Calculations\n",
+ "# opearating point\n",
+ "Ie = Ic = (Vcc-Vbe)/( (2*Re) + (Rin/beta))\n",
+ "Ie = Ic = math.floor(Ic*10**6)/10**6\n",
+ "Vce = Vcc+Vbe-Ic*Rc\n",
+ "# Voltage gain\n",
+ "re = (26*10**-3)/Ie\n",
+ "Aid = Rc/re\n",
+ "# input and output impedance\n",
+ "Ri = 2*re*beta\n",
+ "Ro = Rc\n",
+ "\n",
+ "#Result\n",
+ "print(\"(i) Operating point values:\\nIcq = %.3f mA\\nVcq = %.4f V\\n\\n(ii) Voltage gain:\\nAid = %.2f\"%(Ic*1000,Vce,Aid))\n",
+ "print(\"\\n(iii)input and output impedances:\\nRi = %.3f k-ohm\\nRo = %.1f k-ohm\"%(Ri/1000,Ro/1000)) "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(i) Operating point values:\n",
+ "Icq = 0.688 mA\n",
+ "Vcq = 10.4296 V\n",
+ "\n",
+ "(ii) Voltage gain:\n",
+ "Aid = 87.32\n",
+ "\n",
+ "(iii)input and output impedances:\n",
+ "Ri = 7.558 k-ohm\n",
+ "Ro = 3.3 k-ohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 35
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 1.5, Page No. 19"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# constant current in the circuit(refer fig 1.19(a)\n",
+ "\n",
+ "import math\n",
+ "#Variable declaration\n",
+ "Vee = 20.0 # supply voltage\n",
+ "R1 = 4.7*10**3 # resistor R1\n",
+ "R2 = 4.7*10**3 # resistor R2\n",
+ "R3 = 2.2*10**3 # resistor R3\n",
+ "Vbe = 0.7 # emitter-base junction voltage drop\n",
+ "\n",
+ "#Calcualtions\n",
+ "Vb = (-Vee*R1)/(R1+R2)\n",
+ "Ve = Vb - Vbe\n",
+ "Ie = (Ve-(-Vee))/(R3) \n",
+ "I = Ie = math.floor(Ie*10**5)/10**5\n",
+ "\n",
+ "#Result\n",
+ "print(\"I = %.2f mA\"%(I*1000))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "I = 4.22 mA\n"
+ ]
+ }
+ ],
+ "prompt_number": 47
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 1.6, Page No.23"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Widlar current source(refer fig. 1.24)\n",
+ "\n",
+ "import math\n",
+ "#Variable declaration\n",
+ "Ic2 = 20*10**-6 # required collector current of 2nd Trasistor\n",
+ "Vbe = 0.7 # emitter-base junction voltage drop\n",
+ "Vcc = 30 # supply voltage\n",
+ "R = 33.3*10**3 # Resistor R\n",
+ "Vt = 26*10**-3 # thermal voltage \n",
+ "\n",
+ "#Calculations\n",
+ "Ic1 = (Vcc-Vbe)/R\n",
+ "Re = Vt*math.log(Ic1/Ic2)/Ic2\n",
+ "\n",
+ "#Result\n",
+ "print(\"Re = %.2f k-ohm\"%(Re/1000))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Re = 4.92 k-ohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 50
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 1.7, Page No. 24"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Widlar current source: value of Ic2\n",
+ "\n",
+ "import math\n",
+ "# Variable declaration\n",
+ "Iref = 1*10**-3 # reference current\n",
+ "Re = 5*10**3 # emitter resistor\n",
+ "Vt = 26*10**-3 # thermal voltage \n",
+ "\n",
+ "# Calculations\n",
+ "Ic2_1 = 12*10**-6 # assumed value 1\n",
+ "lhs1 = (Vt*math.log(Iref/Ic2_1))-(Ic2_1*Re)\n",
+ "Ic2_2 = 22*10**-6 # assumed value 2\n",
+ "lhs2 = (Vt*math.log(Iref/Ic2_2))-(Ic2_2*Re)\n",
+ "lhs2 = math.ceil(lhs2*10**5)/10**5\n",
+ "Ic2_3 = 20*10**-6 # assumed value 3\n",
+ "lhs3 = (Vt*math.log(Iref/Ic2_3))-(Ic2_3*Re)\n",
+ "\n",
+ "#Result\n",
+ "print(\"for Ic2 = %.0f micro-A, L.H.S = %.5f\"%(Ic2_1*10**6,lhs1))\n",
+ "print(\"for Ic2 = %.0f micro-A, L.H.S = %.5f\"%(Ic2_2*10**6,lhs2))\n",
+ "print(\"\\nhence actual value is less than but closer to %.0f micro-A\"%(Ic2_2*10**6))\n",
+ "print(\"\\nfor Ic2 = %f micro-A, L.H.S = %.4f\"%(Ic2_3*10**6,lhs3))\n",
+ "print(\"LHS is almost zero, so the value of Ic2 = %.0f micro-A\"%(Ic2_3*10**6))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "for Ic2 = 12 micro-A, L.H.S = 0.05499\n",
+ "for Ic2 = 22 micro-A, L.H.S = -0.01076\n",
+ "\n",
+ "hence actual value is less than but closer to 22 micro-A\n",
+ "\n",
+ "for Ic2 = 20.000000 micro-A, L.H.S = 0.0017\n",
+ "LHS is almost zero, so the value of Ic2 = 20 micro-A\n"
+ ]
+ }
+ ],
+ "prompt_number": 61
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 1.8, Page No.34"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# level shifting network (refer fig. 1.42)\n",
+ "\n",
+ "import math\n",
+ "#Variable declaration\n",
+ "Vi = 6.84 # input dc level\n",
+ "R2 = 270 # resistor R2\n",
+ "Vbe = 0.7 # emitter-base junction voltage drop\n",
+ "\n",
+ "# Calculations\n",
+ "R1 = ((Vi-Vbe)*R2)-R2\n",
+ "R1 = R1/1000\n",
+ "#Result\n",
+ "print(\"Required value of R to get 0V output level is %.3f k-ohm\"%(math.floor(R1*10**3)/1000))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Required value of R to get 0V output level is 1.387 k-ohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 69
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 1.9, Page No. 36"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# differential and common mode output \n",
+ "\n",
+ "import math\n",
+ "#Variable declaration\n",
+ "Aid = 80.0 # differential gain\n",
+ "CMMR = 95.0 # common mode rejection ratio\n",
+ "V1 = 2*10**-6 # input voltage 1\n",
+ "V2 = 1.6*10**-6 # input voltage 2\n",
+ "\n",
+ "#Calculations\n",
+ "Aid = 10**(Aid/20)\n",
+ "CMMR = 10.0**(CMMR/20)\n",
+ "Vid = Aid*(V1-V2)\n",
+ "Acm = Aid/CMMR\n",
+ "Vcm = Acm*(V1+V2)/2\n",
+ "\n",
+ "#Result\n",
+ "print(\"Vid = %.0f mV\\nVcm = %.2f micro-V\"%(Vid*10**3,Vcm*10**6))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Vid = 4 mV\n",
+ "Vcm = 0.32 micro-V\n"
+ ]
+ }
+ ],
+ "prompt_number": 75
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 1.10, Page No. 37"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Common mode output\n",
+ "\n",
+ "import math\n",
+ "#Variable declaration\n",
+ "Aid = 125.0 # differential gain \n",
+ "CMMR = 60.0 # common mode rejection ratio\n",
+ "Vp = 4.0 # peak voltage \n",
+ "#Calculations\n",
+ "x = 10**(CMMR/20) # Aid/Acm\n",
+ "Acm = Aid/x\n",
+ "\n",
+ "#Result\n",
+ "print(\"Commode mode output is given by Acm*Vcm = %.1f*sin(200*pi*t)\"%(Vp*Acm))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Commode mode output is given by Acm*Vcm = 0.5*sin(200*pi*t)\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 1.11, Page No.37"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Collector voltage and and differential voltage gain(refer fig 1.48)\n",
+ "\n",
+ "import math\n",
+ "#Variable declaration\n",
+ "Vbe = 0.7 # emitter-base junction voltage drop\n",
+ "hfe = 100.0 # current gain\n",
+ "hie = 3.9*10**3 # inpput impedance\n",
+ "Rin = 1*10**3 # Source resistance\n",
+ "Re = 27*10**3 # Emitter resistance\n",
+ "Rc = 6.8*10**3 # collector resistance\n",
+ "Vcc = 15 # supply voltage\n",
+ "\n",
+ "\n",
+ "#Calculations\n",
+ "Ie = Ic = (Vcc-Vbe)/((Rin/hfe)+2*Re)\n",
+ "Vout1 = Vout2 = Vcc-Ic*Rc\n",
+ "Aid = abs(hfe*Rc/(Rin+hie))\n",
+ "\n",
+ "#Result\n",
+ "print(\"Vc1 = Vc2 = %.2f V\\nAid = %f \"%(Vout1,Aid))\n",
+ "#Answer for Aid is wrong in the book"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Vc1 = Vc2 = 13.20 V\n",
+ "Aid = 138.775510 \n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 1.12, Page No. 38"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Value of Resistance Re\n",
+ "\n",
+ "import math\n",
+ "#Variable declaration\n",
+ "Vcc = 10.0 # Supply voltage\n",
+ "Vbe = 0.7 # emitter-base junction voltage drop\n",
+ "Rc = 47*10**3 # Collector resistance\n",
+ "hfe = 100.0 # current gain\n",
+ "Vceq = 8.6 # quiescent collector emitter voltage\n",
+ "\n",
+ "#Calculations\n",
+ "Ic = (Vcc+Vbe-Vceq)/Rc\n",
+ "Re =(Vcc-Vbe)/(2*((1+hfe)/hfe))\n",
+ "Re = math.floor(Re*10000)/10000\n",
+ "Re = Re/(Ic*1000) # k-ohm\n",
+ "\n",
+ "#Result\n",
+ "print(\"Re = %.2f k-ohm\"%(math.floor(Re*100)/100))\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Re = 103.03 k-ohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 19
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 1.13, Page No. 38"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Differential amplifier parameter\n",
+ "\n",
+ "import math\n",
+ "#Variable declaration\n",
+ "Vbe = 0.712 # emitter-base junction voltage drop\n",
+ "hfe = 500.0 # current gain\n",
+ "hie = 18 *10**3 # inpput impedance\n",
+ "Rin = 50 # Source resistance\n",
+ "Re = 6.8*10**3 # Emitter resistance\n",
+ "Rc = 4.7*10**3 # collector resistance\n",
+ "Vcc = 10 # supply voltage\n",
+ "\n",
+ "#Calcualtions\n",
+ "#(i)\n",
+ "Ie = (Vcc -Vbe)/(2*Re)\n",
+ "Ic = (hfe/(1+hfe))*Ie\n",
+ "Vce = Vcc+Vbe-Ic*Rc\n",
+ "Vce = math.floor(Vce*1000)/1000\n",
+ "Ic = math.floor(Ic*10**7)/10**7\n",
+ "Ic = Ic *1000 # mA\n",
+ "#(ii)\n",
+ "Ad = hfe*Rc/(2*(Rin+hie))\n",
+ "Ad = math.floor(Ad*100)/100\n",
+ "#(iii)\n",
+ "Ri = 2*(Rin+hie)\n",
+ "Ro = Rc\n",
+ "\n",
+ "#Result\n",
+ "print(\"(i)\\nIcq =%.4f mA\\t\\tVce = %.3f V\\n\\n(ii)\\nAd = %.2f\\n\\n(iii)\\nRi = %.1f k-ohm\\t\\tRo = %.1f k-ohm\"%(Ic,Vce,Ad,Ri/1000.0,Ro/1000))\n",
+ "# answer for Ri is wrong in the book"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(i)\n",
+ "Icq =0.6815 mA\t\tVce = 7.508 V\n",
+ "\n",
+ "(ii)\n",
+ "Ad = 65.09\n",
+ "\n",
+ "(iii)\n",
+ "Ri = 36.1 k-ohm\t\tRo = 4.7 k-ohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 37
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 1.14, Page No. 39"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Current through the transistors(refer fig 1.50)\n",
+ "\n",
+ "import math\n",
+ "#Variable declaration\n",
+ "Q2 = 0.5 # Area of Q2 /Area of Q1\n",
+ "Q3 = 0.25 # Area of Q3 /Area of Q1\n",
+ "Q4 = 0.125 # Area of Q4 /Area of Q1\n",
+ "Vcc = 15 # Supply voltage\n",
+ "Vbe = 0.7 # emitter-base junction voltage drop\n",
+ "R = 20*10**3 # Resistor R\n",
+ "\n",
+ "#Calculations\n",
+ "I1 = (Vcc-Vbe)/R\n",
+ "I2 = I1*Q2\n",
+ "I3 = I1*Q3\n",
+ "I4 = I1*Q4\n",
+ "\n",
+ "\n",
+ "#Result\n",
+ "print(\"I2 = %.3f mA\\nI3 = %.4f mA\\nI4 = %.3f mA\"%(math.floor(I2*10**6)/1000,math.floor(I3*10**7)/10000,I4*1000))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "I2 = 0.357 mA\n",
+ "I3 = 0.1787 mA\n",
+ "I4 = 0.089 mA\n"
+ ]
+ }
+ ],
+ "prompt_number": 50
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ " example 1.15, Page No. 39"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Current calculation in the circuit\n",
+ "\n",
+ "import math\n",
+ "#Variable declaration\n",
+ "Vz = 6.2 # zener voltage\n",
+ "R1 = 4.7*10**3 # resistor R1\n",
+ "R3 = 2.2*10**3 # resistor R3\n",
+ "Vee = -20 # supply voltage\n",
+ "Vbe = 0.7 # emitter-base junction voltage drop\n",
+ "\n",
+ "#Calcualtions\n",
+ "Vb = Vee + Vz\n",
+ "Ve = Vee+Vz-Vbe\n",
+ "I = Ie = (Ve-Vee)/R3\n",
+ "\n",
+ "#Result\n",
+ "print(\"I = %.1f mA\"%(I*1000))\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "I = 2.5 mA\n"
+ ]
+ }
+ ],
+ "prompt_number": 53
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 1.16, Page No.39"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Differential amplifier\n",
+ "\n",
+ "import math\n",
+ "#Variable declaration\n",
+ "Ie = 10**-3 # Emitter current\n",
+ "Vbe = 0.7 # emitter-base junction voltage drop\n",
+ "Rc = 4.7*10**3 # colloector Resistance\n",
+ "Vcc = 12 # Supply voltage\n",
+ "\n",
+ "\n",
+ "#Calculations\n",
+ "Re = (Vcc-Vbe)/(Ie)\n",
+ "Ic = Ic1 = Ic2 = Ie/2\n",
+ "Vout = Vcc-Ic*Rc\n",
+ "\n",
+ "#Result\n",
+ "print(\"(i) Re = %.1f k-ohm\\n\\n(ii) Vout = %.2f V\"%(Re/1000,Vout))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(i) Re = 11.3 k-ohm\n",
+ "\n",
+ "(ii) Vout = 9.65 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 1.17, Page No. 40"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Ie3, Vce1 and differential mode gain(refer fig. 1.54)\n",
+ "\n",
+ "import math\n",
+ "#Variable declaration\n",
+ "Vbe = 0.7 # emitter-base junction voltage drop\n",
+ "hfe = 250.0 # current gain\n",
+ "hie = 560 # inpput impedance for Q1 and Q2\n",
+ "Rin = 1.0*10**3 # Source resistance\n",
+ "Rb4 = 1.5*10**3 # Emitter resistance\n",
+ "Rc = 1.0*10**3 # collector resistance\n",
+ "Vcc = 12 # supply voltage\n",
+ "\n",
+ "# Calculations\n",
+ "I = (Vcc-Vbe)/Rb4\n",
+ "Ie3 = I\n",
+ "Ie1 = Ie2 = Ie3/2\n",
+ "Ic1 = Ie1\n",
+ "Vce1 = Vcc+Vbe-Ic1*Rc\n",
+ "Aid = hfe*Rc/(Rc+hie)\n",
+ "\n",
+ "#Result\n",
+ "print(\"Ie3 = %.3f mA\\nVce1 = %.3f V\\nAid = %.2f\"%(Ie3*10**3,Vce1,math.floor(Aid*100)/100))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Ie3 = 7.533 mA\n",
+ "Vce1 = 8.933 V\n",
+ "Aid = 160.25\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 1.18, Page No. 41"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print(\"Theoretical example\")"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Theoretical example\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 1.19, Page No. 41"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# DC shift and curretn in the circuit (refer fig. 1.55)\n",
+ "\n",
+ "import math\n",
+ "#Variable declaration\n",
+ "Vcc = 15.0 # supply voltage\n",
+ "R1 = 10.0*10**3 # Resistor R1\n",
+ "R2 = 5.0*10**3 # Resistor R2\n",
+ "Vbe = 0.7 # emitter-base junction voltage drop\n",
+ "\n",
+ "#Calculations\n",
+ "shift = (Vcc*R2/R1)+Vbe*(1-(R2/R1))\n",
+ "I = (Vcc-Vbe)/R1\n",
+ "\n",
+ "#Result\n",
+ "print(\"(Vin-Vout) = %.2f V\\n\\t I = %.2f mA\"%(shift, I*10**3))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(Vin-Vout) = 7.85 V\n",
+ "\t I = 1.43 mA\n"
+ ]
+ }
+ ],
+ "prompt_number": 18
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 1.20, Page No. 41"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# maximum possible closed loop gain\n",
+ "\n",
+ "import math\n",
+ "#Variable declaration\n",
+ "sr = 3*10**6 # slew rate in V/sec\n",
+ "dV = 0.4 # input voltage variation\n",
+ "dt = 12*10**-6 # time in which voltage varies\n",
+ "\n",
+ "#Calculations\n",
+ "A = sr/(dV/dt)\n",
+ "\n",
+ "#Result\n",
+ "print(\"Maximum closed loop gain = %.0f\"%A)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Maximum closed loop gain = 90\n"
+ ]
+ }
+ ],
+ "prompt_number": 20
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 1.21, Page No. 42"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# input bias and input offset current\n",
+ "\n",
+ "import math\n",
+ "#Variable Declaration\n",
+ "Vbe = 0.7 # emitter-base junction voltage drop\n",
+ "beta1 = 100.0 # current gain for Q1\n",
+ "beta2 = 125.0 # current gain for Q1\n",
+ "Re = 39*10**3 # Emitter resistance\n",
+ "Rc = 4.7*10**3 # collector resistance\n",
+ "Vcc = 12 # supply voltage\n",
+ "\n",
+ "# Calculations\n",
+ "Ie = (Vcc-Vbe)/Re\n",
+ "Ie1 = Ie2 = Ie/2\n",
+ "Ib1 = Ie1/beta1\n",
+ "Ib2 = Ie2/beta2\n",
+ "Ib = (Ib1+Ib2)/2\n",
+ "Iios = abs(Ib1-Ib2)\n",
+ "\n",
+ "#Result\n",
+ "print(\"Ib = %.4f micro-A\\nIios = %.5f micro-A\"%(Ib*10**6,Iios*10**6))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Ib = 1.3038 micro-A\n",
+ "Iios = 0.28974 micro-A\n"
+ ]
+ }
+ ],
+ "prompt_number": 25
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 1.22, Page No. 42"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Maximum possible amplitude of output\n",
+ "\n",
+ "import math\n",
+ "#Variable declaration\n",
+ "f = 7000.0 # frequency of input sine wave\n",
+ "Icq = 8*10**-6 # collector current\n",
+ "Cc = 27*10**-12 # Capacitance\n",
+ "\n",
+ "#Calculations\n",
+ "S = Icq/Cc\n",
+ "Vm = S/(2*math.pi*f)\n",
+ "\n",
+ "#Result\n",
+ "print(\"Maximum amplitude of output = %.3f V\"%(math.floor(Vm*1000)/1000))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Maximum amplitude of output = 6.736 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 29
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 1.23, Page No. 42"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Slew rate\n",
+ "\n",
+ "import math\n",
+ "#Variable declaration\n",
+ "Vm = 3.8 # output amplitude\n",
+ "tr = 4.5*10**-6 # required rise time\n",
+ "S_741 = 0.5*10**-6 # slew rate of IC741 op-amp\n",
+ "\n",
+ "#Calculations\n",
+ "del_V = (0.9-0.1)*Vm\n",
+ "S = del_V/tr\n",
+ "\n",
+ "#Result\n",
+ "print(\"Required slew rate = %.3f V/micro-s\"%(math.floor(S/10**3)/1000))\n",
+ "print(\"Slew rate of IC 741 is 0.5V/usec which is too low as compared to the required value. Hence Ic 741 cannot be used.\")"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Required slew rate = 0.675 V/micro-s\n",
+ "Slew rate of IC 741 is 0.5V/usec which is too low as compared to the required value. Hence Ic 741 cannot be used.\n"
+ ]
+ }
+ ],
+ "prompt_number": 34
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 1.24, Page No.43"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Maximum gain using op-amp\n",
+ "\n",
+ "import math\n",
+ "#Variable declaration\n",
+ "S = 0.4*10**6 # op-amp slew rate in V/sec\n",
+ "Vm = 0.04 # maximum input \n",
+ "w = 1.13*10**5 # freq in rad/sec\n",
+ "\n",
+ "#Calculations\n",
+ "fm = w/(2*math.pi)\n",
+ "V = S/(2*math.pi*fm)\n",
+ "G = V/Vm\n",
+ "\n",
+ "#Result\n",
+ "print(\"Gain = %.1f \"%G)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Gain = 88.5 \n"
+ ]
+ }
+ ],
+ "prompt_number": 36
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 1.25, Page No. 43"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# smallest and largest possible input bias current and input offset current\n",
+ "\n",
+ "import math\n",
+ "#Variable declaration\n",
+ "Ie = 400*10**-6 # total emitter bias current\n",
+ "beta_min = 80 # minimum current gain\n",
+ "beta_max = 200 # maximum current gain\n",
+ "\n",
+ "#Calculation\n",
+ "Ie1 = Ie2 = Ie/2\n",
+ "Ib1_1 = Ib2_1 = Ie1/(1+beta_min) # for beta =80\n",
+ "Ib1_2 = Ib2_2 = Ie1/(1+beta_max)\n",
+ "\n",
+ "Ib_max = (Ib1_1+Ib2_1)/2\n",
+ "Ib_min = (Ib1_2+Ib2_2)/2\n",
+ "Iios = Ib_max-Ib_min\n",
+ "\n",
+ "#Result\n",
+ "print(\"Largest input bias current = %.3f micro-A\\nSmallest input bias current = %.3f micro-A\"%(Ib_max*10**6,Ib_min*10**6))\n",
+ "print(\"Largest input offset current = %.3f micro-A\"%(Iios*10**6))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Largest input bias current = 2.469 micro-A\n",
+ "Smallest input bias current = 0.995 micro-A\n",
+ "Largest input offset current = 1.474 micro-A\n"
+ ]
+ }
+ ],
+ "prompt_number": 44
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 1.26, Page No.43"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Collector current for each transistor(refer fig. 1.59)\n",
+ "\n",
+ "import math\n",
+ "#Variable declaration\n",
+ "Vbe = 0.715 # emitter-base junction voltage drop\n",
+ "beta = 100.0 # Current gain\n",
+ "Vcc = 10 # input voltage\n",
+ "Rc1 = 5.6*10**3 # Collector resistance\n",
+ "Rc2 = 1.0*10**3 # Collector resistance\n",
+ "\n",
+ "#Calculations\n",
+ "I = (Vcc-Vbe)/Rc1\n",
+ "Ic2 = (beta/(beta+4))*I\n",
+ "\n",
+ "#Result\n",
+ "print(\"I = %.3f mA\\nIc2 = Ic3 = Ic4 = %.4f mA\"%(I*1000,math.floor(Ic2*10**7)/10000))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "I = 1.658 mA\n",
+ "Ic2 = Ic3 = Ic4 = 1.5942 mA\n"
+ ]
+ }
+ ],
+ "prompt_number": 50
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 1.27, Page No. 44"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Differential amplifier parameter\n",
+ "\n",
+ "import math\n",
+ "#Variable declaration\n",
+ "beta = 100.0 # current gain\n",
+ "Vbe = 0.715 # emitter-base junction voltage drop\n",
+ "Vz = 6.2 # Zener Voltage\n",
+ "Iz = 41*10**-3 # Zener Current \n",
+ "Rc = 4.7*10**3 # Collector Current\n",
+ "Rin = 500 # input resistance\n",
+ "Rb = 68*10**3 # base voltage \n",
+ "Re = 2.7*10**3 # emitter resistance\n",
+ "Vcc = 10 # Supply Voltage\n",
+ "hie = 1000.0 # input resistance\n",
+ "\n",
+ "#Calculations\n",
+ "I = (Vcc-Vbe-Vz)/Rb\n",
+ "I = math.floor(I*10**8)/10**8\n",
+ "Ie3 = (Vcc-Vbe-Rb*I)/Re\n",
+ "Ie3 = math.ceil(Ie3*10**7)/10**7\n",
+ "Ic3 = (beta/(1+beta))*Ie3\n",
+ "Ic3 = math.floor(Ic3*10**7)/10**7\n",
+ "Ie = Ic3/2\n",
+ "Ie = math.floor(Ie*10**7)/10**7\n",
+ "Ic = beta*Ie/(1+beta)\n",
+ "Ic = math.ceil(Ic*10**7)/10**7\n",
+ "Vce = Vcc+Vbe-Ic*Rc\n",
+ "Vce = math.floor(Vce*10**4)/10**4\n",
+ "Aid = beta*Rc/(Rin+hie)\n",
+ "Ri = Rin+2*hie\n",
+ "\n",
+ "#Result\n",
+ "print(\"(i) Aid = %.3f\\n\\n(ii) input Resistance = %.1f k-ohm\\n\\n(iii) Icq = %.4f mA\\t\\tVceq = %.4f V\"%(Aid,Ri/1000,Ic*1000,Vce))\n",
+ "#Value for input resistance is wrong in the book"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(i) Aid = 313.333\n",
+ "\n",
+ "(ii) input Resistance = 2.5 k-ohm\n",
+ "\n",
+ "(iii) Icq = 1.1256 mA\t\tVceq = 5.4246 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 77
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Op-amp_and_linear_integrated_circuits_/Chapter_10.ipynb b/Op-amp_and_linear_integrated_circuits_/Chapter_10.ipynb new file mode 100755 index 00000000..0904c810 --- /dev/null +++ b/Op-amp_and_linear_integrated_circuits_/Chapter_10.ipynb @@ -0,0 +1,186 @@ +{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 10 : Operational Transconductance Amplifier(OTA)"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 10.1, Page No.298"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# -3dB frequency\n",
+ "\n",
+ "import math\n",
+ "# Variable declaration\n",
+ "gm = 55*10**-6 # Transconductance\n",
+ "C = 8.75*10**-12 # Capacitance\n",
+ "\n",
+ "#calcualtions\n",
+ "f = gm/(2*math.pi*C)\n",
+ "\n",
+ "#Result\n",
+ "print(\"-3dB frequency = %d MHz\"%(f/10**6))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "-3dB frequency = 1 MHz\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 10.2, Page No. 401"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print(\"Theoretical example\")"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 10.3, Page No. 402"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print(\"Theoretical example\")"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Theoretical example\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 10.4, Page No. 402"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print(\"Theoretical example\")"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Theoretical example\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 10.5, Page No. 403"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print(\"Theoretical example\")"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Theoretical example\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 10.6, Page No. 403"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print(\"Theoretical example\")"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Theoretical example\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Op-amp_and_linear_integrated_circuits_/Chapter_11.ipynb b/Op-amp_and_linear_integrated_circuits_/Chapter_11.ipynb new file mode 100755 index 00000000..f749209f --- /dev/null +++ b/Op-amp_and_linear_integrated_circuits_/Chapter_11.ipynb @@ -0,0 +1,494 @@ +{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 11: Voltage Regulators"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 11.1, Page No. 414"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# op-amp series voltage regulator design\n",
+ "\n",
+ "import math\n",
+ "#Variable declaration\n",
+ "Vin_min = 18-3 # min input voltage specification\n",
+ "Vin_max = 18+3 # max input voltage specification\n",
+ "Vout = 9 # output voltage specification\n",
+ "Iout_min = 10*10**-3 # min output current specification\n",
+ "Iout_max = 50*10**-3 # max output current specification\n",
+ "Vz = 5.6 # zener breakdown voltage\n",
+ "Pzmax = 0.5 # Maximum power dissipation in zener\n",
+ "\n",
+ "#Calculations\n",
+ "R1 = 10*10**3 # assumed\n",
+ "R2 = R1/((Vout/Vz)-1)\n",
+ "R3 = (Vin_min-Vz)/Iout_max\n",
+ "Iz = (Vin_max-Vz)/R3\n",
+ "Pd = Iz*Vz\n",
+ "beta = 30 # assumed\n",
+ "Ib = Iout_max/(beta+1)\n",
+ "\n",
+ "#Result\n",
+ "print(\"Element values for designed circuit are as follows:\\nR1 = %d k-ohm\\nR2 = %.2f k-ohm\"%(R1/1000,R2/1000))\n",
+ "print(\"R3 = %.3f k-ohm\\nIB = %.2f mA\"%(R3/1000,Ib*1000))\n",
+ "#Answer for R3 is wrong in the book"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Element values for designed circuit are as follows:\n",
+ "R1 = 10 k-ohm\n",
+ "R2 = 16.47 k-ohm\n",
+ "R3 = 0.188 k-ohm\n",
+ "IB = 1.61 mA\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 11.2, Page No. 420"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Regulator using IC 723\n",
+ "\n",
+ "import math\n",
+ "#Variable declaration\n",
+ "Vout = 5 # Required output voltage\n",
+ "Iout = 100*10**-3 # Required output current\n",
+ "Vin_min = 15-(0.2*15) # Min input voltage\n",
+ "Vin_max = 15+(0.2*15) # Max input voltage\n",
+ "Isc = 150*10**-3 # Short circuit current requirement\n",
+ "Vsense = 0.7 # short circuit voltage\n",
+ "Vref = 7.15 # reference votage for IC 723\n",
+ "Id = 1*10**-3 # potential divider current\n",
+ "\n",
+ "\n",
+ "#Calculation\n",
+ "Rsc = Vsense/Isc\n",
+ "R1 = (Vref-Vout)/Id\n",
+ "R1std = 2.2*10**3 \n",
+ "R2 = R1std/((Vref/Vout)-1)\n",
+ "R2std = 5.1*10**3 \n",
+ "R3 = R1std*R2std/(R1std+R2std)\n",
+ "R3std = 1.5*10**3 \n",
+ "\n",
+ "#Result\n",
+ "print(\"R1 = %.3f k-ohm\\t We use %.1f k-ohm as standard resistor.\"%(R1/1000,R1std/1000))\n",
+ "print(\"R2 = %.3f k-ohm\\t We use %.1f k-ohm as standard resistor.\"%(R2/1000,R2std/1000))\n",
+ "print(\"R3 = %.3f k-ohm\\t We use %.1f k-ohm as standard resistor.\"%(math.floor((R3/1000)*1000)/1000,R3std/1000))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "R1 = 2.150 k-ohm\t We use 2.2 k-ohm as standard resistor.\n",
+ "R2 = 5.116 k-ohm\t We use 5.1 k-ohm as standard resistor.\n",
+ "R3 = 1.536 k-ohm\t We use 1.5 k-ohm as standard resistor.\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 11.3, Page No. 421"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Ic 723 based positive voltage regulator\n",
+ "\n",
+ "import math\n",
+ "#Variable declaration\n",
+ "Vout = 12.0 # output voltage\n",
+ "Il = 500*10**-3 # load current\n",
+ "Isc = 600*10**-3 # short circuit current\n",
+ "Vref = 7.0 # IC 723 reference voltage \n",
+ "Vsense = 0.6 # voltage at short circuit\n",
+ "\n",
+ "#Calculation\n",
+ "R1 = 4.7*10**3 # assumed\n",
+ "R2 = Vref*R1/(Vout-Vref)\n",
+ "R2std = 6.8*10**3 \n",
+ "Rsc = Vsense/Isc\n",
+ "R3 = R2std*R1/(R2std+R1)\n",
+ "Psc = Isc**2*Rsc*1000\n",
+ "I = Vout/(R1+R2std)\n",
+ "I= math.floor(I*10**6)/10**6\n",
+ "P1 = I**2*R1*1000\n",
+ "P2 = I**2*R2std*1000\n",
+ "\n",
+ "#Result\n",
+ "print(\"R1 = %.1f k-ohm\\nR2 = %.2f k-ohm = %.1f k-ohm(standard value)\\nRsc = %.1f ohm\"%(R1/1000,R2/1000,R2std/1000,Rsc))\n",
+ "print(\"\\nPower wattage:\\nPsc = %.0f mW\\nP1 = %.3f mW\\nP2 = %.3f mW\"%(Psc,math.floor(P1*1000)/1000,P2))\n",
+ "print(\"Hence, both R1 and R2 may be selected safely of 1/16th watt power rating.\")"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "R1 = 4.7 k-ohm\n",
+ "R2 = 6.58 k-ohm = 6.8 k-ohm(standard value)\n",
+ "Rsc = 1.0 ohm\n",
+ "\n",
+ "Power wattage:\n",
+ "Psc = 360 mW\n",
+ "P1 = 5.112 mW\n",
+ "P2 = 7.397 mW\n",
+ "Hence, both R1 and R2 may be selected safely of 1/16th watt power rating.\n"
+ ]
+ }
+ ],
+ "prompt_number": 24
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 11.4, Page No. 426"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Regulator design using IC 723(refer to fig. 11.26)\n",
+ "\n",
+ "import math\n",
+ "#Variable declaration\n",
+ "Vout = 6 # output voltage\n",
+ "Il = 1 # load current\n",
+ "Isc = 0.250 # short circuit \n",
+ "Vref = 7 # reference voltage\n",
+ "Vbe = 0.7 # base-emitter junction voltage\n",
+ "\n",
+ "#Calculations\n",
+ "R1 = 2.7*10**3 # assumed\n",
+ "R2 = Vout*R1/(Vref-Vout)\n",
+ "kRsc = Vbe/Isc\n",
+ "k =1-(((Il-Isc)*kRsc)/Vout)\n",
+ "R4 = 10*10**3 # assumed \n",
+ "R3 = (1-k)*R4\n",
+ "Rsc = kRsc/k\n",
+ "R = (R1*R2)/(R1+R2)\n",
+ "\n",
+ "#Result\n",
+ "print(\"R1 = %.1f k-ohm\\nR2 = %.1f k-ohm\\nR3 = %.1f k-ohm\\nR4 = %.1f k-ohm\\nR = %.2f k-ohm\"%(R1/1000,R2/1000,R3/1000,R4/1000,R/1000))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "R1 = 2.7 k-ohm\n",
+ "R2 = 16.2 k-ohm\n",
+ "R3 = 3.5 k-ohm\n",
+ "R4 = 10.0 k-ohm\n",
+ "R = 2.31 k-ohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 11.5, Page No.432"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Current source design using IC7812\n",
+ "\n",
+ "import math\n",
+ "#Variable declaration\n",
+ "RL = 25.0 # load resistance\n",
+ "P = 10.0 # power \n",
+ "I = 0.5 # current required\n",
+ "V = 12.0 # rated voltage\n",
+ "\n",
+ "#Calculations\n",
+ "R = V/I\n",
+ "Vout = V+(I*RL)\n",
+ "Vin = Vout+2\n",
+ "\n",
+ "#Result\n",
+ "print(\"R = %d ohm\\nVout = %.1f V\\nVin = %.1f V\"%(R,Vout,Vin))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "R = 24 ohm\n",
+ "Vout = 24.5 V\n",
+ "Vin = 26.5 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 16
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 11.6, Page NO. 432"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# min and max voltage of regulator(refer fig.11.34)\n",
+ "\n",
+ "import math\n",
+ "#variable declaration\n",
+ "Iq = 10*10**-3 # quiescent current\n",
+ "Vreg = 15.0 # regulated output voltage\n",
+ "R2 = 0 # min value of potentiometer\n",
+ "R1 = 40.0 # R1 resistor\n",
+ "\n",
+ "#Calculations\n",
+ "Vout = (1+(R2/R1))*Vreg+(Iq*R2)\n",
+ "\n",
+ "#Result\n",
+ "print(\"Vout = %d V\"%Vout)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Vout = 15 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 20
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 11.7, Page No. 432"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# current source using 7805\n",
+ "\n",
+ "import math\n",
+ "#Variable declaration\n",
+ "Il = 0.2 # required load current\n",
+ "RL = 22.0 # load resistance\n",
+ "P = 10.0 # required power\n",
+ "Iq = 4.2*10**-3 # quiescent current\n",
+ "Vr = 5 # regulated output voltage\n",
+ "\n",
+ "#Calculation\n",
+ "R = Vr/(Il-Iq)\n",
+ "Vout = Vr+Il*RL\n",
+ "Vin = Vout+2\n",
+ "\n",
+ "#Result\n",
+ "print(\"R = %f ohm\\nVout = %.1f V\\nVin = %.1f V\"%(R,Vout,Vin))\n",
+ "# Answer for R is wrong in the book"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "R = 25.536261 ohm\n",
+ "Vout = 9.4 V\n",
+ "Vin = 11.4 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 23
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 11.8, Page No.435"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Regulated outpuut voltage(refer fig. 11.38)\n",
+ "\n",
+ "import math\n",
+ "#Variable declaration\n",
+ "R1 = 220.0 # resistance R1\n",
+ "R2 = 1500.0 # Resistance R2\n",
+ "Iadj = 100*10**-6 # adj. current\n",
+ "\n",
+ "\n",
+ "#Calculartions\n",
+ "Vout = (1.25*(1+(R2/R1)))+(Iadj*R2)\n",
+ "\n",
+ "#Result\n",
+ "print(\"Vout = %.2f V\"%Vout)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Vout = 9.92 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 11.9, Page No. 435"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Output voltage range\n",
+ "\n",
+ "import math\n",
+ "#Variable declaration\n",
+ "R1 = 820.0 # resistance R1\n",
+ "R2min = 0 # min potentiometer resistance\n",
+ "R2max = 10*10**3 # max potentiometer resistance\n",
+ "Iadj = 100*10**-6 # adj. current\n",
+ "\n",
+ "#calculations\n",
+ "Vmin = 1.25*(1+(R2min/R1))+(Iadj*R2min)\n",
+ "Vmax = 1.25*(1+(R2max/R1))+(Iadj*R2max)\n",
+ "\n",
+ "#Result\n",
+ "print(\"The output can be varied in the range %.2f V to %.2f V\"%(Vmin,Vmax))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The output can be varied in the range 1.25 V to 17.49 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 11.10, Page No. 436"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Maximum load current\n",
+ "\n",
+ "import math\n",
+ "#Variable declaration\n",
+ "Vbe = 1.0 # base emitter junction voltage\n",
+ "beta = 15.0 # current gain\n",
+ "R1 = 7.0 # resistance R1\n",
+ "Iout = 1.0 # max output current from IC \n",
+ "#Calculations\n",
+ "Il = ((1+beta)*Iout) - beta*(Vbe/R1)\n",
+ "Il = math.floor(Il*100)/100\n",
+ "#Result\n",
+ "print(\"IC which can supply maximum 1A can supply maximum load of %.2f A, with the help of the current boosting arrangements\"%Il)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "IC which can supply maximum 1A can supply maximum load of 13.85 A, with the help of the current boosting arrangements\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Op-amp_and_linear_integrated_circuits_/Chapter_12.ipynb b/Op-amp_and_linear_integrated_circuits_/Chapter_12.ipynb new file mode 100755 index 00000000..8648af62 --- /dev/null +++ b/Op-amp_and_linear_integrated_circuits_/Chapter_12.ipynb @@ -0,0 +1,799 @@ +{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 12 : D/A and A/D Converters"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "examople 12.1, Page No. 461"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# DAC Resolution\n",
+ "\n",
+ "import math\n",
+ "#Variable declaration\n",
+ "n = 8 # Number of bits\n",
+ "VoFS = 2.55 # Maximum output voltage to be represented\n",
+ "\n",
+ "#Calculations\n",
+ "#(i)\n",
+ "R1 = 2**(n)\n",
+ "#(ii)\n",
+ "R2 = VoFS/(2**n-1)\n",
+ "\n",
+ "#\n",
+ "print(\"(i) Resolution = %d, i.e. output voltage can have %d different values including 0.\"%(R1,R1))\n",
+ "print(\"(ii) Resolution = %.0f mV/LSB, i.e. an input change of 1 LSB output to change by %.0f mV\"%(R2*1000,R2*1000))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(i) Resolution = 256, i.e. output voltage can have 256 different values including 0.\n",
+ "(ii) Resolution = 10 mV/LSB, i.e. an input change of 1 LSB output to change by 10 mV\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 12.2, Page No.461"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Analog output from digital output\n",
+ "\n",
+ "import math\n",
+ "#Variable declaration\n",
+ "n = 4 # 4-bit DAC\n",
+ "VoFS = 15.0 # maximum output voltage\n",
+ "\n",
+ "\n",
+ "\n",
+ "#Calculations\n",
+ "R = VoFS/((2**n)-1)\n",
+ "Vout = R*int('0110',2)\n",
+ "\n",
+ "#Result\n",
+ "print(\"Vout = %.0f V\"%Vout)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Vout = 6 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 12.3, Page No.462"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Analog output from digital output\n",
+ "\n",
+ "import math\n",
+ "#Variable declaration\n",
+ "n = 8 # 4-bit DAC\n",
+ "R = 20.0*10**-3 # Resolution in V/LSB\n",
+ "\n",
+ "\n",
+ "#Calculations\n",
+ "VoFS= R*((2**n)-1)\n",
+ "Vout = R*int('10000000',2)\n",
+ "\n",
+ "#Result\n",
+ "print(\"VoFS = %.1f V\"%VoFS)\n",
+ "print(\"Vout = %.2f V\"%Vout)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "VoFS = 5.1 V\n",
+ "Vout = 2.56 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 12.4, Page No.462"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Step size and analog outtput of DAC\n",
+ "\n",
+ "import math\n",
+ "#Variable declaration\n",
+ "n = 4 # 4-bit DAC\n",
+ "VoFS = 5.0 # maximum output voltage\n",
+ "\n",
+ "#Calculations\n",
+ "R = VoFS/((2**n)-1)\n",
+ "Vout1 = R*int('1000',2)\n",
+ "Vout2 = R*int('1111',2)\n",
+ "\n",
+ "# Result\n",
+ "print(\"Step Size i.e. Resolution = %f V/LSB\"%R)\n",
+ "print(\"Output corresponding to input 1000 is %.4f V\"%Vout1)\n",
+ "print(\"Output corresponding to input 1111 is %.0f V\"%Vout2)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Step Size i.e. Resolution = 0.333333 V/LSB\n",
+ "Output corresponding to input 1000 is 2.6667 V\n",
+ "Output corresponding to input 1111 is 5 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 15
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 12.5, Page No.462"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# 12-bit DAC\n",
+ "\n",
+ "import math\n",
+ "#Variable declaration\n",
+ "n = 12 # 12-bit DAC\n",
+ "R = 8*10**-3 # Step Size\n",
+ "\n",
+ "#Calculations\n",
+ "VoFS = R*((2**n)-1)\n",
+ "Res = R*100/VoFS\n",
+ "Vout = R*int('010101101101',2)\n",
+ "\n",
+ "#Result\n",
+ "print(\"VoFS = %.2f V\\n%% Resolution = %f \\nOutput voltage = %.3f V\"%(VoFS,Res,Vout))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "VoFS = 32.76 V\n",
+ "% Resolution = 0.024420 \n",
+ "Output voltage = 11.112 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 21
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 12.6, Page No.467"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# R/2R ladder typr DAC\n",
+ "\n",
+ "import math\n",
+ "#Variable declaration\n",
+ "n = 4 # 4-bit DAC\n",
+ "Res = 0.5 # Resolution \n",
+ "Vr = 10.0 # Reference voltage (assumed)\n",
+ "Rf = 10*10**3 # reference resistor\n",
+ "\n",
+ "#Calculations\n",
+ "R = Vr*Rf/(2**n*Res)\n",
+ "print(\"Reference Voltage, Vr = %.0f V\\nRf = %.0f k-ohm\\nR = %.1f k-ohm\"%(Vr,Rf/1000,R/1000))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Reference Voltage, Vr = 10 V\n",
+ "Rf = 10 k-ohm\n",
+ "R = 12.5 k-ohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 23
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 12.7, Page No.473"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# 8-bit ADC\n",
+ "\n",
+ "import math\n",
+ "#Variable declaration\n",
+ "n = 8 # 8-bit ADC\n",
+ "VoFS = 5.1 # full scale output voltage\n",
+ "Vi = 1.28 # input voltage\n",
+ "\n",
+ "#Calculations\n",
+ "R = VoFS/((2**n)-1)\n",
+ "D = (Vi/R)\n",
+ "D = round(D,0)\n",
+ "D = bin(64)[2:]\n",
+ "d = format(int(D,2),'08b')\n",
+ "print(\"Resolution = %d or Resolution = %.1f mV/LSB\\nBinary output corresponding to 1.28V input is %s\"%(2**n,R*1000,d))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Resolution = 256 or Resolution = 20.0 mV/LSB\n",
+ "Binary output corresponding to 1.28V input is 01000000\n"
+ ]
+ }
+ ],
+ "prompt_number": 18
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 12.8, Page No.474"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# quantization error for 12-bit ADC\n",
+ "\n",
+ "import math\n",
+ "#Variable declaration\n",
+ "n = 12 # 12-bit ADC \n",
+ "ViFS = 4.095 # full scale input voltage\n",
+ "\n",
+ "#Calculations\n",
+ "Qe = ViFS/((2**n-1)*2)\n",
+ "\n",
+ "#Result\n",
+ "print(\"Quantization Error, Qe = %.1f mV\"%(Qe*1000))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Quantization Error, Qe = 0.5 mV\n"
+ ]
+ }
+ ],
+ "prompt_number": 21
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 12.9, Page No.477"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Dual slope ADC\n",
+ "\n",
+ "import math\n",
+ "#Variable declaration\n",
+ "t1 = 83.33*10**-3 # time t1\n",
+ "Vr = 100*10**-3 # reference voltage\n",
+ "Vi_1 = 100*10**-3 # input voltage value for case 1\n",
+ "Vi_2 = 200*10**-3 # input voltage value for case 2\n",
+ "\n",
+ "#Calculations\n",
+ "t2_1 = Vi_1*t1/Vr\n",
+ "t2_2 = Vi_2*t1/Vr\n",
+ "\n",
+ "#Result\n",
+ "print(\"(i) t2 = %.2f ms\\n(ii) t2 = %.2f ms\"%(t2_1*1000,t2_2*1000))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(i) t2 = 83.33 ms\n",
+ "(ii) t2 = 166.66 ms\n"
+ ]
+ }
+ ],
+ "prompt_number": 26
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 12.10, Page No. 477"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Digital output of an ADC\n",
+ "\n",
+ "import math\n",
+ "# Variable declarartion\n",
+ "t1 = 83.33*10**-3 # time t1\n",
+ "Vr = 100*10**-3 # Reference Voltage\n",
+ "Vi = 100*10**-3 # input voltage\n",
+ "f = 12*10**3 # clock frequency\n",
+ "\n",
+ "#Calculations\n",
+ "Vout = f*t1*Vi/Vr\n",
+ "\n",
+ "#Result\n",
+ "print(\"Digital output = %.0f counts\"%(math.ceil(Vout)))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Digital output = 1000 counts\n"
+ ]
+ }
+ ],
+ "prompt_number": 31
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 12.11, Page No. 479"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Successive approximation ADC\n",
+ "\n",
+ "import math\n",
+ "n = 8 # 8-bit ADC \n",
+ "f = 1.0*10**6 # clock frequency\n",
+ "\n",
+ "#Calculations\n",
+ "T = 1/f\n",
+ "Tc = T*(n+1)\n",
+ "\n",
+ "\n",
+ "#Result\n",
+ "print(\"Conversion time = %.0f micro-sec\"%(Tc*10**6))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Conversion time = 9 micro-sec\n"
+ ]
+ }
+ ],
+ "prompt_number": 33
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 12.12, Page No. 480"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Maximum input frequency\n",
+ "\n",
+ "import math\n",
+ "#Variable declaration\n",
+ "n = 8 # 8-bit ADC\n",
+ "Tc = 9*10**-6 # Conversion time\n",
+ "\n",
+ "#Calculations\n",
+ "fmax = 1/(2*math.pi*Tc*2**n)\n",
+ "\n",
+ "#Result\n",
+ "print(\"Maximum frequency, Fmax = %.2f Hz\"%(math.floor(fmax*100)/100))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Maximum frequency, Fmax = 69.07 Hz\n"
+ ]
+ }
+ ],
+ "prompt_number": 35
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 12.13, Page No. 501"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Dual slope ADC\n",
+ "\n",
+ "import math\n",
+ "#Variable declaration\n",
+ "Vr = 2 # Reference Voltage\n",
+ "t2 = 20*10**-3 # time duration\n",
+ "Vo = 5 # Peak value of output voltage\n",
+ "C = 0.1*10**-6 # integrator capacitance\n",
+ "\n",
+ "#Calculations\n",
+ "R = Vr*t2/(Vo*C)\n",
+ "\n",
+ "#Result\n",
+ "print(\"Integrating resistor, R1 = %.0f k-ohm\"%(R/1000))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Integrating resistor, R1 = 80 k-ohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 37
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 12.4, Page No. 501"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Resolution and equivalent Iout for digital input\n",
+ "\n",
+ "import math\n",
+ "#Variable declaration\n",
+ "n = 4 # 4-bit resistance ladder\n",
+ "R1 = 10*10**3 # Resistance R\n",
+ "R2 = 20*10**3 # Resistance 2*R\n",
+ "Vref = 10.0 # reference Voltage\n",
+ "b1 = 1.0 # LSB valueof input\n",
+ "b2 = 1.0 # 2nd bit value of input\n",
+ "b3 = 1.0 # 3rd bit value of input\n",
+ "b4 = 1.0 # MSB value of input\n",
+ "\n",
+ "# Calculations\n",
+ "Res = Vref/(2**n*R1)\n",
+ "Iout = Vref*((b1/2**1)+(b2/2**2)+(b3/2**3)+(b4/2**4))/R1\n",
+ "\n",
+ "#Result\n",
+ "print(\"Resolution = %.3f * 10^-5 \\nIout(1111) = %.3f * 10^-4 A\"%(Res*10**5,Iout*10**4))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Resolution = 6.250 * 10^-5 \n",
+ "Iout(1111) = 9.375 * 10^-4 A\n"
+ ]
+ }
+ ],
+ "prompt_number": 83
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 12.15, Page No. 501"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# 4-bit weighted resistor type DAC\n",
+ "\n",
+ "import math\n",
+ "#Variable declaration\n",
+ "n = 4 # 4-bit DAC\n",
+ "R1 = 10*10**3 # Resistor corresponding to LSB(Value used in calculations)\n",
+ "Vr = 2.5 # reference Voltage\n",
+ "VoFS = 5 # Full scale output voltage\n",
+ "\n",
+ "#Calculations\n",
+ "Rf = VoFS*R1/(Vr*((b1/2**1)+(b2/2**2)+(b3/2**3)+(b4/2**4)))\n",
+ "\n",
+ "#Result\n",
+ "print(\"Rf = %d k-ohm\"%(Rf/1000))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Rf = 21 k-ohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 61
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 12.16, Page N0. 502"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# LSB, MSB and full scale output for 8-bit DAC\n",
+ "\n",
+ "import math\n",
+ "#Variable ddeclaration\n",
+ "n = 8 # 8-bit DAC\n",
+ "Vmin = 0 # minimum input voltage\n",
+ "Vmax = 10.0 # Maximum input voltage \n",
+ "\n",
+ "#Calculations\n",
+ "LSB = (Vmax-Vmin)/(2**n - 1)\n",
+ "MSB = LSB*2**(n-1)\n",
+ "VoFS = LSB*(2**n -1)\n",
+ "\n",
+ "#Result\n",
+ "print(\"LSB = %.2f mV\\nMSB = %d V\\nVoFS = %d V\"%(math.floor(LSB*100000)/100,MSB,VoFS))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "LSB = 39.21 mV\n",
+ "MSB = 5 V\n",
+ "VoFS = 10 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 71
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 12.17, Page No. 502"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# 8-bit ADC\n",
+ "\n",
+ "import math\n",
+ "#Variable declaration\n",
+ "n = 8 # 8-bit ADC\n",
+ "Vmin = 0 # minimum input voltage\n",
+ "Vmax = 3.0 # Maximum input voltage \n",
+ "\n",
+ "#Calculations\n",
+ "MinVol = (Vmax-Vmin)/(2**n-1)\n",
+ "\n",
+ "#Result\n",
+ "print(\"Minimum Voltage = %.2f mv\"%(MinVol*1000))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Minimum Voltage = 11.76 mv\n"
+ ]
+ }
+ ],
+ "prompt_number": 82
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 12.18, Page No. 502"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# 10-bit ADC Resolution\n",
+ "\n",
+ "import math\n",
+ "# Variable declaration\n",
+ "n = 10 # 10-bit ADC\n",
+ "Vmin = -10.0 # minimum input voltage\n",
+ "Vmax = 10.0 # Maximum input voltage \n",
+ "\n",
+ "#Calculations\n",
+ "r = (Vmax-Vmin)/(2**n-1)\n",
+ "\n",
+ "#Result\n",
+ "print(\"Resolution = %f mv\"%(r))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Resolution = 0.019550 mv\n"
+ ]
+ }
+ ],
+ "prompt_number": 74
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 12.19, Page No. 502"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# 8-bit DAC Analog Output\n",
+ "\n",
+ "import math\n",
+ "# Variable declaration\n",
+ "n = 8 # 8-bit DAC\n",
+ "Res = 20*10**-3 # DAC resolution\n",
+ "D = int('00010110',2) # digital input\n",
+ "\n",
+ "#Calculations\n",
+ "Vout = Res*D\n",
+ "\n",
+ "#Result\n",
+ "print(\"Vout = %.0f mv\"%(Vout*1000))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Vout = 440 mv\n"
+ ]
+ }
+ ],
+ "prompt_number": 81
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Op-amp_and_linear_integrated_circuits_/Chapter_2.ipynb b/Op-amp_and_linear_integrated_circuits_/Chapter_2.ipynb new file mode 100755 index 00000000..0346b963 --- /dev/null +++ b/Op-amp_and_linear_integrated_circuits_/Chapter_2.ipynb @@ -0,0 +1,229 @@ +{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 2 : Operational Amplifier Fundamentals"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 2.1, Page No. 59"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Input bias and input offset current\n",
+ "\n",
+ "import math\n",
+ "#Variable declaration\n",
+ "Ib1 = 18*10**-6 # base current of transistor 1\n",
+ "Ib2 = 22*10**-6 # base current of transistor 2\n",
+ "\n",
+ "#Calculations\n",
+ "#(i)\n",
+ "Ib = (Ib1+Ib2)/2\n",
+ "#(ii)\n",
+ "Iios = abs(Ib1-Ib2)\n",
+ "\n",
+ "#Result\n",
+ "print(\"(i) Input bias current = %d micro-A\\n(ii) Input offset current = %.0f micro-A\"%(Ib*10**6,Iios*10**6))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(i) Input bias current = 20 micro-A\n",
+ "(ii) Input offset current = 4 micro-A\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 2.2, Page No. 65"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Maximum frequency of operation\n",
+ "\n",
+ "import math\n",
+ "#Variable declaration\n",
+ "Vin = 3.0 # input voltage\n",
+ "sr = 0.5*10**6 # slew rate in V/Sec\n",
+ "\n",
+ "#Calculations\n",
+ "Vm = Vin/2\n",
+ "fm = sr/(2*math.pi*Vm)\n",
+ "fm = fm /1000 \n",
+ "\n",
+ "#Result\n",
+ "print(\"Maximum frequency of operation is %.3f kHz\"%(math.floor(fm*1000)/1000))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Maximum frequency of operation is 53.051 kHz\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 2.3, Page No. 65"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Slew rate \n",
+ "\n",
+ "import math\n",
+ "#Variable declaration\n",
+ "Icq = 15*10**-6 # Maximum op-amp current \n",
+ "C = 35*10**-12 # equivalent capacitance\n",
+ "V = 12.0 # input voltage \n",
+ "\n",
+ "#Calculations\n",
+ "S = Icq/C\n",
+ "S = S/10**6\n",
+ "\n",
+ "#Result\n",
+ "print(\"Slew rate = %.4f V/micro-sec\"%(math.floor(S*10**4)/10**4))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Slew rate = 0.4285 V/micro-sec\n"
+ ]
+ }
+ ],
+ "prompt_number": 15
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 2.4, Page No. 66"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Slew rate and maximum possible frequency of input\n",
+ "\n",
+ "import math\n",
+ "# Variable declaration\n",
+ "Icq = 10*10**-6 # maximum op-amp current\n",
+ "C = 33*10**-12 # equivalent capacitance\n",
+ "V = 12 # peak value of input voltage\n",
+ "\n",
+ "\n",
+ "#Calculations\n",
+ "S = Icq/C\n",
+ "fm = S/(2*math.pi*V)\n",
+ "\n",
+ "#Result\n",
+ "print(\"Slew rate = %.3f V/micro-sec\\nfm = %.3f kHz\"%(S/10**6,fm/1000))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Slew rate = 0.303 V/micro-sec\n",
+ "fm = 4.019 kHz\n"
+ ]
+ }
+ ],
+ "prompt_number": 20
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 2.5, Page No. 66"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Common mode rejection ratio(refere to fig 2.24)\n",
+ "\n",
+ "import math\n",
+ "#Variable declaration\n",
+ "R1 = 1000.0 # resistance 1\n",
+ "R2_1_E = 90000.0 # resistance R2(1-E)\n",
+ "R2 = 100000.0 # resistance R2\n",
+ "\n",
+ "#Calculations\n",
+ "Aid = R2/R1\n",
+ "E = 1-(R2_1_E/R2)\n",
+ "Acm = R2*E/(R1+R2)\n",
+ "CMRR = Aid/Acm\n",
+ "CMRR = 20*math.log10(CMRR)\n",
+ "\n",
+ "#Result\n",
+ "print(\"CMRR = %d dB\"%CMRR)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "CMRR = 60 dB\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Op-amp_and_linear_integrated_circuits_/Chapter_3.ipynb b/Op-amp_and_linear_integrated_circuits_/Chapter_3.ipynb new file mode 100755 index 00000000..0a250fa7 --- /dev/null +++ b/Op-amp_and_linear_integrated_circuits_/Chapter_3.ipynb @@ -0,0 +1,525 @@ +{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 3 : Op-amp with Negative Feedback"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 3.1, Page No. 90"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# parameters of practical invertig amplifier\n",
+ "\n",
+ "import math\n",
+ "#VAriable declaration\n",
+ "R1 = 470 # Resistor R1\n",
+ "Rf = 4.7*10**3 # feedback resistor\n",
+ "A = 2*10**5 # Open loop gain\n",
+ "Rin= 2*10**6 # input resistance\n",
+ "Ro = 75 # output resistance\n",
+ "f = 5 # single break frequency\n",
+ "V = 15 # dual supply voltage\n",
+ "\n",
+ "#Calculations\n",
+ "K = Rf/(R1+Rf)\n",
+ "B = R1/(R1+Rf)\n",
+ "B = math.floor(B*10000)/10000 \n",
+ "Af = (-A*Rf)/(R1+Rf+R1*A)\n",
+ "Rinf = R1+(Rf*Rin/(Rf+Rin+A*Rin))\n",
+ "Rof = Ro/(1+A*B)\n",
+ "ff = f*(1+A*B)\n",
+ "\n",
+ "#Result\n",
+ "print(\"Closed loop voltage gain with feedback = %.0f\\nInput resistane with feedback = %.4f ohm\"%(math.floor(Af),Rinf))\n",
+ "print(\"Output resistance with feedback = %.2f m-ohm\\nBandwidth with feedback = %.3f KHz\"%(Rof*1000,ff/1000))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Closed loop voltage gain with feedback = -10\n",
+ "Input resistane with feedback = 470.0235 ohm\n",
+ "Output resistance with feedback = 4.13 m-ohm\n",
+ "Bandwidth with feedback = 90.905 KHz\n"
+ ]
+ }
+ ],
+ "prompt_number": 47
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 3.2, Page No. 91"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# inverting Op-amp design\n",
+ "\n",
+ "import math\n",
+ "#Variable declaration\n",
+ "Af = -30.0 # voltage gain\n",
+ "Rf = 1*10**6 # feedback resistance\n",
+ "\n",
+ "#Calcaculation\n",
+ "R1 = -Rf/Af\n",
+ "\n",
+ "#Result\n",
+ "print(\"R1 = %.2f k-ohm\\nlet us choose, R1 = 30 k-ohm + 3.3 k-ohm......standard values(refer fig. 3.7)\"%(R1/1000))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "R1 = 33.33 k-ohm\n",
+ "let us choose, R1 = 30 k-ohm + 3.3 k-ohm......standard values(refer fig. 3.7)\n"
+ ]
+ }
+ ],
+ "prompt_number": 24
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 3.3, Page No. 91"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print(\"Theoretical example\")"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Theoretical example\n"
+ ]
+ }
+ ],
+ "prompt_number": 25
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 3.4, Page No. 95"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Value of feedback resistance\n",
+ "\n",
+ "import math\n",
+ "#Variable declaration\n",
+ "Af = 61 # gain with feedback\n",
+ "R1 = 1000 # resistor R1\n",
+ "\n",
+ "\n",
+ "#Calculations\n",
+ "Rf = (Af-1)*R1\n",
+ "\n",
+ "#Result\n",
+ "print(\"Rf = %d k-ohm\"%(Rf/1000))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Rf = 60 k-ohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 29
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 3.5, Page No.95"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# parameters of non-invertig amplifier\n",
+ "\n",
+ "import math\n",
+ "#VAriable declaration\n",
+ "R1 = 1000.0 # Resistor R1\n",
+ "Rf = 10*10**3 # feedback resistor\n",
+ "A = 2*10**5 # Open loop gain\n",
+ "Rin= 2*10**6 # input resistance\n",
+ "Ro = 75 # output resistance\n",
+ "f = 5 # single break frequency\n",
+ "V = 12 # dual supply voltage\n",
+ "\n",
+ "#Calculations\n",
+ "B = R1/(R1+Rf)\n",
+ "#B = math.floor(B*10000)/10000 \n",
+ "Af = A/(1+A*B)\n",
+ "Rinf = Rin*(1+A*B)\n",
+ "Rof = Ro/(1+A*B)\n",
+ "ff = f*(1+A*B)\n",
+ "\n",
+ "#Result\n",
+ "print(\"Closed loop voltage gain with feedback = %.3f\\nInput resistane with feedback = %.2f G-ohm\"%(Af,math.floor((Rinf/10**9)*100)/100))\n",
+ "print(\"Output resistance with feedback = %.2f m-ohm\\nBandwidth with feedback = %.2f KHz\"%(Rof*1000,ff/1000))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Closed loop voltage gain with feedback = 10.999\n",
+ "Input resistane with feedback = 36.36 G-ohm\n",
+ "Output resistance with feedback = 4.12 m-ohm\n",
+ "Bandwidth with feedback = 90.91 KHz\n"
+ ]
+ }
+ ],
+ "prompt_number": 48
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 3.6, Page No. 96"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# inverter parameters\n",
+ "\n",
+ "import math\n",
+ "#Variable declaration\n",
+ "A = 2*10**5 # Open loop gain\n",
+ "Rin= 2*10**6 # input resistance\n",
+ "Ro = 75 # output resistance\n",
+ "f = 5 # single break frequency\n",
+ "\n",
+ "\n",
+ "#Calculations\n",
+ "Af = -1 # inverter gain\n",
+ "Rf = 330.0 # Rf = R1, Value assumed\n",
+ "R1 = Rf\n",
+ "B = R1/(R1+Rf)\n",
+ "Rof = Ro/(A*B)\n",
+ "BW = f*(A*B)\n",
+ "\n",
+ "#Result\n",
+ "print(\"Af = %.0f\\nRif = %.0f ohm\\nRof = %.5f ohm\\nfF = %.1f MHz\"%(Af,Rf,Rof,BW/10**6))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Af = -1\n",
+ "Rif = 330 ohm\n",
+ "Rof = 0.00075 ohm\n",
+ "fF = 0.5 MHz\n"
+ ]
+ }
+ ],
+ "prompt_number": 42
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 3.7, Page No. 96"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# parameters of invertig and non-inverting amplifier\n",
+ "\n",
+ "import math\n",
+ "#VAriable declaration\n",
+ "R1_n = 1000.0 # Resistor R1 in case of non-inverting ampliflier\n",
+ "Rf_n = 10*10**3 # feedback resistor in case of non-inverting ampliflier\n",
+ "R1_i = 470.0 # Resistor R1 in case of inverting ampliflier\n",
+ "Rf_i = 4.7*10**3 # feedback resistor in case of inverting ampliflier\n",
+ "A = 2*10**5 # Open loop gain\n",
+ "Ri = 2*10**6 # input resistance\n",
+ "Ro = 75 # output resistance\n",
+ "f = 5 # single break frequency\n",
+ "V = 15 # dual supply voltage\n",
+ "Vos = 13 # output voltage swing\n",
+ "\n",
+ "#Calculations\n",
+ "#(i) Non-inverting amplifier\n",
+ "B = R1_n/(R1_n+Rf)\n",
+ "Af = 1+(Rf_n/R1_n)\n",
+ "Rinf = Ri*(1+A*B)\n",
+ "Rof = Ro/(1+A*B)\n",
+ "ff = f*(1+A*B)\n",
+ "ff =ff/1000 # KHz\n",
+ "VooT = Vos/(1+A*B)\n",
+ "#(ii) Inverting amplifier\n",
+ "B_i = R1_i/(R1_i+Rf)\n",
+ "Af_i = -(Rf_i/R1_i)\n",
+ "Rinf_i = R1_i\n",
+ "Rof_i = Ro/(1+A*B_i)\n",
+ "ff_i = f*(1+A*B_i)\n",
+ "ff_i =ff_i/1000 # KHz\n",
+ "VooT_i = Vos/(1+A*B_i)\n",
+ "\n",
+ "#Result\n",
+ "print(\"(i) Non-inverting amplifier:\")\n",
+ "print(\" Closed loop voltage gain with feedback = %.0f\\n Input resistane with feedback = %.4f ohm\"%(math.floor(Af),Rinf/10**9))\n",
+ "print(\" Output resistance with feedback = %.5f ohm\\n Bandwidth with feedback = %.2f KHz\"%(Rof,math.ceil(ff*100)/100))\n",
+ "print(\" Total output offset voltage with feedback = +/- %.3f mV\"%(VooT*1000))\n",
+ "\n",
+ "print(\"\\n(ii) Inverting amplifier:\")\n",
+ "print(\" Closed loop voltage gain with feedback = %.0f\\n Input resistane with feedback = %.0f ohm\"%(math.floor(Af_i),Rinf_i))\n",
+ "print(\" Output resistance with feedback = %.5f ohm\\n Bandwidth with feedback = %.2f KHz\"%(Rof,math.ceil(ff*100)/100))\n",
+ "print(\" Total output offset voltage with feedback = +/- %.3f mV\"%(VooT*1000))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(i) Non-inverting amplifier:\n",
+ " Closed loop voltage gain with feedback = 11\n",
+ " Input resistane with feedback = 36.3656 ohm\n",
+ " Output resistance with feedback = 0.00412 ohm\n",
+ " Bandwidth with feedback = 90.92 KHz\n",
+ " Total output offset voltage with feedback = +/- 0.715 mV\n",
+ "\n",
+ "(ii) Inverting amplifier:\n",
+ " Closed loop voltage gain with feedback = -10\n",
+ " Input resistane with feedback = 470 ohm\n",
+ " Output resistance with feedback = 0.00412 ohm\n",
+ " Bandwidth with feedback = 90.92 KHz\n",
+ " Total output offset voltage with feedback = +/- 0.715 mV\n"
+ ]
+ }
+ ],
+ "prompt_number": 68
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 3.8, Page No. 97"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# inverting amplifier parameters\n",
+ "\n",
+ "import math\n",
+ "#variable declaration\n",
+ "Rf = 500*10**3 # feedback resistance\n",
+ "R1 = 5*10**3 # R1 resistance\n",
+ "Vi = 0.1 # input voltage\n",
+ "\n",
+ "\n",
+ "#Calculation\n",
+ "Af = -Rf/R1\n",
+ "Ri = R1\n",
+ "Ro = 0\n",
+ "Vout = Af*Vi\n",
+ "Iin = Vi/R1\n",
+ "\n",
+ "#Result\n",
+ "print(\"Af = %d\\nRi = %d k-ohm\\nRo = %d ohm\\nVout = %d V\\nIin = %.2f mA\"%(Af,Ri/1000,Ro,Vout,Iin*1000))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Af = -100\n",
+ "Ri = 5 k-ohm\n",
+ "Ro = 0 ohm\n",
+ "Vout = -10 V\n",
+ "Iin = 0.02 mA\n"
+ ]
+ }
+ ],
+ "prompt_number": 76
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 3.9, Page No.97"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# input ippedance, Voltage gain and power gain(refer fig. 3.15)\n",
+ "\n",
+ "import math\n",
+ "#Variable declaration\n",
+ "Rf = 1*10**6 # feedback resistance\n",
+ "Rin = 1*10**6 # input resistance\n",
+ "\n",
+ "#Calculations\n",
+ "Av = -Rf/Rin\n",
+ "Ai = 1 #unity gain inverter\n",
+ "Ap = abs(Av*Ai)\n",
+ "\n",
+ "#Result\n",
+ "print(\"(i) Given amplifier is an inverting amplifier,therefore, Av = %.0f\"%Av)\n",
+ "print(\"(ii) Because it is a unity gain inverter, so Ai = %.0f\"%Ai)\n",
+ "print(\"(iii) Power gain of op-amp circuit, Ap = %.0f\"%Ap)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(i) Given amplifier is an inverting amplifier,therefore, Av = -1\n",
+ "(ii) Because it is a unity gain inverter, so Ai = 1\n",
+ "(iii) Power gain of op-amp circuit, Ap = 1\n"
+ ]
+ }
+ ],
+ "prompt_number": 79
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 3.10, Page No. 98"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# inverting op-amp circuit design\n",
+ "\n",
+ "import math\n",
+ "# Variable declaartion\n",
+ "Av = -8 # voltage gain\n",
+ "Vin = -1 # input voltage\n",
+ "I1 = 15*10**-6 # maximum current through R1 and Rf\n",
+ "\n",
+ "#Calculations\n",
+ "R1 = abs(Vin)/I1\n",
+ "R1std = 68*10**3 # standard value\n",
+ "Rf = -Av*R1\n",
+ "\n",
+ "#Result\n",
+ "print(\"R1 = %.2f K-ohm\\t\\t(we use %.0f K-ohm as standard value)\"%(R1/1000,R1std/1000))\n",
+ "print(\"Rf = %f K-ohm\"%(Rf/1000))\n",
+ "#Answer for Rf is wrong in the book"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "R1 = 66.67 K-ohm\t\t(we use 68 K-ohm as standard value)\n",
+ "Rf = 533.333333 K-ohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 85
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 3.11, Page No. 98"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print(\"Theoretical example\")"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Theoretical example\n"
+ ]
+ }
+ ],
+ "prompt_number": 86
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Op-amp_and_linear_integrated_circuits_/Chapter_4.ipynb b/Op-amp_and_linear_integrated_circuits_/Chapter_4.ipynb new file mode 100755 index 00000000..4b56e56a --- /dev/null +++ b/Op-amp_and_linear_integrated_circuits_/Chapter_4.ipynb @@ -0,0 +1,1729 @@ +{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 4: Basic Applications of Operational Amplifiers"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 4.1, Page No. 104"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Output voltage of circuit shown in fig. 4.3\n",
+ "\n",
+ "import math\n",
+ "#Variable declaration\n",
+ "R1 = R2 = R3 = 1000.0 # input Resistors\n",
+ "Rf = 1000.0 # feedback resistor\n",
+ "Vin1 = 2 # input voltage 1\n",
+ "Vin2 = 1 # input voltage 2\n",
+ "Vin3 = 4 # input voltage 3\n",
+ "\n",
+ "#Calculations\n",
+ "Vout = -((Rf*Vin1/R1)+(Rf*Vin2/R2)+(Rf*Vin3/R3))\n",
+ "\n",
+ "#Result\n",
+ "print(\"Vout = %d V\"%Vout)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Vout = -7 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 4.2, Page No. 104"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Adder circuit design\n",
+ "\n",
+ "import math\n",
+ "#Variable declaration\n",
+ "Rf = 100.0 # feedback resistor in k-ohm\n",
+ "V1 = 1 # multiplication factor for input 1\n",
+ "V2 = 10 # multiplication factor for input 2\n",
+ "V3 = 100 # multiplication factor for input 3\n",
+ "\n",
+ "#Calculations\n",
+ "R1 = Rf/V1\n",
+ "R2 = Rf/V2\n",
+ "R3 = Rf/V3\n",
+ "\n",
+ "#Result\n",
+ "print(\"R1 = %d k-ohm\\nR2 = %d k-ohm\\nR3 = %d k-ohm\"%(R1,R2,R3))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "R1 = 100 k-ohm\n",
+ "R2 = 10 k-ohm\n",
+ "R3 = 1 k-ohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 4.3, Page No. 104"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Determine output voltage\n",
+ "\n",
+ "import math\n",
+ "#Variable declaration\n",
+ "Rf = 12.0 # feedback resistor in k-ohm\n",
+ "Rs1 = 12.0 # input resistance 1\n",
+ "Rs2 = 2.0 # input resistance 2\n",
+ "Rs3 = 3.0 # input resistance 3\n",
+ "Vi1 = 9 # corresponding input Voltage 1\n",
+ "Vi2 = -3 # corresponding input Voltage 2\n",
+ "Vi3 = -1 # corresponding input Voltage 3\n",
+ "\n",
+ "#Calculations\n",
+ "Vout = -Rf*((Vi1/Rs1)+(Vi2/Rs2)+(Vi3/Rs3))\n",
+ "\n",
+ "#Result\n",
+ "print(\"Vout = %.0f V\"%Vout)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Vout = 13 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 4.4, Page No. 105"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Summing amplifier design(refer fig. 4.4)\n",
+ "\n",
+ "import math\n",
+ "#Variable declaration\n",
+ "Rf = 6 # Assume,feedback resistor in k-ohm\n",
+ "V1 = 1 # multiplication factor for input 1\n",
+ "V2 = 2 # multiplication factor for input 2\n",
+ "V3 = -3 # multiplication factor for input 3\n",
+ "\n",
+ "#Calculations\n",
+ "R1 = abs(Rf/V1)\n",
+ "R2 = abs(Rf/V2)\n",
+ "R3 = abs(Rf/V3)\n",
+ "\n",
+ "#Result\n",
+ "print(\"R1 = %d k-ohm\\nR2 = %d k-ohm\\nR3 = %d k-ohm\"%(R1,R2,R3))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "R1 = 6 k-ohm\n",
+ "R2 = 3 k-ohm\n",
+ "R3 = 2 k-ohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 16
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 4.5, Page No. 105"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Summing amplifier design(refer fig. 4.5)\n",
+ "\n",
+ "import math\n",
+ "#Variable declaration\n",
+ "Rf = 40.0 # Assume,feedback resistor in k-ohm\n",
+ "V1 = -2.0 # multiplication factor for input 1\n",
+ "V2 = -3.0 # multiplication factor for input 2\n",
+ "V3 = -4.0 # multiplication factor for input 3\n",
+ "\n",
+ "#Calculations\n",
+ "R1 = abs(Rf/V1)\n",
+ "R2 =abs(Rf/V2)\n",
+ "R3 = abs(Rf/V3)\n",
+ "\n",
+ "#Result\n",
+ "print(\"R1 = %d k-ohm\\nR2 = %.2f k-ohm\\nR3 = %d k-ohm\"%(R1,R2,R3))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "R1 = 20 k-ohm\n",
+ "R2 = 13.33 k-ohm\n",
+ "R3 = 10 k-ohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 22
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 4.6, Page No. 105"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Output Voltage(refer fig. 4.6)\n",
+ "\n",
+ "import math\n",
+ "#Variable declaration\n",
+ "V1 = 2.0 # V1 input\n",
+ "V2 = -1.0 # V2 input\n",
+ "R = 1.0 # Resistor R, assumed\n",
+ "Rf = 2.0*R # feedback resistor\n",
+ "\n",
+ "#Calculations\n",
+ "Vin1 = (R*R/(R+R))*V1/(R+(R*R/(R+R)))\n",
+ "Vout1 = Vin1*(1+(Rf/R))\n",
+ "Vin2 = (R*R/(R+R))*V2/(R+(R*R/(R+R)))\n",
+ "Vout2 = Vin2*(1+(Rf/R))\n",
+ "Vout = Vout1+Vout2\n",
+ "\n",
+ "#Result\n",
+ "print(\"Output voltage, Vout = %d V\"%Vout)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Output voltage, Vout = 1 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 28
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 4.7, Page No. 116"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Limiting frequency\n",
+ "\n",
+ "import math\n",
+ "#Variable declaration\n",
+ "R1 = 10*10**3 # resistor R1\n",
+ "Cf = 0.1*10**-6 # feedback capacitor\n",
+ "\n",
+ "#Calculation\n",
+ "Rf = 10*R1\n",
+ "f = 1/(2*math.pi*Rf*Cf)\n",
+ "\n",
+ "#Result\n",
+ "print(\"Limiting frequency = %.2f Hz\"%(math.floor(f*100)/100))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Limiting frequency = 15.91 Hz\n"
+ ]
+ }
+ ],
+ "prompt_number": 32
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 4.8, Page No. 117"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Design of practical integrator circuit\n",
+ "\n",
+ "import math\n",
+ "#Variable declaration\n",
+ "A = 10.0 # DC gain of integrator\n",
+ "f = 10.0*10**3 # frequency of input square wav\n",
+ "#Calculations\n",
+ "fa = f/10 # break frequency for proper integration\n",
+ "R1 = 10.0*10**3 # selected\n",
+ "Rf = A*R1\n",
+ "Cf = 1/(2*math.pi*Rf*fa)\n",
+ "Rcomp = R1*Rf/(R1+Rf)\n",
+ "\n",
+ "\n",
+ "#Result\n",
+ "print(\"R1 = %d k-ohm\\nRf = %d k-ohm\\nCf = %.4f = %.1f nF\\nRcomp = %.2f k-ohm\"%(R1/1000,Rf/1000,Cf*10**9,Cf*10**9,Rcomp/1000))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "R1 = 10 k-ohm\n",
+ "Rf = 100 k-ohm\n",
+ "Cf = 1.5915 = 1.6 nF\n",
+ "Rcomp = 9.09 k-ohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 40
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 4.9, Page No.118"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# maximum change in output and minimum slew rate required\n",
+ "\n",
+ "import math\n",
+ "#Variable declaration\n",
+ "Vin = 5 # input voltage\n",
+ "f = 1000.0 # input frequency\n",
+ "R1 = 1000.0 # Resistor R1\n",
+ "Cf = 0.1*10**-6 # feedback capacitor\n",
+ "\n",
+ "#Calculation\n",
+ "Vout = Vin/(2*R1*f*Cf)\n",
+ "S = 2*math.pi*f*Vin\n",
+ "\n",
+ "#Result\n",
+ "print(\"Delta V = %d V.\\n\\nOutput may saturate at +/- 14V. But %d change means the output will alternate\"%(Vout,Vout))\n",
+ "print(\"between +/- %.1f V. Hence output will not saturate and will be triangular in nature.\"%(Vout/2))\n",
+ "print(\"\\nMinimum slew rate required is %f V/usec.\"%(S*10**-6))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Delta V = 25 V.\n",
+ "\n",
+ "Output may saturate at +/- 14V. But 25 change means the output will alternate\n",
+ "between +/- 12.5 V. Hence output will not saturate and will be triangular in nature.\n",
+ "\n",
+ "Minimum slew rate required is 0.031416 V/usec.\n"
+ ]
+ }
+ ],
+ "prompt_number": 48
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 4.10, Page No. 118"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Practical integrator circuit\n",
+ "\n",
+ "import math\n",
+ "#Variable declaration\n",
+ "R1 = 120*10**3 # Resistor R1\n",
+ "Rf = 1.2*10**6 # feedback resistor\n",
+ "Cf = 10*10**-9 # feedback capacitor\n",
+ "V = 5 # input sine wave amplitude\n",
+ "f = 10*10**3 # input sine wave frequency\n",
+ "\n",
+ "\n",
+ "#Calculations\n",
+ "#(ii)\n",
+ "fa = 1/(2*math.pi*Rf*Cf)\n",
+ "fs = 10*fa\n",
+ "#(iii)\n",
+ "A = Rf/R1\n",
+ "A = 20*math.log10(A)\n",
+ "#(iv)\n",
+ "A2 = (Rf/R1)/math.sqrt(1+(f/fa)**2)\n",
+ "Vout = V*A2\n",
+ "\n",
+ "#Result\n",
+ "print(\"(i) Circuit diagram is shown in fig.4.27(a)\\n\\n(ii) fa = %.2f Hz\\t\\t Safe frequency = %.1f Hz\\n\\n(iii)DC gain = %d\"%(fa,fs,A))\n",
+ "print(\"\\n(iv) Vout(peak) = %.0f mV\\n\\n(v) Rough nature of frequency response is shown in fig. 4.27(b)\"%(Vout*10**3))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(i) Circuit diagram is shown in fig.4.27(a)\n",
+ "\n",
+ "(ii) fa = 13.26 Hz\t\t Safe frequency = 132.6 Hz\n",
+ "\n",
+ "(iii)DC gain = 20\n",
+ "\n",
+ "(iv) Vout(peak) = 66 mV\n",
+ "\n",
+ "(v) Rough nature of frequency response is shown in fig. 4.27(b)\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 4.11, Page No. 119"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Output voltage\n",
+ "\n",
+ "import math\n",
+ "#Variable declaration\n",
+ "f = 2000.0 # frequency of input sin wave\n",
+ "V = 10*10**-3 # amplitude of sin wave\n",
+ "R = 50*10**3 # Resistor R\n",
+ "C = 2*10**-6 # feedback capacitor\n",
+ "\n",
+ "#Calculations\n",
+ "sf = -1/(R*C)\n",
+ "Vout = (math.sqrt(2)*V*sf)*1000/(2*math.pi*f)\n",
+ "\n",
+ "#Result\n",
+ "print(\"Vout(t) = %.4f*(cos%dt-1)\"%(-Vout,2*f))\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Vout(t) = 0.0113*(cos4000t-1)\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 4.12, Page No. 119"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Capacitor voltage and closed loop time constant\n",
+ "\n",
+ "import math\n",
+ "Vin = 10.0 # input voltage\n",
+ "R = 2.2*10**3 # Resistor\n",
+ "T = 10**-3 # ON time of the pulse\n",
+ "C = 10**-6 # Capacitance value\n",
+ "\n",
+ "#Calculations\n",
+ "I = Vin/R\n",
+ "V = I*T/C\n",
+ "RC = R*C*10**5\n",
+ "\n",
+ "#Result\n",
+ "print(\"I = %.3f mA\\nV = %.3f V\\nclosed-loop time constant = %.0f\"%(I*10**3,V,RC))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "I = 4.545 mA\n",
+ "V = 4.545 V\n",
+ "closed-loop time constant = 220\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 4.13, Page No. 120"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Lossyintegrator circuit\n",
+ "\n",
+ "import math\n",
+ "#Variable declaration\n",
+ "A = 20.0 # peak gain\n",
+ "w = 10000 # w value when gain is 3dB down\n",
+ "C = 0.01*10**-6 # feedback capacitance\n",
+ "\n",
+ "# Calculations\n",
+ "Rf = 1/(C*w)\n",
+ "R1 = Rf/10**(A/20.0)\n",
+ "\n",
+ "#Result\n",
+ "print(\"Rf = %d k-ohm\\t\\tR1 = %d k-ohm\"%(Rf/1000,R1/1000))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Rf = 10 k-ohm\t\tR1 = 1 k-ohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 14
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 4.14, Page No. 120"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# output voltage in case of circuit shown in fig. 4.30 with ideal op-amp\n",
+ "\n",
+ "import math\n",
+ "#Variable declaration\n",
+ "Vin = 5.0 # input voltage at inverting terminal\n",
+ "V1 = 3.0 # input voltage at non-inverting terminal\n",
+ "C = 0.2*10**-6 # feedback capacitor\n",
+ "R = 40*10**3 # Resistor R\n",
+ "t = 50*10**-3 # time delay\n",
+ "\n",
+ "#Calculations\n",
+ "Vout = -((Vin-V1)*t/(R*C))+V1\n",
+ "\n",
+ "\n",
+ "%matplotlib inline\n",
+ "import matplotlib.pyplot as plt\n",
+ "from numpy import arange,sin,pi\n",
+ "t = arange(0.0,5.0,0.01)\n",
+ "t1 = arange(0.0,6.0,0.01)\n",
+ "t2 = arange(0.0,5,0.01)\n",
+ "t3 = arange(-9.5,0.0,0.01)\n",
+ "\n",
+ "plt.axis([0,5.5,-10.0,4.1])\n",
+ "plt.plot(t1,t1*0/t1,'b')\n",
+ "plt.plot(t,3-t*12.5/5.0,'b')\n",
+ "plt.plot(t2,-t2*9.5/t2,'--')\n",
+ "plt.plot(t3*5/t3,t3,'--')\n",
+ "plt.title(\"Output Voltage\")\n",
+ "plt.xlabel(\"Time(x 10^-2) \")\n",
+ "plt.ylabel(\"Output Voltage in Volts\")\n",
+ "\n",
+ "#Result\n",
+ "print(\"Vout = %.1f V\"%Vout)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Vout = -9.5 V\n"
+ ]
+ },
+ {
+ "metadata": {},
+ "output_type": "display_data",
+ "png": "iVBORw0KGgoAAAANSUhEUgAAAYMAAAEZCAYAAAB1mUk3AAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3XlYVGX/BvB7EFwRMRd2RUWQTUBcUwQ13DW1XDBzJVPS\nFl8rLZXREnNB09R6M23R3Evh50IuOJoCLizuvWSKgkouKDKuLOf3x4kJZBVm5pxh7s91ccVsZ75E\nzZfnPM9zH4UgCAKIiMiomUhdABERSY/NgIiI2AyIiIjNgIiIwGZARERgMyAiIrAZEMnO2LFjMXv2\nbKnLICPDZkAG4YcffoCnpyfq1KkDGxsbhISEIDMzs9yvd3R0RHR0tNbqKe14169fh5mZGS5fvlzk\nscGDB+PDDz8s9dgKhQIKhQIAoFKp4ODgUPmCicrAZkCyFx4ejhkzZiA8PBwPHjxAXFwcrl69isDA\nQGRnZ5frGAqFAtrcX1na8ezs7NCjRw+sX7++0P0ZGRnYu3cvxo4dW+bxuReU9E4gkrHMzEzB3Nxc\n2LZtW6H71Wq10KhRI2HdunWCIAjCmDFjhFmzZmkeP3TokGBvby8IgiCMGjVKMDEx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oUOHpC6l\nXL755ht89NFHUpdBBoQjAyIi4siAiIjYDIiICGwGREQENgMiIgKbARERgc2AiIgA/D+nZB+vWWQW\ngwAAAABJRU5ErkJggg==\n",
+ "text": [
+ "<matplotlib.figure.Figure at 0x92ef438>"
+ ]
+ }
+ ],
+ "prompt_number": 92
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 4.15, Page No. 121"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Time when output will get saturated in fig. 4.33\n",
+ "\n",
+ "import math\n",
+ "#Variable declaration\n",
+ "R = 500.0*10**3 # Resistopr R\n",
+ "C = 10.0*10**-6 # feedback capacitor\n",
+ "V = -0.5 # V(t)\n",
+ "Vo = 12.0 # Saturation Voltage \n",
+ "#Calculations\n",
+ "Vout = -V/(R*C)\n",
+ "t = Vo/Vout\n",
+ "\n",
+ "#Result\n",
+ "print(\"Time duration required for saturation of output voltage = %d seconds\"%t)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Time duration required for saturation of output voltage = 120 seconds\n"
+ ]
+ }
+ ],
+ "prompt_number": 48
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 4.16, Page No.122"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# expression using op-amp\n",
+ "\n",
+ "import math\n",
+ "#Variable declaration\n",
+ "Cf = 10.0*10**-6 # feedback capacitor, assumed value\n",
+ "V1 = 1 # multiplication factor for input 1\n",
+ "V2 = 2 # multiplication factor for input 2\n",
+ "V3 = 5 # multiplication factor for input 3\n",
+ "\n",
+ "#Calculations\n",
+ "R1 = 1/(Cf*V1)\n",
+ "R2 = 1/(Cf*V2)\n",
+ "R3 = 1/(Cf*V3)\n",
+ "\n",
+ "#Result\n",
+ "print(\"R1 = %d k-ohm\\nR2 = %d k-ohm\\nR3 = %d k-ohm\\nCircuit will be ass show in fig. 4.35\"%(R1/1000,R2/1000,R3/1000))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "R1 = 100 k-ohm\n",
+ "R2 = 50 k-ohm\n",
+ "R3 = 20 k-ohm\n",
+ "Circuit will be ass show in fig. 4.35\n"
+ ]
+ }
+ ],
+ "prompt_number": 51
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 4.17, Page No. 129"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Practical differentiator\n",
+ "\n",
+ "import math\n",
+ "#Variable declaration\n",
+ "fmax = 150.0 # max frequency to be differentiate\n",
+ "C1 = 1*10**-6 # Capacitor C1, we choose\n",
+ "\n",
+ "#Calculations\n",
+ "fa =fmax\n",
+ "Rf = 1/(2*math.pi*fa*C1)\n",
+ "Rf = Rf/1000 # k-ohm\n",
+ "Rf = math.floor(Rf*100)/100\n",
+ "fb = 10*fa\n",
+ "R1 = 1/(2*math.pi*fb*C1)\n",
+ "R1 = math.floor(R1*10)/10\n",
+ "Cf = R1*C1/(Rf*10**3)\n",
+ "Rcomp = R1*Rf*10**3/(R1+Rf*10**3)\n",
+ "\n",
+ "#Result\n",
+ "print(\"R1 = %.1f ohm\\nC1 = %d uF\\nRf = %.2f k-ohm\\nCf = %.1f uF\\nRcomp = %.2f ohm\"%(R1,C1*10**6,Rf,Cf*10**6,math.floor(Rcomp*100)/100))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "R1 = 106.1 ohm\n",
+ "C1 = 1 uF\n",
+ "Rf = 1.06 k-ohm\n",
+ "Cf = 0.1 uF\n",
+ "Rcomp = 96.44 ohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 68
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 4.18, Page No.130"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# op-amp differentiator\n",
+ "\n",
+ "import math\n",
+ "#Variable declaration\n",
+ "Vm = 10*10**-6 # peak value of sine wave\n",
+ "fa = 2000.0 # maximum frequency\n",
+ "R = 50*10**3 # Resistor R \n",
+ "C = 2*10**-6 # Capacitor C\n",
+ "\n",
+ "\n",
+ "#Calculations\n",
+ "Vout = -R*C*Vm*2*math.pi*fa\n",
+ "\n",
+ "#Result\n",
+ "print(\"Vout = %f*cos(%d*pi*t) micro-V\"%(Vout,2*fa))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Vout = -0.012566*cos(4000*pi*t) micro-V\n"
+ ]
+ }
+ ],
+ "prompt_number": 73
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 4.19, Page No.130"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Differentiator design\n",
+ "\n",
+ "import math\n",
+ "#Variable declaration\n",
+ "V = 3.0 # input sine wave ampitude\n",
+ "f = 200.0 # input sine wave frequency\n",
+ "fa = 1000.0 # maximum input frequency\n",
+ "\n",
+ "#Calculations\n",
+ "C = 0.1*10**-6 #Assumed value\n",
+ "R = 1/(2*math.pi*fa*C)\n",
+ "R_1 = math.floor(R/100)*100\n",
+ "fb = 20*fa\n",
+ "R_dash = 1/(2*math.pi*fb*C)\n",
+ "R_dash_1 = 82*10**3 \n",
+ "C_dash = R_1*C/R_dash_1\n",
+ "Vout = -R_1*C*(V/2)*2*math.pi*f\n",
+ "\n",
+ "#Result\n",
+ "print(\"R = %.2f k-ohm = %.1f k-ohm(say)\\nRom = %.1f k-ohm\\nVout = %.4fcos(%d*pi*t)\"%(R/1000,R_1/1000,R_1/1000,Vout,f*2))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "R = 1.59 k-ohm = 1.5 k-ohm(say)\n",
+ "Rom = 1.5 k-ohm\n",
+ "Vout = -0.2827cos(400*pi*t)\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 4.20, Page No.142"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Instrumentation Amplifier (refer fig 4.64)\n",
+ "\n",
+ "import math\n",
+ "#Variable declaration\n",
+ "R1 = 200.0 # Resistor R1\n",
+ "R2 = 100.0 # Resistor R2\n",
+ "Rf = 100.0*10**3 # Feedback Resistor Rf\n",
+ "Rg_min = 100.0 # 100 ohm + 0 ohm\n",
+ "Rg_max = 100.0*10**3+100 # 100 ohm + 100 k-ohm\n",
+ "\n",
+ "\n",
+ "#Calculation\n",
+ "Gain1 = (1+(2*Rf/Rg_min))*(R2/R1)\n",
+ "Gain2 = (1+(2*Rf/Rg_max))*(R2/R1)\n",
+ "\n",
+ "#Result\n",
+ "print(\"For all practical purposes, the gain can be varied from %.1f to %.1f\"%(Gain2, Gain1))\n",
+ "#Answer for max gain is wrong in the book"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "For all practical purposes, the gain can be varied from 1.5 to 1000.5\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 4.21, Page No. 142"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Instrumentation Amplifier (refer fig 4.65)\n",
+ "\n",
+ "import math\n",
+ "#Variable declaration\n",
+ "R1 = 100.0*10**3 # Resistor R1\n",
+ "R2 = 100.0*10**3 # Resistor R2\n",
+ "Rf = 470.0*10**3 # Feedback Resistor Rf\n",
+ "Gain = 100.0 # Gain \n",
+ "\n",
+ "#Calculations\n",
+ "Rg = 2*Rf/((Gain*(R1/R2))-1)\n",
+ "\n",
+ "#Result\n",
+ "print(\" Rg = %.2f k-ohm\"%(Rg/1000))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " Rg = 9.49 k-ohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 4.22, Page No. 144"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Transducer Resistance\n",
+ "\n",
+ "import math\n",
+ "#Variable declaration\n",
+ "R = 100.0 # reference resistance of the transducer\n",
+ "alfa = 0.00392 # Alfa value\n",
+ "T1 = 25 # Temperature Value 1\n",
+ "T2 = 100 # Temperature Value 2\n",
+ "\n",
+ "#Calculations\n",
+ "R_25 = R*(1+alfa*T1)\n",
+ "R_100 = R*(1+alfa*T2)\n",
+ "\n",
+ "#Result\n",
+ "print(\"It can be seen that Delta_R is %.1f ohm for a change at %d\u00b0C\"%(R_25-R,T1))\n",
+ "print(\"while Delta_R is %.1f ohm for a change of %d\u00b0C.\"%(R_100-R,T2))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "It can be seen that Delta_R is 9.8 ohm for a change at 25\u00b0C\n",
+ "while Delta_R is 39.2 ohm for a change of 100\u00b0C.\n"
+ ]
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 4.23, Page No."
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# instrumentation amplifier design\n",
+ "\n",
+ "import math\n",
+ "#Variable declaration\n",
+ "P_min = 0 # minimum value of potentiometer\n",
+ "P_max = 50*10**3 # maximum value of potentiometer\n",
+ "G_min = 5.0 # minimum gain \n",
+ "G_max = 200.0 # maximum gain\n",
+ "\n",
+ "#Calculations\n",
+ "R3 = 1000.0 # assumed value\n",
+ "R4 = 1000.0 # resistor in series with potentiometer\n",
+ "x1 = (R4+P_min)/R3 \n",
+ "x2 = (R4+P_max)/R3 \n",
+ "y = ((G_min/x1)-1)/2 # R1/R2\n",
+ "R2 =10*10**3 # assumed value\n",
+ "R1 = R2*y\n",
+ "\n",
+ "#Result\n",
+ "print(\"R1 = %.0f k-ohm\\nR2 = %.0f k-ohm\\nR3 = %.0f k-ohm\\nR4 = %.0f k-ohm\\n\"%(R1/1000,R2/1000,R3/1000,R4/1000))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "R1 = 20 k-ohm\n",
+ "R2 = 10 k-ohm\n",
+ "R3 = 1 k-ohm\n",
+ "R4 = 1 k-ohm\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 15
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 4.24, Page No. 147"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print(\"Theoretical example\")"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Theoretical example\n"
+ ]
+ }
+ ],
+ "prompt_number": 16
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 4.25, Page No. 147"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Gain of instrumentation Amplifier(refer fig. 4.73)\n",
+ "\n",
+ "import math\n",
+ "#Variable declaration\n",
+ "Rf = 5.0 # Resistor Rf in k-ohm\n",
+ "Rg = 1.0 # Resistor Rg in k-ohm\n",
+ "R1 = 10.0 # Resistor R1 in k-ohm\n",
+ "R2 = 20.0 # Resistor R2 in k-ohm\n",
+ "\n",
+ "#Calculations\n",
+ "A = (1+(2*Rf/Rg))*(R2/R1)\n",
+ "\n",
+ "#Result\n",
+ "print(\"A = %d\"%A)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "A = 22\n"
+ ]
+ }
+ ],
+ "prompt_number": 17
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 4.26, Page No. 147"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# output voltage of the circuit (refer fig. 4.74)\n",
+ "\n",
+ "import math\n",
+ "#Variable declaration\n",
+ "R_A1 = 1000.0 # terminal resistor for op-amp A1\n",
+ "Rf_A1 = 5000.0 # feedback resistor for op-amp A1\n",
+ "R_A2 = 1000.0 # terminal resistor for op-amp A2\n",
+ "Rf_A2 = 2000.0 # feedback resistor for op-amp A2\n",
+ "Rcom_A2= 2000.0 # Rcom resistor for op-amp A2\n",
+ "V1 = 1.0 # input at terminal 1 of A1 in mV\n",
+ "V2 = 5.0 # 5*sin(wt)-->input at terminal 2 of A1 in mV\n",
+ "V3 = 5.0 # input at terminal 2 of A2\n",
+ "\n",
+ "#Calculations\n",
+ "Vin_1 = V1*(-Rf_A1/R_A1)\n",
+ "Vin_2 = V2*(-Rf_A1/R_A1)\n",
+ "Vout = Vin_1*(-Rf_A2/R_A2)+(1+Rf_A2/R_A2)*(Rcom_A2/(R_A2+Rcom_A2))*V3\n",
+ "Vout2 = Vin_2*(-Rf_A2/R_A2)\n",
+ "\n",
+ "#Result\n",
+ "print(\"Vout = %d + %d*sin(wt) mV\"%(Vout,Vout2))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Vout = 20 + 50*sin(wt) mV\n"
+ ]
+ }
+ ],
+ "prompt_number": 27
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 4.27, Page No. 148"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# output voltage of the circuit (refer fig. 4.75)\n",
+ "\n",
+ "\n",
+ "import math\n",
+ "#Variable declaration\n",
+ "Rf = 10.0 # Resistor Rf in k-ohm\n",
+ "Rg = 5.0 # Resistor Rg in k-ohm\n",
+ "R1 = 1.0 # Resistor R1 in k-ohm\n",
+ "R2 = 2.0 # Resistor R2 in k-ohm\n",
+ "Vin2 = 2.0 # input at non-inverting terminal of A2 in mV\n",
+ "Vin1 = 1.0 # input at non-inverting terminal of A1 in mV\n",
+ "\n",
+ "#Calculations\n",
+ "A = (1+(2*Rf/Rg))*(R2/R1)\n",
+ "Vout = A*(Vin2 - Vin1)\n",
+ "#Result\n",
+ "print(\"Vout = %d mV\"%Vout)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Vout = 10 mV\n"
+ ]
+ }
+ ],
+ "prompt_number": 28
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 4.28, Page No.148"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Determining the value of Rg\n",
+ "\n",
+ "import math\n",
+ "#Variable declaration\n",
+ "Rf = 15.0 # Resistor Rf in k-ohm\n",
+ "R1 = 1.0 # Resistor R1 in k-ohm\n",
+ "R2 = 2.0 # Resistor R2 in k-ohm\n",
+ "Vin2 = 5.0*10**-3 # input at non-inverting terminal of A2 \n",
+ "Vin1 = 2.0*10**-3 # input at non-inverting terminal of A1 \n",
+ "Vout = 3 # output voltage\n",
+ "\n",
+ "#Calculations\n",
+ "A = Vout/(Vin2-Vin1)\n",
+ "Rg = 2*Rf/((A*R1/R2)-1)\n",
+ "\n",
+ "#Result\n",
+ "print(\"Rg = %.2f ohm\"%(Rg*1000))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Rg = 60.12 ohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 31
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 4.29, Page No.149"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print(\"Theoretical example\")"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Theoretical example\n"
+ ]
+ }
+ ],
+ "prompt_number": 32
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 4.30, Page No.150"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print(\"Theoretical example\")"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Theoretical example\n"
+ ]
+ }
+ ],
+ "prompt_number": 33
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 4.31, Page No. 151"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# 3 op-amp instrumentation amplifier design\n",
+ "\n",
+ "import math\n",
+ "#Variable declaration\n",
+ "g = 1.0 # minimum gain required\n",
+ "G = 10000.0 # Maximum gain required\n",
+ "pot = 100.0 # potentiometer max value\n",
+ "#Calculations\n",
+ "A2 = 1.0/5.0 # Assumed gain of second stage\n",
+ "R1 = 100.0 # Resistor R1\n",
+ "R2 = R1*A2\n",
+ "x = ((G/A2)-1)/2 # Rf/Rgb\n",
+ "y = ((1/A2)-1)/2\n",
+ "Rgb = y*pot/(x-y)\n",
+ "Rf = x*Rgb\n",
+ "\n",
+ "#Result\n",
+ "print(\"R1 = %d k-ohm\\nR2 = %d k-ohm\\nRgb = %d ohm\\nRf = %d k-ohm\\n\"%(R1,R2,Rgb*1000,Rf))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "R1 = 100 k-ohm\n",
+ "R2 = 20 k-ohm\n",
+ "Rgb = 8 ohm\n",
+ "Rf = 200 k-ohm\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 42
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 4.32, Page No.168"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Value of the current flowing through the Resistor R(Refer fig. 4.106)\n",
+ "import math\n",
+ "#Variable declartion\n",
+ "R2 = 1000.0 # Resistor in series with R\n",
+ "Va = Vb = 5.0 # input voltage\n",
+ "\n",
+ "#Calculations\n",
+ "I = Vb/R2\n",
+ "\n",
+ "#Result\n",
+ "print(\"I = %d mA\"%(I*10**3))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "I = 5 mA\n"
+ ]
+ }
+ ],
+ "prompt_number": 43
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 4.33, Page No. 169"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Plot output waveform (refer fig 4.109)\n",
+ "##########-------PLOT--------#############\n",
+ "\n",
+ "\n",
+ "%matplotlib inline\n",
+ "import matplotlib.pyplot as plt\n",
+ "from numpy import arange,sin,pi\n",
+ "t = arange(0.0,1.0,0.01)\n",
+ "t1 = arange(0.0,3.0,0.01)\n",
+ "t2 = arange(0.0,1.0,0.01)\n",
+ "t3 = arange(-0.5,0.0,0.01)\n",
+ "t4 = arange(-1.0,0.0,0.01)\n",
+ "t5 = arange(0.0,0.5,0.01)\n",
+ "t6 = arange(1.0,2.0,0.01)\n",
+ "\n",
+ "plt.axis([0,2.0,-1.5,0.9])\n",
+ "plt.plot(t1,t1*0/t1,'b')\n",
+ "plt.plot(t,-t*1,'b')\n",
+ "plt.plot(t2,-t2*1/t2,'--')\n",
+ "plt.plot(t5,-t5*0.5/t5,'--')\n",
+ "plt.plot(t3*0.5/t3,t3,'--')\n",
+ "plt.plot(t4*1.0/t4,t4,'--')\n",
+ "plt.plot(t6,-t6*1/t6,'b')\n",
+ "plt.title(\"Output Voltage\")\n",
+ "plt.xlabel(\"Time(ms)\")\n",
+ "plt.ylabel(\"Vo(t)\")"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "metadata": {},
+ "output_type": "pyout",
+ "prompt_number": 65,
+ "text": [
+ "<matplotlib.text.Text at 0xb45df28>"
+ ]
+ },
+ {
+ "metadata": {},
+ "output_type": "display_data",
+ "png": "iVBORw0KGgoAAAANSUhEUgAAAY0AAAEZCAYAAABrUHmEAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3X1clfX9x/H3hfBzooS3cS8sEUElwAfTeiwUp4i3pGvl\nTW1401aZ1bZfpa01cbPSlY9Vs5y6th5p3szKoFSylceWyVhJN79soU0UQZg34V03Al2/P06cQEAv\n5MB1zuH1fDzOQ88533Px4XjJm+t8r8/3MkzTNAUAgAV+dhcAAPAehAYAwDJCAwBgGaEBALCM0AAA\nWEZoAAAsIzQADzZz5kw98MADdpcBuBAa8DrPPPOMEhMT1bVrV4WFhWnu3Lk6efKk5dfHxMTojTfe\ncFs9F9peWVmZAgIC9J///KfRc1OmTNE999xzwW0bhiHDMCRJDodDUVFRrS8YaAVCA15l2bJlWrBg\ngZYtW6ZTp06poKBABw8eVEZGhqqrqy1twzAMubOn9ULbi4iI0KhRo7RmzZoGj584cULbtm3TzJkz\nL7p9+m/hUUzAS5w8edLs1q2buWnTpgaPnzlzxuzTp4/5l7/8xTRN08zOzjZ//etfu57fsWOHGRkZ\naZqmad50002mn5+f2aVLF7Nbt27mI488Yh44cMA0DMNctWqVGR4eboaFhZmPPvqo6/Ut3d751q1b\nZ/br16/BY08++aQ5ZMgQ0zRNc+/eveaIESPM7t27m4MGDTLz8vJc42bOnGk+8MAD5tmzZ83vfOc7\npp+fn9mtWzczKCjIPHLkiPnPf/7TvOqqq8zu3bubYWFh5rx588xz5865Xv/qq6+acXFxZnBwsDl3\n7lxz+PDh5p///GfX808//bSZkJBg9ujRw8zMzDQPHjxo8V8DHRVHGvAab7/9tr788kv98Ic/bPB4\n165dNX78eL322muSGn6kc741a9aob9++euWVV3T69GndfffdruccDof279+v7du3a+nSpXr99ddb\ntb06kydP1rFjx7Rr164Gr8vOzlZ1dbUmTZqksWPH6ujRo/rjH/+oG2+8UcXFxa6xpmkqMDBQ+fn5\nCg8P1+nTp3Xq1CmFhobK399fjz/+uI4fP67du3fr9ddf11NPPSVJOnbsmK6//notXbpUJ06c0IAB\nA7R7927X95Kbm6uHH35Ymzdv1rFjx5SWlqbp06df9N8BHRuhAa9x7Ngx9e7dW35+jXfb0NBQHT9+\n3HXfvISPdBYuXKguXbpo8ODBmjVrltavX9+q7dXp0qWLrr/+ej377LOSpH379mnPnj2aMWOGCgoK\ndPbsWS1YsED+/v4aOXKkJk6c2OBrX6iGIUOGaOjQofLz81N0dLR+9rOfaefOnZKkrVu3avDgwZo8\nebL8/Px05513KjQ01PXaP/3pT7rvvvs0YMAA+fn56b777tN7772n0tLSS/5e4fsIDXiN3r1769ix\nY/r6668bPXfkyBH17t27VduvP8nct29flZeXt2p79WVnZ2vTpk366quvtGbNGo0dO1a9e/dWeXl5\no8nt6Ohoy1+7uLhYEydOVFhYmIKDg3X//fe7wrO8vFyRkZENxte/f/DgQd11113q0aOHevTooV69\neklyTt4DzSE04DWuvvpqde7cWS+88EKDx8+cOaP8/HyNGjVKkvPjqs8//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uvvtuXXnllRo3bpxqamok\nSe+++67S09OVmpqqsWPHqqKiQpKUm5ur0aNHu75GTEyMfvWrXyklJUWpqanas2ePxowZo9jYWFdn\n/pEjRzR8+HClpKQoMTFRb731liTnsg90QcMuhAZg0YEDB7Rjxw7l5eXppptuUkZGhj744AN16dJF\nW7ZsUXV1te644w698MILeueddzRr1izdf//9kqS33npLqamprm0ZhqHo6GgVFRVp+PDhmjlzpjZv\n3qyCggItXLhQkrRu3TqNHTtWRUVF+uCDD1zXRQgJCdGxY8d09uzZ9n8T0OF5xdpTgN0Mw9C4cePU\nqVMnDR48WF9//bUyMzMlSYmJiSopKVFxcbE++ugj1xFFbW2twsPDJUmHDh1SWFhYg23WLRKZmJio\ns2fPqmvXruratas6d+6sU6dOaejQoZo9e7aqq6s1efJkJSUluV4bEhKi0tJSxcfHt8e3D7hwpAFY\n9D//8z+SJD8/PwUEBLge9/PzU01NjUzT1KBBg1RUVOQ6OsjPz3eN+/rrrxtsr3Pnzq7X1227/vbS\n0tL0j3/8QxEREZo5c6bWrFnjGmOaJtfkgC0IDcACK+eLDBgwQEePHlVBQYEk53UM6q4qFx0d7Zrf\nsLrtQ4cOqU+fPrr55pt18803a8+ePa7nKisrG10DBWgPhAZwnrrf4A3DaPLv9cfUvx8QEKDnn39e\n8+fPV3JyslJSUrR7925J0jXXXKN33nmnydc3t22Hw6Hk5GQNGTJEf/vb31zXQ6ioqFCvXr3UtWtX\nd37bgCU2WanbAAAAbElEQVSccgu0gzNnzmjkyJH617/+1eptrVq1SmfPntUvfvELN1QGtAxHGkA7\n6Natm0aOHKkdO3a0elsbN27UT3/6UzdUBbQcRxoAAMs40gAAWEZoAAAsIzQAAJYRGgAAywgNAIBl\nhAYAwLL/B1H2SzVu3JHjAAAAAElFTkSuQmCC\n",
+ "text": [
+ "<matplotlib.figure.Figure at 0xa538080>"
+ ]
+ }
+ ],
+ "prompt_number": 65
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 3.34, Page No. 170"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print(\"Theoretical example\")"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Theoretical example\n"
+ ]
+ }
+ ],
+ "prompt_number": 66
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 3.35, Page No. 170"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# output of circuit in fig. 4.111\n",
+ "\n",
+ "import math\n",
+ "#Variable declaration\n",
+ "R1 = 1.0 # Resistance to inverting terminal\n",
+ "R2 = 2.0 # Resistance to non-inverting terminal\n",
+ "Rf = 10.0 # Feedback resistance\n",
+ "Rcom = 1.0 # Resistance Rcom\n",
+ "V1 = 2.0 # input voltage at inverting terminal \n",
+ "V2 = 5.0 # input voltage at non-inverting terminal \n",
+ "\n",
+ "#Calculations\n",
+ "Vo1 = -Rf*V1/R1\n",
+ "Vb = V2*Rcom/(R2+Rcom)\n",
+ "Vo2 = (1+(Rf/R1))*Vb\n",
+ "Vout = Vo1+Vo2\n",
+ "\n",
+ "#Result\n",
+ "print(\"Vo = %.3f V\"%Vout)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Vo = -1.667 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 67
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 4.36, Page No. 170"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Output voltage of circuit shown in fig. 4.114\n",
+ "\n",
+ "import math\n",
+ "#Variable declaration\n",
+ "Rf = 10.0 # Resistor Rf in k-ohm\n",
+ "R1 = 5.0 # Resistor R1 in k-ohm\n",
+ "R2 = 4.0 # Resistor R2 in k-ohm\n",
+ "R3 = 2.0 # Resistor R3 in k-ohm\n",
+ "V1 = 5.0 # input 1\n",
+ "V2 = 2.0 # input 2\n",
+ "V3 = 3.0 # input 3\n",
+ "\n",
+ "#Calculations\n",
+ "Vout = -((Rf*V1/R1)+(Rf*V2/R2)+(Rf*V3/R3))\n",
+ "\n",
+ "#Result\n",
+ "print(\"Vout = %d V\"%Vout)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Vout = -30 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 69
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 4.37, Page No. 171"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# output Voltage of circuit in fig. 4.116\n",
+ "\n",
+ "import math\n",
+ "#Variable declaration\n",
+ "R1 = 2.0 # Resistance to inverting terminal\n",
+ "R2 = 1.0 # Resistance to non-inverting terminal\n",
+ "Rf = 4.0 # Feedback resistance\n",
+ "Rcom = 1.0 # Resistance Rcom\n",
+ "V1 = 2.0 # input voltage at non-inverting terminal \n",
+ "V2 = 4.0 # input voltage at non-inverting terminal \n",
+ "\n",
+ "#Calculations\n",
+ "Vb1 = V2*R2/(R2+Rcom)\n",
+ "Vo1 = (1+(Rf/R1))*Vb1\n",
+ "Vb2 = V1*R2/(R2+Rcom)\n",
+ "Vo2 = (1+(Rf/R1))*Vb2\n",
+ "Vout = Vo1+Vo2\n",
+ "\n",
+ "#Result\n",
+ "print(\"Vo = %d V\"%Vout)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Vo = 9 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 72
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 4.39, Page No. 171"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# output of differential amplifier\n",
+ "\n",
+ "import math\n",
+ "#Variable declaration\n",
+ "V1 = 1.0*10**-3 # input voltage 1 \n",
+ "V2 = 2.0*10**-3 # input voltage 2 \n",
+ "Ad = 5000.0 # differential gain\n",
+ "CMRR = 1000.0 # Common Mode Rejection Ratio\n",
+ "\n",
+ "#Calculations\n",
+ "Ac = Ad/CMRR\n",
+ "Vd = (V1-V2)\n",
+ "Vc = (V1+V2)/2\n",
+ "Vout = Ac*Vc+Ad*Vd\n",
+ "\n",
+ "#Result\n",
+ "print(\"Vo = %.4f V\"%Vout)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Vo = -4.9925 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 77
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 4.40, Page No. 172"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# output Voltage of circuit in fig. 4.116\n",
+ "\n",
+ "import math\n",
+ "#Variable declaration\n",
+ "R1 = 40.0 # Resistance to inverting terminal\n",
+ "R2 = 25.0 # Resistance to inverting terminal\n",
+ "Rf = 50.0 # Feedback resistance\n",
+ "R3 = 10.0 # Resistance to non-inverting terminal\n",
+ "R4 = 20.0 # Resistance to non-inverting terminal\n",
+ "Rcom = 30.0 # Resistance Rcom\n",
+ "V1 = 1.0 # input voltage at inverting terminal \n",
+ "V2 = 2.0 # input voltage at inverting terminal \n",
+ "V3 = 3.0 # input voltage at non-inverting terminal \n",
+ "V4 = 4.0 # input voltage at non-inverting terminal \n",
+ "\n",
+ "#Calculations\n",
+ "# (i)\n",
+ "Vo1 = -(Rf/R1)*V1\n",
+ "# (ii)\n",
+ "Vo2 = -(Rf/R2)*V2\n",
+ "# (iii)\n",
+ "R1 = R1*R2/(R1+R2)\n",
+ "Vb3 = V3*(Rcom*R4/(Rcom+R4))/(R3+(Rcom*R4/(Rcom+R4)))\n",
+ "Vo3 = (1+(Rf/R1))*Vb3\n",
+ "Vo3 = math.floor(Vo3*10**4)/10**4\n",
+ "# (iv)\n",
+ "Vb4 = V4*(Rcom*R3/(Rcom+R3))/(R4+(Rcom*R3/(Rcom+R3)))\n",
+ "Vo4 = (1+(Rf/R1))*Vb4\n",
+ "Vo4 = math.floor(Vo4*10**4)/10**4\n",
+ "\n",
+ "Vout = Vo1+Vo2+Vo3+Vo4\n",
+ "\n",
+ "#Result\n",
+ "print(\"Vo = %.4f V\"%Vout)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Vo = 6.3408 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 90
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Op-amp_and_linear_integrated_circuits_/Chapter_5.ipynb b/Op-amp_and_linear_integrated_circuits_/Chapter_5.ipynb new file mode 100755 index 00000000..72b0a450 --- /dev/null +++ b/Op-amp_and_linear_integrated_circuits_/Chapter_5.ipynb @@ -0,0 +1,1070 @@ +{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 5 : Waveform Generator"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 5.1, Page No.186"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Astable multivibrator using IC555\n",
+ "\n",
+ "import math\n",
+ "#Variable declaration\n",
+ "C = 0.01*10**-6 # capacitance\n",
+ "RA = 2*10**3 # Resistance RA\n",
+ "RB = 100*10**3 # Resistance RB\n",
+ "\n",
+ "#Calculations\n",
+ "T_high = 0.693*(RA+RB)*C\n",
+ "T_low = 0.693*RB*C\n",
+ "T= T_high+T_low\n",
+ "f = 1/T\n",
+ "D = T_high*100/T\n",
+ "\n",
+ "#Result\n",
+ "print(\"Frequency of oscillations, f = %.1f Hz\\nDuty cycle = %.1f%%\"%(f,D))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Frequency of oscillations, f = 714.4 Hz\n",
+ "Duty cycle = 50.5%\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 5.2, Page No.186"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Astable multivibrator using IC555\n",
+ "\n",
+ "import math\n",
+ "#Variable declaration\n",
+ "C = 1.0*10**-6 # capacitance \n",
+ "C1 = 0.01*10**-6 # capacitance C1\n",
+ "RA = 4.7*10**3 # Resistance RA\n",
+ "RB = 1.0*10**3 # Resistance RB\n",
+ "\n",
+ "#Calculations\n",
+ "Ton = 0.693*(RA+RB)*C\n",
+ "Toff = 0.693*RB*C\n",
+ "T= T_high+T_low\n",
+ "f = 1.4/((RA+2*RB)*C)\n",
+ "D = (RA+RB)*100/((RA+2*RB))\n",
+ "\n",
+ "#Result\n",
+ "print(\"T_on = %.2f ms\\nT_off = %.3f ms\"%(Ton*1000,Toff*1000))\n",
+ "print(\"Frequency of oscillations, f = %.1f Hz\\nDuty cycle = %.0f%%\"%(math.floor(f*10)/10,D))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "T_on = 3.95 ms\n",
+ "T_off = 0.693 ms\n",
+ "Frequency of oscillations, f = 208.9 Hz\n",
+ "Duty cycle = 85%\n"
+ ]
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 5.3, Page No. 187"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Astable multivibrator using IC555\n",
+ "\n",
+ "import math\n",
+ "#Variable declaration\n",
+ "f = 1000.0 # frequency\n",
+ "d = 50.0/100.0 # duty cycle\n",
+ "C = 0.01*10**-6 # capacitance\n",
+ "\n",
+ "#Calculations\n",
+ "T = 1/f\n",
+ "Ton = d*T\n",
+ "Toff = d*T\n",
+ "RA = 1.44/(2*f*C)\n",
+ "\n",
+ "#Result\n",
+ "print(\"RA = RB = %.0f k-ohm\"%(RA/1000))\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "RA = RB = 72 k-ohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 5.4, Page No. 187"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# IC555 timer as an astable multivibrator\n",
+ "\n",
+ "import math\n",
+ "# Variable declaration\n",
+ "f = 700.0 # frequency\n",
+ "d = 0.5 # duty cycle\n",
+ "C = 0.01*10**-6 # capacitor value assumed\n",
+ "\n",
+ "#Calculations\n",
+ "Ra = 1.44/(2*f*C)\n",
+ "\n",
+ "#Result\n",
+ "print(\"C = %.2f micro-F\\nRA = RB = %.0f k-ohm (100 k-ohm standard value)\"%(C*10**6,Ra/1000))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "C = 0.01 micro-F\n",
+ "RA = RB = 103 k-ohm (100 k-ohm standard value)\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 5.5, Page No. 188"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# IC555 timer as an astable multivibrator\n",
+ "\n",
+ "import math\n",
+ "# Variable declaration\n",
+ "f = 800.0 # frequency\n",
+ "d = 0.6 # duty cycle\n",
+ "C = 0.01*10**-6 # capacitor value assumed\n",
+ "\n",
+ "#Calculations\n",
+ "Ra = 1.44/(5*f*C) # since Rb = 2Ra and f = 1.44/(Ra+2Rb)*C\n",
+ "Rb = 2*Ra\n",
+ "\n",
+ "\n",
+ "#Result\n",
+ "print(\"C = %.2f micro-F\\nRA = %.0f k-ohm\\nRB = %.0f k-ohm\"%(C*10**6,Ra/1000,Rb/1000))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "C = 0.01 micro-F\n",
+ "RA = 36 k-ohm\n",
+ "RB = 72 k-ohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 5.6, Page No. 189"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Timer design(refer fig. 5.11)\n",
+ "\n",
+ "import math\n",
+ "# Variable declaration\n",
+ "Ton = 5.0 # On timing oof the timer\n",
+ "\n",
+ "# Calculations\n",
+ "C = 10*10**-6 # assumed value\n",
+ "R = Ton/(1.1*C)\n",
+ "\n",
+ "#Result\n",
+ "print(\"C = %.0f micro-F\\nR = %.2f ohm\"%(C*10**6,R))\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "C = 10 micro-F\n",
+ "R = 454545.45 ohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 5.7, Page No. 189"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Design of astable multivibrator(refer fig. 5.12)\n",
+ "\n",
+ "import math\n",
+ "#Variable declaration\n",
+ "Ton = 3.0 # ON time\n",
+ "Toff = 1.0 # OFF time\n",
+ "\n",
+ "#Calculations\n",
+ "C = 10*10**-6 # Capacitor assumed value\n",
+ "R2 = Toff/(0.693*C)\n",
+ "R1 = (Ton/(0.693*C))-R2\n",
+ "\n",
+ "\n",
+ "#Result\n",
+ "print(\"C = %.0f micro-F\\nR1 = %.0f ohm\\nR2 = %.0f ohm\"%(C*10**6,R1,R2))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "C = 10 micro-F\n",
+ "R1 = 288600 ohm\n",
+ "R2 = 144300 ohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 19
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 5.8, Page No.190"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Monostable and astable mode of IC555\n",
+ "\n",
+ "import math\n",
+ "#Variable declaration\n",
+ "Ton = 10*10**-3 # ON timing\n",
+ "C = 0.22*10**-6 # Capacitance\n",
+ "V = 1.4 # LED voltage drop\n",
+ "I = 20*10**-3 # current provided by circuit\n",
+ "f = 1000.0 # frequency of astable multivibrator\n",
+ "d = 0.95 # duty cycle of astable multivibrator\n",
+ "\n",
+ "\n",
+ "#calculations\n",
+ "R = Ton/(1.1*C)\n",
+ "R = math.ceil(R/100)/10\n",
+ "Vcc = 15.0 # standard, assumed\n",
+ "Vbe = 0.7 # standard, assumed\n",
+ "VECsat = 0.2 # standard, assumed\n",
+ "Vo = Vcc -2*Vbe-VECsat\n",
+ "Rled = (Vo-V)/I\n",
+ "\n",
+ "C1 = 0.01*10**-6 # capacitor for noise immunity\n",
+ "x = 1.44/(f*C1) # x = R1+2*R2.......(i)\n",
+ "y = (1-d)/(d*2-1) # y = R2/R1.........(ii)\n",
+ "y = math.floor(y*10**4)/10**4\n",
+ "R1 = x/(1+2*y) # using (i) and (ii)\n",
+ "R2 = y*R1\n",
+ "\n",
+ "#Result\n",
+ "print(\"For LED driving circuit:\\nCapacitance = %.2f micro-F\\nResistancce = %.1f ohm\\nVo = %.1f V\\nRled = %.0f ohm\"%(C*10**6,R,Vo,Rled))\n",
+ "print(\"\\nFor astable multivibrator:\\nC = %.2f micro-F\\nR1 = %.1f ohm\\nR2 = %.2f ohm\"%(C1*10**6,R1/1000,R2/1000))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "For LED driving circuit:\n",
+ "Capacitance = 0.22 micro-F\n",
+ "Resistancce = 41.4 ohm\n",
+ "Vo = 13.4 V\n",
+ "Rled = 600 ohm\n",
+ "\n",
+ "For astable multivibrator:\n",
+ "C = 0.01 micro-F\n",
+ "R1 = 129.6 ohm\n",
+ "R2 = 7.19 ohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 5.9, Page No. 191"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# IC555 as a monostable multivibrator(refer fig. 5.15)\n",
+ "\n",
+ "import math\n",
+ "#VAriable declaration\n",
+ "T = 5*10**-3 # output pulse width\n",
+ "\n",
+ "\n",
+ "#Calculations\n",
+ "C = 0.1*10**-6 # capacitance\n",
+ "R = T/(1.1*C)\n",
+ "\n",
+ "#Result\n",
+ "print(\"R = %.2f k-ohm\\nThe value of R should be less than 100 k-ohm, as obtained.\"%(R/1000))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "R = 45.45 k-ohm\n",
+ "The value of R should be less than 100 k-ohm, as obtained.\n"
+ ]
+ }
+ ],
+ "prompt_number": 15
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 5.10, Page No. 191"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# IC555 based square wave generator\n",
+ "\n",
+ "import math\n",
+ "#Variable declaration\n",
+ "f = 1000.0 # required frequency\n",
+ "Vcc = 12.0 # input voltage\n",
+ "\n",
+ "#Calculations\n",
+ "T = 1/f\n",
+ "Td = T/2\n",
+ "C = 0.1*10**-6 # assumed\n",
+ "R2 = Td/(0.69*C)\n",
+ "\n",
+ "#Result\n",
+ "print(\"R2 = %.2f k-ohm\\nR1 = 100 ohm + 10 k-ohm pot(With pot, precise squre wave can be obtained)\"%(R2/1000))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "R2 = 7.25 k-ohm\n",
+ "R1 = 100 ohm + 10 k-ohm pot(With pot, precise squre wave can be obtained)\n"
+ ]
+ }
+ ],
+ "prompt_number": 18
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 5.11, Page No. 192"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Clock with 50% duty cycle\n",
+ "\n",
+ "import math\n",
+ "# Variable declaration\n",
+ "f = 2000.0 # required output frequency \n",
+ "\n",
+ "#Calculations\n",
+ "T = 1/f\n",
+ "Td = T/2\n",
+ "C = 0.1*10**-6 # assumed\n",
+ "R2 = Td/(0.69*C)\n",
+ "\n",
+ "#Result\n",
+ "print(\"R1 = R2 = %.3f k-ohm\"%(R2/1000))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "R1 = R2 = 3.623 k-ohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 21
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 5.12, Page No.193"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Rectangular waveform using astable multivibrator\n",
+ "\n",
+ "import math\n",
+ "# Variable declaration\n",
+ "T = 1.0*10**-3 # Total time period of output waveform\n",
+ "Ton = 0.6 *10**-3 # Ton time\n",
+ "\n",
+ "\n",
+ "#Calculations\n",
+ "D = Ton/T\n",
+ "x = (1-D)/(2*D-1) # Rb/Ra\n",
+ "f = 1/T\n",
+ "C = 0.1*10**-6 # assumed\n",
+ "Ra = (1.44/(f*C))/5\n",
+ "Rb = x*Ra\n",
+ "\n",
+ "#Result\n",
+ "print(\"C = %.2f micro-F\\nRa = %.2f k-ohm\\nRb = %.2f k-ohm\"%(C*10**6,Ra/1000,Rb/1000))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "C = 0.10 micro-F\n",
+ "Ra = 2.88 k-ohm\n",
+ "Rb = 5.76 k-ohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 26
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 5.13, Page No.195"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# 555 timer in astable mode\n",
+ "\n",
+ "import math\n",
+ "# Variable declaration\n",
+ "Ra = 4.0*10**3 # Resistance Ra\n",
+ "Rb = 4.0*10**3 # Resistance Rb\n",
+ "C = 0.01*10**-6 # Capacitance\n",
+ "\n",
+ "#Calculations\n",
+ "f = 1.44/((Ra+2*Rb)*C)\n",
+ "D = (Ra+Rb)/(Ra+2*Rb)\n",
+ "\n",
+ "#Result\n",
+ "print(\"frequency = %.0f KHz\\nDuty cycle = %.2f%%\"%(f/1000,D*100))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "frequency = 12 KHz\n",
+ "Duty cycle = 66.67%\n"
+ ]
+ }
+ ],
+ "prompt_number": 34
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 5.14, Page No. 195"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Timer design\n",
+ "\n",
+ "import math\n",
+ "# Variable declaration\n",
+ "Ton = 5 # ON time width\n",
+ "\n",
+ "# Calculations\n",
+ "C = 10*10**-6 # assumed\n",
+ "R = Ton/(1.1*C)\n",
+ "\n",
+ "#Result\n",
+ "print(\"R = %.2f k-ohm\"%(R/1000))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "R = 454.55 k-ohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 37
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 5.15, Page No.196"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Astable multivibrator\n",
+ "\n",
+ "import math\n",
+ "#Variable declaration\n",
+ "f = 2000.0 # output frequency\n",
+ "D = 0.75 # duty cycle\n",
+ "\n",
+ "\n",
+ "#Calculations\n",
+ "x = (1-D)/(2*D-1) # Rb/Ra\n",
+ "C = 0.1 *10**-6 # assumed\n",
+ "Ra = (1.44/f)/(C*2)\n",
+ "Rb = x*Ra\n",
+ "\n",
+ "#Result\n",
+ "print(\"C = %.1f micro-F\\nRa = %.1f k-ohm\\nRb = %.1f k-ohm\"%(C*10**6,Ra/1000,Rb/1000))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "C = 0.1 micro-F\n",
+ "Ra = 3.6 k-ohm\n",
+ "Rb = 1.8 k-ohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 42
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 5.16, Page No.197"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# 555 as astable mode to generate square wave(refer fig.5.25)\n",
+ "\n",
+ "import math\n",
+ "# Variable declarations\n",
+ "f = 1000.0 # output square wave frequency\n",
+ "Vo = 5.0 # output voltage\n",
+ "Ton = 0.5*10**-3 # ON time of suare wave\n",
+ "Toff= 0.5*10**-3 # OFF time of suare wave\n",
+ "Vl = 5.0 # Lamp voltage rating\n",
+ "Il = 50*10**-3 # lamp current rating\n",
+ "\n",
+ "#Calculations\n",
+ "C = 0.1*10**-6 # capacitance, assumed\n",
+ "Rb = Toff/(0.69*C)\n",
+ "Rb = Rb/1000.0 #k-ohm\n",
+ "VLed = 0.7 # voltage drop accross LED\n",
+ "R =(Vo-VLed)/(Il)\n",
+ "R = 100 #standard value \n",
+ "P = (Il**2)*R\n",
+ "\n",
+ "# Result\n",
+ "print(\"duty cycle is 50%% hence,\\nRa = Rb = %.3f k-ohm\\nCurrent limiting Resistance for LED is, R = %.0f ohm\\nP = %.2f W\"%(Rb,R,P))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "duty cycle is 50% hence,\n",
+ "Ra = Rb = 7.246 k-ohm\n",
+ "Current limiting Resistance for LED is, R = 100 ohm\n",
+ "P = 0.25 W\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 5.17, Page No. 199"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Ramp generator using IC555\n",
+ "\n",
+ "import math\n",
+ "#Variable declaration\n",
+ "f = 5000.0 # output frequency\n",
+ "Vcc = 5.0 # input voltage\n",
+ "\n",
+ "\n",
+ "# Calculations\n",
+ "Vd = 0.7 # = Vbe, assumed \n",
+ "Ic = (Vcc-Vd)\n",
+ "RC = 3*Ic/(Vcc*f)\n",
+ "C = 0.05*10**-6 # assumed\n",
+ "R = RC/C\n",
+ "Ic = Ic/R\n",
+ "\n",
+ "#Result\n",
+ "print(\"C = %.2f micro-F\\nR = %.2f k-ohm\\nIc = %.3f mA\"%(C*10**6,R/1000,math.floor(Ic*10**6)/1000))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "C = 0.05 micro-F\n",
+ "R = 10.32 k-ohm\n",
+ "Ic = 0.416 mA\n"
+ ]
+ }
+ ],
+ "prompt_number": 16
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 5.18, Page No.205"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Triangular wave generator\n",
+ "\n",
+ "import math\n",
+ "#Variable declaration\n",
+ "f = 5000.0 # output frequency \n",
+ "Vo = 10.5 # output voltage\n",
+ "Vsat = 15 # saturation voltage\n",
+ "\n",
+ "\n",
+ "#Calculations\n",
+ "x = 2*Vsat/Vo # R3/R2:: this value is wrong in the book\n",
+ "R2 = 10*10**3 # assumed\n",
+ "R3 = 4*R2 # calculationg using value given in book\n",
+ "C1 = 0.01*10**-6 # assumed\n",
+ "R1 = R3/(4*C1*R2*f)\n",
+ "\n",
+ "\n",
+ "#Result\n",
+ "print(\"C1 = %.2f micro-F\\nR1 = %.0f k-ohm\\nR2 = %.0f k-ohm\\nR3 = %.0f k-ohm\"%(C*10**6,R1/1000,R2/1000,R3/1000))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "C1 = 0.05 micro-F\n",
+ "R1 = 20 k-ohm\n",
+ "R2 = 10 k-ohm\n",
+ "R3 = 40 k-ohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 22
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "exxample 5.19, Page No. 213"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print(\"Theoretical example\")"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Theoretical example\n"
+ ]
+ }
+ ],
+ "prompt_number": 23
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "exxample 5.20, Page No. 220"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print(\"Theoretical example\")"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Theoretical example\n"
+ ]
+ }
+ ],
+ "prompt_number": 24
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "exxample 5.21, Page No.221"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Oscillation frequency(refer fig 5.21)\n",
+ "\n",
+ "import math\n",
+ "#Variable declaration\n",
+ "R = 5.1*10**3 # resistance\n",
+ "C = 0.001*10**-6 # capacitance\n",
+ "R3 = 6.0*10**3 # Resistance of R3\n",
+ "R4 = 2.0*10**3 # Resistance of R4\n",
+ "\n",
+ "#Calculations\n",
+ "A = 1+(R3/R4)\n",
+ "f = 1/(2*math.pi*R*C)\n",
+ "\n",
+ "#Result\n",
+ "print(\"A = %d\\nAs A > 3, this satisfies the required oscillating condition. Hence, Circuit will work as oscillator.\\n\"%(A))\n",
+ "print(\"frequency of oscillations = %.4f kHz\"%(f/1000))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "A = 4\n",
+ "As A > 3, this satisfies the required oscillating condition. Hence, Circuit will work as oscillator.\n",
+ "\n",
+ "frequency of oscillations = 31.2069 kHz\n"
+ ]
+ }
+ ],
+ "prompt_number": 31
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 5.22, Page No. 221"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# design of wein bridge oscillator(refer fig.5.58)\n",
+ "\n",
+ "import math\n",
+ "# Variable declaration\n",
+ "f = 1000.0 # frequency of oscillation\n",
+ "V = 15 # supply voltage\n",
+ "g = 3 # gain of non-inverting op-amp for circuit to be oscillator \n",
+ "\n",
+ "#Calculations \n",
+ "C = 0.05*10**-6 # assumed\n",
+ "R = 1/(2*math.pi*C*f)\n",
+ "R4 = 10*10**3 # assumed\n",
+ "R3 = (g-1)*R4\n",
+ "\n",
+ "#Result\n",
+ "print(\"C1 = C2 = C = %.2f micro-F\\nR1 = R2 = R = %.3f k-ohm\\nR3 = %.0f k-ohm\\nR4 = %.0f k-ohm\"%(C*10**6,R/1000,R3/1000,R4/1000))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "C1 = C2 = C = 0.05 micro-F\n",
+ "R1 = R2 = R = 3.183 k-ohm\n",
+ "R3 = 20 k-ohm\n",
+ "R4 = 10 k-ohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 35
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 5.23, Page No. 225"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# output frequency range\n",
+ "\n",
+ "import math\n",
+ "#Variable declararion\n",
+ "R = 10*10**3 # Resistor R\n",
+ "C = 1.25*10**-9 # Capacitance\n",
+ "Vut = 10.0 # Upper threshold voltage\n",
+ "Vlt = 0.0 # lower threshold voltage\n",
+ "Vmin = 10*10**-3 # minimum voltage \n",
+ "Vmax = 10 # Maximum voltage \n",
+ "\n",
+ "#Calculations\n",
+ "Kv = 1/(8*R*C*(Vut-Vlt))\n",
+ "fmin = Vmin*Kv\n",
+ "fmax = Vmax*Kv\n",
+ "\n",
+ "#Result\n",
+ "print(\"Range over whoich output frequency can be varied is %.0f Hz to %.0f KHz.\"%(fmin,fmax/1000))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Range over whoich output frequency can be varied is 10 Hz to 10 KHz.\n"
+ ]
+ }
+ ],
+ "prompt_number": 38
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 5.24, Page No. 229"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# output frequency(refer fig. 5.67 and 5.68)\n",
+ "\n",
+ "import math\n",
+ "# Variable declaration\n",
+ "V = 10 # supply voltage\n",
+ "R1 = 10*10**3 # Resistor R1\n",
+ "R2 = 1.2*10**3 # Resistor R2\n",
+ "R3 = 10*10**3 # Resistor R3\n",
+ "C1 = 0.001*10**-6 # Capacitance\n",
+ "Vc1 = 7.7 # Voltage at pin 5\n",
+ "Vc2 = 9.5 # Voltage at pin 5\n",
+ "\n",
+ "#Calcualtions\n",
+ "# (a)\n",
+ "Vc = R3*V/(R2+R3)\n",
+ "Vc = math.floor(Vc*1000)/1000\n",
+ "fo = 2*(V-Vc)/(C1*R1*V) \n",
+ "fo = fo/1000 # kHz\n",
+ "# (b)\n",
+ "fo1 = 2*(V-Vc1)/(C1*R1*V)\n",
+ "fo1 = fo1/1000\n",
+ "fo2 = 2*(V-Vc2)/(C1*R1*V)\n",
+ "fo2 = fo2/1000\n",
+ "\n",
+ "#Result\n",
+ "print(\"(a)\\nVc = %.3f V\\nfo = %.2f kHz\\n\\n(b)\\nfo1 = %.0f kHz\\nfo2 = %.0f kHz\\nChange in frequency is %.0f kHz\"%(Vc,fo,fo1,fo2,fo1-fo2))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a)\n",
+ "Vc = 8.928 V\n",
+ "fo = 21.44 kHz\n",
+ "\n",
+ "(b)\n",
+ "fo1 = 46 kHz\n",
+ "fo2 = 10 kHz\n",
+ "Change in frequency is 36 kHz\n"
+ ]
+ }
+ ],
+ "prompt_number": 48
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Op-amp_and_linear_integrated_circuits_/Chapter_6.ipynb b/Op-amp_and_linear_integrated_circuits_/Chapter_6.ipynb new file mode 100755 index 00000000..3aa928b8 --- /dev/null +++ b/Op-amp_and_linear_integrated_circuits_/Chapter_6.ipynb @@ -0,0 +1,117 @@ +{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 6: Digitally Controlled Frequency Synthesizers : PLLs"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 6.1, Page No. 247"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# PLL circuit parameters(refere fig. 6.13)\n",
+ "\n",
+ "import math\n",
+ "#Variable declaration\n",
+ "Ct = 0.005 *10**-6 # external capacitor for VCO\n",
+ "Rt = 10*10**3 # external resistance for VCO\n",
+ "V = 20.0 # supply voltage(V_positive - V_negative) \n",
+ "C = 10*10**-6 # capacitance\n",
+ "\n",
+ "#Calculations\n",
+ "#(i)\n",
+ "fout = 0.25/(Rt*Ct)\n",
+ "\n",
+ "#(ii)\n",
+ "fL = 8*fout/V\n",
+ "\n",
+ "#(iii)\n",
+ "fC = fL/(2*math.pi*3.6*10**3*C)\n",
+ "fC = math.sqrt(fC)\n",
+ "\n",
+ "#in kHz\n",
+ "fout = fout/10**3\n",
+ "fL = fL/10**3\n",
+ "\n",
+ "#Result\n",
+ "print(\"(i)free running frequency, fout = %.0fkHz\\n(ii)Lock range, fL = +/-%.0f kHz\\n(iii)Calpture range, fC = +/-%d Hz\"%(fout,fL,fC))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(i)free running frequency, fout = 5kHz\n",
+ "(ii)Lock range, fL = +/-2 kHz\n",
+ "(iii)Calpture range, fC = +/-94 kHz\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 6.2, Page No. 254"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Digital frequency synthesizer\n",
+ "\n",
+ "import math\n",
+ "#Variable declaration\n",
+ "R = 4 # resolution of digital frequency synthesizer\n",
+ "Fm = 200*10**3 # maximum frequency output\n",
+ "\n",
+ "#Calculations\n",
+ "fclk = Fm*2.2\n",
+ "k = fclk/R\n",
+ "n = math.log(k)/math.log(2)\n",
+ "\n",
+ "#Result\n",
+ "print(\"frequency of reference oscillator = %.0f kHz\\nno of bits required = %.0f\"%(fclk/1000,math.ceil(n)))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "frequency of reference oscillator = 440 kHz\n",
+ "no of bits required = 17\n"
+ ]
+ }
+ ],
+ "prompt_number": 13
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Op-amp_and_linear_integrated_circuits_/Chapter_7.ipynb b/Op-amp_and_linear_integrated_circuits_/Chapter_7.ipynb new file mode 100755 index 00000000..d549ba1d --- /dev/null +++ b/Op-amp_and_linear_integrated_circuits_/Chapter_7.ipynb @@ -0,0 +1,1326 @@ +{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 7: Active Filters"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "examople 7.1, Page No. 279"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# First order Butterworth low-pass filter\n",
+ "\n",
+ "import math\n",
+ "#Variable declaration\n",
+ "R = 10.0*10**3 # Resistor R\n",
+ "R1 = 10.0*10**3 # Resistor R1\n",
+ "Rf = 100.0*10**3 # Resistor Rf\n",
+ "C = 0.001*10**-6 # Capacitance \n",
+ "\n",
+ "#calculations\n",
+ "#(i)\n",
+ "fc = 1/(2*math.pi*R*C)\n",
+ "#(ii)\n",
+ "Af = 1+(Rf/R1)\n",
+ "\n",
+ "#Result\n",
+ "print(\"(i) cut-off frequency for a first order Butterworth LPF is %.3f kHz\\n\\n(ii) Passband Voltage gain = %d\"%(fc/1000,Af))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(i) cut-off frequency for a first order Butterworth LPF is 15.915 kHz\n",
+ "\n",
+ "(ii) Passband Voltage gain = 11\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 7.2, Page No. 279"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# first order low-pass filter design\n",
+ "\n",
+ "import math\n",
+ "#Variable declaration\n",
+ "Af = 2 # Passband voltage gain\n",
+ "fc = 10*10**3 # cut-off frequency\n",
+ "\n",
+ "#Calculations\n",
+ "#since Af = 1+Rf/R1, we have Rf = R1\n",
+ "Rf = 10*10**3 # assumed\n",
+ "C = 0.001*10**-6 # assumed\n",
+ "R = 1/(2*math.pi*fc*C)\n",
+ "\n",
+ "#Result\n",
+ "print(\"Rf = R1 = %.0f k-ohm\\nC = %.3f micro-F\\nR = %.1f k-ohm\"%(Rf/1000,C*10**6,R/1000))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Rf = R1 = 10 k-ohm\n",
+ "C = 0.001 micro-F\n",
+ "R = 15.9 k-ohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 7.3, Page No. 280"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# low-pass filter design\n",
+ "\n",
+ "import math\n",
+ "#Variable declaration\n",
+ "Af = 2.5 # Passband voltage gain\n",
+ "fc = 2*10**3 # cut-off frequency\n",
+ "\n",
+ "#Calculations\n",
+ "C = 0.01*10**-6 # assumed\n",
+ "R = 1/(2*math.pi*fc*C)\n",
+ "R = R/1000 # k-ohm\n",
+ "Rp = 8.2*10**3 # practical value\n",
+ "x = (Af-1) # Rf/R1\n",
+ "R1 = Rp*(x+1)/x\n",
+ "R1p = 15 # k-ohm \n",
+ "Rf = R1*x/1000 # k-ohm\n",
+ "\n",
+ "#Result\n",
+ "print(\"R = %f k-ohm(practical value %f k-ohm)\\nR1 = %.2f k-ohm(say %d k-ohm)\\nRf = %d k-ohm\"%(R,Rp/1000,R1/1000,R1p,Rf))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "R = 7.957747 k-ohm(practical value 8.200000 k-ohm)\n",
+ "R1 = 13.67 k-ohm(say 15 k-ohm)\n",
+ "Rf = 20 k-ohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 18
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 7.4, Page No.283"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# 2nd order low-pass filter design(refer fig. 7.22)\n",
+ "\n",
+ "import math\n",
+ "#Variable declaration\n",
+ "Af = 1.586 # Passband voltage gain\n",
+ "fc = 1000.0 # cut-off frequency\n",
+ "\n",
+ "#Calculations\n",
+ "C = 0.005*10**-6 # assumed\n",
+ "R = 1/(2*math.pi*fc*C)\n",
+ "R = R/1000 # k-ohm\n",
+ "x = (Af-1) # Rf/R1\n",
+ "R1 = 33 # k-ohm \n",
+ "Rf = R1*x # k-ohm\n",
+ "\n",
+ "#Result\n",
+ "print(\"R1 = %d k-ohm\\nRf = %.3f k-ohm\\nR2 = R3 = %.2f k-ohm\\nC2 = C3 = %.3f micro-F\"%(R1,Rf,R,C*10**6))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "R1 = 33 k-ohm\n",
+ "Rf = 19.338 k-ohm\n",
+ "R2 = R3 = 31.83 k-ohm\n",
+ "C2 = C3 = 0.005 micro-F\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 7.5, Page No. 283"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# 2nd order low-pass filter\n",
+ "\n",
+ "import math\n",
+ "#Variable declaration\n",
+ "R1 = 12.0*10**3 # resistor R1\n",
+ "Rf = 7.0*10**3 # feedback resistance\n",
+ "R2 = 33.0*10**3 # Resistance R2\n",
+ "R3 = 33.0*10**3 # Resistance R3\n",
+ "C1 = 0.002*10**-6 # Capacitance C1\n",
+ "C2 = 0.002*10**-6 # Capacitance C2\n",
+ "\n",
+ "#Calculations\n",
+ "#(i)\n",
+ "fc = 1/(2*math.pi*math.sqrt(R2*R3*C2*C1))\n",
+ "#(ii)\n",
+ "Af = 1+(Rf/R1)\n",
+ "\n",
+ "\n",
+ "#Result\n",
+ "print(\"(i) cut-off frequency(fc) = %.3f KHz\\n(ii) Passband voltage gain(Af) = %.3f\"%(fc/1000,Af))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(i) cut-off frequency(fc) = 2.411 KHz\n",
+ "(ii) Passband voltage gain(Af) = 1.583\n"
+ ]
+ }
+ ],
+ "prompt_number": 16
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 7.6, Page No. 284"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# 2nd order low-pass filter design\n",
+ "\n",
+ "import math\n",
+ "#Variable declaration\n",
+ "fc = 2000.0 # cut-off frequency\n",
+ "C = 0.033*10**-6 # Capacitance, assumed\n",
+ "\n",
+ "#Calculations\n",
+ "R = 1/(2*math.pi*fc*C)\n",
+ "Rp = 2.5\n",
+ "x = 0.586 # Rf/R1 \n",
+ "R1 = 2*R*(1+x)/x\n",
+ "R1p = 15.0\n",
+ "Rf = R1p*x\n",
+ "Rfp = 10.0\n",
+ "\n",
+ "#Result\n",
+ "print(\"C2 = C3 = %.3f micro-F\"%(C*10**6))\n",
+ "print(\"R3 = R2 = %.1f k-ohm(say %.1f k-ohm)\"%(R/1000,Rp))\n",
+ "print(\"R1 = %d k-ohm = %d k-ohm (std value)\\nRf = %.2f k-ohm = %d k-ohm (std value)\"%(R1/1000,R1p,Rf,Rfp))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "C2 = C3 = 0.033 micro-F\n",
+ "R3 = R2 = 2.4 k-ohm(say 2.5 k-ohm)\n",
+ "R1 = 13 k-ohm = 15 k-ohm (std value)\n",
+ "Rf = 8.79 k-ohm = 10 k-ohm (std value)\n"
+ ]
+ }
+ ],
+ "prompt_number": 31
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ " example 7.7, Page No. 284"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# 2nd order low-pass filter design\n",
+ "\n",
+ "import math\n",
+ "#Variable declaration\n",
+ "fc = 1000.0 # cut-off frequency\n",
+ "C = 0.0047*10**-6 # Capacitance, assumed\n",
+ "\n",
+ "#Calculations\n",
+ "R = 1/(2*math.pi*fc*C)\n",
+ "Rp = 33\n",
+ "x = 0.586 # Rf/R1 \n",
+ "R1 = 30.0 # R1 in k-ohm \n",
+ "Rf = R1*x\n",
+ "Rfp = 20.0\n",
+ "\n",
+ "#Result\n",
+ "print(\"C2 = C3 = %.4f micro-F\"%(C*10**6))\n",
+ "print(\"R3 = R2 = %.2f k-ohm(say %.1f k-ohm)\"%(R/1000,Rp))\n",
+ "print(\"R1 = %d k-ohm\\nRf = %.2f k-ohm = %d k-ohm (std value)\"%(R1,Rf,Rfp))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "C2 = C3 = 0.0047 micro-F\n",
+ "R3 = R2 = 33.86 k-ohm(say 33.0 k-ohm)\n",
+ "R1 = 30 k-ohm\n",
+ "Rf = 17.58 k-ohm = 20 k-ohm (std value)\n"
+ ]
+ }
+ ],
+ "prompt_number": 35
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 7.8, Page No. 189"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# low pass second order Butterworth filter design\n",
+ "\n",
+ "import math\n",
+ "#Variable declaration\n",
+ "fc = 1500.0 # cut-off frequency\n",
+ "alfa = 1.414 # damping factor\n",
+ "\n",
+ "#Calculations\n",
+ "Rf = 2-alfa\n",
+ "Ri = 1 # for equal component model\n",
+ "Af = 1+Rf/Ri\n",
+ "print(\"Fig 7.26(a) shows the equal component second order Butterworth filter with critical frequency wc = 1 rad/sec.\")\n",
+ "print(\"Where R = R1 = R2 and\\nC = C1 = C2\")\n",
+ "wc = 2*math.pi*fc\n",
+ "wc = math.floor(wc*100)/100\n",
+ "print(\"\\nWe scale this to 1.5 kHz\\nTherefore, wc = %.2f rad/sec\"%(wc))\n",
+ "R = 1/wc\n",
+ "print(\"R1 = R2 = R = %.3f *10^-4 ohm\\nFig 7.26(b) shows 1.5 kHz second order Butterworth filter.\"%(R*10**4))\n",
+ "R = R*10**7\n",
+ "C = 1*10**-7\n",
+ "print(\"\\nTo increase R to a reasonable vaule , we multiply R1 and R2 by 10^7\")\n",
+ "print(\"and to keep the fc unchanged we decrease the C1 and C2 by the same factor.\")\n",
+ "print(\"R1 = R2 = %.3f k-ohm\\nC1 = C2 = %.1f micro-F or %.0f nF\"%(R/1000,C*10**6,C*10**9))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Fig 7.26(a) shows the equal component second order Butterworth filter with critical frequency wc = 1 rad/sec.\n",
+ "Where R = R1 = R2 and\n",
+ "C = C1 = C2\n",
+ "\n",
+ "We scale this to 1.5 kHz\n",
+ "Therefore, wc = 9424.77 rad/sec\n",
+ "R1 = R2 = R = 1.061 *10^-4 ohm\n",
+ "Fig 7.26(b) shows 1.5 kHz second order Butterworth filter.\n",
+ "\n",
+ "To increase R to a reasonable vaule , we multiply R1 and R2 by 10^7\n",
+ "and to keep the fc unchanged we decrease the C1 and C2 by the same factor.\n",
+ "R1 = R2 = 1.061 k-ohm\n",
+ "C1 = C2 = 0.1 micro-F or 100 nF\n"
+ ]
+ }
+ ],
+ "prompt_number": 51
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 7.9, Page No. 292"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print(\"Theeoretical example\")"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Theeoretical example\n"
+ ]
+ }
+ ],
+ "prompt_number": 53
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 7.10, Page No. 292"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print(\"Theeoretical example\")"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Theeoretical example\n"
+ ]
+ }
+ ],
+ "prompt_number": 52
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 7.11, Page No. 293"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# 2nd order Butterworth Low pass filter\n",
+ "\n",
+ "import math\n",
+ "#Variable declaration\n",
+ "fc = 10*10**3 # Cut-off frequency\n",
+ "n = 2 # order of the filter\n",
+ "one_by_Q = 1.414 # from table\n",
+ "#Calculations\n",
+ "C = 0.01*10**-6 # assumed\n",
+ "R = 1/(2*math.pi*fc*C) \n",
+ "Af = 3-(one_by_Q)\n",
+ "Ri = 10*10**3 # assumed\n",
+ "Rf = (Af-1)*Ri\n",
+ "wc = 2*math.pi*fc\n",
+ "f1=1000\n",
+ "w1 = 2*math.pi*f1\n",
+ "f2 = 2000\n",
+ "w2 = 2*math.pi*f2 \n",
+ "f3 = 5000\n",
+ "w3 = 2*math.pi*f3\n",
+ "f4 = 10000\n",
+ "w4 = 2*math.pi*f4\n",
+ "f5 = 50000\n",
+ "w5 = 2*math.pi*f5\n",
+ "f6 = 100000\n",
+ "w6 = 2*math.pi*f6\n",
+ "Hs1 = 20*math.log10(Af/(math.sqrt(1+(w1/wc)**4)))\n",
+ "Hs2 = 20*math.log10(Af/(math.sqrt(1+(w2/wc)**4)))\n",
+ "Hs3 = 20*math.log10(Af/(math.sqrt(1+(w3/wc)**4)))\n",
+ "Hs4 = 20*math.log10(Af/(math.sqrt(1+(w4/wc)**4)))\n",
+ "Hs5 = 20*math.log10(Af/(math.sqrt(1+(w5/wc)**4)))\n",
+ "Hs6 = 20*math.log10(Af/(math.sqrt(1+(w6/wc)**4)))\n",
+ "\n",
+ "#Result\n",
+ "print(\"R1 = R2 = %.3f k-ohm\\nAf = %.3f\\nC1 = C2 = %.2f micro-F\\nRi = %d k-ohm\\nRf = %.2f k-ohm\"%(R/1000,Af,C*10**6,Ri/1000,Rf/1000))\n",
+ "print(\"\\nFrequency in Hz\\t\\t Gain Magnitude in dB|H(s)|\")\n",
+ "print(\"%d\\t\\t\\t\\t%d\"%(f1,Hs1))\n",
+ "print(\"%d\\t\\t\\t\\t%.3f\"%(f2,Hs2))\n",
+ "print(\"%d\\t\\t\\t\\t%.2f\"%(f3,Hs3))\n",
+ "print(\"%d\\t\\t\\t\\t%.0f\"%(f4,math.ceil(Hs4)))\n",
+ "print(\"%d\\t\\t\\t\\t%.2f\"%(f5,math.ceil(Hs5*100)/100))\n",
+ "print(\"%d\\t\\t\\t\\t%.2f\"%(f6,Hs6))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "R1 = R2 = 1.592 k-ohm\n",
+ "Af = 1.586\n",
+ "C1 = C2 = 0.01 micro-F\n",
+ "Ri = 10 k-ohm\n",
+ "Rf = 5.86 k-ohm\n",
+ "\n",
+ "Frequency in Hz\t\t Gain Magnitude in dB|H(s)|\n",
+ "1000\t\t\t\t4\n",
+ "2000\t\t\t\t3.999\n",
+ "5000\t\t\t\t3.74\n",
+ "10000\t\t\t\t1\n",
+ "50000\t\t\t\t-23.95\n",
+ "100000\t\t\t\t-35.99\n"
+ ]
+ }
+ ],
+ "prompt_number": 73
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 7.12, Page No. 294"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# 4th order Butterworth low pass filter(refer fig. 7.33)\n",
+ "\n",
+ "import math\n",
+ "#Variable declaration\n",
+ "fc = 1000.0 # upper cut-off frequency\n",
+ "C = 0.1*10**-6 # aasumed\n",
+ "R = 1/(2*math.pi*fc*C)\n",
+ "R = R/1000\n",
+ "R = math.floor(R*1000)/1000\n",
+ "alfa1 = 0.765\n",
+ "alfa2 = 1.848\n",
+ "Af1 = 3-alfa1\n",
+ "Af2 = 3- alfa2\n",
+ "# for first stage\n",
+ "Ri1 = 10*10**3 # assumed\n",
+ "Rf1 = (Af1-1)*Ri1\n",
+ "# for second stage\n",
+ "Ri2 = 100*10**3 # assumed\n",
+ "Rf2 = (Af2-1)*Ri2\n",
+ "\n",
+ "#Result\n",
+ "print(\"R = %.3f k-ohm\\nAf1 = %.3f\\t Af2 = %.3f\\n\\nFor first stage:\\nRi = %d k-ohm\\tRf = %.1f k-ohm\"%(R,Af1,Af2,Ri1/1000,Rf1/1000))\n",
+ "print(\"\\nfor second stage:\\nRi = %d k-ohm\\tRf = %.1f k-ohm\"%(Ri2/1000,Rf2/1000))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "R = 1.591 k-ohm\n",
+ "Af1 = 2.235\t Af2 = 1.152\n",
+ "\n",
+ "For first stage:\n",
+ "Ri = 10 k-ohm\tRf = 12.3 k-ohm\n",
+ "\n",
+ "for second stage:\n",
+ "Ri = 100 k-ohm\tRf = 15.2 k-ohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 85
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 7.13, Page No.297"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Value of R in first order butterworth high pass filter\n",
+ "\n",
+ "import math\n",
+ "#Vartianble declaration\n",
+ "fc = 10*10**3 # cut-off frequency\n",
+ "C = 0.0047*10**-6 # Capacitance\n",
+ "\n",
+ "#Calculations\n",
+ "R = 1/(2*math.pi*fc*C)\n",
+ "\n",
+ "#Result\n",
+ "print(\"R = %.3f k-ohm\"%(R/1000))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "R = 3.386 k-ohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 87
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 7.14, Page No. 298"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# first order butterworth high pass filter\n",
+ "\n",
+ "import math\n",
+ "#Variable declaration\n",
+ "R = 15*10**3 # resistance\n",
+ "C = 0.01*10**-6 # capacitance\n",
+ "Rf = 10*10**3 # feedback resistance\n",
+ "R1 = 5*10**3 # resistace R1\n",
+ "\n",
+ "#Calcualtions\n",
+ "fc = 1/(2*math.pi*R*C)\n",
+ "fc = math.floor(fc)\n",
+ "wc = 2*math.pi*fc\n",
+ "\n",
+ "#Result\n",
+ "print(\"(i) Cut-off frequency, fc = %d Hz\\n(ii) Cut-off frequency, wc = %f k rad/sec\"%(fc,wc/1000))\n",
+ "# Answer for wc is wrong in the book"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(i) Cut-off frequency, fc = 1061 Hz\n",
+ "(ii) Cut-off frequency, wc = 6.666460 k rad/sec\n"
+ ]
+ }
+ ],
+ "prompt_number": 94
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 7.15, Page No. 299"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# cut-off frequency and voltage gain(refer fig. 7.36)\n",
+ "\n",
+ "import math\n",
+ "# Variable declaration\n",
+ "R1 = 27.0*10**3 # resistor R1\n",
+ "R2 = R1 # resistor R2\n",
+ "R3 = R1 # resistor R3\n",
+ "RL = 10*10**3 # resistor Rl\n",
+ "Rf = 16.0*10**3 # resistor Rf\n",
+ "C2 = 0.005*10**-6 # capacitance\n",
+ "C3 = 0.005*10**-6 # capacitance\n",
+ "\n",
+ "#Calculations\n",
+ "fc = 1/(2*math.pi*math.sqrt(R2*R3*C2*C3))\n",
+ "Af = 1+Rf/R1\n",
+ "\n",
+ "#Result\n",
+ "print(\"Cut-off frequency, fc = %.2f kHz\\nAf = %.3f\"%(fc/1000,math.floor(Af*1000)/1000))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Cut-off frequency, fc = 1.18 kHz\n",
+ "Af = 1.592\n"
+ ]
+ }
+ ],
+ "prompt_number": 101
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 7.16, Page No. 302"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# 2nd order high pass Bessel filter\n",
+ "\n",
+ "import math\n",
+ "#Variable declaration\n",
+ "fb = 2000.0 # Break frequency\n",
+ "alfa = 1.732 # damping factor, from table\n",
+ "kf = 1.274 # frequency factor, from table\n",
+ "\n",
+ "#calculations\n",
+ "R1 = alfa/2\n",
+ "R2 = 2/alfa\n",
+ "Rf = R2\n",
+ "C = 1\n",
+ "print(\"R1 = %.3f ohm\\nR2 = Rf = %.3f ohm\"%(R1,R2))\n",
+ "print(\"\\n2nd order high pass filter with wc = 1 rad/sec is shown in fig 7.40\")\n",
+ "fc = fb/kf\n",
+ "fc = math.floor(fc*100)/100\n",
+ "wc = 2*math.pi*fc\n",
+ "wc = math.ceil(wc*10)/10\n",
+ "print(\"\\nfc = %.2f Hz\\nwc = %.1f rad/sec\"%(fc,wc))\n",
+ "print(\"\\nIn frequency scaling proicedure, we keep the capacitor unchanged and scale down the resistors as follow:\")\n",
+ "R1 = R1/wc\n",
+ "R1 = R1*10**5\n",
+ "R1 = math.floor(R1*10**4)/10**4\n",
+ "R2 = R2/wc\n",
+ "print(\"R1 = %.4f*10^-5\\t\\t\\tR2 = %.4f*10^-4\"%(R1,R2*10**4))\n",
+ "print(\"\\nThe above mentioned components are not practical. So we multyply each resistor by 10^8 and divide each capacitor by 10^8 to\")\n",
+ "print(\"get the final component values as under:\")\n",
+ "R1 = R1*10**3\n",
+ "R2 = R2*10**8\n",
+ "C = 1*10**-8\n",
+ "print(\"R1 = %f k-ohm\\t\\t\\tR2 = %f k-ohm\\t\\tC = %d nF\\n\\nFinal diagram is shown in fig. 7.42\"%(R1/1000,R2/1000,C*10**9))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "R1 = 0.866 ohm\n",
+ "R2 = Rf = 1.155 ohm\n",
+ "\n",
+ "2nd order high pass filter with wc = 1 rad/sec is shown in fig 7.40\n",
+ "\n",
+ "fc = 1569.85 Hz\n",
+ "wc = 9863.7 rad/sec\n",
+ "\n",
+ "In frequency scaling proicedure, we keep the capacitor unchanged and scale down the resistors as follow:\n",
+ "R1 = 8.7796*10^-5\t\t\tR2 = 1.1707*10^-4\n",
+ "\n",
+ "The above mentioned components are not practical. So we multyply each resistor by 10^8 and divide each capacitor by 10^8 to\n",
+ "get the final component values as under:\n",
+ "R1 = 8.779600 k-ohm\t\t\tR2 = 11.706909 k-ohm\t\tC = 10 nF\n",
+ "\n",
+ "Final diagram is shown in fig. 7.42\n"
+ ]
+ }
+ ],
+ "prompt_number": 125
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 7.17, Page No.304"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Wide bandpass filter design\n",
+ "\n",
+ "import math\n",
+ "#Variable declaration\n",
+ "fl = 100.0 # lower cut-off frequency\n",
+ "fh = 1000.0 # higher cut-off frequency\n",
+ "Af = 4\n",
+ "\n",
+ "# Calculations\n",
+ "# 1. low-pass filter components\n",
+ "C_dash = 0.01*10**-6 # assumed\n",
+ "R_dash = 1/(2*math.pi*fh*C_dash)\n",
+ "R_dash = R_dash/1000\n",
+ "Af2 = 2\n",
+ "x1 = (Af2 - 1) # Rf_dash/R1_dash\n",
+ "R1_dash = 10 # k-ohm\n",
+ "Rf_dash = x1*R1_dash\n",
+ "# 2. High pass filter components\n",
+ "C = 0.05*10**-6 \n",
+ "R = 1/(2*math.pi*fl*C)\n",
+ "Af1 = 2\n",
+ "x2 = (Af1-1)\n",
+ "R1 = 10 # k-ohm\n",
+ "Rf = x2*R1\n",
+ "# 3. Quality factor Q\n",
+ "Q = math.sqrt(fl*fh)/(fh-fl)\n",
+ "\n",
+ "#Result\n",
+ "print(\"1.The componets for the low-pass filter are as under:\")\n",
+ "print(\"R1_dash = %d k-ohm\\nR_dash = %.1f k-ohm\\nRf_dash = %d k-ohm\\nC = %.2f micro-F\"%(R1_dash,R_dash,Rf_dash,C_dash*10**6))\n",
+ "print(\"\\n2.The componets for the high pass filter are as under:\")\n",
+ "print(\"R1 = %d k-ohm\\nR = %.2f k-ohm\\nRf = %d k-ohm\\nC = %.2f micro-F\"%(R1,R/1000,Rf,C*10**6))\n",
+ "print(\"\\n3.Quality factor\\nQ = %.3f\"%Q)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1.The componets for the low-pass filter are as under:\n",
+ "R1_dash = 10 k-ohm\n",
+ "R_dash = 15.9 k-ohm\n",
+ "Rf_dash = 10 k-ohm\n",
+ "C = 0.01 micro-F\n",
+ "\n",
+ "2.The componets for the high pass filter are as under:\n",
+ "R1 = 10 k-ohm\n",
+ "R = 31.83 k-ohm\n",
+ "Rf = 10 k-ohm\n",
+ "C = 0.05 micro-F\n",
+ "\n",
+ "3.Quality factor\n",
+ "Q = 0.351\n"
+ ]
+ }
+ ],
+ "prompt_number": 147
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 7.18, Page No. 307"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Narrow band pass filter design\n",
+ "\n",
+ "import math\n",
+ "#Variable declaration\n",
+ "fc = 2000.0 # cut-off frequency\n",
+ "Af = 10 # voltage gain\n",
+ "Q = 4 # quality factor\n",
+ "\n",
+ "#Calculations\n",
+ "C = 0.01*10**-6 # assumed\n",
+ "R1 = Q/(2*math.pi*fc*C*Af)\n",
+ "R1 = R1/1000 # k-ohm\n",
+ "R2 = Q/(2*math.pi*fc*C*((2*Q**2)-Af))\n",
+ "R2 = R2/1000\n",
+ "R3 = Q/(math.pi*fc*C)\n",
+ "R3 = R3 /1000\n",
+ "fc_new = 1000.0\n",
+ "R2_dash = R2*(fc/fc_new)**2\n",
+ "\n",
+ "#Result\n",
+ "print(\"C1 = C2 = %.2f micro-F\\nR1 = %.3f k-ohm\\nR2 = %.3f k-ohm\\nR3 = %.2f k-ohm\"%(C*10**6,R1,math.floor(R2*1000)/1000,R3))\n",
+ "print(\"We use\\t R1 = 3.3 k-ohm,R2 = 1.5 k-ohm, R3 = 63 k-ohm\")\n",
+ "print(\"\\nNew value of R2 = %.3f k-ohm.\\nWe use\\t R2 = %.1f k-ohm\"%(R2_dash,R2_dash))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "C1 = C2 = 0.01 micro-F\n",
+ "R1 = 3.183 k-ohm\n",
+ "R2 = 1.446 k-ohm\n",
+ "R3 = 63.66 k-ohm\n",
+ "We use\t R1 = 3.3 k-ohm,R2 = 1.5 k-ohm, R3 = 63 k-ohm\n",
+ "\n",
+ "New value of R2 = 5.787 k-ohm.\n",
+ "We use\t R2 = 5.8 k-ohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 171
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 7.19, Page No. 308"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Wide band reject filter\n",
+ "\n",
+ "import math\n",
+ "#Variable declaration\n",
+ "fh = 100.0 # higher cut-off frequency\n",
+ "fl = 2000.0 # lower cut-off frequency\n",
+ "\n",
+ "# Calculations\n",
+ "# (i) High-pass section\n",
+ "C = 0.01*10**-6 # assumed\n",
+ "R = 1/(2*math.pi*fl*C)\n",
+ "Af1 = 2\n",
+ "x1 = Af1-1 # Rf/R1\n",
+ "R1 = 10 # k-ohm\n",
+ "Rf = x1*R1\n",
+ "#(ii) Low-pass section\n",
+ "C1 = 0.1*10**-6 # assumed\n",
+ "R_dash = 1/(2*math.pi*fh*C1)\n",
+ "Af2 = 2\n",
+ "x2 = Af2-1 # Rf'/R1'\n",
+ "R1_dash = 10 # k-ohm\n",
+ "Rf_dash = x2*R1_dash\n",
+ "#(iii) Summing amplifier\n",
+ "R2 = 10.0 # k-ohm\n",
+ "R3 = R4 = R2\n",
+ "Rom = (R2*R3/(R2+R3))*R4/(R4+(R2*R3/(R2+R3)))\n",
+ "#result\n",
+ "print(\"(i) High Pass section:\\nC = %.2f micro-F\\nR = %.2f k-ohm\\nR1 = %d k-ohm\\nRf = %d k-ohm\\n\"%(C*10**6,R/1000,R1,Rf))\n",
+ "print(\"(ii) Low Pass section:\\nC = %.1f micro-F\\nR = %.3f k-ohm\\nR1 = %d k-ohm\\nRf = %d k-ohm\"%(C1*10**6,R_dash/1000,R1_dash,Rf_dash))\n",
+ "print(\"\\n(iii) Summing amplifier:\\nRom = %f k-ohm\"%(Rom))\n",
+ "print(\"\\nThe completed circuit diagram is shownn in figure 7.47\")"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(i) High Pass section:\n",
+ "C = 0.01 micro-F\n",
+ "R = 7.96 k-ohm\n",
+ "R1 = 10 k-ohm\n",
+ "Rf = 10 k-ohm\n",
+ "\n",
+ "(ii) Low Pass section:\n",
+ "C = 0.1 micro-F\n",
+ "R = 15.915 k-ohm\n",
+ "R1 = 10 k-ohm\n",
+ "Rf = 10 k-ohm\n",
+ "\n",
+ "(iii) Summing amplifier:\n",
+ "Rom = 3.333333 k-ohm\n",
+ "\n",
+ "The completed circuit diagram is shownn in figure 7.47\n"
+ ]
+ }
+ ],
+ "prompt_number": 191
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ " example 7.20, Page No. 311"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# #Active notch filter\n",
+ "\n",
+ "import math\n",
+ "#Variable declaration\n",
+ "fn = 50 # frequency to be rejected\n",
+ "\n",
+ "#Calculations\n",
+ "C = 0.47*10**-6 # Capacitance, assumed\n",
+ "R = 1/(2*math.pi*fn*C)\n",
+ "\n",
+ "#Result\n",
+ "print(\"C = %.2f micro-F\\nR = %.3f k-ohm. We use %.1f k-ohm\"%(C*10**6,R/1000,R/1000))\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "C = 0.47 micro-F\n",
+ "R = 6.773 k-ohm. We use 6.8 k-ohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 193
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 7.21, Page No. 313"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# phase shift between the input and output voltages for all pass filter\n",
+ "\n",
+ "import math\n",
+ "#Variable declaration\n",
+ "R = 10*10**3 # resistance\n",
+ "C = 0.01*10**-6 # Capacitance\n",
+ "f = 2000.0 # frequency for which phase shift is to be calculated\n",
+ "\n",
+ "#Calculations\n",
+ "fi = -2*math.atan(2*math.pi*R*f*C)\n",
+ "fi = math.ceil(math.degrees(fi)*100)/100\n",
+ "\n",
+ "#Result\n",
+ "print(\"Phase shift = %.2f\u00b0\"%fi)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Phase shift = -102.97\u00b0\n"
+ ]
+ }
+ ],
+ "prompt_number": 199
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 7.22, Page No.313"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Wide band pass filter\n",
+ "\n",
+ "import math\n",
+ "#Variable declaration\n",
+ "fl = 200.0 # lower cut-off frequency\n",
+ "fh = 1000.0 # higher cut-off frequency\n",
+ "\n",
+ "\n",
+ "#Calculations\n",
+ "fc = math.sqrt(fl*fh)\n",
+ "Q = fc/(fh-fl)\n",
+ "\n",
+ "#Result\n",
+ "print(\"fc = %.1f Hz\\nQ = %.3f\\nfilter with Q = 0.8 is more selective.\"%(fc,Q))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "fc = 447.2 Hz\n",
+ "Q = 0.559\n",
+ "filter with Q = 0.8 is more selective\n"
+ ]
+ }
+ ],
+ "prompt_number": 203
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 7.23, Page No. 313"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Wide bandpass filter design\n",
+ "\n",
+ "import math\n",
+ "#Variable declaration\n",
+ "f1 = 5*10**3 # cut-off frequency\n",
+ "f2 = 15*10**3 # ciut-off frequency\n",
+ "Af = 2 # Passband gain \n",
+ "\n",
+ "#Calculations\n",
+ "# low pass filter\n",
+ "C_dash = 0.01*10**-6 # assumed\n",
+ "R_dash = 1/(2*math.pi*f2*C_dash)\n",
+ "R_dash = R_dash/1000\n",
+ "Af1 = Af2 = 1.414\n",
+ "x1 = Af2-1 # Rf'/R1'\n",
+ "R1_dash = 10 # k-ohm\n",
+ "Rf_dash = x1*R1_dash\n",
+ "# high pass filter\n",
+ "C = 0.05*10**-6 # assumed\n",
+ "R = 1/(2*math.pi*f1*C)\n",
+ "x2 = Af1-1 # Rf'/R1'\n",
+ "R1 = 10 # k-ohm\n",
+ "Rf = x2*R1\n",
+ "\n",
+ "#Result\n",
+ "print(\"Low pass filter component:\")\n",
+ "print(\"C' = %.2f micro-F\\nR' = %.3f k-ohm\\nR1'= %d k-ohm\\nRf'= %.2f k-ohm\"%(C_dash*10**6,R_dash,R1_dash,Rf_dash))\n",
+ "print(\"\\nHigh pass filter component:\")\n",
+ "print(\"C = %.2f micro-F\\nR = %.2f k-ohm\\nR1 = %d k-ohm\\nRf = %.2f k-ohm\"%(C*10**6,R,R1,Rf))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Low pass filter component:\n",
+ "C' = 0.01 micro-F\n",
+ "R' = 1.061 k-ohm\n",
+ "R1'= 10 k-ohm\n",
+ "Rf'= 4.14 k-ohm\n",
+ "\n",
+ "High pass filter component:\n",
+ "C = 0.05 micro-F\n",
+ "R = 636.62 k-ohm\n",
+ "R1 = 10 k-ohm\n",
+ "Rf = 4.14 k-ohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 216
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 7.24, Page No. 317"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# output waveform of circuit in fig.7.54\n",
+ "\n",
+ "%matplotlib inline\n",
+ "import matplotlib.pyplot as plt\n",
+ "from numpy import arange,sin,pi\n",
+ "t = arange(0.0,2,0.01)\n",
+ "t1 = arange(0.0,2.0,0.01)\n",
+ "t2 = arange(0.0,1.002,0.01)\n",
+ "t3 = arange(1.0,2,0.01)\n",
+ "t4 = arange(-15.0,15.0,0.01)\n",
+ "\n",
+ "S = sin(math.pi*t)\n",
+ "plt.axis([0,2.0,-16,16])\n",
+ "\n",
+ "plt.plot(t1,t1*0/t1,'b')\n",
+ "plt.plot(t4/t4,t4,'g')\n",
+ "plt.plot(t2,15*t2/t2,'g')\n",
+ "plt.plot(t3,-15*t3/t3,'g')\n",
+ "plt.plot(t,S,'r')\n",
+ "plt.title(\"Output of the circuit shown in fig. 7.54\")\n",
+ "plt.text(-0.3,14.8,'+Vsat')\n",
+ "plt.text(-0.3,-15.2,'-Vsat')"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "metadata": {},
+ "output_type": "pyout",
+ "prompt_number": 274,
+ "text": [
+ "<matplotlib.text.Text at 0xef879e8>"
+ ]
+ },
+ {
+ "metadata": {},
+ "output_type": "display_data",
+ "png": "iVBORw0KGgoAAAANSUhEUgAAAZYAAAEKCAYAAAAxXHOuAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3XlYVOXiB/DvYVMRRBBlF1D0urCI4r6NC+aSXCMzKdIU\nu6WVKdbV/FWCubR5U/N6r6WX1CzJ3VxI0wbLJW6PQPfqU2KBIJvixqIg4vv7Y+4MjAwywKvD4Pfz\nPO/DOWfOvPOe1+P5nvPOzBlFCCFAREQkiYWpG0BERE0Lg4WIiKRisBARkVQMFiIikorBQkREUjFY\niIhIKgYLNRrHjx9Hp06dYG9vj71799a6fkZGBiwsLHD37t0H2q6xY8di8+bN0utdvnw5XnjhhQbX\n87D6oS78/f1x7Nixej1Xux+0atUKe/bswdixY7Fp0ybJLaQHSpDZiouLE/7+/sLW1la4urqKmTNn\niuvXrxv9fG9vb3HkyBFp7WlofcOHDxerV682uv709HShKIqoqKio92s2Fg3ZlqbUD0LUvh/U17Fj\nx4SdnZ1eURRF7Ny50+D6U6dOFTY2Nrp17e3txd27d6utt3HjRqEoili/fr30NpsrXrGYqRUrVmDB\nggVYsWIFCgsLcerUKVy4cAGhoaEoLy83qg5FUSAkfj+2ofVlZmaiW7duD6z+B6GiokJqfY1t+0yh\ntv2gvgYPHoyioiJd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nly1bhszMTAD12z95SxciIpKqyQyFERFR48BgISIiqRgsREQk\nFYOFiIikYrAQEZFUDBYiIpKKwUJERFIxWIiISKr/B6uVhDxkqJpRAAAAAElFTkSuQmCC\n",
+ "text": [
+ "<matplotlib.figure.Figure at 0xed83f98>"
+ ]
+ }
+ ],
+ "prompt_number": 274
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 7.25, Page No. 317"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Cut-off frequency\n",
+ "\n",
+ "import math\n",
+ "#Variable declaration\n",
+ "C = 0.1*10**-6 # capacitance\n",
+ "R = 10*10**3 # Resistance\n",
+ "\n",
+ "#Calculations\n",
+ "fh = 1/(2*math.pi*C*R)\n",
+ "\n",
+ "#Result\n",
+ "print(\"cut-off frequency = %.4f Hz\"%fh)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "cut-off frequency = 159.1549 Hz\n"
+ ]
+ }
+ ],
+ "prompt_number": 275
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 7.26, Page No. 317"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# first order low pass filter design(refer fig 7.56)\n",
+ "\n",
+ "import math\n",
+ "#Variable declaration\n",
+ "fc = 2000.0 # cut-off frequency\n",
+ "Af = 2 # passband gain\n",
+ "\n",
+ "#Calculations\n",
+ "C = 0.01*10**-6 # Capacitance, assumed\n",
+ "R = 1/(2*math.pi*fc*C)\n",
+ "R = R/1000 # k-ohm\n",
+ "R = math.floor(R*10**3)/1000\n",
+ "x = Af -1 # Rf/R1\n",
+ "R1 = 10 # k-ohm\n",
+ "Rf = x*R1\n",
+ "\n",
+ "#Result\n",
+ "print(\"C = %.2f micro-F\\nR = %.3f k-ohm\\nR1 = %d k-ohm\\nRf = %d k-ohm\"%(C*10**6,R,R1,Rf))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "C = 0.01 micro-F\n",
+ "R = 7.957 k-ohm\n",
+ "R1 = 10 k-ohm\n",
+ "Rf = 10 k-ohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 284
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Op-amp_and_linear_integrated_circuits_/Chapter_8.ipynb b/Op-amp_and_linear_integrated_circuits_/Chapter_8.ipynb new file mode 100755 index 00000000..8b6edfd5 --- /dev/null +++ b/Op-amp_and_linear_integrated_circuits_/Chapter_8.ipynb @@ -0,0 +1,455 @@ +{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 8 : Non-linear Applications of Op-amp"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 8.1, Page No. 332"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Threshold voltages(refer fig. 8.20)\n",
+ "\n",
+ "import math\n",
+ "#Variable declaration\n",
+ "Vcc = 15 # positive saturation voltage\n",
+ "Vee = -15 # Negative saturation voltage\n",
+ "R1 = 120.0 # resistance R1\n",
+ "R2 = 51*10**3 # resistance R2\n",
+ "vin = 1 # input voltage\n",
+ "\n",
+ "#Calculations\n",
+ "Vut = Vcc*R1/(R1+R2)\n",
+ "Vult = Vee*R1/(R1+R2)\n",
+ "\n",
+ "#Result\n",
+ "print(\"Vut = %.1f mV\\nVult = %.1f mV\"%(Vut*1000,Vult*1000))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Vut = 35.2 mV\n",
+ "Vult = -35.2 mV\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 8.2, Page No.333"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Values of R1 and R2\n",
+ "\n",
+ "import math\n",
+ "# Variable declaration\n",
+ "Vcc = 12.0 # positive saturation voltage\n",
+ "Vee = -12.0 # negative saturation voltage\n",
+ "Vh = 6.0 # hysteresis width\n",
+ "\n",
+ "\n",
+ "#Calculations\n",
+ "R1 = 10*10**3\n",
+ "R2 = (1-(Vh/(Vcc-Vee)))*R1/(Vh/(Vcc-Vee))\n",
+ "\n",
+ "#Result\n",
+ "print(\"R1 = %.0f k-ohm\\nR2 = %.0f k-ohm\"%(R1/1000,R2/1000))\n",
+ " "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "R1 = 10 k-ohm\n",
+ "R2 = 30 k-ohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 8.3, Page No. 333"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Schmitt trigger\n",
+ "\n",
+ "import math\n",
+ "#Variable declaration\n",
+ "Vh = 2.0 # hysteresis width\n",
+ "Vlt = -1.5 # lower threshold\n",
+ "Vpp = 5.0 # sine wave amplitude\n",
+ "f = 1000.0 # frequency\n",
+ "\n",
+ "# Calculations\n",
+ "Vut = Vh - abs(Vlt)\n",
+ "Vm = Vpp/2\n",
+ "theta = math.asin(-Vlt/Vm)\n",
+ "theta = theta*180/math.pi\n",
+ "T = 1/f\n",
+ "T1 = T*(180.0+theta)/360.0\n",
+ "T2 = T-T1\n",
+ "\n",
+ "#Result\n",
+ "print(\"Time duration for negative portion , T1 = %.3f ms\\nTime duration for positive portion , T2 = %.3f ms\"%(T1*1000,T2*1000))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Time duration for negative portion , T1 = 0.602 ms\n",
+ "Time duration for positive portion , T2 = 0.398 ms\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 8.4, Page No. 334"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Schmitt Trigger\n",
+ "\n",
+ "import math\n",
+ "#Variable declaration\n",
+ "Vh = 10.0 # ligher threshold\n",
+ "Vl = -10.0 # lower threshold\n",
+ "Imax = 100*10**-6 # maximum current through R1 and R2\n",
+ "Vhv = 0.1 # hysteresis width\n",
+ "\n",
+ "\n",
+ "#Calculations\n",
+ "R2 = 1000.0 # assumed\n",
+ "R1= R2*(1-(Vhv/(2*Vh)))/(Vhv/(2*Vh))\n",
+ "R = R1*R2/(R1+R2)\n",
+ "\n",
+ "#Result\n",
+ "print(\"R1 = %.0f k-ohm\\nR2 = %.0f k-ohm\\nR1||R2 = %.0f ohm\"%(R1/1000,R2/1000,R))\n",
+ "# R1||R2 value is in ohm and not in k-ohm"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "R1 = 199 k-ohm\n",
+ "R2 = 1 k-ohm\n",
+ "R1||R2 = 995 ohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 8.5, Page No. 334"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ " print(\"Theoretical example\")"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Theoretical example\n"
+ ]
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 8.6, Page No.336"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Threshold voltages and hysteresis voltage (refer fig. 8.26)\n",
+ "\n",
+ "import math\n",
+ "#Variable declaration\n",
+ "VsatP = 12.0 # Positive saturation voltage\n",
+ "VsatN = -12.0 # Negative saturation voltage\n",
+ "R1 = 1000.0 # Resistor R1 \n",
+ "R2 = 3*10**3 # Resistor R2\n",
+ "\n",
+ "#Result\n",
+ "Vlt = -VsatP*R1/R2\n",
+ "Vut = -VsatN*R1/R2\n",
+ "Vh = (R1/R2)*abs(VsatP-VsatN)\n",
+ "\n",
+ "#Result\n",
+ "print(\"Vlt = %.0f V\\nVut = %.0f V\\nVh = %.0f V\"%(Vlt,Vut,Vh))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Vlt = -4 V\n",
+ "Vut = 4 V\n",
+ "Vh = 8 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 16
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 8.7, Page No.336"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Schmitt's trigger (refer fig. 8.27)\n",
+ "\n",
+ "import math\n",
+ "#Variable declaration\n",
+ "Vcc = 12.5 # positive supply voltage\n",
+ "Vee = -12.5 # negative supply voltage\n",
+ "R1 = 80.0*10**3 # Resistor R1\n",
+ "R2 = 20.0*10**3 # Resistor R2\n",
+ "\n",
+ "#Calcualtions\n",
+ "Vut = R2*Vcc/(R1+R2)\n",
+ "Vlt = R2*Vee/(R1+R2) \n",
+ "Vhv = R2*2*Vcc/(R1+R2)\n",
+ "\n",
+ "#Result\n",
+ "print(\"Vlt = %.1f V\\nVut = %.1f V\\nVh = %.1f V\"%(Vlt,Vut,Vhv))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Vlt = -2.5 V\n",
+ "Vut = 2.5 V\n",
+ "Vh = 5.0 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 19
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 8.8, Page No.350"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print(\"Theoretical example\")"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Theoretical example\n"
+ ]
+ }
+ ],
+ "prompt_number": 20
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 8.9, Page No.360"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Sample and hold circuit\n",
+ "\n",
+ "import math\n",
+ "#Variable declaration\n",
+ "del_Vin = 5.0 # changes in input volage\n",
+ "FRR = 80.0 # feedthrough rejection ratio\n",
+ "\n",
+ "#Calculations\n",
+ "math.sqrt(5)\n",
+ "del_Vout = del_Vin/math.pow(10,FRR/20)\n",
+ "\n",
+ "#Result\n",
+ "print(\"Change in output = %.4f V = %.1f mV\"%(del_Vout,del_Vout*1000))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Change in output = 0.0005 V = 0.5 mV\n"
+ ]
+ }
+ ],
+ "prompt_number": 41
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 8.10, Page No. 365"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Threshold voltages and frequency of oscillation ( refer fig.8.72)\n",
+ "\n",
+ "import math\n",
+ "#Variable declaration\n",
+ "R1 = 86*10**3 # Resistor R1\n",
+ "R2 = 100*10**3 # Resistor R2\n",
+ "Vcc = 15.0 # positive saturation voltage\n",
+ "Vee = -15.0 # negative saturation voltage\n",
+ "Rf = 100*10**3 # feedback resistance\n",
+ "C = 0.1*10**-6 # capacitance\n",
+ "\n",
+ "#Calculations\n",
+ "Vut = R1*Vcc/(R1+R2)\n",
+ "Vlt = R1*Vee/(R1+R2) \n",
+ "fo = 1/(2*Rf*C*math.log((Vcc-Vlt)/(Vcc-Vut)))\n",
+ "\n",
+ "#Result\n",
+ "print(\"(i) Vut = %.2f V\\n(ii) Vlt = %.2f \\n(iii)fo = %.0f Hz\"%(Vut,Vlt,fo))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(i) Vut = 6.94 V\n",
+ "(ii) Vlt = -6.94 \n",
+ "(iii)fo = 50 Hz\n"
+ ]
+ }
+ ],
+ "prompt_number": 36
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 8.11, Page No. 365"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print(\"Theoretical example\")"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Theoretical example\n"
+ ]
+ }
+ ],
+ "prompt_number": 37
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Op-amp_and_linear_integrated_circuits_/Chapter_9.ipynb b/Op-amp_and_linear_integrated_circuits_/Chapter_9.ipynb new file mode 100755 index 00000000..78e40f6d --- /dev/null +++ b/Op-amp_and_linear_integrated_circuits_/Chapter_9.ipynb @@ -0,0 +1,49 @@ +{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 9: Analog Multiplier Circuits"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "example 9.1, Page No.385"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print(\"Theoretical example\")"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Theoretical example\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Op-amp_and_linear_integrated_circuits_/screenshots/ex_3_14.png b/Op-amp_and_linear_integrated_circuits_/screenshots/ex_3_14.png Binary files differnew file mode 100755 index 00000000..b2707bff --- /dev/null +++ b/Op-amp_and_linear_integrated_circuits_/screenshots/ex_3_14.png diff --git a/Op-amp_and_linear_integrated_circuits_/screenshots/ex_3_33.png b/Op-amp_and_linear_integrated_circuits_/screenshots/ex_3_33.png Binary files differnew file mode 100755 index 00000000..7ce1aef8 --- /dev/null +++ b/Op-amp_and_linear_integrated_circuits_/screenshots/ex_3_33.png diff --git a/Op-amp_and_linear_integrated_circuits_/screenshots/ex_7_26.png b/Op-amp_and_linear_integrated_circuits_/screenshots/ex_7_26.png Binary files differnew file mode 100755 index 00000000..433f99ac --- /dev/null +++ b/Op-amp_and_linear_integrated_circuits_/screenshots/ex_7_26.png |