{ "metadata": { "name": "" }, "nbformat": 3, "nbformat_minor": 0, "worksheets": [ { "cells": [ { "cell_type": "heading", "level": 1, "metadata": {}, "source": [ "Chapter 16 : Integrated Circuits as Analog System Building blocks" ] }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Example 16.1, Page No 621" ] }, { "cell_type": "code", "collapsed": false, "input": [ "import math\n", "#initialisation of variables\n", "\n", "#Caption:Fourth Order Butterworth Filter\n", "#Given Data\n", "fo=1.0\t\t#Cutoff Frequency in Hz\n", "#For n = 4\n", "k1=0.765\n", "k2=1.848\n", "Av1 = 3-k1\n", "Av2 = 3-k2\n", "\n", "#Calculations\n", "print('For a fourth order Buttworth filter we cacade 2 second order Buttworth filter with parameters R1 R2 R1d R2d R C')\n", "#we arbitrarily choose\n", "R1=10.0 \t#in K\n", "print(\"The value of R1= %.2f K \" %R1)\n", "#Av1=(R1+R1d)/R1\n", "R1d=(Av1*R1)-R1\n", "print(\"The value of R1d= %.2f K \" %R1d)\n", "\n", "R2 = 10.0 #in K\n", "print(\"The value of R2= %.2f K \" %R2)\n", "R2d=(Av2*R2)-R2\n", "print(\"The value of R2d= %.2f K \" %R2d)\n", "\n", "\n", "#Results\n", "#To satisfy fo = 1/(2*math.pi*r*c) = 1kHz\n", "R=1#in K\n", "C = 1/(2*math.pi*R*fo)\n", "print(\"The value of R = %.2f K \" %R)\n", "print(\"The value of C = %.2f microF \" %C)\n" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "For a fourth order Buttworth filter we cacade 2 second order Buttworth filter with parameters R1 R2 R1d R2d R C\n", "The value of R1= 10.00 K \n", "The value of R1d= 12.35 K \n", "The value of R2= 10.00 K \n", "The value of R2d= 1.52 K \n", "The value of R = 1.00 K \n", "The value of C = 0.16 microF \n" ] } ], "prompt_number": 1 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Example 16.2, Page No 626" ] }, { "cell_type": "code", "collapsed": false, "input": [ "import math\n", "\n", "#initialisation of variables\n", "Ao=50.0 #Gain\n", "fo=160.0 #center frequency\n", "B=16.0 #Bandwidth in Hz\n", "C1=0.1 #in microF\n", "C2=0.1 #in microF\n", "\n", "#Required Formulae\n", "\n", "#Calculations\n", "Q=fo/B\n", "R1=(1000*Q)/(Ao*2*math.pi*fo*C1)\n", "R3=(1000*Q)/((2*math.pi*fo)*(C1*C2/(C1+C2)))\n", "#As C is in microFarad to compensate for it 1000 is multiplied\n", "#Let r = R'\n", "r=(10**6)/((2*math.pi*fo)**2*R3*C1*C2)\n", "R2=(R1*r)/(R1-r)\n", "\n", "#Results\n", "print(\"The value of R1= %.2f K \" %R1)\n", "print(\"The value of R3= %.2f K \" %R3)\n", "print(\"The value of r= %.2f ohm \" %(r*10**3))\n", "print(\"The value of R2= %.2f ohm \" %(R2*10**3))" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "The value of R1= 1.99 K \n", "The value of R3= 198.94 K \n", "The value of r= 497.36 ohm \n", "The value of R2= 663.15 ohm \n" ] } ], "prompt_number": 2 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Example 16.3 Page No 638" ] }, { "cell_type": "code", "collapsed": false, "input": [ "import math\n", "\n", "#initialisation of variables\n", "\n", "Avo=-25.0\n", "Vagc=20.0 #in V\n", "Vcc=6.0 #in V\n", "hfe=50.0 \n", "rbb=50.0 #in ohm\n", "Cs=5.0 #in pF\n", "Cl=5.0 #in pF\n", "Ie1=1.0 #in mA\n", "ft=900.0 #in MHz\n", "Vt=26.0 #in V\n", "n=2.0 #eeta\n", "#re2 = infinity\n", "\n", "#Calculations\n", "#Since Vagc=0 , transistor Q2 is in cut off region and collector current of Q1 flows through Q3....So\n", "Ie2=0\n", "Ie3=1.0 #in mA\n", "re3 = (n*Vt)/Ie3 #in ohm\n", "print(\"The value of re3 = %.2f ohm \" %re3)\n", "gm = (Ie1)/Vt #in ohm^-1\n", "print(\"The value of gm = %.2f ohm^-1 \" %gm)\n", "rbe=hfe/gm\n", "print(\"The value of rbe = %.2f ohm \" %rbe)\n", "Ce=gm/(2*math.pi*ft*10**-6)\n", "print(\"The value of Ce = %.2f pF \" %Ce)\n", "a3=1.0 #we make an assumption that alpha is one\n", "s=0\n", "#Av0 = -((a3*gm)/(re3*rbb))*(1/(((1/rbb)+(1/rbe)+(s*Ce))*((1/re3)+(s*Cs))*((1/Rl)+(s*(Cs+Cl)))))\n", "#From here we can find Rl\n", "k = -((a3*gm)/(re3*rbb))*(1/(((1/rbb)+(1/rbe)+(s*Ce))*((1/re3)+(s*Cs))))\n", "Rl=Avo/k\n", "print(\"The value of Rl = %.2f ohm \" %Rl)\n", "#C is in picoFarad so to compensate the whole equation some constants are multiplied\n", "f1 = 1.0/(2*math.pi*Rl*(Cs+Cl)*10**-6)\n", "\n", "#Results\n", "print(\"The value of f1 = %.2f MHz \" %f1)\n", "f2 = 1.0/(2*math.pi*Ce*10**-6*((rbe*rbb)/(rbe+rbb)))\n", "print(\"The value of f2 = %.2f MHz \" %f2)\n", "f3 = 1.0/(2*math.pi*Cs*re3*10**-6)\n", "print(\"The value of f3 = %.2f MHz \" %f3)\n" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "The value of re3 = 52.00 ohm \n", "The value of gm = 0.04 ohm^-1 \n", "The value of rbe = 1300.00 ohm \n", "The value of Ce = 6.80 pF \n", "The value of Rl = 675.00 ohm \n", "The value of f1 = 23.58 MHz \n", "The value of f2 = 486.00 MHz \n", "The value of f3 = 612.13 MHz \n" ] } ], "prompt_number": 3 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Example 16.4a, Page No 656" ] }, { "cell_type": "code", "collapsed": false, "input": [ "import math\n", "#initialisation of variables\n", "\n", "Vbb = 1.15 #in V\n", "Vee=5.20 #in V\n", "Vbe5=0.7 #in V\n", "R=1.18 #in K\n", "r=300.0 #in ohm\n", "Vbecutin=0.5 #in V\n", "\n", "#Calculations\n", "#If all inputs are low then we assume that Q1,Q2 and Q3 are cutoff and Q4 is conducting\n", "Ve=-Vbb-Vbe5#Voltage at Common Emitter in V\n", "#Current I in 1.18K Resistor\n", "I = (Ve+Vee)/R#in mA\n", "I1=I\n", "print(\"Current in 300 ohm resistance I= %.2f mA \" %I)\n", "#Output Voltage at Y\n", "vy = -(r*I/1000)-Vbe5 #I is in mA so 1000 is multiplied\n", "Vbe = vy-Ve\n", "print(\"The value of Vbe is %.2f v \" %Vbe)\n", "if Vbe0 :\n", " print('For on npn transistor this represents a reverse bias and Q4 must be in active region')\n", "\n", "Vb1 = v\n", "Vc1 = vy+Vbe5\n", "Vcb1 = Vc1 + Vb1\n", "\n", "#Results\n", "print(\"The value of Vc1 is %.2f v \" %Vc1)\n", "print(\"The value of Vcb1 is %.2f v \" %Vcb1)\n", "if Vcb1<0 :\n", " print('For an npn transistor this represents a forward bias.... therefore Q1 is in saturation region')\n" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "The value of Vcb4 is 0.30 v \n", "For on npn transistor this represents a reverse bias and Q4 must be in active region\n", "The value of Vc1 is -0.85 v \n", "The value of Vcb1 is -0.10 v \n", "For an npn transistor this represents a forward bias.... therefore Q1 is in saturation region\n" ] } ], "prompt_number": 6 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Example 16.4d, Page No 656" ] }, { "cell_type": "code", "collapsed": false, "input": [ "import math\n", "#initialisation of variables\n", "Vbb = 1.15 #in V\n", "Vee=5.20 #in V\n", "Vbe5=0.7 #in V\n", "R=1.18 #in K\n", "r=300.0 #in ohm\n", "Vbecutin=0.5 #in V\n", "\n", "#Calculations\n", "\n", "#If all inputs are low then we assume that Q1,Q2 and Q3 are cutoff and Q4 is conducting\n", "Ve=-Vbb-Vbe5#Voltage at Common Emitter in V\n", "#Current I in 1.18K Resistor\n", "I = (Ve+Vee)/R#in mA\n", "I1=I\n", "#Output Voltage at Y\n", "vy = -(r*I/1000.0)-Vbe5#I is in mA so 1000 is multiplied\n", "Vbe = vy-Ve\n", "if Vbe