diff options
32 files changed, 14951 insertions, 0 deletions
diff --git a/Electronic_Circuit_Analysis_And_Design_by_D._A._Neamen/Chapter10_1_1.ipynb b/Electronic_Circuit_Analysis_And_Design_by_D._A._Neamen/Chapter10_1_1.ipynb new file mode 100644 index 00000000..d06c15b2 --- /dev/null +++ b/Electronic_Circuit_Analysis_And_Design_by_D._A._Neamen/Chapter10_1_1.ipynb @@ -0,0 +1,593 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:6b7c754b6ed46e47374605eefbbcd7d3c6bec34fcb694974971d2be63bb15a17"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter10-Integrated Circuit Biasing and Active Loads "
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex1-pg580"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "##Example 10.1\n",
+ "Vbe=0.6;##(V)\n",
+ "b=100.;\n",
+ "V1=5.;\n",
+ "Io=200.;##micro A\n",
+ "Iref=Io*(1.+2./b);\n",
+ "print\"%s %.2f %s\"%('\\nreference current= ',Iref,' microA\\n')\n",
+ "Iref=Iref*0.001;##mA\n",
+ "R1=(V1-Vbe)/Iref;\n",
+ "print\"%s %.2f %s\"%('\\nR1= ',R1,' KOhm\\n')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "reference current= 204.00 microA\n",
+ "\n",
+ "\n",
+ "R1= 21.57 KOhm\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex2-pg582"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "##Example 10.2\n",
+ "V1=5.;\n",
+ "V2=-5.;\n",
+ "R1=9.3;\n",
+ "b=50.;\n",
+ "Vbe=0.7;\n",
+ "Va=80.;\n",
+ "Iref=(V1-Vbe-V2)/R1;\n",
+ "print\"%s %.2f %s\"%('\\nreference current = ',Iref,'mA\\n')\n",
+ "Io=Iref/(1.+2./b);\n",
+ "print\"%s %.2f %s\"%('\\noutput current= ',Io,'mA\\n')\n",
+ "ro=Va/Io;\n",
+ "print\"%s %.2f %s\"%('\\nsmall signal output resistance= ',ro,' KOhm\\n')\n",
+ "##dIo=dVce2/ro\n",
+ "Vce2=0.7;\n",
+ "dIo=(V1-Vce2)/ro;\n",
+ "print\"%s %.2f %s\"%('\\nchange in load current= ',dIo,' mA\\n')\n",
+ "x=dIo/Io;\n",
+ "x=x*100.;\n",
+ "print\"%s %.2f %s\"%('\\npercent change in output current= ',x,' \\n')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "reference current = 1.00 mA\n",
+ "\n",
+ "\n",
+ "output current= 0.96 mA\n",
+ "\n",
+ "\n",
+ "small signal output resistance= 83.20 KOhm\n",
+ "\n",
+ "\n",
+ "change in load current= 0.05 mA\n",
+ "\n",
+ "\n",
+ "percent change in output current= 5.38 \n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex4-pg591"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "##Example 10.4\n",
+ "Iref=1.;\n",
+ "Io=12.*10**-3;\n",
+ "V1=5.;\n",
+ "V2=-5.;\n",
+ "Vt=0.026;\n",
+ "Vbe=0.7;\n",
+ "R1=(V1-Vbe-V2)/Iref;\n",
+ "print\"%s %.2f %s\"%('\\nResistance R1 = ',R1,'KOhm\\n')\n",
+ "Re=(Vt/Io)*math.log(Iref/Io);\n",
+ "print\"%s %.2f %s\"%('\\nResistance Re = ',Re,'KOhm\\n')\n",
+ "Vbe=Io*Re;\n",
+ "print\"%s %.2f %s\"%('\\ndifference between two B-E voltages= ',Vbe,' V\\n')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Resistance R1 = 9.30 KOhm\n",
+ "\n",
+ "\n",
+ "Resistance Re = 9.58 KOhm\n",
+ "\n",
+ "\n",
+ "difference between two B-E voltages= 0.11 V\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex5-pg593"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "##Example 10.5\n",
+ "V1=5.;\n",
+ "V2=-5.;\n",
+ "R1=9.3;\n",
+ "Re=9.580;\n",
+ "Vt=0.026;\n",
+ "b=100.;\n",
+ "Vbe=0.7;\n",
+ "Va=80.;\n",
+ "Io=12.;\n",
+ "ro2=Va/Io;\n",
+ "print\"%s %.2f %s\"%('\\nsmall signal collector resistance= ',ro2,' MOhm\\n')\n",
+ "Io=12.*0.001;##mA\n",
+ "gm2=Io/Vt;\n",
+ "print\"%s %.2f %s\"%('\\ntransconductance= ',gm2,' mA/V\\n')\n",
+ "r=b*Vt/Io;\n",
+ "print\"%s %.2f %s\"%('\\nResistance= ',r,' KOhm\\n')\n",
+ "Ro=ro2*(1.+gm2*Re*r/(Re+r));\n",
+ "print\"%s %.2f %s\"%('\\noutput resistance= ',Ro,' MOhm\\n')\n",
+ "dVc2=4.;\n",
+ "dIo=dVc2/Ro;\n",
+ "print\"%s %.2f %s\"%('\\nchange in load current= ',dIo,' microA\\n')\n",
+ "Io=12.;##micro A\n",
+ "x=dIo/Io;\n",
+ "x=x*100.;\n",
+ "print\"%s %.2f %s\"%('\\npercent change in output current =\\n',x,'')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "small signal collector resistance= 6.67 MOhm\n",
+ "\n",
+ "\n",
+ "transconductance= 0.46 mA/V\n",
+ "\n",
+ "\n",
+ "Resistance= 216.67 KOhm\n",
+ "\n",
+ "\n",
+ "output resistance= 34.90 MOhm\n",
+ "\n",
+ "\n",
+ "change in load current= 0.11 microA\n",
+ "\n",
+ "\n",
+ "percent change in output current =\n",
+ " 0.96 \n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex6-pg597"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "##Example 10.6\n",
+ "V1=5.;\n",
+ "V2=-5.;\n",
+ "Vbe=0.6;\n",
+ "Veb=0.6;\n",
+ "Iq2=400.*10**-3;##mA\n",
+ "Iref=200.*10**-3;##mA\n",
+ "Iq1=Iref;\n",
+ "Iq3=Iq1;\n",
+ "Iq4=600.*10**-6;\n",
+ "R1=(V1-Veb-Vbe-V2)/Iref;\n",
+ "print\"%s %.2f %s\"%('\\nResistance R1= ',R1,' KOhm\\n')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Resistance R1= 44.00 KOhm\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex7-pg601"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ " \n",
+ "##Example 10.7\n",
+ "##uox*Cox/2=x\n",
+ "x=20.*10**-6;##A/V^2\n",
+ "Vtn=1.;\n",
+ "V1=5.;\n",
+ "V2=0.;\n",
+ "Iref=0.25*10**-3;\n",
+ "Io=0.1*10**-3;\n",
+ "Vgs2=1.85;\n",
+ "##let y=W/L\n",
+ "y2=Io/(x*(Vgs2-Vtn)**2);\n",
+ "print\"%s %.2f %s\"%('\\nwidth per length 2= ',y2,'\\n')\n",
+ "y1=Iref/(x*(Vgs2-Vtn)**2);\n",
+ "print\"%s %.2f %s\"%('\\nwidth per length 1= ',y1,'\\n')\n",
+ "Vgs1=Vgs2;\n",
+ "Vgs3=V1-V2-Vgs1;\n",
+ "print\"%s %.2f %s\"%('\\nVgs3= ',Vgs3,' V\\n')\n",
+ "y3=Iref/(x*(Vgs3-Vtn)**2);\n",
+ "print\"%s %.2f %s\"%('\\nwidth per length 3= ',y3,'\\n')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "width per length 2= 6.92 \n",
+ "\n",
+ "\n",
+ "width per length 1= 17.30 \n",
+ "\n",
+ "\n",
+ "Vgs3= 3.15 V\n",
+ "\n",
+ "\n",
+ "width per length 3= 2.70 \n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex8-pg604"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "##Example 10.8\n",
+ "Iref=100.;\n",
+ "Io=Iref;\n",
+ "##lambda=y\n",
+ "y=0.01;\n",
+ "gm=0.5*10**3;\n",
+ "ro=1./(y*Iref);\n",
+ "print\"%s %.2f %s\"%('\\noutput resistance= ',ro,' MOhm\\n')\n",
+ "ro2=1.;\n",
+ "ro4=1.;\n",
+ "Ro=ro4+ro2*(1.+gm*ro4);\n",
+ "print\"%s %.2f %s\"%('\\noutput resistance of cascode circuit= ',Ro,' MOhm\\n')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "output resistance= 1.00 MOhm\n",
+ "\n",
+ "\n",
+ "output resistance of cascode circuit= 502.00 MOhm\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex9-pg609"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "##Example 10.9\n",
+ "Idss1=2.;\n",
+ "Idss2=1.;\n",
+ "Vp1=-1.5;\n",
+ "Vp2=Vp1;\n",
+ "##lambda=y\n",
+ "y1=0.05;\n",
+ "y2=y1;\n",
+ "V2=-5.;\n",
+ "Vds=1.5;\n",
+ "Vsmin=Vds+V2;\n",
+ "print\"%s %.2f %s\"%('\\nminimum value of Vs= ',Vsmin,' V\\n')\n",
+ "Io=Idss2*(1.+y1*Vds);\n",
+ "print\"%s %.2f %s\"%('\\noutput current= ',Io,' mA\\n')\n",
+ "Vgs1=(1.-math.sqrt(Io/Idss1))*Vp1;\n",
+ "print\"%s %.2f %s\"%('\\ngate to source voltage of Q1= ',Vgs1,' V\\n')\n",
+ "V1=Vgs1+Vsmin;\n",
+ "print\"%s %.2f %s\"%('\\nV1= ',V1,' V\\n')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "minimum value of Vs= -3.50 V\n",
+ "\n",
+ "\n",
+ "output current= 1.07 mA\n",
+ "\n",
+ "\n",
+ "gate to source voltage of Q1= -0.40 V\n",
+ "\n",
+ "\n",
+ "V1= -3.90 V\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex10-pg615"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "##Example 10.10\n",
+ "Vt=0.026;\n",
+ "Van=120.;\n",
+ "Vap=80.;\n",
+ "Av=-(1./Vt)/(1./Van+1./Vap);\n",
+ "print\"%s %.2f %s\"%('\\nsmall signal open circuit voltage gain=\\n',Av,'')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "small signal open circuit voltage gain=\n",
+ " -1846.15 \n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex11-pg620"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "##Example 10.11\n",
+ "Van=120.;\n",
+ "Vap=80.;\n",
+ "Vt=0.026;\n",
+ "Ico=0.001;\n",
+ "##Rl=infinity\n",
+ "Av=-(1./Vt)/(1./Van+1./Vap);\n",
+ "print\"%s %.2f %s\"%('\\nsmall signal open circuit voltage gain=\\n',Av,'')\n",
+ "Rl=100.;\n",
+ "Av1=-(1./Vt)/(1./Van+1./Vap+1./Rl);\n",
+ "print\"%s %.2f %s\"%('\\nsmall signal open circuit voltage gain=',Av1,'')\n",
+ "Rl=10.;\n",
+ "Av2=-(1./Vt)/(1./Van+1./Vap+1./Rl);\n",
+ "print\"%s %.2f %s\"%('\\nsmall signal open circuit voltage gain=\\n',Av2,'')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "small signal open circuit voltage gain=\n",
+ " -1846.15 \n",
+ "\n",
+ "small signal open circuit voltage gain= -1247.40 \n",
+ "\n",
+ "small signal open circuit voltage gain=\n",
+ " -318.30 \n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex12-pg623"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ " \n",
+ "##Example 10.12\n",
+ "##lambda=y\n",
+ "yn=0.01;\n",
+ "yp=0.01;\n",
+ "Vtn=1.;\n",
+ "Kn=1.;\n",
+ "Iref=0.5;\n",
+ "gm=2.*math.sqrt(Kn*Iref);\n",
+ "print\"%s %.2f %s\"%('\\ntransconductance = ',gm,'mA/V\\n')\n",
+ "go=yn*Iref;\n",
+ "print\"%s %.2f %s\"%('\\nsmall signal transistor conductance= ',go,' mA/V\\n')\n",
+ "go2=go;\n",
+ "##for Rl=infinity\n",
+ "Av=-gm/(go+go2);\n",
+ "print\"%s %.2f %s\"%('\\nvoltage gain= ',Av,' \\n')\n",
+ "Rl=100.;##Kohm\n",
+ "gl=0.01;\n",
+ "Av=-gm/(go+gl+go2);\n",
+ "print\"%s %.2f %s\"%('\\nvoltage gain= \\n',Av,'')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "transconductance = 1.41 mA/V\n",
+ "\n",
+ "\n",
+ "small signal transistor conductance= 0.01 mA/V\n",
+ "\n",
+ "\n",
+ "voltage gain= -141.42 \n",
+ "\n",
+ "\n",
+ "voltage gain= \n",
+ " -70.71 \n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Electronic_Circuit_Analysis_And_Design_by_D._A._Neamen/Chapter11_1_1.ipynb b/Electronic_Circuit_Analysis_And_Design_by_D._A._Neamen/Chapter11_1_1.ipynb new file mode 100644 index 00000000..4922457d --- /dev/null +++ b/Electronic_Circuit_Analysis_And_Design_by_D._A._Neamen/Chapter11_1_1.ipynb @@ -0,0 +1,829 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:a62c54845c7e9347a8f02d330a533f4d6528b33252a4f4b96d8c27265abd4ced"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter11-Differential and Multistage Amplifier"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex1-pg642"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "##Example 11.1\n",
+ "V1=10.;\n",
+ "V2=-10.;\n",
+ "Iq=1.;\n",
+ "Rc=10.;\n",
+ "Vbe=0.7;\n",
+ "iC1=Iq/2.;\n",
+ "iC2=iC1;\n",
+ "print\"%s %.2f %s\"%('\\ncollector currents = ',iC1,'mA\\n')\n",
+ "Vc1=V1-iC1*Rc;\n",
+ "Vc2=Vc1;\n",
+ "print\"%s %.2f %s\"%('\\ncollector voltages = ',Vc1,'V\\n')\n",
+ "Vcm=0.;\n",
+ "Ve=Vcm-Vbe;\n",
+ "Vce1=Vc1-Ve;\n",
+ "print\"%s %.2f %s\"%('\\ncollector emitter voltage= ',Vce1,' V\\n')\n",
+ "Vcm=-5.;\n",
+ "Ve=Vcm-Vbe;\n",
+ "Vce1=Vc1-Ve;\n",
+ "print\"%s %.2f %s\"%('\\ncollector emitter voltage = ',Vce1,'V\\n')\n",
+ "Vcm=5.;\n",
+ "Ve=Vcm-Vbe;\n",
+ "Vce1=Vc1-Ve;\n",
+ "print\"%s %.2f %s\"%('\\ncollector emitter voltage= ',Vce1,' V\\n')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "collector currents = 0.50 mA\n",
+ "\n",
+ "\n",
+ "collector voltages = 5.00 V\n",
+ "\n",
+ "\n",
+ "collector emitter voltage= 5.70 V\n",
+ "\n",
+ "\n",
+ "collector emitter voltage = 10.70 V\n",
+ "\n",
+ "\n",
+ "collector emitter voltage= 0.70 V\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex3-pg650"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "##Example 11.3\n",
+ "V1=10.;\n",
+ "V2=-10.;\n",
+ "Iq=0.8*10**-3;\n",
+ "Rc=12000.;\n",
+ "Ro=25000.;\n",
+ "b=100.;\n",
+ "Vt=0.026;\n",
+ "Ad=Iq*Rc/(4.*Vt);\n",
+ "print\"%s %.2f %s\"%('\\ndifferential gain=\\n',Ad,'')\n",
+ "Acm=-(Iq*Rc/(2.*Vt))/(1.+(1.+b)*Iq*Ro/(Vt*b));\n",
+ "print\"%s %.2f %s\"%('\\ncommon mode gain=\\n',Acm,'')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "differential gain=\n",
+ " 92.31 \n",
+ "\n",
+ "common mode gain=\n",
+ " -0.24 \n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex7-pg657"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "##Example 11.7\n",
+ "Ad=92.3;\n",
+ "Acm=0.237;##mod of Acm\n",
+ "CMRR=Ad/Acm;\n",
+ "print\"%s %.2f %s\"%('\\ncommon mode rejection ratio=\\n',CMRR,'')\n",
+ "CMRRdB=20.*math.log10(CMRR);\n",
+ "print\"%s %.2f %s\"%('\\nCMRR in decibels= ',CMRRdB,' dB\\n')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "common mode rejection ratio=\n",
+ " 389.45 \n",
+ "\n",
+ "CMRR in decibels= 51.81 dB\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex8-pg658"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "##Example 11.8\n",
+ "CMRRdB=90.;##dB\n",
+ "CMRR=3.16*10**4;\n",
+ "b=100.;\n",
+ "Vt=0.026;\n",
+ "Iq=0.8;\n",
+ "Ro=(2.*CMRR-1.)*Vt*b/((1.+b)*Iq);\n",
+ "Ro=Ro*10**-3;##Mohm\n",
+ "print round(Ro,2)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "2.03\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex9-pg661"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "##Example 11.9\n",
+ "b=100.;\n",
+ "Vbe=0.7;\n",
+ "Va=100.;\n",
+ "Vt=0.026;\n",
+ "Iref=0.5;\n",
+ "Iq=Iref;\n",
+ "I1=Iq/2.\n",
+ "Icq=I1;\n",
+ "r=b*Vt/Icq;\n",
+ "print\"%s %.2f %s\"%('\\nsmall signal parameter= ',r,' KOhm\\n')\n",
+ "ro=Va/Icq;\n",
+ "print\"%s %.2f %s\"%('\\nro= ',ro,' KOhm\\n')\n",
+ "Ro=Va/Iq;\n",
+ "print\"%s %.2f %s\"%('\\noutput resistance of Q4= ',Ro,' KOhm\\n')\n",
+ "Rid=2.*r;\n",
+ "print\"%s %.2f %s\"%('\\ndifferential mode input resistance = ',Rid,'KOhm\\n')\n",
+ "Ricm=(1.+b)*(Ro*ro/2.)/(Ro+ro/2.);\n",
+ "Ricm=Ricm*0.001;##Mohm\n",
+ "print\"%s %.2f %s\"%('\\ncommon mode input resistance= ',Ricm,' MOhm\\n')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "small signal parameter= 10.40 KOhm\n",
+ "\n",
+ "\n",
+ "ro= 400.00 KOhm\n",
+ "\n",
+ "\n",
+ "output resistance of Q4= 200.00 KOhm\n",
+ "\n",
+ "\n",
+ "differential mode input resistance = 20.80 KOhm\n",
+ "\n",
+ "\n",
+ "common mode input resistance= 10.10 MOhm\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex10-pg664"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "import numpy\n",
+ "from numpy import poly\n",
+ "##Example 11.10\n",
+ "Kn1=0.1;\n",
+ "Kn2=Kn1;\n",
+ "Kn3=0.1;\n",
+ "Kn4=Kn3;\n",
+ "R1=30.;\n",
+ "Vtn=1.;\n",
+ "Rd=16.;\n",
+ "\n",
+ "Vgs4=2.40;\n",
+ "I1=(20.-Vgs4)/R1;\n",
+ "print\"%s %.2f %s\"%('\\nI1= ',I1,' mA\\n')\n",
+ "Iq=I1;\n",
+ "Id1=Iq/2.;\n",
+ "print\"%s %.2f %s\"%('\\nId1 and Id2 = ',Id1, 'mA\\n')\n",
+ "Vgs1=math.sqrt(Id1/Kn1)+Vtn;\n",
+ "print\"%s %.2f %s\"%('\\nVgs1 and Vgs2 = ',Vgs1,'V\\n')\n",
+ "vo1=10.-Id1*Rd;\n",
+ "print\"%s %.2f %s\"%('\\nvo1 and vo2= ',vo1,' V\\n')\n",
+ "Vds1=Vgs1-Vtn;\n",
+ "print\"%s %.2f %s\"%('\\nVds1=Vds2=Vds1(sat)= ',Vds1,' V\\n')\n",
+ "Vcm=vo1-Vds1+Vgs1;\n",
+ "print\"%s %.2f %s\"%('\\nVcm max= ',Vcm,' V\\n')\n",
+ "Vds4=Vgs4-Vtn;\n",
+ "print\"%s %.2f %s\"%('\\nVds4= ',Vds4,' V\\n')\n",
+ "Vcm2=Vgs1+Vds4-10.;\n",
+ "print\"%s %.2f %s\"%('\\nVcm min= ',Vcm2,'V\\n')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "I1= 0.59 mA\n",
+ "\n",
+ "\n",
+ "Id1 and Id2 = 0.29 mA\n",
+ "\n",
+ "\n",
+ "Vgs1 and Vgs2 = 2.71 V\n",
+ "\n",
+ "\n",
+ "vo1 and vo2= 5.31 V\n",
+ "\n",
+ "\n",
+ "Vds1=Vds2=Vds1(sat)= 1.71 V\n",
+ "\n",
+ "\n",
+ "Vcm max= 6.31 V\n",
+ "\n",
+ "\n",
+ "Vds4= 1.40 V\n",
+ "\n",
+ "\n",
+ "Vcm min= -5.89 V\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex11-pg668"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "##Example 11.11\n",
+ "Kn=0.5;\n",
+ "Iq=1.;\n",
+ "Vt=0.026;\n",
+ "##transconductance of the MOSFET\n",
+ "gm=2.*math.sqrt(Kn*Iq/2);\n",
+ "print\"%s %.2f %s\"%('\\ntransconductance= ',gm,' mA/V\\n')\n",
+ "##transconductance of the bipolar transistor \n",
+ "gm=Iq/(2.*Vt);\n",
+ "print\"%s %.2f %s\"%('\\ntransconductance= ',gm,' mA/V\\n')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "transconductance= 1.00 mA/V\n",
+ "\n",
+ "\n",
+ "transconductance= 19.23 mA/V\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex12-pg670"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "##Example 11.12\n",
+ "Iq=0.587;\n",
+ "Kn=1.;\n",
+ "Rd=16.;\n",
+ "##lambda=y\n",
+ "y=0.01;\n",
+ "Ro=1./(y*Iq);\n",
+ "print\"%s %.2f %s\"%('\\noutput resistance = ',Ro,'KOhm\\n')\n",
+ "Ad=math.sqrt(Kn*Iq/2.)*Rd;\n",
+ "print\"%s %.2f %s\"%('\\ndifferential mode voltage gain= \\n',Ad,'')\n",
+ "Acm=-math.sqrt(2.*Kn*Iq)*Rd/(1.+2.*math.sqrt(2.*Kn*Iq)*Ro);\n",
+ "print\"%s %.2f %s\"%('\\ncommon mode voltage gain=\\n',Acm,'')\n",
+ "CMRR=20.*math.log10(-Ad/Acm);\n",
+ "print\"%s %.2f %s\"%('\\ncommon mode rejection ratio= ',CMRR,' dB\\n')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "output resistance = 170.36 KOhm\n",
+ "\n",
+ "\n",
+ "differential mode voltage gain= \n",
+ " 8.67 \n",
+ "\n",
+ "common mode voltage gain=\n",
+ " -0.05 \n",
+ "\n",
+ "common mode rejection ratio= 45.35 dB\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex13-pg678"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "##Example 11.13\n",
+ "Iq=0.2;\n",
+ "Va=100.;\n",
+ "Va2=Va;\n",
+ "Va4=Va;\n",
+ "Rl=100.;\n",
+ "Vt=0.026;\n",
+ "Ad=(1./Vt)/(1./Va2+1./Va4);\n",
+ "print\"%s %.2f %s\"%('\\nopen circuit voltage gain=\\n',Ad,'')\n",
+ "Ad=(Iq/(2.*Vt))/(Iq/(2.*Va2)+Iq/(2.*Va4)+1./Rl);\n",
+ "print\"%s %.2f %s\"%('\\nvoltage gain=\\n',Ad,'')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "open circuit voltage gain=\n",
+ " 1923.08 \n",
+ "\n",
+ "voltage gain=\n",
+ " 320.51 \n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex15-pg684"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "##Example 11.15\n",
+ "Kn=0.2;\n",
+ "Idq=0.1;\n",
+ "ro4=1000.;##Kohm\n",
+ "ro6=1000.;##KOhm\n",
+ "ro2=ro4;\n",
+ "##lambda=y\n",
+ "y=0.01;\n",
+ "gm=2.*math.sqrt(Kn*Idq);\n",
+ "print\"%s %.2f %s\"%('\\ntransconductance= ',gm,' mA/V\\n')\n",
+ "ro=1./(y*Idq);\n",
+ "print\"%s %.2f %s\"%('\\noutput resistance= ',ro,' KOhm\\n')\n",
+ "Ro=ro4+ro6*(1.+gm*ro);\n",
+ "Ro=Ro*0.001;##Mohm\n",
+ "print\"%s %.2f %s\"%('\\noutput resistance of the cascode active load= ',Ro,'Mohm\\n')\n",
+ "Ro=Ro*1000.;##KOhm\n",
+ "Ad=gm*ro2*Ro/(ro4+Ro);\n",
+ "print\"%s %.2f %s\"%('\\ndifferential mode voltage gain=\\n',Ad,'')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "transconductance= 0.28 mA/V\n",
+ "\n",
+ "\n",
+ "output resistance= 1000.00 KOhm\n",
+ "\n",
+ "\n",
+ "output resistance of the cascode active load= 284.84 Mohm\n",
+ "\n",
+ "\n",
+ "differential mode voltage gain=\n",
+ " 281.85 \n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex16-pg693"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "##Example 11.16\n",
+ "Iq=0.2;\n",
+ "Ic1=Iq;\n",
+ "Icb=1.;\n",
+ "R4=10.;\n",
+ "R3=0.2;\n",
+ "b=100.;\n",
+ "Va=100.;\n",
+ "Vt=0.026;\n",
+ "Ri=2.*(1.+b)*b*Vt/Iq;\n",
+ "Ri=Ri*0.001;##MOhm\n",
+ "print\"%s %.2f %s\"%('\\ninput resistance= ',Ri,' MOhm\\n')\n",
+ "R11=b*Vt/Iq;\n",
+ "print\"%s %.2f %s\"%('\\nresistance R11= ',R11,' KOhm\\n')\n",
+ "Re=R11*R3/(R11+R3);\n",
+ "print\"%s %.2f %s\"%('\\nRe= ',Re,' KOhm\\n')\n",
+ "gm11=Iq/Vt;\n",
+ "print\"%s %.2f %s\"%('\\ngm11= ',gm11,' mA/V\\n')\n",
+ "ro11=Va/Iq;\n",
+ "print\"%s %.2f %s\"%('\\nro11 = ',ro11,'KOhm\\n')\n",
+ "Rc11=ro11*(1+gm11*Re);\n",
+ "Rc11=Rc11*0.001;##MOhm\n",
+ "print\"%s %.2f %s\"%('\\nRc11= ',Rc11,' MOhm\\n')\n",
+ "r8=b*Vt/Icb;\n",
+ "print\"%s %.2f %s\"%('\\nresistance= ',r8,'KOhm\\n')\n",
+ "##answer of following given in the book is wrong\n",
+ "Rb8=r8+(1.+b)*R4;\n",
+ "Rb8=Rb8*0.001;##MOhm\n",
+ "print\"%s %.2f %s\"%('\\nRb8 = ',Rb8,'MOhm\\n')\n",
+ "Rl7=Rc11*Rb8/(Rc11+Rb8);\n",
+ "print\"%s %.2f %s\"%('\\nRl7= ',Rl7,' MOhm\\n')\n",
+ "Av=Iq*Rl7/(2.*Vt);\n",
+ "print\"%s %.2f %s\"%('\\nsmall signal voltage gain=\\n',Av,'')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "input resistance= 2.63 MOhm\n",
+ "\n",
+ "\n",
+ "resistance R11= 13.00 KOhm\n",
+ "\n",
+ "\n",
+ "Re= 0.20 KOhm\n",
+ "\n",
+ "\n",
+ "gm11= 7.69 mA/V\n",
+ "\n",
+ "\n",
+ "ro11 = 500.00 KOhm\n",
+ "\n",
+ "\n",
+ "Rc11= 1.26 MOhm\n",
+ "\n",
+ "\n",
+ "resistance= 2.60 KOhm\n",
+ "\n",
+ "\n",
+ "Rb8 = 1.01 MOhm\n",
+ "\n",
+ "\n",
+ "Rl7= 0.56 MOhm\n",
+ "\n",
+ "\n",
+ "small signal voltage gain=\n",
+ " 2.16 \n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex17-pg694"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "##Example 11.17\n",
+ "Va=100.;\n",
+ "R4=10.;\n",
+ "b=100.;\n",
+ "Rc11=1.26*10**3;\n",
+ "r8=2.6;\n",
+ "Iq=0.2;\n",
+ "Rc7=Va/Iq;\n",
+ "print\"%s %.2f %s\"%('\\nRc7= ',Rc7,' KOhm\\n')\n",
+ "Z=Rc11*Rc7/(Rc11+Rc7);\n",
+ "print\"%s %.2f %s\"%('\\nZ= ',Z,' KOhm\\n')\n",
+ "x=(r8+Z)/(1.+b);\n",
+ "Ro=R4*x/(R4+x);\n",
+ "print\"%s %.2f %s\"%('\\noutput resistance= ',Ro,' KOhm\\n')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Rc7= 500.00 KOhm\n",
+ "\n",
+ "\n",
+ "Z= 357.95 KOhm\n",
+ "\n",
+ "\n",
+ "output resistance= 2.63 KOhm\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex19-pg697"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "##Example 11.19\n",
+ "b=100.;\n",
+ "Vt=0.026;\n",
+ "Rc=20.;\n",
+ "Ir4=0.4;\n",
+ "Iq=Ir4;\n",
+ "Ir6=Ir4;\n",
+ "r4=b*Vt/Ir4;\n",
+ "print\"%s %.2f %s\"%('\\nr4= ',r4,' KOhm\\n')\n",
+ "r3=b**2*Vt/Ir4;\n",
+ "print\"%s %.2f %s\"%('\\nr3= ',r3,' KOhm\\n')\n",
+ "Ri2=r3+(1.+b)*r4;\n",
+ "print\"%s %.2f %s\"%('\\ninput resistance= ',Ri2,' KOhm\\n')\n",
+ "gm=Iq/(2.*Vt);\n",
+ "print\"%s %.2f %s\"%('\\ntransconductance= ',gm,' mA/V\\n')\n",
+ "Ad1=gm*Rc*Ri2/(2.*(Rc+Ri2));\n",
+ "print\"%s %.2f %s\"%('\\ngain of differential amplifier stage=\\n',Ad1,'')\n",
+ "r5=b*Vt/Ir6;\n",
+ "print\"%s %.2f %s\"%('\\nr5 = ',r5,'KOhm\\n')\n",
+ "Ir7=2.;\n",
+ "r6=b*Vt/Ir7;\n",
+ "print\"%s %.2f %s\"%('\\nr6= ',r6,' KOhm\\n')\n",
+ "R6=16.5;\n",
+ "R7=5.;\n",
+ "Ri3=r5+(1.+b)*(R6+r6+(1.+b)*R7);\n",
+ "Ri3=Ri3*0.001;##MOhm\n",
+ "print\"%s %.2f %s\"%('\\nRi3= ',Ri3,' MOhm\\n')\n",
+ "Rs=5.;\n",
+ "A2=Ir4*Rs/(2.*Vt);\n",
+ "print\"%s %.2f %s\"%('\\nvoltage gain A2=\\n',A2,'')\n",
+ "A3=1.;##vo/vo3\n",
+ "Ad=Ad1*A2*A3;\n",
+ "print\"%s %.2f %s\"%('\\nsmall signal voltage gain=\\n',Ad,'')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "r4= 6.50 KOhm\n",
+ "\n",
+ "\n",
+ "r3= 650.00 KOhm\n",
+ "\n",
+ "\n",
+ "input resistance= 1306.50 KOhm\n",
+ "\n",
+ "\n",
+ "transconductance= 7.69 mA/V\n",
+ "\n",
+ "\n",
+ "gain of differential amplifier stage=\n",
+ " 75.76 \n",
+ "\n",
+ "r5 = 6.50 KOhm\n",
+ "\n",
+ "\n",
+ "r6= 1.30 KOhm\n",
+ "\n",
+ "\n",
+ "Ri3= 52.81 MOhm\n",
+ "\n",
+ "\n",
+ "voltage gain A2=\n",
+ " 38.46 \n",
+ "\n",
+ "small signal voltage gain=\n",
+ " 2913.97 \n"
+ ]
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex20-pg702"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "##Example 11.20\n",
+ "Ro=10000000.;\n",
+ "Co=1.*10**-12;\n",
+ "Rb=500.;\n",
+ "r=10000.;\n",
+ "b=100.;\n",
+ "f=1./(2.*math.pi*Ro*Co);\n",
+ "f=f*0.001;##KHz\n",
+ "print\"%s %.2f %s\"%('\\nfrequency of the zero= ',f,' KHz\\n')\n",
+ "Req=Ro*(1.+Rb/r)/(1.+Rb/r+2.*(1.+b)*Ro/r);\n",
+ "print\"%s %.2f %s\"%('\\nReq= ',Req,' Ohm\\n')\n",
+ "f=1/(2.*math.pi*Req*Co);\n",
+ "f=f*10**-9;##GHz\n",
+ "print\"%s %.2f %s\"%('\\nfrequency of the pole= ',f,' GHz\\n')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "frequency of the zero= 15.92 KHz\n",
+ "\n",
+ "\n",
+ "Req= 51.98 Ohm\n",
+ "\n",
+ "\n",
+ "frequency of the pole= 3.06 GHz\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 14
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Electronic_Circuit_Analysis_And_Design_by_D._A._Neamen/Chapter12_1_1.ipynb b/Electronic_Circuit_Analysis_And_Design_by_D._A._Neamen/Chapter12_1_1.ipynb new file mode 100644 index 00000000..4335c4e4 --- /dev/null +++ b/Electronic_Circuit_Analysis_And_Design_by_D._A._Neamen/Chapter12_1_1.ipynb @@ -0,0 +1,540 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:1ace7ec8ddbfe04d19fdbb2c12f100c57a3d84e0fdba823b9d7bc82551c86874"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter12-Feedback and Stability"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex1-pg732"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "##Example 12.1\n",
+ "A=10**5;##open loop gain\n",
+ "Af=50.;##closed loop gain\n",
+ "b=(A/Af-1.)/A;\n",
+ "print\"%s %.2f %s\"%('\\nfeedback transfer function=\\n',b,'')\n",
+ "A=-10**5;\n",
+ "Af=-50.;\n",
+ "b=(A/Af-1.)/A;\n",
+ "print\"%s %.2f %s\"%('\\nfeedback transfer function=\\n',b,'')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "feedback transfer function=\n",
+ " 0.02 \n",
+ "\n",
+ "feedback transfer function=\n",
+ " -0.02 \n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex2-pg733"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "##Example 12.2\n",
+ "A=10**5;\n",
+ "Af=50.;\n",
+ "b=0.019999;\n",
+ "dA=10**4;\n",
+ "dAf=Af*dA/(A*(1.+b*A));\n",
+ "print\"%s %.2e %s\"%('\\ndAf ',dAf,'\\n')\n",
+ "##x=dAf/Af\n",
+ "x=dAf/Af;\n",
+ "x=x*100.;\n",
+ "print\"%s %.2e %s\"%('\\npercent change dAf/Af= ',x,'\\n')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "dAf 2.50e-03 \n",
+ "\n",
+ "\n",
+ "percent change dAf/Af= 5.00e-03 \n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex3-pg735"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "##Example 12.3\n",
+ "Ao=10**4;\n",
+ "wh=2.*math.pi*100.;##rad/s\n",
+ "Af=50.;\n",
+ "##x=(1+bAo)\n",
+ "x=Ao/Af;\n",
+ "print\"%s %.2f %s\"%('\\n(1+bAo)=\\n',x,'')\n",
+ "wfh=wh*x;\n",
+ "print\"%s %.2f %s\"%('\\nclosed loop bandwidth=\\n',wfh,'')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "(1+bAo)=\n",
+ " 200.00 \n",
+ "\n",
+ "closed loop bandwidth=\n",
+ " 125663.71 \n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex5-pg742"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ " \n",
+ "##Example 12.5\n",
+ "Av=10**5;\n",
+ "Avf=50.;\n",
+ "Rf=10.;##Kohm\n",
+ "Ro=20000.;##Ohm\n",
+ "##x=(1+bvAv)\n",
+ "x=Av/Avf;\n",
+ "print\"%s %.2e %s\"%('\\n(1+bvAv)=\\n',x,'')\n",
+ "Rif=Rf*x;\n",
+ "Rif=Rif*0.001;##MOhm\n",
+ "print\"%s %.2f %s\"%('\\ninput resistance= ',Rif,' MOhm\\n')\n",
+ "Rof=Ro/x;\n",
+ "print\"%s %.2f %s\"%('\\noutput resistance= ',Rof,' Ohm\\n')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "(1+bvAv)=\n",
+ " 2.00e+03 \n",
+ "\n",
+ "input resistance= 20.00 MOhm\n",
+ "\n",
+ "\n",
+ "output resistance= 10.00 Ohm\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex6-pg745"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "##Example 12.6\n",
+ "Af=10**5;\n",
+ "Aif=50.;\n",
+ "Rf=10000.;\n",
+ "Ro=20.;\n",
+ "##x=(1+biAi)\n",
+ "x=Af/Aif;\n",
+ "print\"%s %.2e %s\"%('\\n(1+biAi)=\\n',x,'')\n",
+ "Rif=Rf/x;\n",
+ "print\"%s %.2f %s\"%('\\ninput resistance = ',Rif,'Ohm\\n')\n",
+ "Rof=Ro*x;\n",
+ "Rof=Rof*0.001;##Mohm\n",
+ "print\"%s %.2f %s\"%('\\noutput resistance= ',Rof,' MOhm\\n')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "(1+biAi)=\n",
+ " 2.00e+03 \n",
+ "\n",
+ "input resistance = 5.00 Ohm\n",
+ "\n",
+ "\n",
+ "output resistance= 40.00 MOhm\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex7-pg751"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "##Example 12.7\n",
+ "Ri=50.;\n",
+ "R1=10.;\n",
+ "R2=90.;\n",
+ "Av=10**4;\n",
+ "bv=1./(1.+R2/R1);\n",
+ "print\"%s %.2f %s\"%('\\nfeedback transfer function=\\n',bv,'')\n",
+ "Rif=Ri*(1.+bv*Av);\n",
+ "Rif=Rif*0.001;##Mohm\n",
+ "print\"%s %.2f %s\"%('\\ninput resistance= ',Rif,' MOhm\\n')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "feedback transfer function=\n",
+ " 0.10 \n",
+ "\n",
+ "input resistance= 50.05 MOhm\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex11-pg765"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ " \n",
+ "##Example 12.11\n",
+ "hFE=100.;##transistor parameter\n",
+ "Vbe=0.7;\n",
+ "Vcc=10.;\n",
+ "R1=55.;\n",
+ "R2=12.;\n",
+ "Re=1.;\n",
+ "Rc=4.;\n",
+ "Rl=4.;\n",
+ "Icq=0.983;\n",
+ "Vceq=5.08;\n",
+ "Vt=0.026;\n",
+ "r=hFE*Vt/Icq;\n",
+ "print\"%s %.2f %s\"%('\\nsmall signal parameter resistance= ',r,' KOhm\\n')\n",
+ "gm=Icq/Vt;\n",
+ "print\"%s %.2f %s\"%('\\ntransconductance= ',gm,' mA/V\\n')\n",
+ "Agf=-gm*(Rc/(Rc+Rl))/(1.+Re*(gm+1./r));\n",
+ "print\"%s %.2f %s\"%('\\ntransconductance transfer function= ',Agf,' mA/V\\n')\n",
+ "##as first approximation\n",
+ "Agf2=-1./Re;\n",
+ "print\"%s %.2f %s\"%('\\nAgf= ',Agf2,' mA/V\\n')\n",
+ "Avf=Agf*Rl;\n",
+ "print\"%s %.2f %s\"%('\\nvoltage gain=\\n',Avf,'')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "small signal parameter resistance= 2.64 KOhm\n",
+ "\n",
+ "\n",
+ "transconductance= 37.81 mA/V\n",
+ "\n",
+ "\n",
+ "transconductance transfer function= -0.48 mA/V\n",
+ "\n",
+ "\n",
+ "Agf= -1.00 mA/V\n",
+ "\n",
+ "\n",
+ "voltage gain=\n",
+ " -1.93 \n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex15-pg777"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "##Example 12.15\n",
+ "##Determine the loop gain fig12.45(a)\n",
+ "hFE=100.;\n",
+ "Vbe=0.7;\n",
+ "Icq=0.492;\n",
+ "r=5.28;\n",
+ "gm=18.9;\n",
+ "Rs=10.;\n",
+ "R1=51.;\n",
+ "R2=5.5;\n",
+ "Re=0.500;\n",
+ "Rc=10.;\n",
+ "Rf=82.;\n",
+ "x=r*R2/(r+R2);\n",
+ "y=R1*x/(x+R1);\n",
+ "t=Rs*y/(y+Rs);\n",
+ "Req=t;\n",
+ "print\"%s %.2f %s\"%('\\nequivalent resistance ',t,' KOhm\\n')\n",
+ "T=gm*Rc*Req/(Rc+Rf+Req);\n",
+ "print\"%s %.2f %s\"%('\\nthe loop gain=\\n',T,'')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "equivalent resistance 2.04 KOhm\n",
+ "\n",
+ "\n",
+ "the loop gain=\n",
+ " 4.09 \n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex19-pg791"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "##Example 12.19\n",
+ "##T=b*100/(sqrt(1+(f/10^5)^2) angle=-3tan^-1(f/10^5)\n",
+ "##stable at f180 at which phase becomes -180 degrees\n",
+ "##-3*atan(f180/10^5)=-180\n",
+ "f180=math.tan(60/57.3)*10**5;\n",
+ "print\"%s %.2f %s\"%('\\nfrequency at -180 degree= ',f180,'f Hz\\n')\n",
+ "b=0.2;\n",
+ "T=b*100./(math.sqrt(1.+(f180/10**5)**2))**3;\n",
+ "print\"%s %.2f %s\"%('\\nmagnitude of the loop gain=\\n',T,'')\n",
+ "b=0.02;\n",
+ "T=b*100./(math.sqrt(1.+(f180/10**5)**2))**3;\n",
+ "print\"%s %.2f %s\"%('\\nmagnitude of the loop gain=\\n',T,'')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "frequency at -180 degree= 173174.23 f Hz\n",
+ "\n",
+ "\n",
+ "magnitude of the loop gain=\n",
+ " 2.50 \n",
+ "\n",
+ "magnitude of the loop gain=\n",
+ " 0.25 \n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex22-pg798"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "##Example 12.22\n",
+ "Ao=10**6;\n",
+ "fPD=0.010;##KHz\n",
+ "b=0.01;\n",
+ "Af=Ao/(1.+b*Ao);\n",
+ "print\"%s %.2f %s\"%('\\nlow frequency closed loop gain=\\n',Af,'')\n",
+ "fc=fPD*(1.+b*Ao);\n",
+ "print\"%s %.2f %s\"%('\\nclosed loop 3dB frequency= ',fc,' KHz\\n')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "low frequency closed loop gain=\n",
+ " 99.99 \n",
+ "\n",
+ "closed loop 3dB frequency= 100.01 KHz\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex23-pg799"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "##Example 12.23\n",
+ "A=10**3;\n",
+ "Cf=30.*10**-12;##feedback capacitor (F)\n",
+ "R2=5.*10**5;\n",
+ "Cm=Cf*(1.+A);\n",
+ "print\"%s %.2e %s\"%('\\nMiller capacitance= ',Cm,' F\\n')\n",
+ "fp=1/(2.*math.pi*R2*Cm);\n",
+ "print\"%s %.2f %s\"%('\\ndominant pole frequency = ',fp,'Hz\\n')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Miller capacitance= 3.00e-08 F\n",
+ "\n",
+ "\n",
+ "dominant pole frequency = 10.60 Hz\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Electronic_Circuit_Analysis_And_Design_by_D._A._Neamen/Chapter13_1_1.ipynb b/Electronic_Circuit_Analysis_And_Design_by_D._A._Neamen/Chapter13_1_1.ipynb new file mode 100644 index 00000000..192e847c --- /dev/null +++ b/Electronic_Circuit_Analysis_And_Design_by_D._A._Neamen/Chapter13_1_1.ipynb @@ -0,0 +1,804 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:2a940490296bbeac10456bf5a339ec669001e8073eddecdfff753904e075bb2b"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter13-Operational Amplifier Circuits "
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex1-pg824"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "\n",
+ "V1=15.;##positive supply voltage\n",
+ "V2=-15.;##negative supply voltage\n",
+ "Veb12=-0.6;\n",
+ "Vbe11=0.6;\n",
+ "Rs=40.;\n",
+ "Iref=(V1-V2-Veb12-Vbe11)/Rs;\n",
+ "print\"%s %.2f %s\"%('\\nreference current= ',Iref,' mA\\n')\n",
+ "Ic10=19.;\n",
+ "Ic1=Ic10/2.;\n",
+ "print\"%s %.2f %s\"%('\\nIc1=Ic2=Ic3=Ic4= ',Ic1,'microA\\n')\n",
+ "Ic1=Ic1*0.001;##mA\n",
+ "Vbe7=0.6;\n",
+ "Vbe6=0.6;\n",
+ "Ic6=Ic1;\n",
+ "R2=1.;\n",
+ "Vc6=Vbe7+Vbe6+Ic6*R2+V2;\n",
+ "print\"%s %.2f %s\"%('\\nvoltage at collector of Q6= ',Vc6,' V\\n')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "reference current= 0.75 mA\n",
+ "\n",
+ "\n",
+ "Ic1=Ic2=Ic3=Ic4= 9.50 microA\n",
+ "\n",
+ "\n",
+ "voltage at collector of Q6= -13.79 V\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex2-pg827"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "##Example 13.2\n",
+ "Iref=0.72;\n",
+ "Ic17=0.75*Iref;\n",
+ "print\"%s %.2f %s\"%('\\ncollector currents in Q17= ',Ic17,' mA\\n')\n",
+ "b=200.;\n",
+ "Ib17=Ic17/b;\n",
+ "Ie17=Ic17;\n",
+ "R8=0.100;\n",
+ "Vbe17=0.6;\n",
+ "R9=50.;\n",
+ "Ic16=Ib17+(Ie17*R8+Vbe17)/R9;\n",
+ "Ic16=Ic16*1000.;\n",
+ "print\"%s %.2f %s\"%('\\ncollector current in Q16= ',Ic16,' microA\\n')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "collector currents in Q17= 0.54 mA\n",
+ "\n",
+ "\n",
+ "collector current in Q16= 15.78 microA\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex3-pg829"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "##Example 13.3\n",
+ "Is1=10**-14;##reverse saturation currents for Q18 Q19\n",
+ "Is2=3*10**-14;##reverse saturation currents for Q14 Q20\n",
+ "Iref=0.72;\n",
+ "Vt=0.026;\n",
+ "Ic13a=0.25*Iref;\n",
+ "print\"%s %.2f %s\"%('\\nIc13a= ',Ic13a,' mA\\n')\n",
+ "Vbe19=0.6;\n",
+ "R10=50.;\n",
+ "Ir1o=Vbe19/R10;\n",
+ "print\"%s %.2f %s\"%('\\ncurrent in Ro= ',Ir1o,' mA\\n')\n",
+ "Ic19=Ic13a-Ir1o;\n",
+ "print\"%s %.2f %s\"%('\\ncurrent in Q19 = ',Ic19,'mA\\n')\n",
+ "Ic19=Ic19*0.001;##A\n",
+ "Vbe19=Vt*math.log(Ic19/Is1);\n",
+ "print\"%s %.2f %s\"%('\\nB-E voltage of Q19= ',Vbe19,' V\\n')\n",
+ "b=200.;\n",
+ "Ic19=Ic19*10**6;##micro A\n",
+ "Iv19=Ic19*1000.;\n",
+ "Ib18=Ic19/b;\n",
+ "Ir1o=Ir1o*1000.;\n",
+ "print\"%s %.2f %s\"%('\\nbase current in Q18= ',Ib18,' microA\\n')\n",
+ "Ic18=Ir1o+Ib18;\n",
+ "print\"%s %.2f %s\"%('\\ncurrents in Q18= ',Ic18,' microA\\n')\n",
+ "Ic18=Ic18*10**-6;\n",
+ "Vbe18=Vt*math.log(Ic18/Is1);\n",
+ "print\"%s %.2f %s\"%('\\nB-E voltage of Q18= ',Vbe18,' V\\n')\n",
+ "Vbb=Vbe18+Vbe19;\n",
+ "print\"%s %.2f %s\"%('\\nvoltage difference Vbb= ',Vbb,' V\\n')\n",
+ "Ic14=Is2*math.exp(Vbb/(2.*Vt));\n",
+ "Ic14=Ic14*10**6;##micro A\n",
+ "print\"%s %.2f %s\"%('\\nquiescent currents in Q14 and Q20 ',Ic14,'microA\\n')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Ic13a= 0.18 mA\n",
+ "\n",
+ "\n",
+ "current in Ro= 0.01 mA\n",
+ "\n",
+ "\n",
+ "current in Q19 = 0.17 mA\n",
+ "\n",
+ "\n",
+ "B-E voltage of Q19= 0.61 V\n",
+ "\n",
+ "\n",
+ "base current in Q18= 0.84 microA\n",
+ "\n",
+ "\n",
+ "currents in Q18= 12.84 microA\n",
+ "\n",
+ "\n",
+ "B-E voltage of Q18= 0.55 V\n",
+ "\n",
+ "\n",
+ "voltage difference Vbb= 1.16 V\n",
+ "\n",
+ "\n",
+ "quiescent currents in Q14 and Q20 139.33 microA\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex4-pg832"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "##Example 13.4\n",
+ "b=200.;\n",
+ "Va=50.\n",
+ "Vt=0.026;\n",
+ "R2=1.;\n",
+ "Ic6=0.0095;\n",
+ "Ic4=Ic6;\n",
+ "Ic16=0.0158;\n",
+ "Ic17=0.54;\n",
+ "r17=b*Vt/Ic17;\n",
+ "print\"%s %.2f %s\"%('\\ninput resistance to gain stage= ',r17,' KOhm\\n')\n",
+ "R9=50.;\n",
+ "R8=0.100;\n",
+ "x=r17+(1.+b)*R8;\n",
+ "Re=x*R9/(x+R9);\n",
+ "print\"%s %.2f %s\"%('\\nRe= ',Re,' KOhm\\n')\n",
+ "r16=b*Vt/Ic16;\n",
+ "print\"%s %.2f %s\"%('\\nr16= ',r16,' KOhm\\n')\n",
+ "Ri2=r16+(1.+b)*Re;\n",
+ "Ri2=Ri2*0.001;##MOhm\n",
+ "print\"%s %.2f %s\"%('\\nRi2= ',Ri2,' KOhm\\n')\n",
+ "r6=b*Vt/Ic6;\n",
+ "print\"%s %.2f %s\"%('\\nresistance of the active load= ',r6,' KOhm\\n')\n",
+ "gm=Ic6/Vt;\n",
+ "print\"%s %.2f %s\"%('\\ntransconductance = ',gm,'mA/V\\n')\n",
+ "ro6=Va/Ic6;\n",
+ "ro6=ro6*0.001;##MOhm\n",
+ "print\"%s %.2f %s\"%('\\nro6= ',ro6,' MOhm\\n')\n",
+ "R=ro6*(1.+gm*R2*r6/(R2+r6));\n",
+ "print\"%s %.2f %s\"%('\\neffective resistance of active load= ',R,' MOhm\\n')\n",
+ "ro4=Va/Ic4;\n",
+ "ro4=ro4*0.001;##Mohm\n",
+ "print\"%s %.2f %s\"%('\\nResistance ro4= ',ro4,' KOhm\\n')\n",
+ "Icq=9.5;\n",
+ "x=Ri2*R/(R+Ri2);\n",
+ "y=ro4*x/(ro4+x);\n",
+ "Ad=-y*Icq/Vt;\n",
+ "print\"%s %.2f %s\"%('\\nsmall signal differential voltage gain=\\n',Ad,'')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "input resistance to gain stage= 9.63 KOhm\n",
+ "\n",
+ "\n",
+ "Re= 18.64 KOhm\n",
+ "\n",
+ "\n",
+ "r16= 329.11 KOhm\n",
+ "\n",
+ "\n",
+ "Ri2= 4.08 KOhm\n",
+ "\n",
+ "\n",
+ "resistance of the active load= 547.37 KOhm\n",
+ "\n",
+ "\n",
+ "transconductance = 0.37 mA/V\n",
+ "\n",
+ "\n",
+ "ro6= 5.26 MOhm\n",
+ "\n",
+ "\n",
+ "effective resistance of active load= 7.18 MOhm\n",
+ "\n",
+ "\n",
+ "Resistance ro4= 5.26 KOhm\n",
+ "\n",
+ "\n",
+ "small signal differential voltage gain=\n",
+ " -635.97 \n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex5-pg835"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "##Example 13.5\n",
+ "bp=50.;\n",
+ "bn=200.;\n",
+ "Va=50.;\n",
+ "R9=50.;\n",
+ "R8=0.100;\n",
+ "Rl=2.;\n",
+ "Vt=0.026;\n",
+ "Ri2=4070.;\n",
+ "Ic20=0.138;\n",
+ "r20=bp*Vt/Ic20;\n",
+ "print\"%s %.2f %s\"%('\\nr20= ',r20,' KOhm\\n')\n",
+ "R20=r20+(1.+bp)*Rl;\n",
+ "print\"%s %.2f %s\"%('\\nR20= ',R20,' KOhm\\n')\n",
+ "Ic13A=0.18;\n",
+ "R19=Va/Ic13A;\n",
+ "print\"%s %.2f %s\"%('\\nR19= ',R19,' KOhm\\n')\n",
+ "r22=bp*Vt/Ic13A;\n",
+ "print\"%s %.2f %s\"%('\\nr22= ',r22,' KOhm\\n')\n",
+ "Ri3=r22+(1.+bp)*R19*R20/(R19+R20);\n",
+ "Ri3=Ri3*0.001;##MOhm\n",
+ "print\"%s %.2f %s\"%('\\ninput resistance to the output stage= ',Ri3,' MOhm\\n')\n",
+ "Ic13B=0.54;\n",
+ "R=Va/Ic13B;\n",
+ "print\"%s %.2f %s\"%('\\neffective resistance of the active load= ',R,' KOhm\\n')\n",
+ "Ic17=Ic13B;\n",
+ "R17=Va/Ic17;\n",
+ "print\"%s %.2f %s\"%('\\noutput resistance Ro17 = ',R17,'KOhm\\n')\n",
+ "Ri3=Ri3*1000.;##KOhm\n",
+ "r17=9.63;\n",
+ "x=R17*Ri3/(Ri3+R17);\n",
+ "y=x*R/(R+x);\n",
+ "A=-bn*R9*(1.+bn)*y/(Ri2*(R9+r17+(1.+bn)*R8));\n",
+ "print\"%s %.2f %s\"%('\\nsmall signal voltage gain=\\n',A,'')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "r20= 9.42 KOhm\n",
+ "\n",
+ "\n",
+ "R20= 111.42 KOhm\n",
+ "\n",
+ "\n",
+ "R19= 277.78 KOhm\n",
+ "\n",
+ "\n",
+ "r22= 7.22 KOhm\n",
+ "\n",
+ "\n",
+ "input resistance to the output stage= 4.06 MOhm\n",
+ "\n",
+ "\n",
+ "effective resistance of the active load= 92.59 KOhm\n",
+ "\n",
+ "\n",
+ "output resistance Ro17 = 92.59 KOhm\n",
+ "\n",
+ "\n",
+ "small signal voltage gain=\n",
+ " -283.53 \n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex6-pg837"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "##Example 13.6\n",
+ "Ic20=2.;\n",
+ "bn=200.;\n",
+ "bp=50.;\n",
+ "Va=50.;\n",
+ "r17=9.63;\n",
+ "r22=7.22;\n",
+ "R20=0.260;\n",
+ "gm17=20.8;\n",
+ "ro17=92.6;\n",
+ "Ro13B=92.6;\n",
+ "R8=0.100;\n",
+ "Rc17=ro17*(1.+gm17*R8*r17/(R8+r17));\n",
+ "print\"%s %.2f %s\"%('\\nRc17= ',Rc17,' KOhm\\n')\n",
+ "Rc22=(r22+Rc17*Ro13B/(Rc17+Ro13B))/(1.+bp);\n",
+ "print\"%s %.2f %s\"%('\\nRc22= ',Rc22,' KOhm\\n')\n",
+ "Ic13A=0.18;\n",
+ "Rc19=Va/Ic13A;\n",
+ "print\"%s %.2f %s\"%('\\nRc19= ',Rc19,' KOhm\\n')\n",
+ "Rc20=(R20+Rc22*Rc19/(Rc22+Rc19))/(1.+bp);\n",
+ "print\"%s %.2f %s\"%('\\nRc20= ',Rc20,' KOhm\\n')\n",
+ "Rc20=Rc20*1000.;##Ohm\n",
+ "R3=22.;\n",
+ "Ro=R3+Rc20;\n",
+ "print\"%s %.2f %s\"%('\\noutput resistance= ',Ro,' Ohm\\n')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Rc17= 283.23 KOhm\n",
+ "\n",
+ "\n",
+ "Rc22= 1.51 KOhm\n",
+ "\n",
+ "\n",
+ "Rc19= 277.78 KOhm\n",
+ "\n",
+ "\n",
+ "Rc20= 0.03 KOhm\n",
+ "\n",
+ "\n",
+ "output resistance= 56.54 Ohm\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex7-pg838"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "##Example 13.7\n",
+ "Av2=285.;\n",
+ "C1=30.;\n",
+ "Ci=C1*(1.+Av2);\n",
+ "print\"%s %.2f %s\"%('\\ninput capacitance= ',Ci,' pF\\n')\n",
+ "Ri2=4.07;\n",
+ "Ract=7.18;\n",
+ "ro4=5.26;\n",
+ "Ro1=Ract*ro4/(Ract+ro4);\n",
+ "print\"%s %.2f %s\"%('\\ngate stage input resistance= ',Ro1,' MOhm \\n')\n",
+ "Req=Ro1*Ri2/(Ri2+Ro1);\n",
+ "print\"%s %.2f %s\"%('\\nequivalent resistance= ',Req,' MOhm\\n')\n",
+ "Req=Req*10**6;##Ohm\n",
+ "Ci=Ci*10**-12;##F\n",
+ "fPD=1/(2.*math.pi*Req*Ci);\n",
+ "print\"%s %.2f %s\"%('\\ndominant pole frequency = ',fPD,' Hz\\n')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "input capacitance= 8580.00 pF\n",
+ "\n",
+ "\n",
+ "gate stage input resistance= 3.04 MOhm \n",
+ "\n",
+ "\n",
+ "equivalent resistance= 1.74 MOhm\n",
+ "\n",
+ "\n",
+ "dominant pole frequency = 10.67 Hz\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex9-pg842"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ " \n",
+ "##Example 13.9\n",
+ "##lambda=y\n",
+ "y=0.02;\n",
+ "##W/L=x and u*Cox/2=t\n",
+ "x=12.5;\n",
+ "t=10.;\n",
+ "Kp1=x*t;\n",
+ "print\"%s %.2f %s\"%('\\nconduction parameters of M1 and M2= ',Kp1,' microA/V^2\\n')\n",
+ "Kp1=Kp1*0.001;##mA/V^2\n",
+ "Id=0.0199;\n",
+ "ro2=1./(y*Id);\n",
+ "ro2=ro2*0.001;##Mohm\n",
+ "print\"%s %.2f %s\"%('\\noutput resistance= MOhm\\n',ro2,'')\n",
+ "Iq=0.0397;\n",
+ "ro2=ro2*1000.;##Kohm\n",
+ "ro4=ro2;\n",
+ "Ad=math.sqrt(2.*Kp1*Iq)*ro2*ro4/(ro2+ro4);\n",
+ "print\"%s %.2f %s\"%('\\nthe gain of input stage= \\n',Ad,'')\n",
+ "Kn7=0.250;\n",
+ "Id7=Iq;\n",
+ "gm7=2.*math.sqrt(Kn7*Id7)\n",
+ "print\"%s %.2f %s\"%('\\ntransconductance of M7= ',gm7,' mA/V\\n')\n",
+ "ro7=1./(y*Id7);\n",
+ "ro7=ro7*0.001;\n",
+ "print\"%s %.2f %s\"%('\\noutput resistance of M7 and M8 = ',ro7,'MOhm\\n')\n",
+ "ro7=ro7*1000.;##Kohm\n",
+ "ro8=ro7;\n",
+ "Av2=gm7*ro7*ro8/(ro7+ro8);\n",
+ "print\"%s %.2f %s\"%('\\ngain of the second stage=\\n',Av2,'')\n",
+ "Av=Ad*Av2;\n",
+ "print\"%s %.2f %s\"%('\\noverall voltage gain=\\n',Av,'')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "conduction parameters of M1 and M2= 125.00 microA/V^2\n",
+ "\n",
+ "\n",
+ "output resistance= MOhm\n",
+ " 2.51 \n",
+ "\n",
+ "the gain of input stage= \n",
+ " 125.16 \n",
+ "\n",
+ "transconductance of M7= 0.20 mA/V\n",
+ "\n",
+ "\n",
+ "output resistance of M7 and M8 = 1.26 MOhm\n",
+ "\n",
+ "\n",
+ "gain of the second stage=\n",
+ " 125.47 \n",
+ "\n",
+ "overall voltage gain=\n",
+ " 15703.52 \n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex10-pg845"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "##Example 13.10\n",
+ "Iref=100;\n",
+ "Kn=80;\n",
+ "Kp=40;\n",
+ "##W/L=x\n",
+ "x=25;\n",
+ "##lambda=y\n",
+ "y=0.02;\n",
+ "Id=Iref/2.;\n",
+ "gm1=2.*math.sqrt(Kp*x*Id/2.);\n",
+ "print\"%s %.2f %s\"%('\\ntransconductance gm1=gm8= ',gm1,' microA/V\\n')\n",
+ "gm6=2.*math.sqrt(Kn*x*Id/2.);\n",
+ "print\"%s %.2f %s\"%('\\ntransconductance= ',gm6,' microA/V\\n')\n",
+ "ro1=1./(y*Id);\n",
+ "ro8=ro1;\n",
+ "ro6=ro1;\n",
+ "ro10=ro1;\n",
+ "print\"%s %.2f %s\"%('\\noutput resistance ro1=ro8=ro6=ro10= ',ro1,' MOhm\\n')\n",
+ "Id4=Iref;\n",
+ "ro4=1./(y*Id4);\n",
+ "print\"%s %.2f %s\"%('\\nro4= ',ro4,' MOhm\\n')\n",
+ "Ro8=gm1*ro8*ro10;\n",
+ "print\"%s %.2f %s\"%('\\ncomposite output resistances = ',Ro8,'MOhm\\n')\n",
+ "Ro6=gm6*ro6*ro4*ro1/(ro4+ro1);\n",
+ "print\"%s %.2f %s\"%('\\ncomposite output resistances= ',Ro6,' MOhm\\n')\n",
+ "Ad=gm1*Ro6*Ro8/(Ro6+Ro8);\n",
+ "print\"%s %.2f %s\"%('\\ndifferential voltage gain=\\n',Ad,'')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "transconductance gm1=gm8= 316.23 microA/V\n",
+ "\n",
+ "\n",
+ "transconductance= 447.21 microA/V\n",
+ "\n",
+ "\n",
+ "output resistance ro1=ro8=ro6=ro10= 1.00 MOhm\n",
+ "\n",
+ "\n",
+ "ro4= 0.50 MOhm\n",
+ "\n",
+ "\n",
+ "composite output resistances = 316.23 MOhm\n",
+ "\n",
+ "\n",
+ "composite output resistances= 149.07 MOhm\n",
+ "\n",
+ "\n",
+ "differential voltage gain=\n",
+ " 32037.72 \n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex12-pg854"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "##Example 13.12\n",
+ "Kp=0.6;\n",
+ "bn=200.;\n",
+ "Va=50.;\n",
+ "Vt=0.026;\n",
+ "Ic13=0.20;\n",
+ "Ri2=bn*Vt/Ic13;\n",
+ "print\"%s %.2f %s\"%('\\ninput resistance to the gain stage= ',Ri2,' KOhm\\n')\n",
+ "Iq5=Ic13;\n",
+ "Ad=math.sqrt(2.*Kp*Iq5)*Ri2;\n",
+ "print\"%s %.2f %s\"%('\\nsmall signal voltage gain=\\n',Ad,'')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "input resistance to the gain stage= 26.00 KOhm\n",
+ "\n",
+ "\n",
+ "small signal voltage gain=\n",
+ " 12.74 \n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex13-pg855"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "##Example 13.13\n",
+ "Va=150.;\n",
+ "Vt=0.026;\n",
+ "Ic13=0.2;\n",
+ "gm13=Ic13/Vt;\n",
+ "print\"%s %.2f %s\"%('\\ntransconductance= ',gm13,' mA/V\\n')\n",
+ "ro13=Va/Ic13;\n",
+ "print\"%s %.2f %s\"%('\\noutput resistance= ',ro13,' KOhm\\n')\n",
+ "Av2=gm13*ro13;\n",
+ "print\"%s %.2f %s\"%('\\nvoltage gain= \\n',Av2,'')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "transconductance= 7.69 mA/V\n",
+ "\n",
+ "\n",
+ "output resistance= 750.00 KOhm\n",
+ "\n",
+ "\n",
+ "voltage gain= \n",
+ " 5769.23 \n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex14-pg856"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "##Example 13.14\n",
+ "Av2=5768.;\n",
+ "C1=12.;\n",
+ "Ci=C1*(1.+Av2);\n",
+ "print\"%s %.2f %s\"%('\\neffective input capacitance= ',Ci,' pF\\n')\n",
+ "Ri2=26000.;##gain stage input resistance (Ohm)\n",
+ "Ci=Ci*10**-12;##F\n",
+ "fPD=1/(2.*math.pi*Ri2*Ci);\n",
+ "print\"%s %.2f %s\"%('\\ndominant pole frequency= ',fPD,' Hz\\n')\n",
+ "Av=73254.;\n",
+ "fT=fPD*Av;\n",
+ "fT=fT*10**-6;##MHz\n",
+ "print\"%s %.2f %s\"%('\\nunity gain bandwidth= ',fT,' MHz\\n')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "effective input capacitance= 69228.00 pF\n",
+ "\n",
+ "\n",
+ "dominant pole frequency= 88.42 Hz\n",
+ "\n",
+ "\n",
+ "unity gain bandwidth= 6.48 MHz\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Electronic_Circuit_Analysis_And_Design_by_D._A._Neamen/Chapter14_1_1.ipynb b/Electronic_Circuit_Analysis_And_Design_by_D._A._Neamen/Chapter14_1_1.ipynb new file mode 100644 index 00000000..af5ad5a1 --- /dev/null +++ b/Electronic_Circuit_Analysis_And_Design_by_D._A._Neamen/Chapter14_1_1.ipynb @@ -0,0 +1,385 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:346bac54aa836b30505ba957f43799ddc8ade182f697449e8221de9753ec8a1b"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter14-Nonideal Effects in Operational Amplifier Circuits"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex2-pg880"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "\n",
+ "##Example 14.2\n",
+ "R2=10000.;\n",
+ "Ri=10000.\n",
+ "Aol=10**5;\n",
+ "Rif=1./(1./Ri+(1.+Aol)/R2);\n",
+ "print\"%s %.2f %s\"%('\\nclosed loop input resistance = ',Rif,'Ohm\\n')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "closed loop input resistance = 0.10 Ohm\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex3-pg883"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ " \n",
+ "##Example 14.3\n",
+ "Aol=10**5;\n",
+ "Ri=10.;\n",
+ "R1=10.;\n",
+ "R2=R1;\n",
+ "Rif=(Ri*(1.+Aol)+R2*(1.+Ri/R1))/(1.+R2/R1);\n",
+ "Rif=Rif*0.001;##Mohm\n",
+ "print\"%s %.2f %s\"%('\\ninput resistance ',Rif,'MOhm\\n')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "input resistance 500.01 MOhm\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex5-pg888"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ " \n",
+ "##Example 14.5\n",
+ "Ao=2*10**5;\n",
+ "fPD=5.;\n",
+ "fT=fPD*Ao;\n",
+ "print\"%s %.2f %s\"%('\\nunity gain bandwidth= ',fT,' Hz\\n')\n",
+ "f3dB=20.*10**3;\n",
+ "Acl=fT/f3dB;\n",
+ "print\"%s %.2f %s\"%('\\nclosed loop gain=\\n',Acl,'')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "unity gain bandwidth= 1000000.00 Hz\n",
+ "\n",
+ "\n",
+ "closed loop gain=\n",
+ " 50.00 \n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex6-pg890"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "##Example 14.6\n",
+ "Iq=19*10**-6;\n",
+ "C1=30*10**-12;\n",
+ "SR=Iq/C1;\n",
+ "SR=SR*10**-6;\n",
+ "print\"%s %.2f %s\"%('\\nslew rate= ',SR,' V/micros\\n')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "slew rate= 0.63 V/micros\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex7-pg892"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "##Example 14.7\n",
+ "fT=1000.;##KHz\n",
+ "Aclo=10.;\n",
+ "SR=1.*10**3;\n",
+ "Vpo=10.;\n",
+ "f3dB=fT/Aclo;\n",
+ "print\"%s %.2f %s\"%('\\nsmall signal closed loop bandwidth= ',f3dB,' KHz\\n')\n",
+ "fmax=SR/(2.*math.pi*Vpo);\n",
+ "print\"%s %.2f %s\"%('\\nfull power bandwidth= ',fmax,' KHz\\n')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "small signal closed loop bandwidth= 100.00 KHz\n",
+ "\n",
+ "\n",
+ "full power bandwidth= 15.92 KHz\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex8-pg895"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ " \n",
+ "##Example 14.8\n",
+ "Is1=10**-14;\n",
+ "Is2=1.05*10**-14;\n",
+ "Vt=0.026;\n",
+ "Vos=Vt*math.log(Is2/Is1);\n",
+ "print\"%s %.2e %s\"%('\\nthe offset voltage = ',Vos,'V\\n')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "the offset voltage = 1.27e-03 V\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex10-pg900"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "##Example 14.10\n",
+ "Kn1=105.;\n",
+ "Kn2=100.;\n",
+ "Iq=200.;\n",
+ "dKn=Kn1-Kn2;\n",
+ "print\"%s %.2f %s\"%('\\ndifference in conduction parameter= ',dKn,' microA/V^2\\n')\n",
+ "Kn=(Kn1+Kn2)/2.;\n",
+ "print\"%s %.2f %s\"%('\\naverage of the conduction parameter= ',Kn,' microA/V^2\\n')\n",
+ "Vos=math.sqrt(Iq/(2.*Kn))*dKn/(2.*Kn);\n",
+ "print\"%s %.2f %s\"%('\\noffset voltage= ',Vos,' V\\n')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "difference in conduction parameter= 5.00 microA/V^2\n",
+ "\n",
+ "\n",
+ "average of the conduction parameter= 102.50 microA/V^2\n",
+ "\n",
+ "\n",
+ "offset voltage= 0.02 V\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex11-pg901"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "##Example 14.11\n",
+ "Rs=100.;\n",
+ "R4=100000.;\n",
+ "R3=100000.;\n",
+ "V1=15.;\n",
+ "V2=-15.;\n",
+ "Vy=Rs*V1/(Rs+R4);\n",
+ "Vy=Vy*1000.;##mV\n",
+ "print\"%s %.2f %s\"%('\\nVoltage Vy = ',Vy,'mV\\n')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Voltage Vy = 14.99 mV\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex13-pg908"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "##Example 14.13\n",
+ "R1=10.;\n",
+ "R2=100.;\n",
+ "Ib1=1.1*10**-3;\n",
+ "Ib2=1.*10**-3;\n",
+ "vo=Ib1*R2;\n",
+ "print\"%s %.2f %s\"%('\\noutput voltage = ',vo,'V\\n')\n",
+ "R3=R1*R2/(R1+R2);\n",
+ "print\"%s %.2f %s\"%('\\nR3= ',R3,' KOhm\\n')\n",
+ "vo=R2*(Ib1-Ib2);\n",
+ "print\"%s %.2f %s\"%('\\noutput voltage= ',vo,' V\\n')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "output voltage = 0.11 V\n",
+ "\n",
+ "\n",
+ "R3= 9.09 KOhm\n",
+ "\n",
+ "\n",
+ "output voltage= 0.01 V\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Electronic_Circuit_Analysis_And_Design_by_D._A._Neamen/Chapter15_1_1.ipynb b/Electronic_Circuit_Analysis_And_Design_by_D._A._Neamen/Chapter15_1_1.ipynb new file mode 100644 index 00000000..7e7356d2 --- /dev/null +++ b/Electronic_Circuit_Analysis_And_Design_by_D._A._Neamen/Chapter15_1_1.ipynb @@ -0,0 +1,452 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:8d0dd3bab90dc7613b5ca5489532f94ae244e073567e3fb2fd8cc9148ba4ba3a"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter15-Applications and Design of Integrated Circuits"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex2-pg935"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "import math\n",
+ "\n",
+ "##Example 15.2\n",
+ "C=20.*10**-6;\n",
+ "Req=1000.;\n",
+ "fC=1./(C*Req);\n",
+ "print\"%s %.2f %s\"%('\\nclock frequency = ',fC,' KHz\\n')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "clock frequency = 50.00 KHz\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex3-pg936"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "##Example 15.3\n",
+ "fC=10000.;\n",
+ "f3dB=1000.;\n",
+ "##x=C2/C1\n",
+ "x=2.*math.pi*f3dB/fC;\n",
+ "print\"%s %.2f %s\"%('\\ncapacitances C2/C1= \\n',x,'')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "capacitances C2/C1= \n",
+ " 0.63 \n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex4-pg940"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "##Example 15.4\n",
+ "C=0.1*10**-6;\n",
+ "R=1000.;\n",
+ "fo=1/(2.*math.pi*R*C*math.sqrt(3.));\n",
+ "print\"%s %.2f %s\"%('\\nthe oscillation frequency = ',fo,'Hz\\n')\n",
+ "##minimum amplifier gain=8\n",
+ "R=1.;##KOhm\n",
+ "R2=8.*R;\n",
+ "print\"%s %.2f %s\"%('\\nR2= ',R2,' KOhm\\n')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "the oscillation frequency = 918.88 Hz\n",
+ "\n",
+ "\n",
+ "R2= 8.00 KOhm\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex6-pg953"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "##Example 15.6\n",
+ "R1=10000.;\n",
+ "R2=90000.;\n",
+ "Vh=10.;\n",
+ "Vl=-10.;\n",
+ "Vth=R1*Vh/(R1+R2);\n",
+ "print\"%s %.2f %s\"%('\\nupper crossover voltage= ',Vth,' V\\n')\n",
+ "Vtl=R1*Vl/(R1+R2);\n",
+ "print\"%s %.2f %s\"%('\\nlower crossover voltage= ',Vtl,' V\\n')\n",
+ "x=Vth-Vtl;\n",
+ "print\"%s %.2f %s\"%('\\nhysteresis width = ',x,'V\\n')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "upper crossover voltage= 1.00 V\n",
+ "\n",
+ "\n",
+ "lower crossover voltage= -1.00 V\n",
+ "\n",
+ "\n",
+ "hysteresis width = 2.00 V\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex7-pg958"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "##Example 15.7\n",
+ "Vs=2.;\n",
+ "Vh=15.;\n",
+ "Vl=-15.;\n",
+ "##hysteresis width=x\n",
+ "x=60.*0.001;##(V)\n",
+ "##Vth-Vtl=(R1/(R1+R2))*(Vh-Vl)\n",
+ "##R2/R=y\n",
+ "y=(Vh-Vl)/x-1.;\n",
+ "print\"%s %.2f %s\"%('\\nR2/R1= \\n',y,'')\n",
+ "Vref=(1.+1./y)*Vs;\n",
+ "print\"%s %.2f %s\"%('\\nreference voltage= ',Vref,' V\\n')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "R2/R1= \n",
+ " 499.00 \n",
+ "\n",
+ "reference voltage= 2.00 V\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex10-pg969"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "##Example 15.10\n",
+ "C=15.*10**-9;\n",
+ "T=100.*10**-6;##(s) time\n",
+ "R=T/(1.1*C);\n",
+ "R=R*0.001;##Kohm\n",
+ "print\"%s %.2f %s\"%('\\nResistance R= ',R,' KOhm\\n')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Resistance R= 6.06 KOhm\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex13-pg974"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "##Example 15.13\n",
+ "Rl=10.;##load resistance \n",
+ "Pl=20.;##power delivered to the load\n",
+ "Ps=20.;##(W)\n",
+ "Vp=math.sqrt(2.*Rl*Pl);\n",
+ "print\"%s %.2f %s\"%('\\npeak output voltage= ',Vp,' V\\n')\n",
+ "Ip=Vp/Rl;\n",
+ "print\"%s %.2f %s\"%('\\npeak load current = ',Ip,'A\\n')\n",
+ "Vs=math.pi*Rl*Ps/Vp;\n",
+ "print\"%s %.2f %s\"%('\\nrequired supply voltage= ',Vs,' V\\n')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "peak output voltage= 20.00 V\n",
+ "\n",
+ "\n",
+ "peak load current = 2.00 A\n",
+ "\n",
+ "\n",
+ "required supply voltage= 31.42 V\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex14-pg979"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "##Example 15.14\n",
+ "Vonl=5;\n",
+ "Vofl=4.96;\n",
+ "I1=0.005;\n",
+ "I2=1.5;\n",
+ "dVo=Vonl-Vofl;\n",
+ "dIo=I1-I2;\n",
+ "Rvf=-dVo/dIo;\n",
+ "print\"%s %.2f %s\"%('\\noutput resistance= ',Rvf,' Ohm\\n')\n",
+ "LR=100.*(Vonl-Vofl)/Vonl;\n",
+ "print\"%s %.2f %s\"%('\\nload regulation =\\n',LR,'')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "output resistance= 0.03 Ohm\n",
+ "\n",
+ "\n",
+ "load regulation =\n",
+ " 0.80 \n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex15-pg982"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "##Example 15.15\n",
+ "Aol=1000.;\n",
+ "Vref=5.;\n",
+ "Vo=10.;\n",
+ "Io=0.1*0.001;\n",
+ "Vt=0.026;\n",
+ "Rof=2.*Vt*Vo/(Io*Vref*Aol);\n",
+ "print\"%s %.2f %s\"%('\\noutput resistance= ',Rof,' mOhm\\n')\n",
+ "##dVo/Vo=V and dIo/Io=I\n",
+ "##V=-I*2*Vt/(Vref*Aol)\n",
+ "##V/I=x\n",
+ "x=-2.*Vt/(Vref*Aol);\n",
+ "print\"%s %.2e %s\"%('\\npercent change=\\n',x,'')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "output resistance= 1.04 mOhm\n",
+ "\n",
+ "\n",
+ "percent change=\n",
+ " -1.04e-05 \n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex16-pg984"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "##Example 15.16\n",
+ "Vz=6.3;\n",
+ "Vbe=0.6;\n",
+ "Veb=0.6;\n",
+ "Vo=8.;\n",
+ "R1=3.9;\n",
+ "R2=3.4;\n",
+ "R3=0.576;\n",
+ "Ic3=(Vz-3.*Vbe)/(R1+R2+R3);\n",
+ "print\"%s %.2f %s\"%('\\nbias current = ',Ic3,' mA\\n')\n",
+ "Vb7=Ic3*R1+2.*Vbe;\n",
+ "print\"%s %.2f %s\"%('\\ntemperature compensated reference voltage= ',Vb7,' V\\n')\n",
+ "R13=2.23;\n",
+ "R12=R13*Vo/Vb7-R13;\n",
+ "print\"%s %.2f %s\"%('\\nR12= ',R12,' KOhm\\n')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "bias current = 0.57 mA\n",
+ "\n",
+ "\n",
+ "temperature compensated reference voltage= 3.43 V\n",
+ "\n",
+ "\n",
+ "R12= 2.97 KOhm\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Electronic_Circuit_Analysis_And_Design_by_D._A._Neamen/Chapter16_1_1.ipynb b/Electronic_Circuit_Analysis_And_Design_by_D._A._Neamen/Chapter16_1_1.ipynb new file mode 100644 index 00000000..a7c194d9 --- /dev/null +++ b/Electronic_Circuit_Analysis_And_Design_by_D._A._Neamen/Chapter16_1_1.ipynb @@ -0,0 +1,428 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:967330d5e3a998fb6f78e20c34781eef3a87e37f117b0ab752e2b4eb4123a177"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter16-MOSFET Digital Circuits "
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex3-pg1013"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "##Example 16.3\n",
+ "Vdd=5.;\n",
+ "Vtnd=0.8;\n",
+ "Vtnl=0.8;\n",
+ "Kn=35.;\n",
+ "Vo=0.1;\n",
+ "Vi=4.2;\n",
+ "##W/L=Y\n",
+ "yl=0.5;\n",
+ "##Kd/Kl=x\n",
+ "x=(Vdd-Vo-Vtnl)**2/(2.*Vo*(Vi-Vtnd)-Vo**2);\n",
+ "print\"%s %.2f %s\"%('\\nKd/Kl=\\n',x,'')\n",
+ "##Kd/Kl=yd/yl\n",
+ "yd=12.6\n",
+ "yl=0.5\n",
+ "iD=Kn*yl*(Vdd-Vo-Vtnl)**2/2.;\n",
+ "print\"%s %.2f %s\"%('\\ndrain current = ',iD,' microA\\n')\n",
+ "P=iD*Vdd;\n",
+ "print\"%s %.2f %s\"%('\\npower dissipation= ',P,' microW\\n')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Kd/Kl=\n",
+ " 25.09 \n",
+ "\n",
+ "drain current = 147.09 microA\n",
+ "\n",
+ "\n",
+ "power dissipation= 735.44 microW\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex4-pg1017"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ " \n",
+ "##Example 16.4\n",
+ "Vdd=5.;\n",
+ "Vtnd=0.8;\n",
+ "Vtnl=-2.;\n",
+ "Kn=35.;\n",
+ "Vo=0.1;\n",
+ "Vi=5.;\n",
+ "##W/L=Y\n",
+ "yl=0.5;\n",
+ "##Kd/Kl=x\n",
+ "x=(-Vtnl)**2/(2.*Vo*(Vi-Vtnd)-Vo**2);\n",
+ "print\"%s %.2f %s\"%('\\nKd/Kl=\\n',x,'')\n",
+ "##Kd/Kl=yd/yl\n",
+ "yd=2.41\n",
+ "yl=0.5\n",
+ "iD=Kn*yl*(-Vtnl)**2/2.;\n",
+ "print\"%s %.2f %s\"%('\\ndrain current= ',iD,' microA\\n')\n",
+ "P=iD*Vdd;\n",
+ "print\"%s %.2f %s\"%('\\npower dissipation = ',P,' microW\\n')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Kd/Kl=\n",
+ " 4.82 \n",
+ "\n",
+ "drain current= 35.00 microA\n",
+ "\n",
+ "\n",
+ "power dissipation = 175.00 microW\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex5-pg1021"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "##Example 16.5\n",
+ "Voh=4.2;\n",
+ "Vol=0.1;\n",
+ "##x=Kd/Kl\n",
+ "x=25.1;\n",
+ "Vdd=5.;\n",
+ "Vtnl=0.8;\n",
+ "Vohu=4.2;\n",
+ "Vil=0.8;\n",
+ "Vtnd=0.8;\n",
+ "Vih=Vtnd+(Vdd-Vtnl)/x*((1+2*x)/math.sqrt(1.+3.*x)-1.);\n",
+ "print\"%s %.2f %s\"%('\\nVih= ',Vih,' V\\n')\n",
+ "Volu=(Vdd-Vtnl+x*(Vih-Vtnd))/(1.+2.*x);\n",
+ "print\"%s %.2f %s\"%('\\noutput voltage corresponding to Vih= ',Volu,' V\\n')\n",
+ "NMl=Vil-Volu;\n",
+ "print\"%s %.2f %s\"%('\\nnoise margin= ',NMl,' V\\n')\n",
+ "NMh=Vohu-Vih;\n",
+ "print\"%s %.2f %s\"%('\\nnoise margin= ',NMh,' V\\n')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Vih= 1.61 V\n",
+ "\n",
+ "\n",
+ "output voltage corresponding to Vih= 0.48 V\n",
+ "\n",
+ "\n",
+ "noise margin= 0.32 V\n",
+ "\n",
+ "\n",
+ "noise margin= 2.59 V\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex9-pg1041"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ " \n",
+ "##Example 16.9\n",
+ "Vdd=5.;\n",
+ "Vtn=1.;\n",
+ "Vtp=-1.;\n",
+ "##Kn=Kp hence Kn/Kp=x=1;\n",
+ "x=1.;\n",
+ "Vit=(Vdd+Vtp+math.sqrt(x)*Vtn)/(1.+math.sqrt(x));\n",
+ "print\"%s %.2f %s\"%('\\ninput voltage= ',Vit,' V\\n')\n",
+ "Vipt=Vit;\n",
+ "Vopt=Vipt-Vtp;\n",
+ "print\"%s %.2f %s\"%('\\noutput voltage at the transition point for PMOS = ',Vopt,' V\\n')\n",
+ "Vint=Vit;\n",
+ "Vont=Vint-Vtn;\n",
+ "print\"%s %.2f %s\"%('\\noutput voltage at the transition point for NMOS= ',Vont,' V\\n')\n",
+ "Vdd=10.;\n",
+ "Vit=(Vdd+Vtp+math.sqrt(x)*Vtn)/(1.+math.sqrt(x));\n",
+ "print\"%s %.2f %s\"%('\\ninput voltage = ',Vit,'V\\n')\n",
+ "Vipt=Vit;\n",
+ "Vint=Vit;\n",
+ "Vopt=Vipt-Vtp;\n",
+ "print\"%s %.2f %s\"%('\\noutput voltage at the transition point for PMOS = ',Vopt,' V\\n')\n",
+ "Vont=Vint-Vtn;\n",
+ "print\"%s %.2f %s\"%('\\noutput voltage at the transition point for NMOS = ',Vont,' V\\n')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "input voltage= 2.50 V\n",
+ "\n",
+ "\n",
+ "output voltage at the transition point for PMOS = 3.50 V\n",
+ "\n",
+ "\n",
+ "output voltage at the transition point for NMOS= 1.50 V\n",
+ "\n",
+ "\n",
+ "input voltage = 5.00 V\n",
+ "\n",
+ "\n",
+ "output voltage at the transition point for PMOS = 6.00 V\n",
+ "\n",
+ "\n",
+ "output voltage at the transition point for NMOS = 4.00 V\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex10-pg1045"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "##Example 16.10\n",
+ "Cl=2.*10**-6;\n",
+ "Vdd=5.;\n",
+ "f=100000.;\n",
+ "P=f*Cl*Vdd**2;\n",
+ "print\"%s %.2f %s\"%('\\npower dissipation in the CMOS inverter= ',P,' microW\\n')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "power dissipation in the CMOS inverter= 5.00 microW\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex11-pg1047"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "##Example 16.11\n",
+ "Vtn=1.;\n",
+ "Vtp=-1.;\n",
+ "Vdd=5.;\n",
+ "Vth=1.;\n",
+ "Vil=Vtn+3.*(Vdd+Vtp-Vth)/8.;\n",
+ "print\"%s %.2f %s\"%('\\ninput voltage at the transition points Vil= ',Vil,' V\\n')\n",
+ "Vih=Vtn+5.*(Vdd+Vtp-Vtn)/8.;\n",
+ "print\"%s %.2f %s\"%('\\ninput voltage at the transition points Vih= ',Vih,' V\\n')\n",
+ "Vohu=1.*(2.*Vil+Vdd-Vtn-Vtp)/2.;\n",
+ "print\"%s %.2f %s\"%('\\noutput voltage = ',Vohu,' V\\n')\n",
+ "Volu=1.*(2.*Vih-Vdd-Vtn-Vtp)/2.;\n",
+ "print\"%s %.2f %s\"%('\\noutput voltage = ',Volu,' V\\n')\n",
+ "NML=Vil-Volu;\n",
+ "print\"%s %.2f %s\"%('\\nnoise margin = ',NML,' V\\n')\n",
+ "NMH=Vohu-Vih;\n",
+ "print\"%s %.2f %s\"%('\\nnoise margin= ',NML,' V\\n')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "input voltage at the transition points Vil= 2.12 V\n",
+ "\n",
+ "\n",
+ "input voltage at the transition points Vih= 2.88 V\n",
+ "\n",
+ "\n",
+ "output voltage = 4.62 V\n",
+ "\n",
+ "\n",
+ "output voltage = 0.38 V\n",
+ "\n",
+ "\n",
+ "noise margin = 1.75 V\n",
+ "\n",
+ "\n",
+ "noise margin= 1.75 V\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex15-pg1080"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ " \n",
+ "##Example 16.15\n",
+ "Vdd=3.;\n",
+ "Kn=60.;\n",
+ "Vtnd=0.5;\n",
+ "##W/L=x\n",
+ "xd=2.;\n",
+ "Vtnl=-1.;\n",
+ "xl=0.5;\n",
+ "R=2.;##(MOhm)\n",
+ "Vgsl=0.;\n",
+ "##solution with Depletion load\n",
+ "iD=Kn*xl*(Vgsl-Vtnl)**2/2.;\n",
+ "print\"%s %.2f %s\"%('\\nfrain currents in M1 and M3 = ',iD,' microA\\n')\n",
+ "P=iD*Vdd;\n",
+ "print\"%s %.2f %s\"%('\\npower dissipation in the circuit= ',P,'microW\\n')\n",
+ "##iD=Kn/2*x*(2*Vgsd-Vtnd)Vdsd-Vdsd^2\n",
+ "Q=50.5\n",
+ "p=0.25 - 5*(50.5) + 50.5\n",
+ "print(p)\n",
+ "\n",
+ "##solution with Resistor load\n",
+ "##(Vdd-Q)/R=Kn/2*xd*(2*Vgsd-Vtnd)Q-Q^2\n",
+ "\n",
+ "\n",
+ "Q=0.005;\n",
+ "p1=0.25 - 5*(0.005) + 0.005\n",
+ "print(p1)\n",
+ "iD=(Vdd-Q)/R;\n",
+ "print\"%s %.2f %s\"%('\\ndrain current = ',iD,' microA\\n')\n",
+ "P=iD*Vdd;\n",
+ "print\"%s %.2f %s\"%('\\npower dissipation in the circuit = ',P,' microW\\n')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "frain currents in M1 and M3 = 15.00 microA\n",
+ "\n",
+ "\n",
+ "power dissipation in the circuit= 45.00 microW\n",
+ "\n",
+ "-201.75\n",
+ "0.23\n",
+ "\n",
+ "drain current = 1.50 microA\n",
+ "\n",
+ "\n",
+ "power dissipation in the circuit = 4.49 microW\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Electronic_Circuit_Analysis_And_Design_by_D._A._Neamen/Chapter17_1_1.ipynb b/Electronic_Circuit_Analysis_And_Design_by_D._A._Neamen/Chapter17_1_1.ipynb new file mode 100644 index 00000000..0913e184 --- /dev/null +++ b/Electronic_Circuit_Analysis_And_Design_by_D._A._Neamen/Chapter17_1_1.ipynb @@ -0,0 +1,647 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:abb54176eeb369f0f245b707b98b6a093b5c09d2bb0c269e911dfcaf8a6dfa9d"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter17-Bipolar Digital Circuits"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex1-pg1115"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "##Example 17.1\n",
+ "V1=5.;\n",
+ "V2=-5.;\n",
+ "Rc1=1.;\n",
+ "Rc2=Rc1;\n",
+ "Rc=Rc1;\n",
+ "Re=2.150;\n",
+ "v2=0.;\n",
+ "##for v1=0\n",
+ "vE=-0.7;\n",
+ "iE=(vE-V2)/Re;\n",
+ "print\"%s %.2f %s\"%('\\nemitter current= ',iE,' mA\\n')\n",
+ "iC=1.;\n",
+ "Vcc=5.;\n",
+ "vo1=Vcc-iC*Rc;\n",
+ "print\"%s %.2f %s\"%('\\nvo1=vo2= ',vo1,' V\\n')\n",
+ "##for v2=-1\n",
+ "vE=-0.7;\n",
+ "iE=2.;\n",
+ "iC2=2.;\n",
+ "vo1=5.;\n",
+ "vo2=Vcc-iC2*Rc;\n",
+ "print\"%s %.2f %s\"%('\\nvo2= ',vo2,' V\\n')\n",
+ "v1=1.;\n",
+ "Vbe=0.7;\n",
+ "vE=v1-Vbe;\n",
+ "iE=(vE-V2)/Re;\n",
+ "print\"%s %.2f %s\"%('\\nemitter current =',iE,' mA\\n')\n",
+ "iC1=iE;\n",
+ "vo1=Vcc-iC1*Rc;\n",
+ "print\"%s %.2f %s\"%('\\nvo1= ',vo1,' V\\n')\n",
+ "vo2=Vcc\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "emitter current= 2.00 mA\n",
+ "\n",
+ "\n",
+ "vo1=vo2= 4.00 V\n",
+ "\n",
+ "\n",
+ "vo2= 3.00 V\n",
+ "\n",
+ "\n",
+ "emitter current = 2.47 mA\n",
+ "\n",
+ "\n",
+ "vo1= 2.53 V\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex2-pg1118"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "##Example 17.2\n",
+ "Vx=-0.7;\n",
+ "Vy=Vx;\n",
+ "Vbe=0.7;\n",
+ "V2=-5.2;\n",
+ "Re=1.180;\n",
+ "vE=Vx-Vbe;\n",
+ "print\"%s %.2f %s\"%('\\nemitter voltage = ',vE,' V\\n')\n",
+ "iE=(vE-V2)/Re;\n",
+ "print\"%s %.2f %s\"%('\\nemitter current= ',iE,' mA\\n')\n",
+ "Icxy=iE;\n",
+ "vo1=-0.7;\n",
+ "Rc1=-vo1/Icxy;\n",
+ "print\"%s %.2f %s\"%('\\nRc1= ',Rc1,' KOhm\\n')\n",
+ "Vnor=vo1-Vbe;\n",
+ "print\"%s %.2f %s\"%('\\nNOR output logic 0 value= ',Vnor,' V\\n')\n",
+ "Vr=(vo1+Vnor)/2.;\n",
+ "vE=Vr-Vbe;\n",
+ "print\"%s %.2f %s\"%('\\nvE= ',vE,' V\\n')\n",
+ "iE=(vE-V2)/Re;\n",
+ "print\"%s %.2f %s\"%('\\niE= ',iE,' mA\\n')\n",
+ "vo2=-0.7;\n",
+ "iC2=iE;\n",
+ "Rc2=-vo2/iC2;\n",
+ "print\"%s %.2f %s\"%('\\nRc2= ',Rc2,' KOhm\\n')\n",
+ "Vor=vo2-Vbe;\n",
+ "print\"%s %.2f %s\"%('\\nOR logic 0 value is= ',Vor,' V\\n')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "emitter voltage = -1.40 V\n",
+ "\n",
+ "\n",
+ "emitter current= 3.22 mA\n",
+ "\n",
+ "\n",
+ "Rc1= 0.22 KOhm\n",
+ "\n",
+ "\n",
+ "NOR output logic 0 value= -1.40 V\n",
+ "\n",
+ "\n",
+ "vE= -1.75 V\n",
+ "\n",
+ "\n",
+ "iE= 2.92 mA\n",
+ "\n",
+ "\n",
+ "Rc2= 0.24 KOhm\n",
+ "\n",
+ "\n",
+ "OR logic 0 value is= -1.40 V\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex3-pg1120"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "##Example 17.3\n",
+ "Vr=-1.05;\n",
+ "Vbe=0.7;\n",
+ "Vb5=Vr+Vbe;\n",
+ "print\"%s %.2f %s\"%('\\nVb5 = ',Vb5,' V\\n')\n",
+ "R1=0.250;\n",
+ "i1=-Vb5/R1;\n",
+ "print\"%s %.2f %s\"%('\\ni1= ',i1,' mA\\n')\n",
+ "Vy=0.7;\n",
+ "V2=-5.2;\n",
+ "##let R1+R2=x\n",
+ "x=(-2.*Vy-V2)/i1;\n",
+ "R2=x-R1;\n",
+ "print\"%s %.2f %s\"%('\\nR2= ',R2,' KOhm\\n')\n",
+ "iS=i1;\n",
+ "Rs=(Vr-V2)/iS;\n",
+ "print\"%s %.2f %s\"%('\\nRs= ',Rs,' KOhm\\n')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Vb5 = -0.35 V\n",
+ "\n",
+ "\n",
+ "i1= 1.40 mA\n",
+ "\n",
+ "\n",
+ "R2= 2.46 KOhm\n",
+ "\n",
+ "\n",
+ "Rs= 2.96 KOhm\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex4-pg1121"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "##Example 17.4\n",
+ "Vx=-0.7;\n",
+ "Vy=-0.7;\n",
+ "iCxy=3.22;##(mA)\n",
+ "iCR=0.;\n",
+ "i5=1.40;\n",
+ "i1=1.40;\n",
+ "Vor=-0.7;\n",
+ "R4=1.500;\n",
+ "Vnor=-1.4;\n",
+ "V2=-5.2;\n",
+ "R3=1.500;\n",
+ "i3=(Vor-V2)/R3;\n",
+ "print\"%s %.2f %s\"%('\\ncurrent i3= ',i3,' mA\\n')\n",
+ "i4=(Vnor-V2)/R4;\n",
+ "print\"%s %.2f %s\"%('\\ncurrent i4 = ',i4, 'mA')\n",
+ "P=(iCxy+iCR+i5+i1+i3+i4)*(0.-V2);\n",
+ "print\"%s %.2f %s\"%('\\npower dissipation= ',P,' mW\\n')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "current i3= 3.00 mA\n",
+ "\n",
+ "\n",
+ "current i4 = 2.53 mA\n",
+ "\n",
+ "power dissipation= 60.08 mW\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex5-pg1122"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "##Example 17.5\n",
+ "b=50.;\n",
+ "V2=-5.2;\n",
+ "Vbe=0.7;\n",
+ "Rc2=0.240;\n",
+ "Vor=-0.75;\n",
+ "Re=1.180;\n",
+ "iE=(Vor-Vbe-V2)/Re;\n",
+ "print\"%s %.2f %s\"%('\\nemitter current= ',iE,' mA\\n')\n",
+ "iB=iE/(1.+b);\n",
+ "iB=iB*1000.;##micro A\n",
+ "print\"%s %.2f %s\"%('\\ninput base current= ',iB,' microA\\n')\n",
+ "R3=1.500;\n",
+ "i3=(Vor-V2)/R3;\n",
+ "print\"%s %.2f %s\"%('\\ni3= ',i3,' mA\\n')\n",
+ "iB=iB*0.001;##mA\n",
+ "N=(-(Vor+Vbe)*(1.+b)/(Rc2)-i3)/iB;\n",
+ "print\"%s %.2f %s\"%('\\nN\\n',N,'')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "emitter current= 3.18 mA\n",
+ "\n",
+ "\n",
+ "input base current= 62.31 microA\n",
+ "\n",
+ "\n",
+ "i3= 2.97 mA\n",
+ "\n",
+ "\n",
+ "N\n",
+ " 122.90 \n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex7-pg1127"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ " \n",
+ "##Example 17.7\n",
+ "Vcc=1.7;\n",
+ "Re=0.008;##mohm\n",
+ "Rc=0.008;##mohm\n",
+ "Vy=0.4;\n",
+ "Vbe=0.7;\n",
+ "Vor=Vcc##logic 1\n",
+ "Vor=Vcc-Vy##logic 0\n",
+ "Vr=1.5;\n",
+ "iE=(Vr-Vbe)/Re;\n",
+ "print\"%s %.2f %s\"%('\\nemitter current= ',iE,' microA\\n')\n",
+ "iR=Vy/Rc;\n",
+ "print\"%s %.2f %s\"%('\\nmaximum current in Rc = ',iR,' microA\\n')\n",
+ "iD=iE-iR;\n",
+ "print\"%s %.2f %s\"%('\\ncurrent through the diode= ',iD,' microA\\n')\n",
+ "P=iE*Vcc;\n",
+ "print\"%s %.2f %s\"%('\\npower dissipation= ',P,' microW\\n')\n",
+ "Vv=1.7;\n",
+ "iE=(Vv-Vbe)/Re;\n",
+ "print\"%s %.2f %s\"%('\\niE = ',iE,' microA\\n')\n",
+ "P=iE*Vcc;\n",
+ "print\"%s %.2f %s\"%('\\npower dissipation = ',P,' microW\\n')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "emitter current= 100.00 microA\n",
+ "\n",
+ "\n",
+ "maximum current in Rc = 50.00 microA\n",
+ "\n",
+ "\n",
+ "current through the diode= 50.00 microA\n",
+ "\n",
+ "\n",
+ "power dissipation= 170.00 microW\n",
+ "\n",
+ "\n",
+ "iE = 125.00 microA\n",
+ "\n",
+ "\n",
+ "power dissipation = 212.50 microW\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex9-pg1142"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "##Example 17.9\n",
+ "bf=25.;\n",
+ "b=bf;\n",
+ "br=0.1;\n",
+ "Vcc=5.;\n",
+ "R1=4.;\n",
+ "Vbc=0.7;\n",
+ "Vy=0.1;\n",
+ "Vx=0.1;\n",
+ "R2=1.6;\n",
+ "Vbe=0.8;\n",
+ "Rc=4.;\n",
+ "Vce=0.1;\n",
+ "vB2=Vx+Vce;\n",
+ "print\"%s %.2f %s\"%('\\nvB2= ',vB2,' V\\n')\n",
+ "vB1=Vx+Vbe;\n",
+ "print\"%s %.2f %s\"%('\\nbase voltage= ',vB1,' V\\n')\n",
+ "i1=(Vcc-vB1)/R1;\n",
+ "print\"%s %.2f %s\"%('\\ncurrent i1= ',i1,' mA\\n')\n",
+ "vB1=Vbe+Vbe+Vbc;\n",
+ "print\"%s %.2f %s\"%('\\nvB1= ',vB1,' V\\n')\n",
+ "vC2=Vbe+Vce;\n",
+ "print\"%s %.2f %s\"%('\\ncollector voltage= ',vC2,' V\\n')\n",
+ "i1=(Vcc-vB1)/R1;\n",
+ "print\"%s %.2f %s\"%('\\ncurrent i1 = ',i1,' mA\\n')\n",
+ "iB2=(1.+2.*br)*i1;\n",
+ "print\"%s %.2f %s\"%('\\niB2= ',iB2,' mA\\n')\n",
+ "i2=(Vcc-vC2)/R2;\n",
+ "print\"%s %.2f %s\"%('\\ni2 = ',i2,' mA\\n')\n",
+ "iE2=i2+iB2;\n",
+ "print\"%s %.2f %s\"%('\\niE2= ',iE2,' mA\\n')\n",
+ "Rb=1.;\n",
+ "i4=Vbe/Rb;\n",
+ "print\"%s %.2f %s\"%('\\ncurrent in the pull down resistor= ',i4,' mA\\n')\n",
+ "iBo=iE2-i4;\n",
+ "print\"%s %.2f %s\"%('\\nbase drive to the output transistor= ',iBo,' mA\\n')\n",
+ "i1=(Vcc-Vce)/Rc;\n",
+ "print\"%s %.2f %s\"%('\\ni1= ',i1,' mA\\n')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "vB2= 0.20 V\n",
+ "\n",
+ "\n",
+ "base voltage= 0.90 V\n",
+ "\n",
+ "\n",
+ "current i1= 1.02 mA\n",
+ "\n",
+ "\n",
+ "vB1= 2.30 V\n",
+ "\n",
+ "\n",
+ "collector voltage= 0.90 V\n",
+ "\n",
+ "\n",
+ "current i1 = 0.68 mA\n",
+ "\n",
+ "\n",
+ "iB2= 0.81 mA\n",
+ "\n",
+ "\n",
+ "i2 = 2.56 mA\n",
+ "\n",
+ "\n",
+ "iE2= 3.37 mA\n",
+ "\n",
+ "\n",
+ "current in the pull down resistor= 0.80 mA\n",
+ "\n",
+ "\n",
+ "base drive to the output transistor= 2.57 mA\n",
+ "\n",
+ "\n",
+ "i1= 1.23 mA\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex11-pg1150"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "##Example 17.11\n",
+ "b=25.;\n",
+ "iB=1.;\n",
+ "iC=2.;\n",
+ "ic=(iB+iC)/(1.+1./b);\n",
+ "print\"%s %.2f %s\"%('\\ninternal collector current= ',ic,' mA\\n',)\n",
+ "ib=ic/b;\n",
+ "print\"%s %.2f %s\"%('\\ninternal base current = ',ib,' mA\\n')\n",
+ "iD=iB-ib;\n",
+ "print\"%s %.2f %s\"%('\\nSchottky diode current= ',iD,' mA\\n')\n",
+ "iC=20.;\n",
+ "ic=(iB+iC)/(1.+1./b);\n",
+ "print\"%s %.2f %s\"%('\\ninternal collector current= ',ic,' mA\\n')\n",
+ "ib=ic/b;\n",
+ "print\"%s %.2f %s\"%('\\ninternal base current = ',ib,' mA\\n')\n",
+ "iD=iB-ib;\n",
+ "print\"%s %.2f %s\"%('\\nSchottky diode current= ',iD,' mA\\n')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "internal collector current= 2.88 mA\n",
+ "\n",
+ "\n",
+ "internal base current = 0.12 mA\n",
+ "\n",
+ "\n",
+ "Schottky diode current= 0.88 mA\n",
+ "\n",
+ "\n",
+ "internal collector current= 20.19 mA\n",
+ "\n",
+ "\n",
+ "internal base current = 0.81 mA\n",
+ "\n",
+ "\n",
+ "Schottky diode current= 0.19 mA\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex12-pg1154"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "##Example 17.12\n",
+ "Vy=0.3;\n",
+ "Vbe=0.7;\n",
+ "vx=0.4;\n",
+ "R2=8.;\n",
+ "Vce=0.4;\n",
+ "Vcc=5.;\n",
+ "b=25.;\n",
+ "Vce=0.4;\n",
+ "Vbe1=0.7;\n",
+ "Vbe2=0.7;\n",
+ "Vcc=5.;\n",
+ "R1=20.;\n",
+ "v1=Vce+Vy;\n",
+ "i1=(Vcc-v1)/R1;\n",
+ "print\"%s %.2f %s\"%('\\ni1= ',i1,' mA\\n')\n",
+ "Pl=i1*(Vcc-vx);\n",
+ "print\"%s %.2f %s\"%('\\npower dissipation= ',Pl,' mW\\n')\n",
+ "v1=Vbe1+Vbe2;\n",
+ "print\"%s %.2f %s\"%('\\nv1= ',v1,' V\\n')\n",
+ "vC2=Vbe1+Vce;\n",
+ "print\"%s %.2f %s\"%('\\nvoltage vC2 =',vC2,' V\\n')\n",
+ "i1=(Vcc-v1)/R1;\n",
+ "print\"%s %.2f %s\"%('\\ncurrent i1 = ',i1,' mA\\n')\n",
+ "i2=(Vcc-vC2)/R2;\n",
+ "print\"%s %.2f %s\"%('\\ncurrent i2 = ',i2,' mA\\n')\n",
+ "P=(i1+i2)*Vcc;\n",
+ "print\"%s %.2f %s\"%('\\npower dissipation for high input condition= ',P,' mW\\n')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "i1= 0.21 mA\n",
+ "\n",
+ "\n",
+ "power dissipation= 0.99 mW\n",
+ "\n",
+ "\n",
+ "v1= 1.40 V\n",
+ "\n",
+ "\n",
+ "voltage vC2 = 1.10 V\n",
+ "\n",
+ "\n",
+ "current i1 = 0.18 mA\n",
+ "\n",
+ "\n",
+ "current i2 = 0.49 mA\n",
+ "\n",
+ "\n",
+ "power dissipation for high input condition= 3.34 mW\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Electronic_Circuit_Analysis_And_Design_by_D._A._Neamen/Chapter1_1_1.ipynb b/Electronic_Circuit_Analysis_And_Design_by_D._A._Neamen/Chapter1_1_1.ipynb new file mode 100644 index 00000000..d1c77068 --- /dev/null +++ b/Electronic_Circuit_Analysis_And_Design_by_D._A._Neamen/Chapter1_1_1.ipynb @@ -0,0 +1,474 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:12fda3be337124becb50b8ef7de2608c3b358deb143d70552beef4ab1e72fe80"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter1-Semiconductor materials and diodes"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex1-pg6"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#calculate the \n",
+ "##Example 1.1\n",
+ "T=300.;##((K)temperature)\n",
+ "##for silicon\n",
+ "B=5.23*10**(15);##Constant (per centimeter cube degree kelvin)\n",
+ "Eg=1.1;##bandgap energy in electrovolt(eV)\n",
+ "k=86.*10**(-6);##Boltzmann's constant(eV per degree kelvin)\n",
+ "n_i=B*T**(3/2.)*math.exp(-Eg/(2.*k*T));##intrinsic carrier concentration\n",
+ "print\"%s %.2f %s\"%('intrinsic carrier concentration= ',n_i,' cm^-3');\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "intrinsic carrier concentration= 14995738948.72 cm^-3\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex2-pg8"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "import math\n",
+ "\n",
+ "#calculate the\n",
+ "\n",
+ "##Example 1.2 \n",
+ "T=300.;##(K)Given Temperature\n",
+ "Nd=10**16;##(cm^-3)Donor concentration\n",
+ "n_i=1.5*10**10;##(cm^-3)intrinsic carrier concentration\n",
+ "##since Nd>>n_i\n",
+ "n_o=10**16;##(cm^-3)electron concentration\n",
+ "##by using formula ::n_i^2=n_o*p_o\n",
+ "p_o=(n_i)**2/Nd;##hole concentration\n",
+ "print\"%s %.2e %s\"%('\\nelectron concentration= ',n_o,' cm^-3');\n",
+ "print\"%s %.2e %s\"%('\\nhole concentration = ',p_o,' cm^-3');\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "electron concentration= 1.00e+16 cm^-3\n",
+ "\n",
+ "hole concentration = 2.25e+04 cm^-3\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex3-pg13"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#calculate the \n",
+ "##Example1.3\n",
+ "T=300;##(K)Given Temperature\n",
+ "Na=10**16;##(cm^-3)Acceptor concentration in p region\n",
+ "Nd=10**17;##(cm^-3)Donor concentration in n region\n",
+ "n_i=1.5*10**10;##(cm^-3)intrinsic carrier concentration\n",
+ "V_T=0.026;##(Volt)terminal voltage\n",
+ "##built-in potential\n",
+ "V_bi=V_T*math.log(Na*Nd/(n_i)**2);\n",
+ "print\"%s %.2f %s\"%('\\nthe built-in potential= ',V_bi,'V')\n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "the built-in potential= 0.76 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex4-pg15"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#calculate the \n",
+ "##Example 1.4\n",
+ "T=300.;##(K)Given Temperature\n",
+ "Na=10**16;##(cm**-3)Acceptor concentration in p region\n",
+ "Nd=10**15;##(cm**-3)Donor concentration in n region\n",
+ "n_i=1.5*10**10;##(cm**-3)intrinsic carrier concentration\n",
+ "C_jo=0.5;##(pF)junction capacitance at zero applied voltage\n",
+ "V_T=0.026;##(Volt)terminal voltage\n",
+ "##built-in potential\n",
+ "V_bi=V_T*math.log(Na*Nd/(n_i)**2);\n",
+ "print\"%s %.2f %s\"%(\"the built-in potential(V)\",V_bi,\"\")\n",
+ "##the junction capacitance for\n",
+ "V_R=1.;##(V)reverse bias voltage\n",
+ "Cj=C_jo*(1.+V_R/V_bi)**(-1/2.);\n",
+ "print\"%s %.2f %s\"%('\\nthe junction capacitance for V_R=1V= ',Cj,' pF\\n')\n",
+ "V_R=5.;##(V)reverse bias voltage\n",
+ "Cj=C_jo*(1.+V_R/V_bi)**(-1/2.);\n",
+ "print\"%s %.2f %s\"%('\\nthe junction capacitance for V_R=5V = ',Cj,' pF')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "the built-in potential(V) 0.64 \n",
+ "\n",
+ "the junction capacitance for V_R=1V= 0.31 pF\n",
+ "\n",
+ "\n",
+ "the junction capacitance for V_R=5V = 0.17 pF\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex5-pg17"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#calculate the \n",
+ "##Example 1.5\n",
+ "T=300.;##(K)Given Temperature\n",
+ "V_T=0.026;##(Volt)terminal voltage\n",
+ "Is=10**-11;##(mA)reverse bias saturation current\n",
+ "n=1.;##emission coefficient\n",
+ "v_D=+0.7;##(V)applied voltage\n",
+ "##pn junction is forward biased\n",
+ "i_D=Is*(math.exp(v_D/V_T)-1.);##diode current\n",
+ "print\"%s %.2f %s\"%('\\ndiode current= ',i_D,' mA\\n')\n",
+ "v_D=-0.7;##(V)pn junction is reverse biased\n",
+ "Is=10**-14##A;\n",
+ "i_D=Is*(math.exp(v_D/V_T)-1);##diode current\n",
+ "print\"%s %.2e %s\"%('\\ndiode current= ',i_D,' A')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "diode current= 4.93 mA\n",
+ "\n",
+ "\n",
+ "diode current= -1.00e-14 A\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex6-pg25"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#calculate the \n",
+ "##Example 1.6\n",
+ "Is=10**-13;##(A)reverse saturation current\n",
+ "V_PS=5.;##(V)applied voltage\n",
+ "R=2;##(KOhm)Resistance in circuit\n",
+ "V_T=0.026;##(Volt)terminal voltage\n",
+ "##V_PS=Is*R*(exp(V_D/V_T)-1)+V_D\n",
+ "##5=(10^-13)*(2000)*(exp(V_D/V_T)-1)+V_D\n",
+ "##let right side of equation be x=(10^-13)*(2000)*(exp(V_D/V_T)-1)+V_D\n",
+ "V_D=0.6;##(V)\n",
+ "x=(10**-13)*(2000.)*(math.exp(V_D/V_T)-1.)+V_D\n",
+ "##so the equation is not balanced\n",
+ "V_D=0.65;##(V)\n",
+ "x=(10**-13)*(2000.)*(math.exp(V_D/V_T)-1.)+V_D\n",
+ "##again equation is not balanced .solution for V_D is between 0.6V and 0.65V\n",
+ "V_D=0.619;##(V)\n",
+ "x=(10**-13)*(2000.)*(math.exp(V_D/V_T)-1.)+V_D\n",
+ "##essentially equal to the value of the left side of the equation i.e 5V\n",
+ "print\"%s %.2f %s\"%('\\ndiode voltage= ',V_D,' V')\n",
+ "I_D=(V_PS-V_D)/R;##(A)diode current\n",
+ "print\"%s %.2f %s\"%('\\nthe diode current= ',I_D,' mA')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "diode voltage= 0.62 V\n",
+ "\n",
+ "the diode current= 2.19 mA\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex7-pg28"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#calculate the \n",
+ "##Example 1.7\n",
+ "##piecewise linear diode parameters\n",
+ "V_Y=0.6;##(V)\n",
+ "r_f=0.010;##(KOhm)\n",
+ "V_PS=5.;##(V)applied voltage\n",
+ "R=2.;##(KOhm)Resistance in circuit\n",
+ "I_D=(V_PS-V_Y)/(R+r_f);##(A)diode current\n",
+ "print\"%s %.2f %s\"%('\\nthe diode current= ',I_D,' mA\\n')\n",
+ "V_D=V_Y+I_D*r_f;##(V)diode voltage\n",
+ "print\"%s %.2f %s\"%('\\ndiode voltage= ',V_D,' V')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "the diode current= 2.19 mA\n",
+ "\n",
+ "\n",
+ "diode voltage= 0.62 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex9-pg33"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#calculate the \n",
+ "##Example 1.9 \n",
+ "##circuit and diode parameters \n",
+ "V_PS=5.;##(V)\n",
+ "R=5;##(KOhm)\n",
+ "V_Y=0.6;##(V)\n",
+ "V_T=0.026;##(Volt)terminal voltage\n",
+ "v_i=0.1##*sin(wt)Volt\n",
+ "##dc analysis\n",
+ "I_DQ=(V_PS-V_Y)/R;\n",
+ "print\"%s %.2f %s\"%('\\ndc quiescent current= ',I_DQ,' mA\\n')\n",
+ "V_O=I_DQ*R;\n",
+ "print\"%s %.2f %s\"%('\\ndc output voltage= ',V_O,' V\\n')\n",
+ "##ac analysis\n",
+ "V_PS=0.;\n",
+ "##Kirchhoff voltage law equation becomes\n",
+ "##v_i=i_d*r_d+i_d*R\n",
+ "r_d=V_T/I_DQ##(Ohm)small signal diode diffusion resistance\n",
+ "i_d=v_i/(r_d+R);##ac diode current\n",
+ "print\"%s %.2f %s\"%('\\nac diode current= ',i_d,'sin(wt) A\\n')\n",
+ "\n",
+ "v_o=i_d*R;##ac output voltage\n",
+ "print\"%s %.2f %s\"%('\\nac output voltage= ',v_o,'sin(wt) V')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "dc quiescent current= 0.88 mA\n",
+ "\n",
+ "\n",
+ "dc output voltage= 4.40 V\n",
+ "\n",
+ "\n",
+ "ac diode current= 0.02 sin(wt) A\n",
+ "\n",
+ "\n",
+ "ac output voltage= 0.10 sin(wt) V\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex10-pg38"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#calculate the \n",
+ "##Example 1.10\n",
+ "V_Y=0.7;##(V)cut in voltage for pn junction\n",
+ "r_f=0.;\n",
+ "V_PS=4;##(V)\n",
+ "R1=4.\n",
+ "R2=4.##(KOhm) from given circuit\n",
+ "I1=(V_PS-V_Y)/R1;\n",
+ "print\"%s %.2f %s\"%('\\ncurrent through pn junction diode= ',I1,' mA\\n')\n",
+ "V_Y=0.3;##(V)cut in voltage for Schottky diode\n",
+ "I2=(V_PS-V_Y)/R2;\n",
+ "print\"%s %.2f %s\"%('\\ncurrent through Schottky diode= ',I2,' mA\\n')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "current through pn junction diode= 0.82 mA\n",
+ "\n",
+ "\n",
+ "current through Schottky diode= 0.93 mA\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex11-pg40"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#calculate the \n",
+ "##Example 1.11 \n",
+ "V_Z=5.6;##(V)Zener diode breakdown voltage\n",
+ "r_z=0.;##(Ohm)Zener resistance\n",
+ "I=3.;##(mA)current in the diode\n",
+ "V_PS=10.;##(V)\n",
+ "##I=(V_PS-V_Z)/R\n",
+ "R=(V_PS-V_Z)/I;\n",
+ "print\"%s %.2f %s\"%('\\nresistance= ',R,' KOhm\\n')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "resistance= 1.47 KOhm\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Electronic_Circuit_Analysis_And_Design_by_D._A._Neamen/Chapter2_1_1.ipynb b/Electronic_Circuit_Analysis_And_Design_by_D._A._Neamen/Chapter2_1_1.ipynb new file mode 100644 index 00000000..324bce27 --- /dev/null +++ b/Electronic_Circuit_Analysis_And_Design_by_D._A._Neamen/Chapter2_1_1.ipynb @@ -0,0 +1,407 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:77e57590b67964207d6f9870670ae0e0da31a20ccd56c5e90b158890f9c8ff6f"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter2-Diode Circuits"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex1-pg55"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ " \n",
+ "##Example 2.1\n",
+ "v_I=120.;##(V)rms primary input \n",
+ "v_o=9.;##(V)peak output voltage\n",
+ "V_Y=0.7;##(V)diode cut in voltage\n",
+ "##for center-tapped transformer circuit in fig.2.6(a)\n",
+ "v_S=v_o+V_Y##(V)peak value of secondary voltage\n",
+ "print\"%s %.2f %s\"%('\\npeak value of secondary voltage= ',v_S,' V\\n')\n",
+ "v_S_rms=v_S/math.sqrt(2)##for a sinusoidal signal rms value of v_S\n",
+ "print\"%s %.2f %s\"%('\\nrms value of v_S= ',v_S_rms,' V\\n')\n",
+ "##let turns ratio of the primary to secondary winding be x=N1/N2\n",
+ "x=v_I/v_S_rms;\n",
+ "print\"%s %.2f %s\"%('\\nturns ratio= \\n',x,'')\n",
+ "##for the bridge circuit in fig.2.7(a)\n",
+ "v_Sb=v_o+2*V_Y;##(V)peak value of secondary voltage\n",
+ "print\"%s %.2f %s\"%('\\npeak value of secondary voltage= ',v_Sb,' V\\n')\n",
+ "v_S_rms=v_Sb/math.sqrt(2.);##for a sinusoidal signal rms value of v_S\n",
+ "print\"%s %.2f %s\"%('\\nrms value of v_S= ',v_S_rms,' V\\n')\n",
+ "##let turns ratio of the primary to secondary winding be x=N1/N2\n",
+ "x=v_I/v_S_rms;\n",
+ "print\"%s %.2f %s\"%('\\nturns ratio=\\n',x,'')\n",
+ "##for center tapped rectifier\n",
+ "PIV=2*v_S-V_Y;\n",
+ "print\"%s %.2f %s\"%('\\npeak inverse voltage of a diode= ',PIV,' V\\n')\n",
+ "##for the bridge rectifier peak inverse voltage of a diode\n",
+ "PIV=v_Sb-V_Y;\n",
+ "print\"%s %.2f %s\"%('\\npeak inverse voltage of a diode=\\n',PIV,'V')\n",
+ "##advantage of bridge rectifier over center tapped rectifier is it requies only half of the turns\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "peak value of secondary voltage= 9.70 V\n",
+ "\n",
+ "\n",
+ "rms value of v_S= 6.86 V\n",
+ "\n",
+ "\n",
+ "turns ratio= \n",
+ " 17.50 \n",
+ "\n",
+ "peak value of secondary voltage= 10.40 V\n",
+ "\n",
+ "\n",
+ "rms value of v_S= 7.35 V\n",
+ "\n",
+ "\n",
+ "turns ratio=\n",
+ " 16.32 \n",
+ "\n",
+ "peak inverse voltage of a diode= 18.70 V\n",
+ "\n",
+ "\n",
+ "peak inverse voltage of a diode=\n",
+ " 9.70 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex2-pg59"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "##Example 2.2\n",
+ "##full wave rectifier circuit with 60Hz input signal\n",
+ "V_M=10.;##(V)peak output voltage\n",
+ "R=0.01;##(MOhm)output load resistance\n",
+ "f=60.;##Hz\n",
+ "V_r=0.2;##(V)ripple voltage\n",
+ "C=V_M/(2.*f*R*V_r);##capacitance\n",
+ "print\"%s %.2f %s\"%('\\ncapacitance= ',C,' microF\\n')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "capacitance= 41.67 microF\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex3-pg61"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ " \n",
+ "##Example 2.3\n",
+ "V_O=12.;##(V)peak output voltage\n",
+ "I_L=0.12;##(A)current delivered to the load\n",
+ "R=V_O/I_L;\n",
+ "print\"%s %.2f %s\"%('\\neffective load resistance= ',R,' Ohm\\n')\n",
+ "V_Y=0.7;##(V)diode cut in voltage\n",
+ "v_S=V_O+2.*V_Y;\n",
+ "print\"%s %.2f %s\"%('\\npeak value of v_S= ',v_S,' V\\n')\n",
+ "v_Srms=v_S/math.sqrt(2.);\n",
+ "print\"%s %.2f %s\"%('\\nrms voltage= ',v_Srms,' V\\n')\n",
+ "##let x=N1/N2\n",
+ "Vin=120.;##(V)input line voltage\n",
+ "x=Vin/v_Srms;\n",
+ "print\"%s %.2f %s\"%('\\nturns ratio= \\n',x,'')\n",
+ "VM=12.;##(V)\n",
+ "Vr=5/100.*VM;\n",
+ "print\"%s %.2f %s\"%('\\nripple voltage= ',Vr,' V\\n')\n",
+ "f=60.;##(Hz) input frequency\n",
+ "C=VM/(2.*R*Vr*f);\n",
+ "print\"%s %.2f %s\"%('\\nfilter capacitance= ',C,' F\\n')\n",
+ "i_Dmax=(VM/R)*(1+2*math.pi*math.sqrt(VM/(2.*Vr)));\n",
+ "print\"%s %.2f %s\"%('\\npeak diode current= ',i_Dmax,' A\\n')\n",
+ "R=0.1;##Kohm\n",
+ "i_Davg=(1/(2.*math.pi))*math.sqrt(2.*Vr/VM)*((VM/R)*(1.+math.pi*math.sqrt(VM/(2.*Vr))));\n",
+ "print\"%s %.2f %s\"%('\\naverage diode current= ',i_Davg,' mA\\n')\n",
+ "PIV=v_S-V_Y;\n",
+ "print\"%s %.2f %s\"%('\\npeak inverse voltage= ',PIV,' V\\n')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "effective load resistance= 100.00 Ohm\n",
+ "\n",
+ "\n",
+ "peak value of v_S= 13.40 V\n",
+ "\n",
+ "\n",
+ "rms voltage= 9.48 V\n",
+ "\n",
+ "\n",
+ "turns ratio= \n",
+ " 12.66 \n",
+ "\n",
+ "ripple voltage= 0.60 V\n",
+ "\n",
+ "\n",
+ "filter capacitance= 0.00 F\n",
+ "\n",
+ "\n",
+ "peak diode current= 2.50 A\n",
+ "\n",
+ "\n",
+ "average diode current= 66.04 mA\n",
+ "\n",
+ "\n",
+ "peak inverse voltage= 12.70 V\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex5-pg68"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "##Example 2.5\n",
+ "rZ=4.;##(Ohm) Zener resistance\n",
+ "V_Lnom=9.;##(V) nominal output voltage\n",
+ "Izmax=0.3;##(A) maximum zener diode current\n",
+ "Izmin=0.03;##(A) minimum zener diode current\n",
+ "V_Lmax=V_Lnom+Izmax*rZ\n",
+ "V_Lmin=V_Lnom+Izmin*rZ\n",
+ "##percent regulation R\n",
+ "R=((V_Lmax-V_Lmin)/V_Lnom)*100.;\n",
+ "print\"%s %.2f %s\"%('\\npercent regulation= ',R,' \\n')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "percent regulation= 12.00 \n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex8-pg77"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "##Example 2.8\n",
+ "R1=5.;R2=10.;##(KOhm) \n",
+ "V_Y=0.7;##(V)diode cut in voltage\n",
+ "V1=5.;V2=-5;##(V)\n",
+ "vt=0.;##(V)\n",
+ "##asssuming initially diode D1 is off\n",
+ "##iR1=iD2=iR2=V1-V2-V_Y/(R1+R2)\n",
+ "iD2=(V1-V2-V_Y)/(R1+R2);\n",
+ "print\"%s %.2f %s\"%('\\ndiode current= ',iD2,'mA\\n')\n",
+ "iR1=iD2;\n",
+ "vo=V1-iR1*R1;\n",
+ "print\"%s %.2f %s\"%('\\noutput voltage= ',vo,' V\\n')\n",
+ "v=vo-V_Y;##v=v'\n",
+ "print\"%s %.2f %s\"%('\\nVoltage= ',v,' V\\n')\n",
+ "vt=4.;##(V)fig.2.33\n",
+ "##both D1 and D2 are on\n",
+ "vo==vt;\n",
+ "vo=4.;\n",
+ "iD2=(V1-vo)/R1;\n",
+ "print\"%s %.2f %s\"%('\\ndiode current= ',iD2,' mA\\n')\n",
+ "iR1==iD2;\n",
+ "v=vo-V_Y;\n",
+ "print\"%s %.2f %s\"%('\\nV= ',v,' V\\n')\n",
+ "iR2=(v-V2)/R2;\n",
+ "print\"%s %.2f %s\"%('\\niR2= ',iR2,' mA\\n')\n",
+ "iD1=iR2-iD2;\n",
+ "print\"%s %.2f %s\"%('\\ncurrent through D1= ',iD1,' mA\\n')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "diode current= 0.62 mA\n",
+ "\n",
+ "\n",
+ "output voltage= 1.90 V\n",
+ "\n",
+ "\n",
+ "Voltage= 1.20 V\n",
+ "\n",
+ "\n",
+ "diode current= 0.20 mA\n",
+ "\n",
+ "\n",
+ "V= 3.30 V\n",
+ "\n",
+ "\n",
+ "iR2= 0.83 mA\n",
+ "\n",
+ "\n",
+ "current through D1= 0.63 mA\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex10-pg83"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "##Example 2.10\n",
+ "n=1.;##quantum efficiency\n",
+ "A=10**-2;##cm^2 junction area\n",
+ "p=5*10**17;##(cm^-2-s^-1) incident photon flux\n",
+ "e=1.6*10**-16;##charge of an electron\n",
+ "Iph=n*e*p*A;\n",
+ "print\"%s %.2f %s\"%('\\nphotocurrent= ',Iph,' mA\\n')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "photocurrent= 0.80 mA\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex11-pg84"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "##Example 2.11\n",
+ "I=0.01;##(A) diode current\n",
+ "V_Y=1.7;##(V) forward bias voltage drop\n",
+ "Vt=0.2;##(V)\n",
+ "R=(5.-V_Y-Vt)/I;\n",
+ "print\"%s %.2f %s\"%('\\nresistance= ',R,' Ohm')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "resistance= 310.00 Ohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Electronic_Circuit_Analysis_And_Design_by_D._A._Neamen/Chapter3_1_1.ipynb b/Electronic_Circuit_Analysis_And_Design_by_D._A._Neamen/Chapter3_1_1.ipynb new file mode 100644 index 00000000..e6fdfc33 --- /dev/null +++ b/Electronic_Circuit_Analysis_And_Design_by_D._A._Neamen/Chapter3_1_1.ipynb @@ -0,0 +1,992 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:454a57b394e23d05ed048843520d141cbdae1d1bc179f5ca99f9342e5d6f5307"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter3-The Bipolar Junction Transistor"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex1-pgpg104"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "\n",
+ "##Example 3.1\n",
+ "##let beta be \"b\"\n",
+ "b=150.;##common emitter current gain\n",
+ "iB=15*10**-3;##(mA) base current\n",
+ "##assume transistor biased in forward active mode\n",
+ "iC=b*iB;\n",
+ "print\"%s %.2f %s\"%('\\ncollector current= ',iC,' mA\\n')\n",
+ "iE=(1.+b)*iB;\n",
+ "print\"%s %.2f %s\"%('\\nemitter current= ',iE,' mA\\n')\n",
+ "a=b/(1.+b);\n",
+ "print\"%s %.2f %s\"%('\\ncommon base current gain=',a,'')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "collector current= 2.25 mA\n",
+ "\n",
+ "\n",
+ "emitter current= 2.27 mA\n",
+ "\n",
+ "\n",
+ "common base current gain= 0.99 \n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex2-pg113"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#calculate the \n",
+ "##Example 3.2\n",
+ "b=100.;##common emitter current gain\n",
+ "BVcbo=120.;##(V) break down voltage of the B-C junction\n",
+ "n=3.;##empirical constant\n",
+ "BVceo=BVcbo/(b)**(1./n);\n",
+ "print\"%s %.2f %s\"%('\\nbreakdown voltage= ',BVceo,' V\\n')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "breakdown voltage= 25.85 V\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex3-pg115"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "##Example 3.3\n",
+ "Vbb=4.;##(V)\n",
+ "Rb=220.##(KOhm);\n",
+ "Rc=2.;##(KOhm)\n",
+ "Vcc=10.;##(V)\n",
+ "Vbe=0.7;##(V)\n",
+ "b=200.;\n",
+ "##from fig.3.19(b)\n",
+ "Ib=(Vbb-Vbe)/Rb;\n",
+ "print\"%s %.2f %s\"%('\\nbase current= ',Ib,' mA\\n')\n",
+ "Ic=b*Ib;\n",
+ "print\"%s %.2f %s\"%('\\ncollector current= ',Ic,' mA\\n')\n",
+ "Ie=(1.+b)*Ib;\n",
+ "print\"%s %.2f %s\"%('\\nemitter current= ',Ie,' mA\\n')\n",
+ "Vce=Vcc-Ic*Rc;\n",
+ "print\"%s %.2f %s\"%('\\ncollector emitter voltage= ',Vce,' V\\n')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "base current= 0.01 mA\n",
+ "\n",
+ "\n",
+ "collector current= 3.00 mA\n",
+ "\n",
+ "\n",
+ "emitter current= 3.01 mA\n",
+ "\n",
+ "\n",
+ "collector emitter voltage= 4.00 V\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex4-pg116"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "##Example 3.4\n",
+ "Vbb=1.5;##(V)\n",
+ "Rb=580.;##(KOhm)\n",
+ "Veb=0.6;##(V)\n",
+ "Vcc=5.;##(V)\n",
+ "b=100.;\n",
+ "##writing Kirchhoff voltage law equation around E-B loop\n",
+ "Ib=(Vcc-Veb-Vbb)/Rb;\n",
+ "print\"%s %.2f %s\"%('\\nbase current= ',Ib,' mA\\n')\n",
+ "Ic=b*Ib;\n",
+ "print\"%s %.2f %s\"%('\\ncollector current= ',Ic,' mA\\n')\n",
+ "Ie=(1.+b)*Ib;\n",
+ "print\"%s %.2f %s\"%('\\nemitter current=',Ie,' mA\\n')\n",
+ "Vec=(1./2.)*Vcc;\n",
+ "print\"%s %.2f %s\"%('\\nce voltage= ',Vec,' V\\n')\n",
+ "Rc=(Vcc-Vec)/Ic;\n",
+ "print\"%s %.2f %s\"%('\\ncollector resistance= ',Rc,' KOhm\\n')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "base current= 0.01 mA\n",
+ "\n",
+ "\n",
+ "collector current= 0.50 mA\n",
+ "\n",
+ "\n",
+ "emitter current= 0.51 mA\n",
+ "\n",
+ "\n",
+ "ce voltage= 2.50 V\n",
+ "\n",
+ "\n",
+ "collector resistance= 5.00 KOhm\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex5-pg119"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "##Example 3.5\n",
+ "b=100.;\n",
+ "Vbe=0.7;##(V)\n",
+ "Vce=0.2;##(V)\n",
+ "Vbb=8.;##(v)\n",
+ "Rb=220.;##(KOhm)\n",
+ "Ib=(Vbb-Vbe)/Rb\n",
+ "print\"%s %.2f %s\"%('\\nbase current= ',Ib,' mA\\n')\n",
+ "##transistor in active region\n",
+ "Ic=b*Ib;\n",
+ "print\"%s %.2f %s\"%('\\ncollector current= ',Ic,' mA\\n')\n",
+ "Vcc=10.;##(V)\n",
+ "Rc=4.;##(KOhm)\n",
+ "Vce=Vcc-Ic*Rc;\n",
+ "print\"%s %.2f %s\"%('\\ncollector emitter voltage= ',Vce,' V\\n')\n",
+ "##saturation\n",
+ "Vce=0.2;##(V)\n",
+ "Ic=(Vcc-Vce)/Rc;\n",
+ "print\"%s %.2f %s\"%('\\nsaturation collector current= ',Ic,' mA\\n')\n",
+ "x=Ic/Ib\n",
+ "##which is <b\n",
+ "Ie=Ic+Ib;\n",
+ "print\"%s %.2f %s\"%('\\nemitter current= ',Ie,' mA\\n')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "base current= 0.03 mA\n",
+ "\n",
+ "\n",
+ "collector current= 3.32 mA\n",
+ "\n",
+ "\n",
+ "collector emitter voltage= -3.27 V\n",
+ "\n",
+ "\n",
+ "saturation collector current= 2.45 mA\n",
+ "\n",
+ "\n",
+ "emitter current= 2.48 mA\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex6-pg122"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "import numpy\n",
+ "import matplotlib\n",
+ "from matplotlib import pyplot\n",
+ "import math\n",
+ "%matplotlib inline\n",
+ "import warnings\n",
+ "warnings.filterwarnings('ignore')\n",
+ "#calculate the \n",
+ "##Example 3.6\n",
+ "Vbe=0.7;\n",
+ "b=75.;\n",
+ "##Q point values::\n",
+ "##using KVL eq around the B-E loop\n",
+ "##Vbb=Ib*Re+Vbe+Ie*Re\n",
+ "##assuming transistor is in forward biased mode we can write Ie=(1+b)*Ib\n",
+ "Vbb=6.;\n",
+ "Rb=25.;##KOhm\n",
+ "Re=0.6;##KOhm\n",
+ "Ib=(Vbb-Vbe)/(Rb+(1.+b)*Re);\n",
+ "print\"%s %.2f %s\"%('\\nbase current= ',Ib,' mA\\n')\n",
+ "Ic=b*Ib;\n",
+ "print\"%s %.2f %s\"%('\\ncollector current= ',Ic,' mA\\n')\n",
+ "Ie=(1+b)*Ib;\n",
+ "print\"%s %.2f %s\"%('\\nemitter current= ',Ie,' mA\\n')\n",
+ "Vcc=12.;\n",
+ "Rc=0.4;\n",
+ "Vce=Vcc-Ic*Rc-Ie*Re;\n",
+ "print\"%s %.2f %s\"%('\\ncollector emitter voltage= ',Vce,' V\\n')\n",
+ "##load line::\n",
+ "##using KVL law around C-E loop\n",
+ "##Vce=Vcc-(Ic*(Rc+((1+B)/B)*Re));\n",
+ "Ic=numpy.array([0.12,5.63])\n",
+ "Vce=12.-(Ic)*1\n",
+ "pyplot.plot(Vce,Ic)\n",
+ "pyplot.xlabel(\"Vce\")\n",
+ "pyplot.ylabel(\"Ic\")\n",
+ "pyplot.show()\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "base current= 0.08 mA\n",
+ "\n",
+ "\n",
+ "collector current= 5.63 mA\n",
+ "\n",
+ "\n",
+ "emitter current= 5.71 mA\n",
+ "\n",
+ "\n",
+ "collector emitter voltage= 6.32 V\n",
+ "\n"
+ ]
+ },
+ {
+ "metadata": {},
+ "output_type": "display_data",
+ "png": "iVBORw0KGgoAAAANSUhEUgAAAXoAAAEPCAYAAABMTw/iAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAEPdJREFUeJzt3XvMZHddx/H3p10LWwgUuSOQIglXW2iFutEQxoim3LVh\nkYIKVYiJgoXIrTGwj4ZIKBrAlZpwadM1UnUL1NpAaKmMlGhLa7dYaIFAQFuFsqHcCttY6Nc/ZrYM\n2+fZfS5z5lzm/Uo2OzNnnjm/k25/+97fzDmTqkKSNFxHtT0ASVKznOglaeCc6CVp4JzoJWngnOgl\naeCc6CVp4Bqd6JMcl+TCJDcmuSHJjib3J0m6u20Nv/67gI9U1QuSbAPu1fD+JEmHSFMnTCW5L7Cv\nqn62kR1IktalyaWbRwH7k5yX5Nok701ybIP7kyStosmJfhtwMnBOVZ0MfB94Y4P7kyStosk1+puB\nm6vq6un9Czlkok/ihXYkaROqKut9bmNFX1VfB25K8pjpQ88APrfK8wb7a9euXa2PwePz+Jbx+IZ8\nbFUb7+OmP3XzKuDvkhwDfBk4o+H9SZIO0ehEX1WfAZ7a5D4kSYfnmbENGo1GbQ+hUR5fvw35+IZ8\nbJvR2Ofo17XzpNrcvyT1URKqC2/GSpK6wYlekgbOiV6SBs6JXp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]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex7-pg123"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "import numpy\n",
+ "import matplotlib\n",
+ "from matplotlib import pyplot\n",
+ "%matplotlib inline\n",
+ "#calculate the \n",
+ "##Example 3.7\n",
+ "Vbe=0.65;\n",
+ "Vcc=5.;\n",
+ "Rc=0.5;##KOhm\n",
+ "b=100.;\n",
+ "V1=-5.;\n",
+ "Re=1.;##KOhm\n",
+ "## Q-point values :: writing KVL eq around B-E loop\n",
+ "Ie=(-V1-Vbe)/Re;\n",
+ "print\"%s %.2f %s\"%('\\nemitter current= ',Ie,' mA\\n')\n",
+ "Ib=(Ie/(1.+b));\n",
+ "print\"%s %.2f %s\"%('\\nbase current= ',Ib,' mA\\n')\n",
+ "Ic=(b/(1.+b))*Ie;\n",
+ "print\"%s %.2f %s\"%('\\ncollector current= ',Ic,' mA\\n')\n",
+ "Vce=Vcc-Ic*Rc-Ie*Re-V1;\n",
+ "print\"%s %.2f %s\"%('\\ncollector emitter voltage= ',Vce,' V\\n')\n",
+ "##load line::\n",
+ "##Vce=Vcc-V1-(Ic*(Rc+((1+B)/B)*Re));\n",
+ "\n",
+ "Vce=numpy.array([0,2,3.5,4,6,8,10])\n",
+ "Ic=(10.-Vce)/1.51;\n",
+ "\n",
+ "\n",
+ "pyplot.plot(Vce,Ic)\n",
+ "pyplot.xlabel(\"Vce\")\n",
+ "pyplot.ylabel(\"Ic\")\n",
+ "\n",
+ "pyplot.title(\"load line\")\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "emitter current= 4.35 mA\n",
+ "\n",
+ "\n",
+ "base current= 0.04 mA\n",
+ "\n",
+ "\n",
+ "collector current= 4.31 mA\n",
+ "\n",
+ "\n",
+ "collector emitter voltage= 3.50 V\n",
+ "\n"
+ ]
+ },
+ {
+ "metadata": {},
+ "output_type": "pyout",
+ "prompt_number": 4,
+ "text": [
+ "<matplotlib.text.Text at 0x75078d0>"
+ ]
+ },
+ {
+ "metadata": {},
+ "output_type": "display_data",
+ "png": "iVBORw0KGgoAAAANSUhEUgAAAXoAAAEZCAYAAACZwO5kAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAH1ZJREFUeJzt3Xu81GW1x/HP2htQ8Yqi5GUrIoiCwOYigoJNXsALmsc8\nWpaWmge8g540ywLKJDUFE8FrHsoyLxwMUkEkRkARuV/N0rRjlGRiCqLIZZ0/ngG2yGXvzfzm+c3M\n9/167Zcze2bv33Jeulis5/mtx9wdEREpXRWxAxARkWQp0YuIlDglehGREqdELyJS4pToRURKnBK9\niEiJU6KXomVmb5nZiQn83kFm9qutvJYxs7drPF9kZsfnOwaRfGoQOwCRHeC5ryR+b+3e6H5UAtcX\nyStV9CIiJU6JXkqCme1kZsPMbGnua6iZNcq9tpeZ/d7M/mlmy81snJkdWONnDzWzF8zsQzN7Dmha\nh+u+ZWYn5B4PMrPHzWxU7nctMrPONd57gJmNzsXxFzO7Ko8fgchWKdFLqfg+0BXokPvqCtyUe60C\neAg4OPf1MTC8xs/+BpgJ7AP8GPgmtW/fbP6+M4BHgT2BsRuuY2YVwDhgLnAAcCLQ38x61fZfUKS+\nlOilVJwP/Mjd/+Xu/wIGAxcAuPtydx/j7p+4+0rgFuCLAGZ2MNAF+IG7r3H3qYSEbPWMY6q7j/cw\nROoRwh86AEcDTd39Zndf6+5vAg8CX63ndURqTYuxUioOAP5a4/n/5b6HmTUGhgK9gSa513czM8u9\n5313/7jGz/4VqKpnHMtqPF4F7Jyr5g8BDjCz92u8XglMqed1RGpNiV5Kxd+B5sCruecHA0tzj68D\nDge6uvs/zawamEOo2v8BNDGzxu6+Kvf+Q4B1eY7vbeBNdz88z79XZLvUupFS8Shw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hepmygjEERic/flZvYKYfb9WEJ1/5iZ\nnUqY9d3V3T+pcXLP/UBfd3/dzI4BRhAOvhdJPY1AkLJlZucDfdz9/NycoYuBrwOvuvtDNd63G2E6\n4Gs1frxR7lQwkdRTRS/lbCww1Mw6Ao3dfW5uzvnms/ArCIdddCx4hCJ5oB69lK3cAS+TCWdybliE\nnQhcZGa7AJhZE3f/EHjTzM7Jfc/MrH2MmEXqQ4leyt2jQLvcP3H3CYRKf1aunXNd7n1fBy4xs3nA\nIkIfX6QoqEcvIlLiVNGLiJQ4JXoRkRKnRC8iUuKU6EVESpwSvYhIiVOiFxEpcUr0IiIlToleRKTE\n/T96Dpvfmjsi0wAAAABJRU5ErkJggg==\n",
+ "text": [
+ "<matplotlib.figure.Figure at 0x75076f0>"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex9-pg128"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "import numpy\n",
+ "import matplotlib\n",
+ "from matplotlib import pyplot\n",
+ "%matplotlib inline\n",
+ "#calculate the \n",
+ "##Example 3.9\n",
+ "b=100.;\n",
+ "Vbe=0.7;\n",
+ "V1=-5.;\n",
+ "V2=12.;\n",
+ "Rb=10.;\n",
+ "Re=5.;\n",
+ "Rc=5.;\n",
+ "Rl=5.;\n",
+ "##Q point values:: using KVL eq around B-E loop\n",
+ "Ib=-(V1+Vbe)/(Rb+(1.+b)*Re);\n",
+ "print\"%s %.2f %s\"%('\\nbase current= ',Ib,' mA\\n')\n",
+ "Ic=b*Ib;\n",
+ "print\"%s %.2f %s\"%('\\ncollector current= ',Ic,' mA\\n')\n",
+ "Ie=(1.+b)*Ib;\n",
+ "print\"%s %.2f %s\"%('\\nemitter current= ',Ie,' mA\\n')\n",
+ "##at collector node we can write Ic=(V2-Vo)/Rc-Vo/Rl\n",
+ "Vo=(V2/Rc-Ic)*Rc*Rl/(Rc+Rl);\n",
+ "print\"%s %.2f %s\"%('\\noutput voltage= ',Vo,' V\\n')\n",
+ "Vce=Vo-Ie*Re-V1;\n",
+ "print\"%s %.2f %s\"%('\\ncollector emitter voltage= ',Vce,' V\\n')\n",
+ "##load line::\n",
+ "Rth=Rl*Rc/(Rl+Rc);\n",
+ "print\"%s %.2f %s\"%('\\nThevenin rquivalent resistance= ',Rth,' KOhm\\n')\n",
+ "Vth=(Rl/(Rl+Rc))*V2;\n",
+ "print\"%s %.2f %s\"%('\\nThevenin equivalent voltage= ',Vth,' V\\n')\n",
+ "##fig.3.36(c) KVL law\n",
+ "##Vce=6-V1-Ic*Rth-Ie*Re;\n",
+ "\n",
+ "\n",
+ "\n",
+ "Vce=numpy.array([0,2,4.7,3.5,4,6,8,10])\n",
+ "Ic=(11.-Vce)/7.5;\n",
+ "\n",
+ "\n",
+ "pyplot.plot(Vce,Ic)\n",
+ "pyplot.xlabel(\"Vce\")\n",
+ "pyplot.ylabel(\"Ic\")\n",
+ "pyplot.title(\"load line\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "base current= 0.01 mA\n",
+ "\n",
+ "\n",
+ "collector current= 0.83 mA\n",
+ "\n",
+ "\n",
+ "emitter current= 0.84 mA\n",
+ "\n",
+ "\n",
+ "output voltage= 3.91 V\n",
+ "\n",
+ "\n",
+ "collector emitter voltage= 4.70 V\n",
+ "\n",
+ "\n",
+ "Thevenin rquivalent resistance= 2.50 KOhm\n",
+ "\n",
+ "\n",
+ "Thevenin equivalent voltage= 6.00 V\n",
+ "\n"
+ ]
+ },
+ {
+ "metadata": {},
+ "output_type": "pyout",
+ "prompt_number": 5,
+ "text": [
+ "<matplotlib.text.Text at 0x34068b0>"
+ ]
+ },
+ {
+ "metadata": {},
+ "output_type": "display_data",
+ "png": "iVBORw0KGgoAAAANSUhEUgAAAYQAAAEZCAYAAACXRVJOA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Tv\nkjy7u9Kl3Tewl66QulZV303yRfr3XriO/t7Cx5KcRP9a88dX1b9OuRPVFcDaqro7yS8AHwRe2EXt\n0kJ46QppF5KcBpxcVac115A6EzgduL2qPjxl3H70ryb5tSkv36e5w500FNxDkHbtOuA9SZ4P7FtV\nW5rr7E+/F8Ne9G/K8vwlr1BaJGYI0i40NyH6NP171u4Ik28CzkjyNIAkB1bVI8A3kvyX5rkkOaqL\nmqWFsiFIc9sAHNn8l6r6JP09h5ubw0jnNeNOB85KshX4Kv2cQRoaZgiSJMA9BElSw4YgSQJsCJKk\nhg1BkgTYECRJDRuCJAmwIUiSGjYESRIA/x+o/vcOVxPvBAAAAABJRU5ErkJggg==\n",
+ "text": [
+ "<matplotlib.figure.Figure at 0x758f0b0>"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex10-pg132"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#calculate the \n",
+ "##Example 3.10\n",
+ "Rb=0.24;\n",
+ "Vcc=12.;\n",
+ "Vbe=0.7;\n",
+ "Vce=0.1;\n",
+ "b=75.;\n",
+ "Rc=5.;##Ohm\n",
+ "##for Vt=0 ,transistor is cut off,Ib=Ic=0,Vo=Vcc=12 V,power dissipation is zero\n",
+ "Vt=12.;##(V)\n",
+ "Ib=(Vt-Vbe)/Rb;\n",
+ "print\"%s %.2f %s\"%('\\nbase current= ',Ib,' mA\\n')\n",
+ "Ic=(Vcc-Vce)/Rc;\n",
+ "print\"%s %.2f %s\"%('\\ncollector current= ',Ic,'A\\n')\n",
+ "Ib=0.0471;##A\n",
+ "x=Ic/Ib\n",
+ "##since Ic/Ib<b transistor is in saturation\n",
+ "##Vo==Vcc;\n",
+ "Vo=0.1;\n",
+ "print\"%s %.2f %s\"%('\\noutput voltage= ',Vo,' V\\n')\n",
+ "P=Ic*Vce+Ib*Vbe;\n",
+ "print\"%s %.2f %s\"%('\\npower dissipation= ',P,' W\\n')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "base current= 47.08 mA\n",
+ "\n",
+ "\n",
+ "collector current= 2.38 A\n",
+ "\n",
+ "\n",
+ "output voltage= 0.10 V\n",
+ "\n",
+ "\n",
+ "power dissipation= 0.27 W\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 22
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex13-pg138"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "##Example 3.13\n",
+ "b=100.;\n",
+ "Vcc=12.;\n",
+ "Vbe=0.7;\n",
+ "Icq=1.;##mA\n",
+ "Vceq=6.;\n",
+ "Rc=(Vcc-Vceq)/Icq;\n",
+ "print\"%s %.2f %s\"%('\\ncollector resistance= ',Rc,' KOhms\\n')\n",
+ "Ibq=Icq/b;\n",
+ "print\"%s %.2f %s\"%('\\nbase current= ',Ibq,' mA\\n')\n",
+ "Rb=(Vcc-Vbe)/Ibq;\n",
+ "print\"%s %.2f %s\"%('\\nbase resistance= ',Rb,' KOhms\\n')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "collector resistance= 6.00 KOhms\n",
+ "\n",
+ "\n",
+ "base current= 0.01 mA\n",
+ "\n",
+ "\n",
+ "base resistance= 1130.00 KOhms\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 23
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex14-pg141"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "##Example 3.14\n",
+ "R1=56.;\n",
+ "R2=12.2;\n",
+ "Rc=2.;\n",
+ "Re=.4;\n",
+ "Vcc=10.;\n",
+ "Vbe=0.7;\n",
+ "b=100.;\n",
+ "##fig.3.53(b)\n",
+ "Rth=R2*R1/(R1+R2);\n",
+ "print\"%s %.2f %s\"%('\\nThevenin rquivalent resistance= ',Rth,' KOhm\\n')\n",
+ "Vth=(R2/(R1+R2))*Vcc;\n",
+ "print\"%s %.2f %s\"%('\\nThevenin equivalent voltage= ',Vth,' V\\n')\n",
+ "Ibq=(Vth-Vbe)/(Rth+(1.+b)*Re);\n",
+ "print\"%s %.2f %s\"%('\\nbase current= ',Ibq,' mA\\n')\n",
+ "Icq=b*Ibq;\n",
+ "print\"%s %.2f %s\"%('\\ncollector current= ',Icq,' mA\\n')\n",
+ "Ieq=(1.+b)*Ibq;\n",
+ "print\"%s %.2f %s\"%('\\nemitter current= ',Ieq,' mA\\n')\n",
+ "Vceq=Vcc-Icq*Rc-Ieq*Re;\n",
+ "print\"%s %.2f %s\"%('\\ncollector emitter voltage= ',Vceq,' V\\n')\n",
+ "b=numpy.array([50,100,150])\n",
+ "for x in range(0,150):\n",
+ " Ibq=(Vth-Vbe)/(Rth+(1.+x)*Re);\n",
+ "print(\"Ibeq,Iceq,Ieq,Vceq\")\n",
+ "print(Ibq)\n",
+ "Icq=x*Ibq;\n",
+ "print(Icq)\n",
+ "Ieq=(1+x)*Ibq;\n",
+ "print(Ieq)\n",
+ "Vceq=Vcc-Icq*Rc-Ieq*Re;\n",
+ "print(Vceq)\n",
+ "print(\"\")\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Thevenin rquivalent resistance= 10.02 KOhm\n",
+ "\n",
+ "\n",
+ "Thevenin equivalent voltage= 1.79 V\n",
+ "\n",
+ "\n",
+ "base current= 0.02 mA\n",
+ "\n",
+ "\n",
+ "collector current= 2.16 mA\n",
+ "\n",
+ "\n",
+ "emitter current= 2.18 mA\n",
+ "\n",
+ "\n",
+ "collector emitter voltage= 4.81 V\n",
+ "\n",
+ "Ibeq,Iceq,Ieq,Vceq\n",
+ "0.0155511811024\n",
+ "2.31712598425\n",
+ "2.33267716535\n",
+ "4.43267716535\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 28
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex15-pg142"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "##Example 3.15\n",
+ "Vcc=5.;\n",
+ "Rc=1.;##KOhm\n",
+ "Vbe=0.7;\n",
+ "b=120.;\n",
+ "Vceq=3.;\n",
+ "Re=.510;\n",
+ "Icq=(Vcc-Vceq)/(Rc+Re);\n",
+ "print\"%s %.2f %s\"%('\\ncollector current= ',Icq,' mA\\n')\n",
+ "Ibq=Icq/b;\n",
+ "print\"%s %.2f %s\"%('\\nbase current= ',Ibq,' mA\\n')\n",
+ "##for bias stable circuit\n",
+ "Rth=0.1*(1.+b)*Re;\n",
+ "print\"%s %.2f %s\"%('\\nThevenin rquivalent resistance= ',Rth,' KOhm\\n')\n",
+ "##Ibq=(Vth-Vbe)/(Rth+(1+b)*Re)\n",
+ "Vth=Ibq*(Rth+(1.+b)*Re)+Vbe;\n",
+ "print\"%s %.2f %s\"%('\\nThevenin equivalent voltage= ',Vth,' V\\n')\n",
+ "##Vth=(R2/(R1+R2))*Vcc\n",
+ "##let x=(R2/(R1+R2))\n",
+ "x=Vth/Vcc\n",
+ "##Rth=6050=R1*x\n",
+ "R1=6.05/x;\n",
+ "print\"%s %.2f %s\"%('\\nR1= ',R1,'KOhms\\n')\n",
+ "R2=x*R1/(1-x);\n",
+ "print\"%s %.2f %s\"%('\\nR2= ',R2,'KOhms\\'')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "collector current= 1.32 mA\n",
+ "\n",
+ "\n",
+ "base current= 0.01 mA\n",
+ "\n",
+ "\n",
+ "Thevenin rquivalent resistance= 6.17 KOhm\n",
+ "\n",
+ "\n",
+ "Thevenin equivalent voltage= 1.45 V\n",
+ "\n",
+ "\n",
+ "R1= 20.87 KOhms\n",
+ "\n",
+ "\n",
+ "R2= 8.52 KOhms'\n"
+ ]
+ }
+ ],
+ "prompt_number": 29
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex16-pg146"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "##Example 3.16\n",
+ "R1=10.;\n",
+ "b=50.;\n",
+ "Vbe=0.7;\n",
+ "V1=-5.;\n",
+ "I1=-(V1+Vbe)/R1;\n",
+ "print\"%s %.2f %s\"%('\\nreference current= ',I1,' mA\\n')\n",
+ "Iq=I1/(1.+2./b);\n",
+ "print\"%s %.2f %s\"%('\\nbias current= ',Iq,' mA\\n')\n",
+ "##Ib=Ib1=Ib2\n",
+ "Ib=Iq/b;\n",
+ "print\"%s %.2f %s\"%('\\nbase current= ',Ib,' mA\\n')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "reference current= 0.43 mA\n",
+ "\n",
+ "\n",
+ "bias current= 0.41 mA\n",
+ "\n",
+ "\n",
+ "base current= 0.01 mA\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 30
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex17-pg148"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#calculate the \n",
+ "##Example 3.17\n",
+ "Vbe=0.7;\n",
+ "Vcc=10.;\n",
+ "V2=5.;\n",
+ "b=100.;\n",
+ "R1=100.;\n",
+ "R2=50.;\n",
+ "Re1=2.;\n",
+ "Rth=R2*R1/(R1+R2);\n",
+ "print\"%s %.2f %s\"%('\\nThevenin rquivalent resistance= ',Rth,' KOhm\\n')\n",
+ "Vth=(R2/(R1+R2))*Vcc-V2;\n",
+ "print\"%s %.2f %s\"%('\\nThevenin equivalent voltage= ',Vth,' V\\n')\n",
+ "##Vth=Ib1*Rth+Vbe+Ie1*Re1-5 and Ie1=(1+b)*Ib1\n",
+ "Ib1=(Vth+5-Vbe)/(Rth+(1+b)*Re1);\n",
+ "print\"%s %.2f %s\"%('\\nIb1= ',Ib1,' mA\\n')\n",
+ "Ic1=b*Ib1;\n",
+ "print\"%s %.2f %s\"%('\\nIc1= ',Ic1,' mA\\n')\n",
+ "Ie1=(1.+b)*Ib1;\n",
+ "print\"%s %.2f %s\"%('\\nIe1= ',Ie1,' mA\\n')\n",
+ "##summing the currents at the collector of Q1,Ir1+Ib2=Ic1\n",
+ "##(5-Vc1)/Rc1+Ib2=Ic1\n",
+ "##also Ib2=Ie2/(1+b)=(5-(Vc1+0.7))/(1+b)*Re2\n",
+ "Rc1=5.;\n",
+ "Re1=2.;\n",
+ "Re2=2.;\n",
+ "Rc2=1.5;\n",
+ "Vc1=Rc1*(1.+b)*Re2*((5./Rc1)+(4.3/((1.+b)*Re2))-Ic1)/(((1.+b)*Re2)+Rc1);\n",
+ "print\"%s %.2f %s\"%('\\nVc1= ',Vc1,' V\\n')\n",
+ "Ir1=(5.-Vc1)/Rc1;\n",
+ "print\"%s %.2f %s\"%('\\nIr1= ',Ir1,' mA\\n')\n",
+ "Ve2=Vc1+Vbe;\n",
+ "print\"%s %.2f %s\"%('\\nVe2= ',Ve2,' V\\n')\n",
+ "Ie2=(5-Ve2)/Re1;\n",
+ "print\"%s %.2f %s\"%('\\nIe2= ',Ie2,' mA\\n')\n",
+ "Ic2=Ie2*b/(1.+b);\n",
+ "print\"%s %.2f %s\"%('\\nIc2= ',Ic2,' mA\\n')\n",
+ "Ib2=Ie2/(1.+b);\n",
+ "print\"%s %.2f %s\"%('\\nIb2 ',Ib2,' mA\\n')\n",
+ "Ve1=Ie1*Re1-5;\n",
+ "print\"%s %.2f %s\"%('\\nVe1= ',Ve1,' V\\n')\n",
+ "Vc2=Ic2*Rc2-5.;\n",
+ "print\"%s %.2f %s\"%('\\nVc2= ',Vc2,' V\\n')\n",
+ "Vce1=Vc1-Ve1;\n",
+ "print\"%s %.2f %s\"%('\\nVce1= ',Vce1,'V\\n')\n",
+ "Vec2=Ve2-Vc2;\n",
+ "print\"%s %.2f %s\"%('\\nVec2= ',Vec2,' V\\n')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Thevenin rquivalent resistance= 33.33 KOhm\n",
+ "\n",
+ "\n",
+ "Thevenin equivalent voltage= -1.67 V\n",
+ "\n",
+ "\n",
+ "Ib1= 0.01 mA\n",
+ "\n",
+ "\n",
+ "Ic1= 1.12 mA\n",
+ "\n",
+ "\n",
+ "Ie1= 1.13 mA\n",
+ "\n",
+ "\n",
+ "Vc1= -0.48 V\n",
+ "\n",
+ "\n",
+ "Ir1= 1.10 mA\n",
+ "\n",
+ "\n",
+ "Ve2= 0.22 V\n",
+ "\n",
+ "\n",
+ "Ie2= 2.39 mA\n",
+ "\n",
+ "\n",
+ "Ic2= 2.36 mA\n",
+ "\n",
+ "\n",
+ "Ib2 0.02 mA\n",
+ "\n",
+ "\n",
+ "Ve1= -2.74 V\n",
+ "\n",
+ "\n",
+ "Vc2= -1.45 V\n",
+ "\n",
+ "\n",
+ "Vce1= 2.26 V\n",
+ "\n",
+ "\n",
+ "Vec2= 1.68 V\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 31
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Electronic_Circuit_Analysis_And_Design_by_D._A._Neamen/Chapter4_1_1.ipynb b/Electronic_Circuit_Analysis_And_Design_by_D._A._Neamen/Chapter4_1_1.ipynb new file mode 100644 index 00000000..474a3300 --- /dev/null +++ b/Electronic_Circuit_Analysis_And_Design_by_D._A._Neamen/Chapter4_1_1.ipynb @@ -0,0 +1,511 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:6cd0454c158d13a9f3c4fd9afab45debe741070024bd59dcb697aaffd2aec82d"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter4-Basic BJT Amplifiers"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex1-pg174"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "##Example 4.1\n",
+ "b=100.;\n",
+ "Vcc=12.;\n",
+ "Vbe=0.7;\n",
+ "Rc=6.;\n",
+ "Rb=50.;\n",
+ "Vbb=1.2;\n",
+ "##dc solution\n",
+ "Ibq=(Vbb-Vbe)/Rb;\n",
+ "print\"%s %.2f %s\"%('\\nbase current= ',Ibq,' mA\\n')\n",
+ "Icq=b*Ibq;\n",
+ "print\"%s %.2f %s\"%('\\ncollector current= ',Icq,' mA\\n')\n",
+ "Vceq=Vcc-Icq*Rc;\n",
+ "print\"%s %.2f %s\"%('\\ncollector emitter voltage= ',Vceq,' V\\n')\n",
+ "##transistor is forward biased\n",
+ "##ac solution \n",
+ "V_T=0.026;##(V)\n",
+ "##small signal hybrid pi parameters\n",
+ "r_pi=b*V_T/Icq;\n",
+ "print\"%s %.2f %s\"%('\\nsmall signal resistance= ',r_pi,' KOhm\\n')\n",
+ "g_m=Icq/V_T;\n",
+ "print\"%s %.2f %s\"%('\\ntransconductance= ',g_m,' mA/V\\n')\n",
+ "##Av=Vo/Vs=-(g_m*Rc)*r_pi/(r_pi+Rb)\n",
+ "Av=-(g_m*Rc)*r_pi/(r_pi+Rb);\n",
+ "print\"%s %.2f %s\"%('\\nsmall signal voltage gain=\\n',Av,'')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "base current= 0.01 mA\n",
+ "\n",
+ "\n",
+ "collector current= 1.00 mA\n",
+ "\n",
+ "\n",
+ "collector emitter voltage= 6.00 V\n",
+ "\n",
+ "\n",
+ "small signal resistance= 2.60 KOhm\n",
+ "\n",
+ "\n",
+ "transconductance= 38.46 mA/V\n",
+ "\n",
+ "\n",
+ "small signal voltage gain=\n",
+ " -11.41 \n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex2-pg177"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "##Example 4.2\n",
+ "V_pi=50.;##(V)\n",
+ "Icq=1.;##(mA)\n",
+ "ro=V_pi/Icq;\n",
+ "print\"%s %.2f %s\"%('\\nsmall signal output resistance= ',ro,' KOhm\\n')\n",
+ "Rc=6.;\n",
+ "g_m=38.5;\n",
+ "r_pi=2.6;\n",
+ "Rb=50.;\n",
+ "Av=-(g_m)*(Rc*ro/(Rc+ro))*r_pi/(r_pi+Rb);\n",
+ "print\"%s %.2f %s\"%('\\nsmall signal voltage gain= \\n',Av,'')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "small signal output resistance= 50.00 KOhm\n",
+ "\n",
+ "\n",
+ "small signal voltage gain= \n",
+ " -10.19 \n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex4-pg190"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "##Example 4.4\n",
+ "b=100.;\n",
+ "Vbe=0.7;\n",
+ "Va=100.;\n",
+ "V_T=0.026;##(V)\n",
+ "##from dc analysis\n",
+ "Icq=0.95;\n",
+ "Vceq=6.31;\n",
+ "##ac analysis\n",
+ "r_pi=b*V_T/Icq;\n",
+ "print\"%s %.2f %s\"%('\\nsmall signal resistance= ',r_pi,' KOhm\\n')\n",
+ "g_m=Icq/V_T;\n",
+ "print\"%s %.2f %s\"%('\\ntransconductance= ',g_m,' mA/V\\n')\n",
+ "Rs=0.5;\n",
+ "Rc=6.;\n",
+ "ro=Va/Icq;\n",
+ "print\"%s %.2f %s\"%('\\nro= ',ro,' KOhm\\n')\n",
+ "Av=-g_m*(5.9*r_pi/(5.9+r_pi))/((5.9*r_pi/(r_pi+5.9))+Rs)*ro*Rc/(ro+Rc);\n",
+ "print\"%s %.2f %s\"%('\\nsmall signal voltage gain= ',Av,' \\n')\n",
+ "Ri=5.9*r_pi/(r_pi+5.9);\n",
+ "print\"%s %.2f %s\"%('\\ninput resistance= ',Ri,' KOhm\\n')\n",
+ "Ro=ro*Rc/(ro+Rc);\n",
+ "print\"%s %.2f %s\"%('\\noutput resistance= ',Ro,' KOhm\\n')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "small signal resistance= 2.74 KOhm\n",
+ "\n",
+ "\n",
+ "transconductance= 36.54 mA/V\n",
+ "\n",
+ "\n",
+ "ro= 105.26 KOhm\n",
+ "\n",
+ "\n",
+ "small signal voltage gain= -163.64 \n",
+ "\n",
+ "\n",
+ "input resistance= 1.87 KOhm\n",
+ "\n",
+ "\n",
+ "output resistance= 5.68 KOhm\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex5-pg194"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "##Example 4.5\n",
+ "b=100.;\n",
+ "Vbe=0.7;\n",
+ "Rc=2.;\n",
+ "Rs=0.5;\n",
+ "Icq=2.16;\n",
+ "V_T=0.026;##(V)\n",
+ "Vceq=4.8\n",
+ "##ac solution\n",
+ "r_pi=b*V_T/Icq;\n",
+ "print\"%s %.2f %s\"%('\\nsmall signal resistance= ',r_pi,' KOhm\\n')\n",
+ "g_m=Icq/V_T;\n",
+ "print\"%s %.2f %s\"%('\\ntransconductance= ',g_m,' mA/V\\n')\n",
+ "##since Va=infinity,ro=Va/Icq is also infinity\n",
+ "Re=0.4;\n",
+ "Rib=r_pi+(1.+b)*Re;\n",
+ "print\"%s %.2f %s\"%('\\ninput resistance to the base= ',Rib,' KOhm\\n')\n",
+ "##Ri=R1||R2||Rib\n",
+ "Ri=10.*Rib/(10.+Rib);\n",
+ "print\"%s %.2f %s\"%('\\ninput resistance to the amplifier= ',Ri,' KOhm\\n')\n",
+ "Av=-(1./(r_pi+(1.+b)*Re))*b*Rc*Ri/(Ri+Rs);\n",
+ "print\"%s %.2f %s\"%('\\nsmall signal voltage gain= \\n',Av,'')\n",
+ "##by approximate expression\n",
+ "Av=-Rc/Re;\n",
+ "print\"%s %.2f %s\"%('\\nsmall signal voltage gain= \\n',Av,'')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "small signal resistance= 1.20 KOhm\n",
+ "\n",
+ "\n",
+ "transconductance= 83.08 mA/V\n",
+ "\n",
+ "\n",
+ "input resistance to the base= 41.60 KOhm\n",
+ "\n",
+ "\n",
+ "input resistance to the amplifier= 8.06 KOhm\n",
+ "\n",
+ "\n",
+ "small signal voltage gain= \n",
+ " -4.53 \n",
+ "\n",
+ "small signal voltage gain= \n",
+ " -5.00 \n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex7-pg199"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "##Example 4.7\n",
+ "Iq=0.5;\n",
+ "b=120.;\n",
+ "Va=80.;\n",
+ "V_T=0.026;##(V)\n",
+ "rc=120.;##small signal collector resistance (KOhm)\n",
+ "##Icq=Iq\n",
+ "Icq=0.5;\n",
+ "g_m=Icq/V_T;\n",
+ "print\"%s %.2f %s\"%('\\ntransconductance= ',g_m,' mA/V\\n')\n",
+ "ro=Va/Icq;\n",
+ "print\"%s %.2f %s\"%('\\nsmall signal output resistance= ',ro,' KOhm\\n')\n",
+ "Av=-g_m*ro*rc/(ro+rc);\n",
+ "print\"%s %.2f %s\"%('\\nsmall signal voltage gain= ',Av,' \\n')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "transconductance= 19.23 mA/V\n",
+ "\n",
+ "\n",
+ "small signal output resistance= 160.00 KOhm\n",
+ "\n",
+ "\n",
+ "small signal voltage gain= -1318.68 \n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex8-pg201"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "##Example 4.8\n",
+ "b=150.;Veb=0.7;\n",
+ "##dc solution\n",
+ "V2=10.;\n",
+ "V1=-10.;\n",
+ "V_T=0.026;##(V)\n",
+ "Rc=5.;\n",
+ "Rb=50.;\n",
+ "Re=10.;\n",
+ "Ibq=(V2-Veb)/(Rb+(1.+b)*Re);\n",
+ "print\"%s %.2f %s\"%('\\nbase current ',Ibq,' mA\\n')\n",
+ "Icq=b*Ibq;\n",
+ "print\"%s %.2f %s\"%('\\ncollector current= ',Icq,' mA\\n')\n",
+ "Ieq=(1.+b)*Ibq;\n",
+ "print\"%s %.2f %s\"%('\\nemitter current= ',Ieq,' mA\\n')\n",
+ "Vecq=V2-V1-Icq*Rc-Ieq*Re;\n",
+ "print\"%s %.2f %s\"%('\\nemitter collector voltage= ',Vecq,' V\\n')\n",
+ "##ac solution\n",
+ "r_pi=b*V_T/Icq;\n",
+ "print\"%s %.2f %s\"%('\\nsmall signal resistance= ',r_pi,' KOhm\\n')\n",
+ "g_m=Icq/V_T;\n",
+ "print\"%s %.2f %s\"%('\\ntransconductance = ',g_m,'mA/V\\n')\n",
+ "##since Va=infinity,ro=Va/Icq is also infinity\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "base current 0.01 mA\n",
+ "\n",
+ "\n",
+ "collector current= 0.89 mA\n",
+ "\n",
+ "\n",
+ "emitter current= 0.90 mA\n",
+ "\n",
+ "\n",
+ "emitter collector voltage= 6.53 V\n",
+ "\n",
+ "\n",
+ "small signal resistance= 4.36 KOhm\n",
+ "\n",
+ "\n",
+ "transconductance = 34.39 mA/V\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex9-203"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "##Example 4.9\n",
+ "Ic=0.894;\n",
+ "i_C=2.*Ic;\n",
+ "print\"%s %.2f %s\"%('\\nmaximum possible symmetrical peak to peak ac collector current= ',i_C,' mA\\n')\n",
+ "Rc=5.;\n",
+ "Rl=2.;\n",
+ "vo=i_C*Rc*Rl/(Rc+Rl);\n",
+ "print\"%s %.2f %s\"%('\\nmaximum possible symmetrical peak to peak output voltage= ',vo,' V\\n')\n",
+ "iC=Ic+i_C*1/2.;\n",
+ "print\"%s %.2f %s\"%('\\nmaximum instantaneous collector current= ',iC,' mA\\n')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "maximum possible symmetrical peak to peak ac collector current= 1.79 mA\n",
+ "\n",
+ "\n",
+ "maximum possible symmetrical peak to peak output voltage= 2.55 V\n",
+ "\n",
+ "\n",
+ "maximum instantaneous collector current= 1.79 mA\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex10-pg206"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ " \n",
+ "##Example 4.10\n",
+ "b=100.;\n",
+ "Vbe=0.7;\n",
+ "V_T=0.026;##(V)\n",
+ "Re=2.;\n",
+ "R1=50.;\n",
+ "R2=50.;\n",
+ "Rs=0.5;\n",
+ "Va=80.;\n",
+ "##by dc analysis\n",
+ "Icq=0.793;\n",
+ "Vceq=3.4;\n",
+ "r_pi=b*V_T/Icq;\n",
+ "print\"%s %.2f %s\"%('\\nsmall signal resistance= ',r_pi,' KOhm\\n')\n",
+ "g_m=Icq/V_T;\n",
+ "print\"%s %.2f %s\"%('\\ntransconductance= ',g_m,' mA/V\\n')\n",
+ "ro=Va/Icq;\n",
+ "print\"%s %.2f %s\"%('\\nsmall signal output resistance= ',ro,' KOhm\\n')\n",
+ "Rib=r_pi+(1.+b)*Re*ro/(ro+Re);\n",
+ "print\"%s %.2f %s\"%('\\ninput resistance to the base= ',Rib,' KOhm\\n')\n",
+ "##Ri=R1||R2||Rib\n",
+ "x=R1*R2/(R1+R2);\n",
+ "Ri=x*Rib/(x+Rib);\n",
+ "print\"%s %.2f %s\"%('\\nRi= ',Ri,' KOhm\\n')\n",
+ "y=ro*Re/(ro+Re);\n",
+ "Av=(1./(r_pi+(1.+b)*y))*(1.+b)*y*Ri/(Ri+Rs);\n",
+ "print\"%s %.2f %s\"%('\\nsmall signal voltage gain= ',Av,' \\n')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "small signal resistance= 3.28 KOhm\n",
+ "\n",
+ "\n",
+ "transconductance= 30.50 mA/V\n",
+ "\n",
+ "\n",
+ "small signal output resistance= 100.88 KOhm\n",
+ "\n",
+ "\n",
+ "input resistance to the base= 201.35 KOhm\n",
+ "\n",
+ "\n",
+ "Ri= 22.24 KOhm\n",
+ "\n",
+ "\n",
+ "small signal voltage gain= 0.96 \n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Electronic_Circuit_Analysis_And_Design_by_D._A._Neamen/Chapter5_1_1.ipynb b/Electronic_Circuit_Analysis_And_Design_by_D._A._Neamen/Chapter5_1_1.ipynb new file mode 100644 index 00000000..f4bc5a6b --- /dev/null +++ b/Electronic_Circuit_Analysis_And_Design_by_D._A._Neamen/Chapter5_1_1.ipynb @@ -0,0 +1,812 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:94a278ecbe0a391fb4d9353ffc9aa9e2a6d1780bede99089ee306c07fa367982"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter5-The Field Effect Transistor "
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex1-pg252"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "##Example 5.1\n",
+ "Vtn=0.75;##(V)\n",
+ "W=40.*10**-6;##(cm)\n",
+ "L=4.*10**-6;##(cm)\n",
+ "u=650.;##(cm)\n",
+ "Iox=450.*10**-11;\n",
+ "e=3.9*8.86*10**-14;\n",
+ "Kn=W*u*e/(2.*L*Iox);\n",
+ "print\"%s %.2f %s\"%('\\nconduction parameter= ',Kn,' mA/V^2\\n')\n",
+ "Vgs=2.*Vtn;\n",
+ "i_D=Kn*(Vgs-Vtn)**2;\n",
+ "print\"%s %.2f %s\"%('\\ndrain current= ',i_D,' mA\\n')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "conduction parameter= 0.25 mA/V^2\n",
+ "\n",
+ "\n",
+ "drain current= 0.14 mA\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex2-pg256"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ " \n",
+ "##Example 5.2\n",
+ "Kp=0.2;##(mA/V^2)\n",
+ "Vtp=0.5;\n",
+ "iD=0.5;\n",
+ "Vsg=math.sqrt(iD/Kp)-Vtp;\n",
+ "print\"%s %.2f %s\"%('\\nVgs= ',Vsg,' V\\n')\n",
+ "##to bias in p channel MOSFET \n",
+ "Vsd=Vsg+Vtp;\n",
+ "print\"%s %.2f %s\"%('\\nVsd= ',Vsd,' V\\n')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Vgs= 1.08 V\n",
+ "\n",
+ "\n",
+ "Vsd= 1.58 V\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex3-pg264"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ " \n",
+ "##Example 5.3\n",
+ "R1=30.;\n",
+ "R2=20.;\n",
+ "RD=20.;\n",
+ "Vdd=5.;\n",
+ "Vtn=1.;\n",
+ "Kn=0.1;\n",
+ "Vgs=R2*Vdd/(R1+R2);\n",
+ "print\"%s %.2f %s\"%('\\nVgs= ',Vgs,' V\\n')\n",
+ "I_D=Kn*(Vgs-Vtn)**2;\n",
+ "print\"%s %.2f %s\"%('\\nthe drain current= ',I_D,' mA\\n')\n",
+ "Vds=Vdd-I_D*RD;\n",
+ "print\"%s %.2f %s\"%('\\ndrain to source voltage= ',Vds,' V\\n')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Vgs= 2.00 V\n",
+ "\n",
+ "\n",
+ "the drain current= 0.10 mA\n",
+ "\n",
+ "\n",
+ "drain to source voltage= 3.00 V\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex4-pg265"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "##Example 5.4\n",
+ "R1=50.;\n",
+ "R2=50.;\n",
+ "RD=7.5;\n",
+ "Vdd=5.;\n",
+ "Vtp=-0.8;\n",
+ "Vg=2.5;\n",
+ "Kp=0.2;\n",
+ "Vo=R2*Vdd/(R1+R2);\n",
+ "print\"%s %.2f %s\"%('\\nVo= ',Vo,' V\\n')\n",
+ "Vsg=Vdd-Vg;\n",
+ "print\"%s %.2f %s\"%('\\nsource to gate voltage= ',Vsg,' V\\n')\n",
+ "I_D=Kp*(Vsg+Vtp)**2;\n",
+ "print\"%s %.2f %s\"%('\\nthe drain current= ',I_D,' mA\\n')\n",
+ "Vsd=Vdd-I_D*RD;\n",
+ "print\"%s %.2f %s\"%('\\nsource to drain voltage= ',Vsd,' V\\n')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Vo= 2.50 V\n",
+ "\n",
+ "\n",
+ "source to gate voltage= 2.50 V\n",
+ "\n",
+ "\n",
+ "the drain current= 0.58 mA\n",
+ "\n",
+ "\n",
+ "source to drain voltage= 0.67 V\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex6-pg269"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "##Example 5.6\n",
+ "Vtn=2.;\n",
+ "Kn=80.*10**-3;\n",
+ "##x=W/L\n",
+ "x=4.;\n",
+ "I_D=0.5;\n",
+ "##I_D=Kn*x*((Vgs-Vtn)^2)/2;\n",
+ "Vgs=math.sqrt(I_D*2./(Kn*x))+2.;\n",
+ "print\"%s %.2f %s\"%('\\nVgs= ',Vgs,' V\\n')\n",
+ "##y=R1+R2\n",
+ "Rs=2.;\n",
+ "y=10./0.05;\n",
+ "print\"%s %.2f %s\"%('\\nR1+R2= ',y,' Kohm\\n')\n",
+ "##Vgs=Vg-Vs=(R2/(R1+R2)*10-5)-I_D*Rs+5\n",
+ "R2=(y/10.)*(Vgs+I_D*Rs);\n",
+ "print\"%s %.2f %s\"%('\\nR2= ',R2,' KOhm\\n')\n",
+ "R1=y-R2;\n",
+ "print\"%s %.2f %s\"%('\\nR1= ',R1,' KOhm\\n')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Vgs= 3.77 V\n",
+ "\n",
+ "\n",
+ "R1+R2= 200.00 Kohm\n",
+ "\n",
+ "\n",
+ "R2= 95.36 KOhm\n",
+ "\n",
+ "\n",
+ "R1= 104.64 KOhm\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex7-pg270"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "##Example 5.7\n",
+ "Vtn=0.8;\n",
+ "Kn=80.;\n",
+ "##x=W/L\n",
+ "x=3.;\n",
+ "I_D=250.;\n",
+ "Vd=2.5;\n",
+ "##I_D=Kn/2*x*(Vgs-Vtn)^2\n",
+ "Vgs=math.sqrt(I_D*2./(Kn*x))+Vtn;\n",
+ "print\"%s %.2f %s\"%('\\nVgs= ',Vgs,' V\\n')\n",
+ "Vs=-Vgs\n",
+ "##I_D=(5-Vd)/Rd\n",
+ "Rd=(5.-Vd)/I_D;\n",
+ "print\"%s %.2f %s\"%('\\nRd= ',Rd,' KOhm\\n')\n",
+ "Vds=Vd-Vs;\n",
+ "print\"%s %.2f %s\"%('\\nVds= ',Vds,' V\\n')\n",
+ "Vdssat=Vgs-Vtn\n",
+ "##since Vds>Vdssat transistor is biased in saturation region\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Vgs= 2.24 V\n",
+ "\n",
+ "\n",
+ "Rd= 0.01 KOhm\n",
+ "\n",
+ "\n",
+ "Vds= 4.74 V\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex8-pg272"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from sympy import *\n",
+ "##Example 5.8\n",
+ "Vtn=0.8;\n",
+ "Kn=0.05;\n",
+ "##I_D=Kn*(Vgs-Vtn)^2\n",
+ "##Vds=Vgs=5-I_D*Rs\n",
+ "##combining these two equations we obtain 0.5(Vgs)^2+0.2Vgs-4.68\n",
+ "import numpy\n",
+ "from numpy.polynomial import Polynomial as P\n",
+ "p = P([1, 5, 6])\n",
+ "p.roots()\n",
+ "\n",
+ "\n",
+ "print('',p.roots(),' V\\n')\n",
+ "##assuming transistor is conducting ,Vgs must be greater than threshold voltage\n",
+ "Vgs=2.87;\n",
+ "I_D=Kn*(Vgs-Vtn)**2;\n",
+ "print\"%s %.2f %s\"%('\\ndrain current= ',I_D,' mA\\n')\n",
+ "#ans is varying due to round of error in book calculations are done wrong\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "('', array([-0.5 , -0.33333333]), ' V\\n')\n",
+ "\n",
+ "drain current= 0.21 mA\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex10-pg277"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ " \n",
+ "##Example 5.10\n",
+ "Vtn=-2.;\n",
+ "Kn=0.1;\n",
+ "Vdd=5.;\n",
+ "Rs=5.;\n",
+ "Vgs=0.;\n",
+ "I_D=Kn*(Vgs-Vtn)**2;\n",
+ "print\"%s %.2f %s\"%('\\ndrain current= ',I_D,' mA\\n')\n",
+ "Vds=Vdd-I_D*Rs;\n",
+ "print\"%s %.2f %s\"%('\\ndc drain to source voltage= ',Vds,' V\\n')\n",
+ "Vdssat=Vgs-Vtn\n",
+ "##since Vds>Vdssat transisyor is biased in saturation region\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "drain current= 0.40 mA\n",
+ "\n",
+ "\n",
+ "dc drain to source voltage= 3.00 V\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex11-pg277"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "import numpy\n",
+ "\n",
+ "##Example 5.11\n",
+ "Vtnd=1;\n",
+ "Vtnl=-2;\n",
+ "Knd=50;\n",
+ "Knl=10;\n",
+ "Vt=5;\n",
+ "import numpy\n",
+ "from numpy.polynomial import Polynomial as P\n",
+ "p = P([4, -40, 5])\n",
+ "p.roots()\n",
+ "\n",
+ "\n",
+ "print('\\npossible solutions ::',p.roots(),'')\n",
+ "##since output voltage cannot be greater than supply voltage 5V\n",
+ "Vo=0.1;##(V)\n",
+ "I_D=Knl*(-Vtnl)**2;\n",
+ "print\"%s %.2f %s\"%('\\ndrain current= ',I_D,' microA\\n')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "('\\npossible solutions ::', array([ 0.10128226, 7.89871774]), '')\n",
+ "\n",
+ "drain current= 40.00 microA\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex13-pg282"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#calculate the \n",
+ "##Example 5.13\n",
+ "Kn1=0.2;\n",
+ "Kn2=0.1;\n",
+ "Kn3=0.1;\n",
+ "Kn4=0.1;\n",
+ "Vtn1=1.;\n",
+ "Vtn2=1.;\n",
+ "Vtn3=1.;\n",
+ "Vtn4=1.;\n",
+ "V2=-5.;\n",
+ "Vgs3=(math.sqrt(Kn4/Kn3)*(-V2-Vtn4)+Vtn3)/(1.+math.sqrt(Kn4/Kn3));\n",
+ "print\"%s %.2f %s\"%('\\nVgs3= ',Vgs3,' V\\n')\n",
+ "Iq=Kn3*(Vgs3-Vtn3)**2;\n",
+ "print\"%s %.2f %s\"%('\\nbias current= ',Iq,' mA\\n')\n",
+ "Vgs1=math.sqrt(Iq/Kn1)+Vtn1;\n",
+ "print\"%s %.2f %s\"%('\\ngate to source voltage on M1= ',Vgs1,' V\\n')\n",
+ "Vds2=-V2-Vgs1;\n",
+ "print\"%s %.2f %s\"%('\\ndrain to source voltage on M2= ',Vds2,' V\\n')\n",
+ "Vgs2=Vgs3;\n",
+ "Vdssat=Vgs2-Vtn2\n",
+ "##since Vds2>Vdssat M2 is biased in saturation region\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Vgs3= 2.50 V\n",
+ "\n",
+ "\n",
+ "bias current= 0.23 mA\n",
+ "\n",
+ "\n",
+ "gate to source voltage on M1= 2.06 V\n",
+ "\n",
+ "\n",
+ "drain to source voltage on M2= 2.94 V\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 16
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex14-pg284"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "##Example 5.14\n",
+ "I_D=0.5;\n",
+ "Vds=6.;\n",
+ "Kn=80.*10**-6;\n",
+ "Vgs=5.;\n",
+ "Vtn=1.;\n",
+ "##x=W/L\n",
+ "x=I_D*2./(Kn*(Vgs-Vtn)**2);\n",
+ "print(x,\"W/L \")\n",
+ "##maximum power dissipation in transistor \n",
+ "Pmax=Vds*I_D;\n",
+ "print\"%s %.2f %s\"%('\\nmaximum power dissipation in transistor= ',Pmax,' W\\n')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(781.2500000000001, 'W/L ')\n",
+ "\n",
+ "maximum power dissipation in transistor= 3.00 W\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 17
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex16-pg293"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "import numpy \n",
+ "##Example 5.16\n",
+ "Idss=2.;##(mA) saturation current\n",
+ "Vp=-3.5;##(V) pinch off voltage\n",
+ "Vgs=numpy.array([[0, Vp/4. ,Vp/2.]])\n",
+ "I_D=Idss*(1.-Vgs/Vp)**2;\n",
+ "print (I_D)\n",
+ "Vds=Vgs-Vp;\n",
+ "print (Vds)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "[[ 2. 1.125 0.5 ]]\n",
+ "[[ 3.5 2.625 1.75 ]]\n"
+ ]
+ }
+ ],
+ "prompt_number": 18
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex17-pg295"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "##Example 5.17\n",
+ "Idss=5.;##mA\n",
+ "Vp=-4.;\n",
+ "Vdd=10.;\n",
+ "I_D=2.;\n",
+ "Vds=6.;\n",
+ "##I_D=Idss*(1-Vgs/Vp)^2\n",
+ "Vgs=(1.-math.sqrt(I_D/Idss))*Vp;\n",
+ "print\"%s %.2f %s\"%('\\nVgs= ',Vgs,' V\\n')\n",
+ "Rs=-Vgs/I_D;\n",
+ "print\"%s %.2f %s\"%('\\nRs= ',Rs,' KOhm\\n')\n",
+ "Rd=(Vdd-Vds-I_D*Rs)/I_D;\n",
+ "print\"%s %.2f %s\"%('\\nRd= ',Rd,' KOhm\\n')\n",
+ "Vgs-Vp\n",
+ "##since Vds>Vgs-Vp JFET is biased in saturation\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Vgs= -1.47 V\n",
+ "\n",
+ "\n",
+ "Rs= 0.74 KOhm\n",
+ "\n",
+ "\n",
+ "Rd= 1.26 KOhm\n",
+ "\n"
+ ]
+ },
+ {
+ "metadata": {},
+ "output_type": "pyout",
+ "prompt_number": 19,
+ "text": [
+ "2.5298221281347035"
+ ]
+ }
+ ],
+ "prompt_number": 19
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex19-pg298"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "##Example 5.19\n",
+ "Idss=2.5;\n",
+ "Vp=2.5;\n",
+ "I_D=0.8;\n",
+ "##I_D=Iq=0.8*10^-3=(Vd-(-9))/Rd\n",
+ "Vd=0.8*4.-9;\n",
+ "print\"%s %.2f %s\"%('\\nVd = ',Vd,'V\\n')\n",
+ "##I_D=Idss*(1-Vgs/Vp)^2;\n",
+ "Vgs=(1.-math.sqrt(I_D/Idss))*Vp;\n",
+ "print\"%s %.2f %s\"%('\\nVgs = ',Vgs,'V\\n')\n",
+ "Vs=1-Vgs;\n",
+ "print\"%s %.2f %s\"%('\\nVs= ',Vs,' V\\n')\n",
+ "Vsd=Vs-Vd;\n",
+ "print\"%s %.2f %s\"%('\\nVsd= ',Vsd,' V\\n')\n",
+ "Vp-Vgs\n",
+ "##since Vsd>Vp-Vgs JFET is biased in saturation\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Vd = -5.80 V\n",
+ "\n",
+ "\n",
+ "Vgs = 1.09 V\n",
+ "\n",
+ "\n",
+ "Vs= -0.09 V\n",
+ "\n",
+ "\n",
+ "Vsd= 5.71 V\n",
+ "\n"
+ ]
+ },
+ {
+ "metadata": {},
+ "output_type": "pyout",
+ "prompt_number": 20,
+ "text": [
+ "1.414213562373095"
+ ]
+ }
+ ],
+ "prompt_number": 20
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex20-pg299"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "##Example 5.20\n",
+ "Vtn=0.24;\n",
+ "Kn=1.1;\n",
+ "##x=R1+R2=50000\n",
+ "x=50.;\n",
+ "Vgs=0.5;\n",
+ "Vds=2.5;\n",
+ "Vdd=4.;\n",
+ "Rd=6.7;\n",
+ "I_D=Kn*(Vgs-Vtn)**2;\n",
+ "print\"%s %.2f %s\"%('\\ndrain current= ',I_D,' mA\\n')\n",
+ "Vd=Vdd-I_D*Rd;\n",
+ "print\"%s %.2f %s\"%('\\nvoltage at drain= ',Vd,' V\\n')\n",
+ "Vs=Vd-Vds;\n",
+ "print\"%s %.2f %s\"%('\\nvoltage at source = ',Vs,'V\\n')\n",
+ "Rs=Vs/I_D;\n",
+ "print\"%s %.2f %s\"%('\\nsource resistance = ',Rs,'KOhm\\n')\n",
+ "Vg=Vgs+Vs;\n",
+ "print\"%s %.2f %s\"%('\\nvoltage at the gate= ',Vg,' V\\n')\n",
+ "##Vg=R2*Vdd/(R2+R1)\n",
+ "R2=Vg*x/Vdd;\n",
+ "print\"%s %.2f %s\"%('\\nR2= ',R2,' KOhm\\n')\n",
+ "R1=x-R2;\n",
+ "print\"%s %.2f %s\"%('\\nR1= ',R1,' KOhm\\n')\n",
+ "Vgs-Vtn\n",
+ "##since Vds>Vgs-Vtn transistor is biased in saturation\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "drain current= 0.07 mA\n",
+ "\n",
+ "\n",
+ "voltage at drain= 3.50 V\n",
+ "\n",
+ "\n",
+ "voltage at source = 1.00 V\n",
+ "\n",
+ "\n",
+ "source resistance = 13.47 KOhm\n",
+ "\n",
+ "\n",
+ "voltage at the gate= 1.50 V\n",
+ "\n",
+ "\n",
+ "R2= 18.77 KOhm\n",
+ "\n",
+ "\n",
+ "R1= 31.23 KOhm\n",
+ "\n"
+ ]
+ },
+ {
+ "metadata": {},
+ "output_type": "pyout",
+ "prompt_number": 21,
+ "text": [
+ "0.26"
+ ]
+ }
+ ],
+ "prompt_number": 21
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Electronic_Circuit_Analysis_And_Design_by_D._A._Neamen/Chapter6_1_1.ipynb b/Electronic_Circuit_Analysis_And_Design_by_D._A._Neamen/Chapter6_1_1.ipynb new file mode 100644 index 00000000..f26e210a --- /dev/null +++ b/Electronic_Circuit_Analysis_And_Design_by_D._A._Neamen/Chapter6_1_1.ipynb @@ -0,0 +1,955 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:5f69c997f454918e67123a37f5caef5b8555309eb92b985bcafc07b0e579172b"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter6-Basic FET Amplifier"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex1-pg316"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "##Example 6.1\n",
+ "Vtn=1.;\n",
+ "##let x= u_n*Cox*1/2\n",
+ "x=20.*10**-3;\n",
+ "##let y=W/L\n",
+ "y=40.;\n",
+ "I_D=1.;\n",
+ "Kn=x*y;\n",
+ "print\"%s %.2f %s\"%('\\nconduction parameter= ',Kn,' mA/V^2\\n')\n",
+ "g_m=2.*math.sqrt(Kn*I_D);\n",
+ "print\"%s %.2f %s\"%('\\ntransconductance= ',g_m,' mA/V\\n')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "conduction parameter= 0.80 mA/V^2\n",
+ "\n",
+ "\n",
+ "transconductance= 1.79 mA/V\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex2-pg319"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "##Example 6.2\n",
+ "Vgsq=2.12;\n",
+ "Vdd=5.;\n",
+ "Rd=2.5;\n",
+ "Vtn=1.;\n",
+ "Kn=0.8;\n",
+ "##let lambda=y\n",
+ "y=0.02;##V^-1\n",
+ "Idq=Kn*(Vgsq-Vtn)**2;\n",
+ "print\"%s %.2f %s\"%('\\ndrain current= ',Idq,'mA\\n')\n",
+ "Vdsq=Vdd-Idq*Rd;\n",
+ "print\"%s %.2f %s\"%('\\ndrain to source voltage= ',Vdsq,' V\\n')\n",
+ "Vgs=1.82;\n",
+ "Vgs-Vtn\n",
+ "##since Vdsq>Vgs-Vtn transistor is biased in saturation\n",
+ "g_m=2.*Kn*(Vgsq-Vtn);\n",
+ "print\"%s %.2f %s\"%('\\ntransconductance= ',g_m,' mA/V\\n')\n",
+ "ro=(y*Idq)**-1;\n",
+ "print\"%s %.2f %s\"%('\\noutput resistance= ',ro,' KOhm\\n')\n",
+ "Av=-g_m*ro*Rd/(ro+Rd);\n",
+ "print\"%s %.2f %s\"%('\\nsmall signal voltage gain= ',Av,'\\n')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "drain current= 1.00 mA\n",
+ "\n",
+ "\n",
+ "drain to source voltage= 2.49 V\n",
+ "\n",
+ "\n",
+ "transconductance= 1.79 mA/V\n",
+ "\n",
+ "\n",
+ "output resistance= 49.82 KOhm\n",
+ "\n",
+ "\n",
+ "small signal voltage gain= -4.27 \n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex3-pg326"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "##Example 6.3\n",
+ "Vdd=10.;\n",
+ "R1=70.9;##(Kohm)\n",
+ "R2=29.1;##(Kohm)\n",
+ "Rd=5.;##(Kohm)\n",
+ "Vtn=1.5;\n",
+ "Kn=0.5;##(mA/V^2)\n",
+ "##lambda=y\n",
+ "y=0.01;##V^-1\n",
+ "Rsi=4.;##(Kohm)\n",
+ "Vgsq=Vdd*R2/(R1+R2);\n",
+ "print\"%s %.2f %s\"%('\\ngate to source voltage= ',Vgsq,' V\\n')\n",
+ "Idq=Kn*(Vgsq-Vtn)**2;\n",
+ "print\"%s %.2f %s\"%('\\ndrain current= ',Idq,' mA\\n')\n",
+ "Vdsq=Vdd-Idq*Rd;\n",
+ "print\"%s %.2f %s\"%('\\ndrain to source voltage= ',Vdsq,' V\\n')\n",
+ "g_m=2*Kn*(Vgsq-Vtn);\n",
+ "print\"%s %.2f %s\"%('\\ntransconductance= ',g_m,' mA/V\\n')\n",
+ "ro=(y*Idq)**-1;\n",
+ "print\"%s %.2f %s\"%('\\noutput resistance= ',ro,' KOhm\\n')\n",
+ "Ri=R1*R2/(R1+R2);\n",
+ "print\"%s %.2f %s\"%('\\namplifier input resistance= ',Ri,' Kohm\\n')\n",
+ "Av=-g_m*(ro*Rd/(ro+Rd))*Ri/(Ri+Rsi);\n",
+ "print\"%s %.2f %s\"%('\\nsmall signal voltage gain=\\n',Av,'')\n",
+ "print\"%s %.2f %s\"%('\\namplifier input resistance= ',Ri,' Kohm\\n')\n",
+ "Ro=Rd*ro/(Rd+ro);\n",
+ "print\"%s %.2f %s\"%('\\namplifier output resistance= ',Ro,' Kohm\\n')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "gate to source voltage= 2.91 V\n",
+ "\n",
+ "\n",
+ "drain current= 0.99 mA\n",
+ "\n",
+ "\n",
+ "drain to source voltage= 5.03 V\n",
+ "\n",
+ "\n",
+ "transconductance= 1.41 mA/V\n",
+ "\n",
+ "\n",
+ "output resistance= 100.60 KOhm\n",
+ "\n",
+ "\n",
+ "amplifier input resistance= 20.63 Kohm\n",
+ "\n",
+ "\n",
+ "small signal voltage gain=\n",
+ " -5.63 \n",
+ "\n",
+ "amplifier input resistance= 20.63 Kohm\n",
+ "\n",
+ "\n",
+ "amplifier output resistance= 4.76 Kohm\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex4-pg327"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "##Example 6.4\n",
+ "Vtn=1.;\n",
+ "Kn=1.;##(mA/V^2)\n",
+ "##lambda=y\n",
+ "y=0.015;##V^-1\n",
+ "Ri=100.;##(Kohm)\n",
+ "Idq=2.;##(mA)\n",
+ "Idt=4.;##(mA)\n",
+ "##Idt=4=Kn*(Vgst-Vtn)^2\n",
+ "Vgst=math.sqrt(Idt/Kn)+Vtn;\n",
+ "print\"%s %.2f %s\"%('\\nVgst= ',Vgst,' V\\n')\n",
+ "Vdst=Vgst-Vtn;\n",
+ "print\"%s %.2f %s\"%('\\nVdst= ',Vdst,' V\\n')\n",
+ "Vdd=12.;\n",
+ "Vdsq=7.;\n",
+ "Rd=(Vdd-Vdsq)/Idq;\n",
+ "print\"%s %.2f %s\"%('\\nRd = ',Rd,'KOhm\\n')\n",
+ "Vgsq=math.sqrt(Idq/Kn)+Vtn;\n",
+ "print\"%s %.2f %s\"%('\\nVgsq= ',Vgsq,' V\\n')\n",
+ "R1=Ri*Vdd/Vgsq;\n",
+ "print\"%s %.2f %s\"%('\\nR1= ',R1,' Kohm\\n')\n",
+ "R2=Ri*R1/(R1-Ri);\n",
+ "print\"%s %.2f %s\"%('\\nR2= ',R2,' Kohm\\n')\n",
+ "g_m=2*Kn*(Vgsq-Vtn);\n",
+ "print\"%s %.2f %s\"%('\\ntransconductance= ',g_m,' mA/V\\n')\n",
+ "ro=(y*Idq)**-1;\n",
+ "print\"%s %.2f %s\"%('\\noutput resistance= ',ro,' KOhm\\n')\n",
+ "Av=-g_m*(ro*Rd/(ro+Rd));\n",
+ "print\"%s %.2f %s\"%('\\nsmall signal voltage gain= ',Av,'\\n')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Vgst= 3.00 V\n",
+ "\n",
+ "\n",
+ "Vdst= 2.00 V\n",
+ "\n",
+ "\n",
+ "Rd = 2.50 KOhm\n",
+ "\n",
+ "\n",
+ "Vgsq= 2.41 V\n",
+ "\n",
+ "\n",
+ "R1= 497.06 Kohm\n",
+ "\n",
+ "\n",
+ "R2= 125.19 Kohm\n",
+ "\n",
+ "\n",
+ "transconductance= 2.83 mA/V\n",
+ "\n",
+ "\n",
+ "output resistance= 33.33 KOhm\n",
+ "\n",
+ "\n",
+ "small signal voltage gain= -6.58 \n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex6-pg332"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "##Example 6.6\n",
+ "Vtn=0.8;\n",
+ "Kn=1.;##(mA/V^2)\n",
+ "Idq=0.5;\n",
+ "Vdd=5.;\n",
+ "Rd=7.;##(Kohm)\n",
+ "Vgsq=math.sqrt(Idq/Kn)+Vtn;\n",
+ "print\"%s %.2f %s\"%('\\nVgsq= ',Vgsq,' V\\n')\n",
+ "Vs=-Vgsq\n",
+ "Vdsq=Vdd-Idq*Rd-Vs;\n",
+ "print\"%s %.2f %s\"%('\\nVdsq=',Vdsq,' V\\n')\n",
+ "g_m=2.*Kn*(Vgsq-Vtn);\n",
+ "print\"%s %.2f %s\"%('\\ntransconductance= ',g_m,' mA/V\\n')\n",
+ "Av=-g_m*Rd;\n",
+ "print\"%s %.2f %s\"%('\\nsmall signal voltage gain=\\n',Av,'')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Vgsq= 1.51 V\n",
+ "\n",
+ "\n",
+ "Vdsq= 3.01 V\n",
+ "\n",
+ "\n",
+ "transconductance= 1.41 mA/V\n",
+ "\n",
+ "\n",
+ "small signal voltage gain=\n",
+ " -9.90 \n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex7-pg336"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "##Example 6.7\n",
+ "Vdd=12.;\n",
+ "R1=162.;\n",
+ "R2=463.;\n",
+ "Rs=0.75;\n",
+ "Kn=4.;\n",
+ "Vtn=1.5;\n",
+ "##lambda=y\n",
+ "y=0.01;\n",
+ "Rsi=4.;\n",
+ "Idq=7.97;\n",
+ "Vgsq=2.91;\n",
+ "g_m=2.*Kn*(Vgsq-Vtn);\n",
+ "print\"%s %.2f %s\"%('\\ntransconductance= ',g_m,' mA/V\\n')\n",
+ "ro=(y*Idq)**-1.;\n",
+ "print\"%s %.2f %s\"%('\\noutput resistance= ',ro,' KOhm\\n')\n",
+ "Ri=R1*R2/(R1+R2);\n",
+ "print\"%s %.2f %s\"%('\\namplifier input resistance= ',Ri,' Kohm\\n')\n",
+ "x=Rs*ro/(Rs+ro);\n",
+ "Av=g_m*x*(Ri/(Ri+Rsi))/(1.+g_m*x);\n",
+ "print\"%s %.2f %s\"%('\\nsmall signal voltage gain=\\n',Av,'')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "transconductance= 11.28 mA/V\n",
+ "\n",
+ "\n",
+ "output resistance= 12.55 KOhm\n",
+ "\n",
+ "\n",
+ "amplifier input resistance= 120.01 Kohm\n",
+ "\n",
+ "\n",
+ "small signal voltage gain=\n",
+ " 0.86 \n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex9-pg340"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "##Example 6.9\n",
+ "Rs=750.;##Ohm\n",
+ "ro=12500.;\n",
+ "g_m=11.3*10**-3;\n",
+ "x=1./g_m;\n",
+ "y=x*Rs/(x+Rs);\n",
+ "Ro=y*ro/(y+ro);\n",
+ "print\"%s %.2f %s\"%('\\noutput resistance= ',Ro,' ohm\\n')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "output resistance= 78.66 ohm\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex11-pg348"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "##Example 6.11\n",
+ "Vtnd=1.;\n",
+ "Vtnl=1.;\n",
+ "Kn=30.;\n",
+ "##let W/L=x\n",
+ "xl=1.;\n",
+ "Vdd=5.;\n",
+ "Av=10.;\n",
+ "##Av=sqrt(xd/xl)\n",
+ "xd=(Av)**2*xl;\n",
+ "print\"%s %.2f %s\"%('\\nwidth to length ratio of driver transistor=\\n',xd,'')\n",
+ "Knd=xd*Kn*0.001/2.;\n",
+ "Knl=xl*Kn*0.001/2.;\n",
+ "print\"%s %.2f %s\"%('\\nconduction parameter Knd= ',Knd,' mA/V^2\\n')\n",
+ "print\"%s %.2f %s\"%('\\nconduction parameter Knl= ',Knl,' mA/V^2\\n')\n",
+ "##Vgsd-Vtnd=(Vdd-Vtnl)-sqrt(Knd/Knl)*(Vgsd-Vtnd)\n",
+ "y=math.sqrt(Knd/Knl);\n",
+ "Vgsd=(y+5.)/(1.+y);\n",
+ "print\"%s %.2f %s\"%('\\nVgsd= ',Vgsd,' V\\n')\n",
+ "Vdsd=Vgsd-1.;\n",
+ "print\"%s %.2f %s\"%('\\nVdsd= ',Vdsd,' V\\n')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "width to length ratio of driver transistor=\n",
+ " 100.00 \n",
+ "\n",
+ "conduction parameter Knd= 1.50 mA/V^2\n",
+ "\n",
+ "\n",
+ "conduction parameter Knl= 0.01 mA/V^2\n",
+ "\n",
+ "\n",
+ "Vgsd= 1.36 V\n",
+ "\n",
+ "\n",
+ "Vdsd= 0.36 V\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex12-pg352"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "##Example 6.12\n",
+ "Vtnd=0.8;\n",
+ "Vtnl=-1.5;\n",
+ "Knd=1.;\n",
+ "Knl=0.2;\n",
+ "##lambda=y\n",
+ "yd=0.01;\n",
+ "yl=0.01;\n",
+ "Idq=0.2;\n",
+ "gmd=2.*math.sqrt(Knd*Idq);\n",
+ "print\"%s %.2f %s\"%('\\ntransconductance of the driver= ',gmd,' mA/V\\n')\n",
+ "roD=1./(yd*Idq);\n",
+ "print\"%s %.2f %s\"%('\\noutput resistances= ',roD,' Kohm\\n')\n",
+ "Av=-gmd*roD/2.;\n",
+ "print\"%s %.2f %s\"%('\\nsmall signal voltage gain= \\n',Av,'')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "transconductance of the driver= 0.89 mA/V\n",
+ "\n",
+ "\n",
+ "output resistances= 500.00 Kohm\n",
+ "\n",
+ "\n",
+ "small signal voltage gain= \n",
+ " -223.61 \n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex13-pg354"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "##Example 6.13\n",
+ "Vtn=0.8;\n",
+ "Vtp=-0.8;\n",
+ "Kn=80.*10**-3;\n",
+ "Kp=40.*10**-3;\n",
+ "##x=W/L\n",
+ "xn=15.;\n",
+ "xp=10.;\n",
+ "##lambda=y\n",
+ "yn=0.01;\n",
+ "yp=0.01;\n",
+ "Ibias=0.2;\n",
+ "gm=2.*math.sqrt(Kn*xn*Ibias/2.);\n",
+ "print\"%s %.2f %s\"%('\\ntransconductance of the NMOS driver= ',gm,' mA/V^2\\n')\n",
+ "ron=1./(yn*Ibias);\n",
+ "print\"%s %.2f %s\"%('\\noutput resistances= ',ron,' Kohm\\n')\n",
+ "Av=-gm*ron/2.;\n",
+ "print\"%s %.2f %s\"%('\\nsmall signal voltage gain= \\n',Av,'')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "transconductance of the NMOS driver= 0.69 mA/V^2\n",
+ "\n",
+ "\n",
+ "output resistances= 500.00 Kohm\n",
+ "\n",
+ "\n",
+ "small signal voltage gain= \n",
+ " -173.21 \n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex14-pg357"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "##Example 6.14\n",
+ "Kn1=500.*10**-3;\n",
+ "Kn2=200.*10**-3;\n",
+ "Vtn1=1.2;\n",
+ "Vtn2=Vtn1;\n",
+ "Idq1=0.2;\n",
+ "Idq2=0.5;\n",
+ "Vdsq1=6.;\n",
+ "Vdsq2=6.;\n",
+ "Ri=100.;\n",
+ "Rsi=4.;\n",
+ "Rs2=(10.-Vdsq2)/Idq2;\n",
+ "print\"%s %.2f %s\"%('\\nRs2= ',Rs2,' KOhm\\n')\n",
+ "Vgs2=math.sqrt(Idq2/Kn2)+Vtn2;\n",
+ "print\"%s %.2f %s\"%('\\ngate to source voltage for M2= ',Vgs2,' V\\n')\n",
+ "Vs2=-1.;\n",
+ "Vg2=Vs2+Vgs2;\n",
+ "print\"%s %.2f %s\"%('\\ngate voltage of M2= ',Vg2,' V\\n')\n",
+ "Vg1=Vg2;\n",
+ "Rd1=(5.-Vg1)/Idq1;\n",
+ "print\"%s %.2f %s\"%('\\nresistor Rd1= ',Rd1,' KOhm\\n')\n",
+ "Vs1=Vg1-Vdsq1;\n",
+ "print\"%s %.2f %s\"%('\\nsource voltage of M1= ',Vs1,' KOhm\\n')\n",
+ "Rs1=(Vs1+5.)/Idq1;\n",
+ "print\"%s %.2f %s\"%('\\nresistor Rs1= ',Rs1,' KOhm\\n')\n",
+ "Vgs1=math.sqrt(Idq1/Kn1)+Vtn1;\n",
+ "print\"%s %.2f %s\"%('\\ngate to source voltage for M1',Vgs1,' V\\n')\n",
+ "R1=Ri*10./(Vgs1+Idq1*Rs1);\n",
+ "print\"%s %.2f %s\"%('\\nR1= ',R1,' KOhm\\n')\n",
+ "##Ri=R1*R2/(R1+R2)\n",
+ "R2=Ri*R1/(R1-Ri);\n",
+ "print\"%s %.2f %s\"%('\\nR2= ',R2,' KOhm\\n')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Rs2= 8.00 KOhm\n",
+ "\n",
+ "\n",
+ "gate to source voltage for M2= 2.78 V\n",
+ "\n",
+ "\n",
+ "gate voltage of M2= 1.78 V\n",
+ "\n",
+ "\n",
+ "resistor Rd1= 16.09 KOhm\n",
+ "\n",
+ "\n",
+ "source voltage of M1= -4.22 KOhm\n",
+ "\n",
+ "\n",
+ "resistor Rs1= 3.91 KOhm\n",
+ "\n",
+ "\n",
+ "gate to source voltage for M1 1.83 V\n",
+ "\n",
+ "\n",
+ "R1= 382.61 KOhm\n",
+ "\n",
+ "\n",
+ "R2= 135.38 KOhm\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex15-pg358"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "##Example 6.15\n",
+ "Vtn1=1.2;\n",
+ "Vtn2=1.2;\n",
+ "Kn1=0.8;\n",
+ "Kn2=0.8;\n",
+ "##x=R1+R2+R3=300\n",
+ "x=300.;\n",
+ "Rs=10.;\n",
+ "Idq=0.4;\n",
+ "Vdsq1=2.5;\n",
+ "Vdsq2=2.5;\n",
+ "Vs1=Idq*Rs-5.;\n",
+ "print\"%s %.2f %s\"%('\\ndc voltage at source of M1= ',Vs1,' V\\n')\n",
+ "Vgs=math.sqrt(Idq/Kn1)+Vtn1;\n",
+ "print\"%s %.2f %s\"%('\\ngate to source voltage= ',Vgs,' V\\n')\n",
+ "R3=(Vgs+Vs1)*x/5.;\n",
+ "print\"%s %.2f %s\"%('\\nR3= ',R3,' KOhm\\n')\n",
+ "Vs2=Vdsq2+Vs1;\n",
+ "print\"%s %.2f %s\"%('\\nvoltage at source of M2= ',Vs2,' V\\n')\n",
+ "##y=R2+R3\n",
+ "y=(Vgs+Vs2)*x/5.;\n",
+ "print\"%s %.2f %s\"%('\\nR2+R3= ',y,' KOhm\\n')\n",
+ "R2=150.;\n",
+ "R1=x-y;\n",
+ "print\"%s %.2f %s\"%('\\nR1=',R1,' KOhm\\n')\n",
+ "R3=y-R2;\n",
+ "print\"%s %.2f %s\"%('\\nR3= ',R3,' KOhm\\n')\n",
+ "Vd2=Vdsq2+Vs2;\n",
+ "print\"%s %.2f %s\"%('\\nvoltage at drain of M2 = ',Vd2,'V\\n')\n",
+ "Rd=(5.-Vd2)/Idq;\n",
+ "print\"%s %.2f %s\"%('\\ndrain resistance= ',Rd,' KOhm\\n')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "dc voltage at source of M1= -1.00 V\n",
+ "\n",
+ "\n",
+ "gate to source voltage= 1.91 V\n",
+ "\n",
+ "\n",
+ "R3= 54.43 KOhm\n",
+ "\n",
+ "\n",
+ "voltage at source of M2= 1.50 V\n",
+ "\n",
+ "\n",
+ "R2+R3= 204.43 KOhm\n",
+ "\n",
+ "\n",
+ "R1= 95.57 KOhm\n",
+ "\n",
+ "\n",
+ "R3= 54.43 KOhm\n",
+ "\n",
+ "\n",
+ "voltage at drain of M2 = 4.00 V\n",
+ "\n",
+ "\n",
+ "drain resistance= 2.50 KOhm\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex17-pg361"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ " \n",
+ "##Example 6.17\n",
+ "Kn=0.8;\n",
+ "Vtn=1.2;\n",
+ "Vgs=1.91;\n",
+ "Rd=2.5;\n",
+ "gm=2.*Kn*(Vgs-Vtn);\n",
+ "print\"%s %.2f %s\"%('\\ntransconductance= ',gm,' mA/V\\n')\n",
+ "Av=-gm*Rd;\n",
+ "print\"%s %.2f %s\"%('\\nsmall signal voltage gain= ',Av,' \\n')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "transconductance= 1.14 mA/V\n",
+ "\n",
+ "\n",
+ "small signal voltage gain= -2.84 \n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex18-pg364"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "##Example 6.18\n",
+ "##Determine the small signal voltage gain of a circuit in fig.6.55\n",
+ "Idss=12.;\n",
+ "Vp=-4.;\n",
+ "##lambda=y\n",
+ "y=0.008;\n",
+ "import numpy\n",
+ "from numpy.polynomial import Polynomial as P\n",
+ "p = P([26.4, 17.2, 2.025])\n",
+ "p.roots()\n",
+ "\n",
+ "\n",
+ "print('',p.roots(),' V\\n')\n",
+ "Vgsq=-2.01\n",
+ "Idq=Idss*(1.-Vgsq/Vp)**2;\n",
+ "print\"%s %.2f %s\"%('\\nquiescent drain current= ',Idq,' mA\\n')\n",
+ "gm=(-2*Idss/Vp)*(1.-Vgsq/Vp);\n",
+ "print\"%s %.2f %s\"%('\\ntransconductance= ',gm,' mA/V\\n')\n",
+ "ro=(1/(y*Idq));\n",
+ "print\"%s %.2f %s\"%('\\noutput resistance= ',ro,' KOhm\\n')\n",
+ "Rd=2.7;\n",
+ "Rl=4.;\n",
+ "x=Rd*Rl/(Rd+Rl);\n",
+ "Av=-gm*ro*x/(ro+x);\n",
+ "print\"%s %.2f %s\"%('\\nsmall signal voltage gain= ',Av,' \\n')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "('', array([-6.48281115, -2.01101602]), ' V\\n')\n",
+ "\n",
+ "quiescent drain current= 2.97 mA\n",
+ "\n",
+ "\n",
+ "transconductance= 2.99 mA/V\n",
+ "\n",
+ "\n",
+ "output resistance= 42.09 KOhm\n",
+ "\n",
+ "\n",
+ "small signal voltage gain= -4.63 \n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex19-pg366"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ " \n",
+ "##Example 6.19\n",
+ "Idss=12.;\n",
+ "Vp=-4.;\n",
+ "Rl=10.;\n",
+ "##lambda=y\n",
+ "y=0.01;\n",
+ "Av=0.9;\n",
+ "##gm=(-2*Idss/Vp)*(1-Vgs/Vp)\n",
+ "gm=2.;\n",
+ "Vgs=(1.+gm*Vp/(2.*Idss))*Vp;\n",
+ "print\"%s %.2f %s\"%('\\ngate to source voltage= ',Vgs,' V\\n')\n",
+ "Idq=Idss*(1.-Vgs/Vp)**2;\n",
+ "print\"%s %.2f %s\"%('\\nquiescent drain current= ',Idq,' mA\\n')\n",
+ "Rs=(-Vgs+10.)/Idq;\n",
+ "print\"%s %.2f %s\"%('\\nRs= ',Rs,' KOhm\\n')\n",
+ "ro=(1./(y*Idq));\n",
+ "print\"%s %.2f %s\"%('\\noutput resistance= ',ro,' KOhm\\n')\n",
+ "x=Rl*ro/(Rl+ro);\n",
+ "t=x*Rs/(x+Rs);\n",
+ "Av=gm*t/(1.+gm*t);\n",
+ "print\"%s %.2f %s\"%('\\nsmall signal voltage gain= ',Av,' \\n')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "gate to source voltage= -2.67 V\n",
+ "\n",
+ "\n",
+ "quiescent drain current= 1.33 mA\n",
+ "\n",
+ "\n",
+ "Rs= 9.50 KOhm\n",
+ "\n",
+ "\n",
+ "output resistance= 75.00 KOhm\n",
+ "\n",
+ "\n",
+ "small signal voltage gain= 0.90 \n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 15
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Electronic_Circuit_Analysis_And_Design_by_D._A._Neamen/Chapter7_1_1.ipynb b/Electronic_Circuit_Analysis_And_Design_by_D._A._Neamen/Chapter7_1_1.ipynb new file mode 100644 index 00000000..ad03d9ee --- /dev/null +++ b/Electronic_Circuit_Analysis_And_Design_by_D._A._Neamen/Chapter7_1_1.ipynb @@ -0,0 +1,1012 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:dffc3a2403edde165f33b6308fbd20345cecf1da13bbb808db0bb00e10439bb7"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter7-Frequency Response"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex1-pg393"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ " \n",
+ "##Example 7.1\n",
+ "Rs=1000.;\n",
+ "Rp=10000.;\n",
+ "Cs=1.*10**-6;\n",
+ "Cp=3.*10**-12;\n",
+ "Ts=(Rs+Rp)*Cs;\n",
+ "print\"%s %.2f %s\"%('\\ntime constant= ',Ts,' s\\n')\n",
+ "f=1/(2.*math.pi*Ts);\n",
+ "print\"%s %.2f %s\"%('\\ncorner frequency= ',f,' Hz\\n')\n",
+ "x=20.*math.log10(Rp/(Rp+Rs));\n",
+ "print\"%s %.2f %s\"%('\\nmaximum magnitude = ',x,'dB\\n')\n",
+ "Rp=10.;##KOhm\n",
+ "Rs=1.;##Kohm\n",
+ "Cp=3.;##pF\n",
+ "Tp=Cp*Rs*Rp/(Rs+Rp);\n",
+ "print\"%s %.2f %s\"%('\\ntime constant= ',Tp,' ns\\n')\n",
+ "Tp=2.73*10**-3;##micro sec\n",
+ "f=1/(2.*math.pi*Tp);\n",
+ "print\"%s %.2f %s\"%('\\ncorner frequency = ',f,'MHz\\n')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "time constant= 0.01 s\n",
+ "\n",
+ "\n",
+ "corner frequency= 14.47 Hz\n",
+ "\n",
+ "\n",
+ "maximum magnitude = -0.83 dB\n",
+ "\n",
+ "\n",
+ "time constant= 2.73 ns\n",
+ "\n",
+ "\n",
+ "corner frequency = 58.30 MHz\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex2-pg396"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "##Example 7.2\n",
+ "Rs=1000.;\n",
+ "Rp=10000.;\n",
+ "Cs=1*10**-6;\n",
+ "Cp=3*10**-12;\n",
+ "Ts=(Rs+Rp)*Cs;\n",
+ "print\"%s %.2f %s\"%('\\nopen circuit time constant= ',Ts,' s\\n')\n",
+ "Rs=1.;##KOhm\n",
+ "Rp=10.;##KOhm\n",
+ "Cp=3.;##pF\n",
+ "Tp=Cp*Rs*Rp/(Rs+Rp);\n",
+ "print\"%s %.2f %s\"%('\\nshort circuit time constant= ',Tp,' ns\\n')\n",
+ "fL=1./(2.*math.pi*Ts);\n",
+ "print\"%s %.2f %s\"%('\\ncorner frequency fL= ',fL,' Hz\\n')\n",
+ "Tp=2.73*10**-3;##microsec\n",
+ "fH=1/(2.*math.pi*Tp);\n",
+ "print\"%s %.2f %s\"%('\\ncorner frequency fH= ',fH,' MHz\\n')\n",
+ "fL=14.5*10**-6;##MHz\n",
+ "fbw=fH-fL;\n",
+ "print\"%s %.2f %s\"%('\\nbandwidth = ',fbw,' MHz\\n')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "open circuit time constant= 0.01 s\n",
+ "\n",
+ "\n",
+ "short circuit time constant= 2.73 ns\n",
+ "\n",
+ "\n",
+ "corner frequency fL= 14.47 Hz\n",
+ "\n",
+ "\n",
+ "corner frequency fH= 58.30 MHz\n",
+ "\n",
+ "\n",
+ "bandwidth = 58.30 MHz\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex3-pg400"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "##Example 7.3\n",
+ "R1=51.2;\n",
+ "R2=9.6;\n",
+ "Rc=2.;\n",
+ "Re=.4;\n",
+ "Rsi=.1;\n",
+ "Vt=0.026;\n",
+ "Cc=1.;\n",
+ "Vcc=10.;\n",
+ "Vbe=0.7;\n",
+ "b=100.;\n",
+ "Rb=8.08;\n",
+ "Icq=1.81;\n",
+ "gm=Icq/Vt;\n",
+ "print\"%s %.2f %s\"%('\\ntransconductance= ',gm,' mA/V\\n')\n",
+ "r=b*Vt/Icq;\n",
+ "print\"%s %.2f %s\"%('\\ndiffusion resistance= ',r,' KOhm\\n')\n",
+ "x=r+(1.+b)*Re;\n",
+ "y=x*R2/(x+R2);\n",
+ "Ri=y*R1/(R1+y);\n",
+ "print\"%s %.2f %s\"%('\\ninput resistance= ',Ri,' KOhm\\n')\n",
+ "Ts=(Rsi+Ri)*Cc;\n",
+ "print\"%s %.2f %s\"%('\\ntime constant= ',Ts, 'ms')\n",
+ "Ts=6.87*10**-3;##Sec\n",
+ "fL=1/(2.*math.pi*Ts);\n",
+ "print\"%s %.2f %s\"%('\\ncorner frequency fL= ',fL,' Hz\\n')\n",
+ "Rib=r+(1.+b)*Re;\n",
+ "print\"%s %.2f %s\"%('\\nRib= ',Rib,' KOhm\\n')\n",
+ "Av=(gm*r*Rc/(Rsi+Ri))*Rb/(Rb+Rib);\n",
+ "print\"%s %.2f %s\"%('\\nsmall signal voltage gain= ',Av,'\\n')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "transconductance= 69.62 mA/V\n",
+ "\n",
+ "\n",
+ "diffusion resistance= 1.44 KOhm\n",
+ "\n",
+ "\n",
+ "input resistance= 6.78 KOhm\n",
+ "\n",
+ "\n",
+ "time constant= 6.88 ms\n",
+ "\n",
+ "corner frequency fL= 23.17 Hz\n",
+ "\n",
+ "\n",
+ "Rib= 41.84 KOhm\n",
+ "\n",
+ "\n",
+ "small signal voltage gain= 4.71 \n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex4-pg402"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "##Example 7.4\n",
+ "fL=20.*10**-3;##KHz\n",
+ "Rd=6.7;\n",
+ "Rl=10;\n",
+ "Ts=1./(2.*math.pi*fL);\n",
+ "print\"%s %.2f %s\"%('\\ntime constant= ',Ts,' ms\\n')\n",
+ "Cc=Ts/(Rd+Rl);\n",
+ "print\"%s %.2f %s\"%('\\ncoupling capacitance= ',Cc,' microF\\n')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "time constant= 7.96 ms\n",
+ "\n",
+ "\n",
+ "coupling capacitance= 0.48 microF\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex5-pg403"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "##Example 7.5\n",
+ "b=100.;\n",
+ "Vbe=0.7;\n",
+ "Rs=500.;\n",
+ "Rb=100000.;\n",
+ "Re=10000.;\n",
+ "Rl=10000.;\n",
+ "Va=120.;\n",
+ "Ccc2=1*10**-6;\n",
+ "Icq=0.838*0.001;\n",
+ "r=3100.;##small signal parameter\n",
+ "gm=32.2*0.001;\n",
+ "ro=143000.;\n",
+ "x=(r+Rs*Rb/(Rs+Rb))/(1+b);\n",
+ "y=ro*x/(ro+x);\n",
+ "Ro=Re*y/(Re+y);\n",
+ "print\"%s %.2f %s\"%('\\noutput resistance of emitter= ',Ro,' Ohm\\n')\n",
+ "Ts=(Ro+Rl)*Ccc2;\n",
+ "print\"%s %.2f %s\"%('\\ntime constant= ',Ts,' s\\n')\n",
+ "fL=1/(2.*math.pi*Ts);\n",
+ "print\"%s %.2f %s\"%('\\n3dB frequency= ',fL,' Hz\\n')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "output resistance of emitter= 35.48 Ohm\n",
+ "\n",
+ "\n",
+ "time constant= 0.01 s\n",
+ "\n",
+ "\n",
+ "3dB frequency= 15.86 Hz\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex6-pg406"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "##Example 7.6\n",
+ "Rs=3.2;\n",
+ "Rd=10.;\n",
+ "Rl=20.;\n",
+ "Cl=10.;\n",
+ "Vtp=-2.;\n",
+ "Kp=0.25;\n",
+ "Idq=0.5;\n",
+ "Vsgq=3.41;\n",
+ "Vsdq=3.41;\n",
+ "gm=2.*Kp*(Vsgq+Vtp);\n",
+ "print\"%s %.2f %s\"%('\\ntransconductance = ',gm,'mA/V\\n')\n",
+ "Tp=Cl*Rd*Rl/(Rd+Rl);\n",
+ "print\"%s %.2f %s\"%('\\ntime constant= ',Tp,' ns\\n')\n",
+ "Tp=66.7*10**-3;##micro sec\n",
+ "fH=1./(2.*math.pi*Tp);\n",
+ "print\"%s %.2f %s\"%('\\ncorner frequency= ',fH,' MHz\\n')\n",
+ "Av=(gm*Rd*Rl/(Rd+Rl))/(1+gm*Rs);\n",
+ "print\"%s %.2f %s\"%('\\nmaximum small signal voltage gain=\\n',Av,'')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "transconductance = 0.71 mA/V\n",
+ "\n",
+ "\n",
+ "time constant= 66.67 ns\n",
+ "\n",
+ "\n",
+ "corner frequency= 2.39 MHz\n",
+ "\n",
+ "\n",
+ "maximum small signal voltage gain=\n",
+ " 1.44 \n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex7-pg409"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "##Example 7.7\n",
+ "Vbe=0.7;\n",
+ "b=100.;\n",
+ "Re=.5;\n",
+ "Rc=5.;\n",
+ "Rl=10.;\n",
+ "R1=40.;\n",
+ "Cc=10.;\n",
+ "R2=5.7;\n",
+ "Rs=.1;\n",
+ "Vt=0.026;\n",
+ "Icq=0.99;\n",
+ "gm=Icq/Vt;\n",
+ "print\"%s %.2f %s\"%('\\ntransconductance= ',gm,' mA/V\\n')\n",
+ "r=b*Vt/Icq;\n",
+ "print\"%s %.2f %s\"%('\\ndiffusion resistance= ',r,' KOhm\\n')\n",
+ "Ri=r+(1.+b)*Re;\n",
+ "print\"%s %.2f %s\"%('\\ninput resistance= ',Ri,' KOhm\\n')\n",
+ "x=Rc*Rl/(Rc+Rl);\n",
+ "y=R1*R2/(R1+R2);\n",
+ "t=y*Ri/(y+Ri);\n",
+ "Av=gm*r*x*(y/(y+Ri))*(1./(Rs+t));\n",
+ "print\"%s %.2f %s\"%('\\nmaximum small signal voltage gain=\\n',Av,'')\n",
+ "Ts=(Rs+t)*Cc;\n",
+ "print\"%s %.2f %s\"%('\\ntime constant=\\n',Ts,'ms')\n",
+ "Ts=46.6*0.001;##sec\n",
+ "Cl=15.;\n",
+ "Tp=x*Cl;\n",
+ "print\"%s %.2f %s\"%('\\ntime constant ',Tp,' ns\\n')\n",
+ "fL=1/(2.*math.pi*Ts);\n",
+ "print\"%s %.2f %s\"%('\\nlower corner frequency= ',fL,' Hz\\n')\n",
+ "Tp=50.*10**-3;##micro sec\n",
+ "fH=1/(2.*math.pi*Tp);\n",
+ "print\"%s %.2f %s\"%('\\nupper corner frequency= ',fH,' MHz\\n')\n",
+ "fL=3.4*10**-6;##MHz\n",
+ "fbw=fH-fL;\n",
+ "print\"%s %.2f %s\"%('\\nbandwidth = ',fbw,'MHz\\n')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "transconductance= 38.08 mA/V\n",
+ "\n",
+ "\n",
+ "diffusion resistance= 2.63 KOhm\n",
+ "\n",
+ "\n",
+ "input resistance= 53.13 KOhm\n",
+ "\n",
+ "\n",
+ "maximum small signal voltage gain=\n",
+ " 6.14 \n",
+ "\n",
+ "time constant=\n",
+ " 46.61 ms\n",
+ "\n",
+ "time constant 50.00 ns\n",
+ "\n",
+ "\n",
+ "lower corner frequency= 3.42 Hz\n",
+ "\n",
+ "\n",
+ "upper corner frequency= 3.18 MHz\n",
+ "\n",
+ "\n",
+ "bandwidth = 3.18 MHz\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex8-pg412"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ " \n",
+ "##Example 7.8\n",
+ "Re=4.;\n",
+ "Rc=2.;\n",
+ "Rs=0.5;\n",
+ "Vt=0.026;\n",
+ "Ce=1*10**-3;\n",
+ "V1=5.;\n",
+ "Icq=1.06;\n",
+ "V2=-5.;\n",
+ "b=100.;\n",
+ "Vbe=0.7;\n",
+ "gm=Icq/Vt;\n",
+ "print\"%s %.2f %s\"%('\\ntransconductance = ',gm,'mA/V\\n')\n",
+ "r=b*Vt/Icq;\n",
+ "print\"%s %.2f %s\"%('\\ndiffusion resistance= ',r,' KOhm\\n')\n",
+ "Ta=Re*Ce;\n",
+ "print\"%s %.2f %s\"%('\\ntime constant Ta= ',Ta,'f s\\n')\n",
+ "Tb=(Re*Ce*(Rs+r))/(Rs+r+(1+b)*Re);\n",
+ "print\"%s %.2f %s\"%('\\ntime constant Tb= ',Tb,' s\\n')\n",
+ "fA=1/(2.*math.pi*Ta);\n",
+ "print\"%s %.2f %s\"%('\\ncorner frequency = ',fA,'Hz\\n')\n",
+ "Tb=2.9*0.01;##msec\n",
+ "fB=1/(2.*math.pi*Tb);\n",
+ "print\"%s %.2f %s\"%('\\ncorner frequency =',fB,'khz')\n",
+ "Av=(gm*r*Rc)/(Rs+r+(1.+b)*Re);\n",
+ "print\"%s %.2f %s\"%('\\nlimiting low frequency horizontal asymptote= \\n',Av,'')\n",
+ "Av=gm*r*Rc/(Rs+r);\n",
+ "print\"%s %.2f %s\"%('\\nnlimiting high frequency horizontal asymptote=\\n',Av,'')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "transconductance = 40.77 mA/V\n",
+ "\n",
+ "\n",
+ "diffusion resistance= 2.45 KOhm\n",
+ "\n",
+ "\n",
+ "time constant Ta= 0.00 f s\n",
+ "\n",
+ "\n",
+ "time constant Tb= 0.00 s\n",
+ "\n",
+ "\n",
+ "corner frequency = 39.79 Hz\n",
+ "\n",
+ "\n",
+ "corner frequency = 5.49 khz\n",
+ "\n",
+ "limiting low frequency horizontal asymptote= \n",
+ " 0.49 \n",
+ "\n",
+ "nlimiting high frequency horizontal asymptote=\n",
+ " 67.73 \n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex9-pg420"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "##Example 7.9\n",
+ "r=2600.;\n",
+ "C1=2.*10**-6;\n",
+ "C2=0.1*10**-6;\n",
+ "fB=1/(2.*math.pi*r*(C1+C2));\n",
+ "print\"%s %.2f %s\"%('\\n3dB frequency= ',fB,' MHz\\n')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "3dB frequency= 29.15 MHz\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex10-pg421"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "##Example 7.10\n",
+ "fT=500.;\n",
+ "Ic=1.;\n",
+ "b=100.;\n",
+ "Vt=0.026;\n",
+ "C2=0.3*10**-12;\n",
+ "fB=fT/b;\n",
+ "print\"%s %.2f %s\"%('\\nbandwidth= ',fB,' MHz\\n')\n",
+ "gm=Ic/Vt;\n",
+ "print\"%s %.2f %s\"%('\\ntransconductance= ',gm,'mA/V\\n')\n",
+ "fT=500000000.;\n",
+ "gm=38.5*0.001;\n",
+ "C1=gm/(fT*2.*math.pi)-C2;\n",
+ "print\"%s %.2e %s\"%('\\ncapacitance = ',C1,'F\\n')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "bandwidth= 5.00 MHz\n",
+ "\n",
+ "\n",
+ "transconductance= 38.46 mA/V\n",
+ "\n",
+ "\n",
+ "capacitance = 1.20e-11 F\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex12-pg430"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "##Example 7.12\n",
+ "Kn=0.25;\n",
+ "Vtn=1.;\n",
+ "Cgd=0.04*10**-3;\n",
+ "Cgs=0.2*10**-3;\n",
+ "Vgs=3.;\n",
+ "gm=2.*Kn*(Vgs-Vtn);\n",
+ "print\"%s %.2f %s\"%('\\ntransconductance = ',gm,'mA/V\\n')\n",
+ "fT=gm/(2.*math.pi*(Cgd+Cgs));\n",
+ "print\"%s %.2f %s\"%('\\nunity gain bandwidth= ',fT,' MHz\\n')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "transconductance = 1.00 mA/V\n",
+ "\n",
+ "\n",
+ "unity gain bandwidth= 663.15 MHz\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex13-pg432"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ " \n",
+ "##Example 7.13\n",
+ "gm=1.;\n",
+ "Cgd=0.04;\n",
+ "Rl=10.;\n",
+ "Cgs=0.2;\n",
+ "Cm=Cgd*(1.+gm*Rl);\n",
+ "print\"%s %.2f %s\"%('\\nMiller capacitance= ',Cm,' pF\\n')\n",
+ "Cm=0.44*0.001;##nF\n",
+ "Cgs=0.2*0.001;##nF\n",
+ "fT=gm/(2.*math.pi*(Cgs+Cm));\n",
+ "print\"%s %.2f %s\"%('\\ncutoff frequency= ',fT,' MHz\\n')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Miller capacitance= 0.44 pF\n",
+ "\n",
+ "\n",
+ "cutoff frequency= 248.68 MHz\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex14-pg435"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "##Example 7.14\n",
+ "V1=5.;\n",
+ "V=-5.;\n",
+ "Rs=0.1;\n",
+ "Rb=40.;\n",
+ "R2=5.72;\n",
+ "Re=0.5;\n",
+ "Rc=5.;\n",
+ "Rl=10.;\n",
+ "b=150.;\n",
+ "Vbe=0.7;\n",
+ "C1=35*10**-3;\n",
+ "C2=4.;\n",
+ "Vt=0.026;\n",
+ "Icq=1.02;\n",
+ "r=b*Vt/Icq;\n",
+ "print\"%s %.2f %s\"%('\\nsmall signal parameter= ',r,' KOhm\\n')\n",
+ "gm=Icq/Vt;\n",
+ "print\"%s %.2f %s\"%('\\ntransconductance= ',gm,' mA/V\\n')\n",
+ "Cm=C2*(1+gm*Rc*Rl/(Rc+Rl));\n",
+ "print\"%s %.2f %s\"%('\\nMiller capacitance= ',Cm,' pF\\n')\n",
+ "Cm=527.*10**-3;\n",
+ "x=Rb*Rs/(Rb+Rs);\n",
+ "y=r*x/(r+x);\n",
+ "fH=1/(2.*math.pi*y*(C1+Cm));\n",
+ "print\"%s %.2f %s\"%('\\nupper corner frequency = ',fH,'MHz\\n')\n",
+ "t=Rb*r/(Rb+r);\n",
+ "p=Rc*Rl/(Rc+Rl);\n",
+ "Av=gm*p*t/(t+Rs);\n",
+ "print\"%s %.2f %s\"%('\\nmidband gain= ',Av,'\\n')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "small signal parameter= 3.82 KOhm\n",
+ "\n",
+ "\n",
+ "transconductance= 39.23 mA/V\n",
+ "\n",
+ "\n",
+ "Miller capacitance= 527.08 pF\n",
+ "\n",
+ "\n",
+ "upper corner frequency = 2.91 MHz\n",
+ "\n",
+ "\n",
+ "midband gain= 127.13 \n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex15-pg439"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "##Example 7.15\n",
+ "V1=5.;\n",
+ "V=-5.;\n",
+ "Rs=0.1;\n",
+ "R1=40.;\n",
+ "R2=5.72;\n",
+ "Re=0.5;\n",
+ "Rc=5.;\n",
+ "Rl=10.;\n",
+ "b=150.;\n",
+ "Vbe=0.7;\n",
+ "C1=35.;\n",
+ "C2=4.;\n",
+ "Vt=0.026;\n",
+ "Icq=1.02;\n",
+ "gm=39.2;\n",
+ "r=3.82;\n",
+ "x=Re*Rs/(Re+Rs);\n",
+ "t=r/(1.+b);\n",
+ "y=t*x/(t+x);\n",
+ "Tp=y*C1;\n",
+ "print\"%s %.2f %s\"%('\\ntime constant= ',Tp,' ns\\n')\n",
+ "Tp=0.679*10**-3;##micro sec\n",
+ "f=1/(2.*math.pi*Tp);\n",
+ "print\"%s %.2f %s\"%('\\nupper frequency = ',f,'MHz\\n')\n",
+ "T=C2*Rc*Rl/(Rc+Rl);\n",
+ "print\"%s %.2f %s\"%('\\ntime constant= ',T,' ns\\n')\n",
+ "T=13.3*10**-3;##micro sec\n",
+ "f=1/(2.*math.pi*T);\n",
+ "print\"%s %.2f %s\"%('\\nupper frequency= ',f,' MHz\\n')\n",
+ "x=Rc*Rl/(Rc+Rl);\n",
+ "y=Re*t/(Re+t);\n",
+ "Av=gm*x*(y/(y+Rs));\n",
+ "print\"%s %.2f %s\"%('\\nmidband voltage gain \\n',Av,'')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "time constant= 0.68 ns\n",
+ "\n",
+ "\n",
+ "upper frequency = 234.40 MHz\n",
+ "\n",
+ "\n",
+ "time constant= 13.33 ns\n",
+ "\n",
+ "\n",
+ "upper frequency= 11.97 MHz\n",
+ "\n",
+ "\n",
+ "midband voltage gain \n",
+ " 25.36 \n"
+ ]
+ }
+ ],
+ "prompt_number": 14
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex16-pg443"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "##Example 7.16\n",
+ "V1=5.;\n",
+ "V=-5.;\n",
+ "Rs=0.1;\n",
+ "R1=42.5;\n",
+ "R2=20.5;\n",
+ "R3=28.3;\n",
+ "Re=5.4;\n",
+ "Rc=5.;\n",
+ "Rl=10.;\n",
+ "b=150.;\n",
+ "Vbe=0.7;\n",
+ "C1=35.;\n",
+ "C2=4.;\n",
+ "Vt=0.026;\n",
+ "Icq=1.02;\n",
+ "gm=39.2;\n",
+ "r=3.820;\n",
+ "Rb=R2*R3/(R2+R3);\n",
+ "x=Rb*r/(Rb+r);\n",
+ "y=Rs*x/(x+Rs);\n",
+ "Tp=y*(C1+2*C2);\n",
+ "print\"%s %.2f %s\"%('\\ntime constant= ',Tp,' ns\\n')\n",
+ "Tp=Tp*10**-3;##micro sec\n",
+ "f=1/(2.*math.pi*Tp);\n",
+ "print\"%s %.2f %s\"%('\\n3dB frequency = ',f,'MHz\\n')\n",
+ "T=C2*Rc*Rl/(Rc+Rl);\n",
+ "print\"%s %.2f %s\"%('\\ntime constant= ',T,'ns\\n')\n",
+ "T=T*0.001;##micro sec\n",
+ "f=1/(2.*math.pi*T);\n",
+ "print\"%s %.2f %s\"%('\\nupper frequency= ',f,' MHz\\n')\n",
+ "x=Rc*Rl/(Rc+Rl);\n",
+ "y=Rb*r/(Rb+r);\n",
+ "Av=gm*x*(y/(y+Rs));\n",
+ "print\"%s %.2f %s\"%('\\nmidband voltage gain= ',Av,' \\n')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "time constant= 4.16 ns\n",
+ "\n",
+ "\n",
+ "3dB frequency = 38.29 MHz\n",
+ "\n",
+ "\n",
+ "time constant= 13.33 ns\n",
+ "\n",
+ "\n",
+ "upper frequency= 11.94 MHz\n",
+ "\n",
+ "\n",
+ "midband voltage gain= 126.30 \n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 15
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex17-pg447"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "##Example 7.17\n",
+ "V1=5.;\n",
+ "V=-5.;\n",
+ "Rs=0.1;\n",
+ "R1=40;\n",
+ "R2=5.720;\n",
+ "Re=0.5;\n",
+ "Rc=5.;\n",
+ "Rl=10.;\n",
+ "b=150.;\n",
+ "Vbe=0.7;\n",
+ "C1=35.;\n",
+ "C2=4.;\n",
+ "Vt=0.026;\n",
+ "Icq=1.02;\n",
+ "gm=39.2;\n",
+ "r=3.820;\n",
+ "t=r/(1.+b);\n",
+ "t=t*0.001;\n",
+ "f=1/(2.*math.pi*C1*t);\n",
+ "print'%s %.2f %s'%('\\nthe zero occurs at this frequency= ',f,' MHz\\n')\n",
+ "x=1+gm*Re*Rl/(Re+Rl);\n",
+ "Rb=R1*R2/(R1+R2)\n",
+ "d=x*r;\n",
+ "y=d*Rb/(d+Rb);\n",
+ "t=y*Rs/(y+Rs);\n",
+ "Tp=t*(C2+C1/x);\n",
+ "print'%s %.2f %s'%('\\ntime constant= ',Tp,' ns\\n')\n",
+ "Tp=Tp*10**-3;##micro sec\n",
+ "f=1/(2.*math.pi*Tp);\n",
+ "print'%s %.2f %s'%('\\n3dB frequency= ',f,' MHz\\n')"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "the zero occurs at this frequency= 179.75 MHz\n",
+ "\n",
+ "\n",
+ "time constant= 0.57 ns\n",
+ "\n",
+ "\n",
+ "3dB frequency= 281.24 MHz\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 17
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Electronic_Circuit_Analysis_And_Design_by_D._A._Neamen/Chapter8_1_1.ipynb b/Electronic_Circuit_Analysis_And_Design_by_D._A._Neamen/Chapter8_1_1.ipynb new file mode 100644 index 00000000..c0c5ebd2 --- /dev/null +++ b/Electronic_Circuit_Analysis_And_Design_by_D._A._Neamen/Chapter8_1_1.ipynb @@ -0,0 +1,447 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:cdd1f791d4e53fd374d40ced42151b47691b22d0170edabcbe64af78e36e0de3"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter8-Ouput Stages and Power Amplifier "
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex2-pg478"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "##Example 8.1\n",
+ "##let thermal resistance parameters be R\n",
+ "Rdcase=1.75;##degree celsius per watt\n",
+ "Rcsnk=1.;##degree celsius per watt\n",
+ "Rsamb=5.;##degree celsius per watt\n",
+ "Rcamb=50.;##degree celsius per watt\n",
+ "Tamb=30.;##ambient temperature \n",
+ "Tjmax=150.;##maximum junction temperature\n",
+ "Tdev=150.;##device temperature\n",
+ "##when no heat sink is used\n",
+ "P=(Tjmax-Tamb)/(Rdcase+Rcamb);\n",
+ "print\"%s %.2f %s\"%('\\nmaximum power dissipation= ',P,' W\\n')\n",
+ "##when heat sink is used\n",
+ "P=(Tjmax-Tamb)/(Rdcase+Rcsnk+Rsamb);\n",
+ "print\"%s %.2f %s\"%('\\nmaximum power dissipation= ',P,' W\\n')\n",
+ "\n",
+ "\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "maximum power dissipation= 2.32 W\n",
+ "\n",
+ "\n",
+ "maximum power dissipation= 15.48 W\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex3-pg479"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "##Example 8.3\n",
+ "Rcsnk=1.;##degree celsius per watt\n",
+ "Rsamb=5.;##degree celsius per watt\n",
+ "Tjmax=175.;##maximum junction temperature\n",
+ "Toc=25.;\n",
+ "Tamb=25.;\n",
+ "Pr=20.;##rated power W\n",
+ "Rdcase=(Tjmax-Toc)/Pr;\n",
+ "print\"%s %.2f %s\"%('\\ndevice to case thermal resistance= ',Rdcase,' C/W\\n')\n",
+ "P=(Tjmax-Tamb)/(Rdcase+Rcsnk+Rsamb);\n",
+ "print\"%s %.2f %s\"%('\\nmaximum power dissipation= ',P,' W\\n')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "device to case thermal resistance= 7.50 C/W\n",
+ "\n",
+ "\n",
+ "maximum power dissipation= 11.11 W\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex7-pg492"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "##Example 8.7\n",
+ "Vdd=10.;\n",
+ "Rl=20.;\n",
+ "K=0.2;\n",
+ "Vt=1.;\n",
+ "vo=5.;\n",
+ "iL=vo/20.;\n",
+ "print\"%s %.2f %s\"%('\\niL= ',iL,' A\\n')\n",
+ "Idq=0.05;\n",
+ "##Idq=K*(Vbb/2-Vt)\n",
+ "Vbb=(math.sqrt(Idq/K)+1.)*2.;\n",
+ "print\"%s %.2f %s\"%('\\nVbb= ',Vbb,' V\\n')\n",
+ "iD=iL;\n",
+ "Vgsn=math.sqrt(iD/K)+Vt;\n",
+ "print\"%s %.2f %s\"%('\\nVgsn= ',Vgsn,' V\\n')\n",
+ "Vsgp=Vbb-Vgsn;\n",
+ "print\"%s %.2f %s\"%('\\nVsgp= ',Vsgp,' V\\n')\n",
+ "vi=vo+Vgsn-Vbb/2.;\n",
+ "print\"%s %.2f %s\"%('\\ninput voltage= ',vi,' V\\n')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "iL= 0.25 A\n",
+ "\n",
+ "\n",
+ "Vbb= 3.00 V\n",
+ "\n",
+ "\n",
+ "Vgsn= 2.12 V\n",
+ "\n",
+ "\n",
+ "Vsgp= 0.88 V\n",
+ "\n",
+ "\n",
+ "input voltage= 5.62 V\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex8-pg498"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ " \n",
+ "##Example 8.8\n",
+ "Vcc=24.;\n",
+ "Rl=8.;\n",
+ "P=5.;\n",
+ "Vbe=0.7;\n",
+ "b=100.;\n",
+ "Vp=math.sqrt(2.*Rl*P);\n",
+ "print\"%s %.2f %s\"%('\\npeak output voltage= ',Vp,' V\\n')\n",
+ "Ip=Vp/Rl;\n",
+ "print\"%s %.2f %s\"%('\\npeak output current = ',Ip,'A\\n')\n",
+ "a=0.9*Vcc/Vp;\n",
+ "print\"%s %.2f %s\"%('\\na= ',a,'\\n')\n",
+ "Icq=Ip/(0.9*a);\n",
+ "print\"%s %.2f %s\"%('\\nIcq= ',Icq,' A\\n')\n",
+ "Pq=Vcc*Icq;\n",
+ "print\"%s %.2f %s\"%('\\nmaximum power dissipated in the transistor= ',Pq,' W\\n')\n",
+ "Ibq=Icq/b;\n",
+ "Ibq=Ibq*1000.;##mA\n",
+ "print\"%s %.2f %s\"%('\\nbase current Ibq= ',Ibq,' mA\\n')\n",
+ "Rth=2.500;\n",
+ "##Vth=Vcc*Rth/R1 and Vth=Ibq*Rth+Vbe\n",
+ "R1=Vcc*Rth/(Ibq*Rth+Vbe);\n",
+ "print\"%s %.2f %s\"%('\\nR1= ',R1,' KOhm\\n')\n",
+ "R2=Rth*R1/(R1-Rth);\n",
+ "print\"%s %.2f %s\"%('\\nR2= ',R2,' KOhm\\n')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "peak output voltage= 8.94 V\n",
+ "\n",
+ "\n",
+ "peak output current = 1.12 A\n",
+ "\n",
+ "\n",
+ "a= 2.41 \n",
+ "\n",
+ "\n",
+ "Icq= 0.51 A\n",
+ "\n",
+ "\n",
+ "maximum power dissipated in the transistor= 12.35 W\n",
+ "\n",
+ "\n",
+ "base current Ibq= 5.14 mA\n",
+ "\n",
+ "\n",
+ "R1= 4.42 KOhm\n",
+ "\n",
+ "\n",
+ "R2= 5.75 KOhm\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex9-pg500"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "##Example 8.9\n",
+ "Iso=3*10**-14;\n",
+ "Isq=10**-13;\n",
+ "b=75.;\n",
+ "Vt=0.026;\n",
+ "Rl=8.;\n",
+ "P=5.;\n",
+ "Vp=math.sqrt(2.*Rl*P);\n",
+ "print\"%s %.2f %s\"%('\\npeak voltage Vp= ',Vp,' V\\n')\n",
+ "Vcc=Vp/0.8;\n",
+ "print\"%s %.2f %s\"%('\\nsupply voltage= ',Vcc,' V\\n')\n",
+ "Ien=Vp/Rl;\n",
+ "print\"%s %.2f %s\"%('\\nemitter current= ',Ien,' A\\n')\n",
+ "Ibn=Ien/(1.+b);\n",
+ "Ibn=Ibn*1000.;##mA\n",
+ "print\"%s %.2f %s\"%('\\nbase current= ',Ibn,' mA\\n')\n",
+ "iD=0.020;\n",
+ "Vbb=2.*Vt*math.log(iD/Iso);\n",
+ "print\"%s %.2f %s\"%('\\nVbb= ',Vbb,' V\\n')\n",
+ "Icq=Isq*math.exp((Vbb/2.)/Vt);\n",
+ "Icq=Icq*1000.;##mA\n",
+ "print\"%s %.2f %s\"%('\\nquiescent collector current= ',Icq,' mA\\n')\n",
+ "Ibias=20.;##mA\n",
+ "iD=Ibias-Ibn;\n",
+ "print\"%s %.2f %s\"%('\\ndrain current= ',iD,' mA\\n')\n",
+ "iD=iD*0.001;##A\n",
+ "Vbb=2.*Vt*math.log(iD/Iso);\n",
+ "print\"%s %.2f %s\"%('\\nVbb= ',Vbb,' V\\n')\n",
+ "Icn=1.12;\n",
+ "Vben=Vt*math.log(Icn/Isq);\n",
+ "print\"%s %.2f %s\"%('\\nB-E voltage of Qn= ',Vben,' V\\n')\n",
+ "Vebp=Vbb-Vben;\n",
+ "print\"%s %.2f %s\"%('\\nemitter base voltage of Qp= ',Vebp,' V\\n')\n",
+ "Icp=Isq*math.exp(Vebp/Vt);\n",
+ "Icp=Icp*1000.;##mA\n",
+ "print\"%s %.2f %s\"%('\\nIcp ',Icp,' mA\\n')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "peak voltage Vp= 8.94 V\n",
+ "\n",
+ "\n",
+ "supply voltage= 11.18 V\n",
+ "\n",
+ "\n",
+ "emitter current= 1.12 A\n",
+ "\n",
+ "\n",
+ "base current= 14.71 mA\n",
+ "\n",
+ "\n",
+ "Vbb= 1.42 V\n",
+ "\n",
+ "\n",
+ "quiescent collector current= 66.67 mA\n",
+ "\n",
+ "\n",
+ "drain current= 5.29 mA\n",
+ "\n",
+ "\n",
+ "Vbb= 1.35 V\n",
+ "\n",
+ "\n",
+ "B-E voltage of Qn= 0.78 V\n",
+ "\n",
+ "\n",
+ "emitter base voltage of Qp= 0.57 V\n",
+ "\n",
+ "\n",
+ "Icp 0.28 mA\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex11-pg505"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "##Example 8.11\n",
+ "R1=2.;##KOhm\n",
+ "R2=R1;\n",
+ "Rl=.1;##KOhm\n",
+ "b=60.;\n",
+ "Vbe=0.6;\n",
+ "Veb=0.6;\n",
+ "V1=15.;\n",
+ "V2=V1;\n",
+ "iR1=(V1-Vbe)/R1;\n",
+ "##iR1=iR2=iE1=iE2\n",
+ "print\"%s %.2f %s\"%('\\niR1= ',iR1,' mA\\n')\n",
+ "vo=10.;\n",
+ "io=vo/Rl;\n",
+ "print\"%s %.2f %s\"%('\\noutput current= ',io,' mA\\n')\n",
+ "iB3=100./61.;\n",
+ "print\"%s %.2f %s\"%('\\niB3= ',iB3,'mA\\n')\n",
+ "iR1=(V1-(10.+Vbe))/R1;\n",
+ "print\"%s %.2f %s\"%('\\ncurrent in R1= ',iR1,' mA\\n')\n",
+ "iE1=iR1-iB3;\n",
+ "print\"%s %.2f %s\"%('\\niE1= ',iE1,' mA\\n')\n",
+ "iB1=iE1/(1.+b);\n",
+ "iB1=iB1*1000.;##micro A\n",
+ "print\"%s %.2f %s\"%('\\niB1= ',iB1,' microA\\n')\n",
+ "iE2=(10-0.6+15.)/R1;\n",
+ "print\"%s %.2f %s\"%('\\niE2= ',iE2,' mA\\n')\n",
+ "iB2=iE2/(1.+b);\n",
+ "iB2=iB2*1000.;\n",
+ "print\"%s %.2f %s\"%('\\niB2= ',iB2,' microA\\n')\n",
+ "Ii=iB2-iB1;\n",
+ "print\"%s %.2f %s\"%('\\ninput current= ',Ii,' microA\\n')\n",
+ "Ii=Ii*0.001;##mA\n",
+ "Ai=io/Ii;\n",
+ "print\"%s %.2f %s\"%('\\ncurrent gain=\\n',Ai,'')\n",
+ "Ai=(1.+b)*R1/(2.*Rl);\n",
+ "print\"%s %.2f %s\"%('\\npredicted current gain=\\n',Ai,'')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "iR1= 7.20 mA\n",
+ "\n",
+ "\n",
+ "output current= 100.00 mA\n",
+ "\n",
+ "\n",
+ "iB3= 1.64 mA\n",
+ "\n",
+ "\n",
+ "current in R1= 2.20 mA\n",
+ "\n",
+ "\n",
+ "iE1= 0.56 mA\n",
+ "\n",
+ "\n",
+ "iB1= 9.19 microA\n",
+ "\n",
+ "\n",
+ "iE2= 12.20 mA\n",
+ "\n",
+ "\n",
+ "iB2= 200.00 microA\n",
+ "\n",
+ "\n",
+ "input current= 190.81 microA\n",
+ "\n",
+ "\n",
+ "current gain=\n",
+ " 524.08 \n",
+ "\n",
+ "predicted current gain=\n",
+ " 610.00 \n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Electronic_Circuit_Analysis_And_Design_by_D._A._Neamen/Chapter9_1_1.ipynb b/Electronic_Circuit_Analysis_And_Design_by_D._A._Neamen/Chapter9_1_1.ipynb new file mode 100644 index 00000000..01be9a77 --- /dev/null +++ b/Electronic_Circuit_Analysis_And_Design_by_D._A._Neamen/Chapter9_1_1.ipynb @@ -0,0 +1,136 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:32f4ddc547fad5eac3ccd22992e1c23752ad6ef6cf432bf032a216c1338d002f"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter9-The Ideal Operational Amplifier"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex5-pg541"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "##Example 9.5\n",
+ "Zl=0.1;\n",
+ "R1=10.;\n",
+ "R2=1.;\n",
+ "R3=1.;\n",
+ "Rf=10.;\n",
+ "Vt=-5.;\n",
+ "iL=-Vt/R2;\n",
+ "print\"%s %.2f %s\"%('\\nload current= ',iL,' mA\\n')\n",
+ "vL=iL*Zl;\n",
+ "print\"%s %.2f %s\"%('\\nvoltage across the load= ',vL,' V\\n')\n",
+ "i4=vL/R2;\n",
+ "print\"%s %.2f %s\"%('\\ni4= ',i4,' mA\\n')\n",
+ "i3=i4+iL;\n",
+ "print\"%s %.2f %s\"%('\\ni3= ',i3,' mA\\n')\n",
+ "Vo=i3*R3+vL;\n",
+ "print\"%s %.2f %s\"%('\\noutput voltage= ',Vo,' V\\n')\n",
+ "i1=Vt/R1;\n",
+ "i2=i1;\n",
+ "print\"%s %.2f %s\"%('\\ni1= ',i1,' mA\\n')\n",
+ "print\"%s %.2f %s\"%('\\ni2= ',i2,' mA\\n')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "load current= 5.00 mA\n",
+ "\n",
+ "\n",
+ "voltage across the load= 0.50 V\n",
+ "\n",
+ "\n",
+ "i4= 0.50 mA\n",
+ "\n",
+ "\n",
+ "i3= 5.50 mA\n",
+ "\n",
+ "\n",
+ "output voltage= 6.00 V\n",
+ "\n",
+ "\n",
+ "i1= -0.50 mA\n",
+ "\n",
+ "\n",
+ "i2= -0.50 mA\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex9-pg552"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "import numpy\n",
+ "import scipy\n",
+ "from scipy import integrate\n",
+ " \n",
+ "##Example 9.9\n",
+ "##Vo=(-1/R1*C2)*integrate((-1)dt) \n",
+ "def fun(x):\n",
+ " y=-1\n",
+ " return y\n",
+ "Vo=10.;\n",
+ "I=scipy.integrate.quad(fun, 0, 1);\n",
+ "I1=I[0]\n",
+ "##let y=R1*C2\n",
+ "y1=I1/Vo;\n",
+ "print\"%s %.2f %s\"%('\\nR1C2= ',y1,' ms\\n')\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "R1C2= -0.10 ms\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Electronic_Circuit_Analysis_And_Design_by_D._A._Neamen/screenshots/chapter3_1.png b/Electronic_Circuit_Analysis_And_Design_by_D._A._Neamen/screenshots/chapter3_1.png Binary files differnew file mode 100644 index 00000000..2b96ab91 --- /dev/null +++ b/Electronic_Circuit_Analysis_And_Design_by_D._A._Neamen/screenshots/chapter3_1.png diff --git a/Electronic_Circuit_Analysis_And_Design_by_D._A._Neamen/screenshots/chapter4_1.png b/Electronic_Circuit_Analysis_And_Design_by_D._A._Neamen/screenshots/chapter4_1.png Binary files differnew file mode 100644 index 00000000..8be22e5e --- /dev/null +++ b/Electronic_Circuit_Analysis_And_Design_by_D._A._Neamen/screenshots/chapter4_1.png diff --git a/Electronic_Circuit_Analysis_And_Design_by_D._A._Neamen/screenshots/chapter5_1.png b/Electronic_Circuit_Analysis_And_Design_by_D._A._Neamen/screenshots/chapter5_1.png Binary files differnew file mode 100644 index 00000000..411b2e3c --- /dev/null +++ b/Electronic_Circuit_Analysis_And_Design_by_D._A._Neamen/screenshots/chapter5_1.png diff --git a/Wireless_Communications_Principles_and_Practices_by_T._S._Rappaport/Chap2.ipynb b/Wireless_Communications_Principles_and_Practices_by_T._S._Rappaport/Chap2.ipynb new file mode 100644 index 00000000..e4ed1ef9 --- /dev/null +++ b/Wireless_Communications_Principles_and_Practices_by_T._S._Rappaport/Chap2.ipynb @@ -0,0 +1,315 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter No.2 : Appendix B Noise figure calculations for link budgets" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example no B.1 Page no. 613" + ] + }, + { + "cell_type": "code", + "execution_count": 11, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + " SNR at the detector output stage = 14 dB\n" + ] + } + ], + "source": [ + "# To determine SNR at the detector output stage\n", + "\n", + "\n", + "# Given data\n", + "SNRin=20# # SNR at the receiver antenna input terminal in dB\n", + "F=6# # Noise figure in dB\n", + "\n", + "# SNR at the detector output stage\n", + "SNRout=SNRin-F# # SNR at the detector output stage in dB\n", + "\n", + "# Displaying the result in command window\n", + "print '\\n SNR at the detector output stage = %0.0f dB'%(SNRout)#" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example no B.2 Page no. 613" + ] + }, + { + "cell_type": "code", + "execution_count": 12, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + " Noise figure of mobile receiver system = 9 dB\n" + ] + } + ], + "source": [ + "from __future__ import division\n", + "from math import log10\n", + "#To compute noise figure of mobile receiver system\n", + "\n", + "\n", + "#Given data\n", + "F1=3# #Coaxial cable loss in dB\n", + "F1=10**(F1/10)# #Coaxial cable loss\n", + "F2=6# #Noise figure of phone in dB\n", + "F2=10**(F2/10)# #Noise figure of phone\n", + "\n", + "Fsys=F1+((F2-1)/0.5)# #Noise figure of mobile receiver system\n", + "Fsys=10*log10(Fsys)# #Noise figure of mobile receiver system in dB\n", + "\n", + "# Displaying the result in command window\n", + "print '\\n Noise figure of mobile receiver system = %0.0f dB'%(Fsys)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example no B.3 Page no. 614" + ] + }, + { + "cell_type": "code", + "execution_count": 13, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + " Average output thermal noise power = -119.5 dBm\n" + ] + } + ], + "source": [ + "from __future__ import division\n", + "from math import log10\n", + "# To determine average output thermal noise power\n", + "\n", + "\n", + "# Given data\n", + "T0=300# # Ambient room temperature in K\n", + "Fsys=8# # Noise figure of the system\n", + "Tant=290# # Effective temperature of antenna in K\n", + "K=1.38*10**-23# # Boltzmann's constant in J/K\n", + "B=30000# # Effective bandwidth in Hz\n", + "\n", + "Te=(Fsys-1)*T0# # Effective noise temperature in K\n", + "Ttotal=Tant+Te# # Overall system noise temperature in K\n", + "\n", + "# To determine average output thermal noise power\n", + "Pn=(1+(Ttotal/T0))*K*T0*B# # Average output thermal noise power in W\n", + "Pn=10*log10(Pn/(10**-3))# # Average output thermal noise power in dBm\n", + "\n", + "# Displaying the result in command window\n", + "print '\\n Average output thermal noise power = %0.1f dBm'%(Pn)#" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example no B.4 Page no. 614" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + " Average signal strength at the antenna terminal to provide 30dB SNR = -89.5 dBm\n" + ] + } + ], + "source": [ + "# To determine average signal strength at the antenna terminal \n", + "\n", + "\n", + "# Given data\n", + "Pn=-119.5# # Average output thermal noise power in dBm\n", + "SNR=30# # SNR at the receiver output in dB\n", + "\n", + "# To determine average signal strength at the antenna terminal to provide 30dB SNR\n", + "Ps=SNR+Pn# # Average signal strength at the antenna terminal\n", + "\n", + "# Displaying the result in command window\n", + "print '\\n Average signal strength at the antenna terminal to provide 30dB SNR = %0.1f dBm'%(Ps)#" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example no B.5 Page no. 615" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + " Average signal strength at the antenna terminal to provide 30dB SNR = -68.5 dBm\n" + ] + } + ], + "source": [ + "# To determine average signal strength at the antenna terminal \n", + "\n", + "\n", + "# Given data\n", + "Pn=-104.5# # Average output thermal noise power in dBm\n", + "SNR=36# # SNR at the receiver output in dB\n", + "\n", + "# To determine average signal strength at the antenna terminal to provide 36dB SNR\n", + "Ps=SNR+Pn# # Average signal strength at the antenna terminal\n", + "\n", + "# Displaying the result in command window\n", + "print '\\n Average signal strength at the antenna terminal to provide 30dB SNR = %0.1f dBm'%(Ps)#" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example no B.6 Page no. 615" + ] + }, + { + "cell_type": "code", + "execution_count": 16, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + " Noise figure of mobile receiver system = 11 dB\n" + ] + } + ], + "source": [ + "from __future__ import division\n", + "from math import log10\n", + "#To compute noise figure of mobile receiver system\n", + "\n", + "\n", + "#Given data\n", + "F1=5# #Coaxial cable loss in dB\n", + "F1=10**(F1/10)# #Coaxial cable loss\n", + "F2=8# #Noise figure of phone in dB\n", + "F2=10**(F2/10)# #Noise figure of phone\n", + "\n", + "Fsys=F1+((F2-1)/0.5)# #Noise figure of mobile receiver system\n", + "Fsys=10*log10(Fsys)# #Noise figure of mobile receiver system in dB\n", + "\n", + "# Displaying the result in command window\n", + "print '\\n Noise figure of mobile receiver system = %0.0f dB'%(Fsys)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example no B.7 Page no. 615" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + " SNR at the detector output stage = 24 dB\n" + ] + } + ], + "source": [ + "# To determine SNR at the detector output stage\n", + "\n", + "\n", + "# Given data\n", + "SNRin=30# # SNR at the receiver antenna input terminal in dB\n", + "F=6# # Noise figure in dB\n", + "\n", + "# SNR at the detector output stage\n", + "SNRout=SNRin-F# # SNR at the detector output stage in dB\n", + "\n", + "# Displaying the result in command window\n", + "print '\\n SNR at the detector output stage = %0.0f dB'%(SNRout)#" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 2", + "language": "python", + "name": "python2" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 2 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython2", + "version": "2.7.9" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/Wireless_Communications_Principles_and_Practices_by_T._S._Rappaport/Chap3.ipynb b/Wireless_Communications_Principles_and_Practices_by_T._S._Rappaport/Chap3.ipynb new file mode 100644 index 00000000..fbf8d02c --- /dev/null +++ b/Wireless_Communications_Principles_and_Practices_by_T._S._Rappaport/Chap3.ipynb @@ -0,0 +1,619 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter No.3 : The cellular concept system design fundamentals" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 3.1 Page No.61" + ] + }, + { + "cell_type": "code", + "execution_count": 14, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + " The number of channels available per cell for 4-cell reuse system = 165 channels\n", + "\n", + " One control channel and 160 voice channels would be assigned to each cell.\n", + "\n", + " \n", + " The number of channels available per cell for 7-cell reuse system = 95 channels\n", + "\n", + " Each cell would have one control channel, four cells would have 90 voice channels and three cells would have 91 voice channels.\n", + "\n", + " \n", + " The number of channels available per cell for 12-cell reuse system = 55 channels\n", + "\n", + " Each cell would have one control channel, eight cells would have 53 voice channels and four cells would have 54 voice channels.\n" + ] + } + ], + "source": [ + "from math import ceil\n", + "# To compute the number of channels available per cell for a)four-cell reuse system a)seven-cell reuse system a)12-cell reuse system\n", + "\n", + "# Given data\n", + "B=33*10**6# # Total bandwidth allocated to particular FDD system in Hz\n", + "Bc=25*10**3# # Bandwidth per channel in Hz\n", + "Nc=2# # Number of simplex channels\n", + "Bc=Bc*Nc# # Channel bandwidth in Hz\n", + "\n", + "Ntotal=B/Bc# # Total number of channels\n", + "\n", + "#a) To compute the number of channels available per cell for four-cell reuse system\n", + "N=4# # frequency reuse factor\n", + "chpercell=Ntotal/N# # number of channels available per cell for four-cell reuse system\n", + "\n", + "# Displaying the result in command window\n", + "print \"\\n The number of channels available per cell for 4-cell reuse system = %0.0f channels\"%(chpercell)\n", + "print \"\\n One control channel and 160 voice channels would be assigned to each cell.\"\n", + "\n", + "# b) To compute the number of channels available per cell for seven-cell reuse system\n", + "N=7# # frequency reuse factor\n", + "chpercell=ceil(Ntotal/N)# # number of channels available per cell for seven-cell reuse system\n", + "\n", + "# Answer is varrying due to round-off error\n", + "\n", + "# Displaying the result in command window\n", + "print \"\\n \\n The number of channels available per cell for 7-cell reuse system = %0.0f channels\"%(chpercell)\n", + "print \"\\n Each cell would have one control channel, four cells would have 90 voice channels and three cells would have 91 voice channels.\"\n", + "\n", + "# c) To compute the number of channels available per cell for 12-cell reuse system\n", + "N=12# # frequency reuse factor\n", + "chpercell=Ntotal/N# # number of channels available per cell for seven-cell reuse system\n", + "\n", + "# Displaying the result in command window\n", + "print \"\\n \\n The number of channels available per cell for 12-cell reuse system = %0.0f channels\"%(chpercell)\n", + "print \"\\n Each cell would have one control channel, eight cells would have 53 voice channels and four cells would have 54 voice channels.\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 3.2 Page No.72" + ] + }, + { + "cell_type": "code", + "execution_count": 15, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + " Signal to noise ratio for n=4 with frequency reuse factor N=7 = 18.66 dB\n", + "\n", + " Signal to noise ratio for n=3 with frequency reuse factor N=7 = 12.05 dB\n", + "\n", + " Signal to noise ratio for n=3 with frequency reuse factor N=12 = 15.56 dB\n", + "\n", + " Since SIR is for n=3 with frequency reuse factor N=7 greater than the minimum required, so N=12 is used.\n" + ] + } + ], + "source": [ + "from math import sqrt, log10\n", + "from __future__ import division\n", + "# To find frequency reuse factor for path loss exponent (n) a)n=4 b)n=3\n", + "\n", + "# Given data\n", + "SIdB=15# # Signal to interference(dB)\n", + "io=6# # Number of cochannel cell\n", + "\n", + "# For n=4\n", + "n1=4# # Path loss exponent\n", + "N1=7# # First consideration: frequency reuse factor N=7\n", + "DR1=sqrt(3*N1)# # Co-channel reuse ratio\n", + "si1=(1/io)*(DR1)**n1# # Signal to interference\n", + "sidB1=10*log10(si1)# # Signal to interference(dB)\n", + "\n", + "# For n=3\n", + "n2=3# # Path loss exmponent\n", + "si=(1/io)*(DR1)**n2# # Signal to interference for first consideration: frequency reuse factor N=7\n", + "sidB=10*log10(si)# # Signal to interference(dB)\n", + "\n", + "N2=12# # second consideration : frequency reuse factor N=12 since sidB<SIdB \n", + "DR2=sqrt(3*N2)# # Co-channel reuse ratio\n", + "si2=(1/io)*(DR2)**n2# # Signal to interference\n", + "sidB2=10*log10(si2)# # Signal to interference(dB)\n", + "\n", + "# Displaying the result in command window\n", + "print \"\\n Signal to noise ratio for n=4 with frequency reuse factor N=7 = %0.2f dB\"%(sidB1)\n", + "print \"\\n Signal to noise ratio for n=3 with frequency reuse factor N=7 = %0.2f dB\"%(sidB)\n", + "print \"\\n Signal to noise ratio for n=3 with frequency reuse factor N=12 = %0.2f dB\"%(sidB2)\n", + "print \"\\n Since SIR is for n=3 with frequency reuse factor N=7 greater than the minimum required, so N=12 is used.\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 3.4 Page No.80" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + " Total number of users for 1 channel = 1\n", + "\n", + " Total number of users for 5 channel = 11\n", + "\n", + " Total number of users for 10 channel = 40\n", + "\n", + " Total number of users for 20 channel = 111\n", + "\n", + " Total number of users for 100 channel = 809\n" + ] + } + ], + "source": [ + "# To find number of users for Number of channels (C) a)C=1 b)C=5 c)C=10 d)C=20 e)C=100\n", + "\n", + "# Given data\n", + "GOS=0.005# #G rade of Service\n", + "Au=0.1# # Traffic intensity per user\n", + "\n", + "# a)To find number of users for C=1\n", + "C1=1# # Number of channels\n", + "A1=0.005# # Total traffic intensity from Erlangs B chart\n", + "U1=(A1/Au)# # Number of users\n", + "U1=1# # Since one user could be supported on one channel\n", + "\n", + "# b)To find number of users for C=5\n", + "C2=5# # Number of channels\n", + "A2=1.13# # Total traffic intensity from Erlangs B chart\n", + "U2=round(A2/Au)# # Number of users\n", + "\n", + "# c)To find number of users for C=10\n", + "C3=10# # Number of channels\n", + "A3=3.96# # Total traffic intensity from Erlangs B chart\n", + "U3=round(A3/Au)# # Number of users\n", + "\n", + "# Answer is varrying due to round off error\n", + "\n", + "# d)To find number of users for C=20\n", + "C4=20# # Number of channels\n", + "A4=11.10# # Total traffic intensity from Erlangs B chart\n", + "U4=round(A4/Au)# # Number of users\n", + "\n", + "# Answer is varrying due to round off error\n", + "\n", + "# e)To find number of users for C=100\n", + "C5=100# # Number of channels\n", + "A5=80.9# # Total traffic intensity from Erlangs B chart\n", + "U5=round(A5/Au)# # Number of users\n", + "\n", + "# Displaying the result in command window\n", + "print \"\\n Total number of users for 1 channel = %0.0f\"%(U1)\n", + "print \"\\n Total number of users for 5 channel = %0.0f\"%(U2)\n", + "print \"\\n Total number of users for 10 channel = %0.0f\"%(U3)\n", + "print \"\\n Total number of users for 20 channel = %0.0f\"%(U4)\n", + "print \"\\n Total number of users for 100 channel = %0.0f\"%(U5)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 3.5 Page No.83" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + " Total number of users in system A = 47280\n", + "\n", + " The percentage market penetration of system A = 2.36\n", + "\n", + " \n", + " Total number of users in system B = 44100\n", + "\n", + " The percentage market penetration of system B = 2.205\n", + "\n", + " \n", + " Total number of users in system C = 43120\n", + "\n", + " The percentage market penetration of system C = 2.156\n", + "\n", + " \n", + " Total number of users in all 3 systems = 134500\n", + "\n", + " The combined Market penetration percentage of all systems = 6.725\n" + ] + } + ], + "source": [ + "from __future__ import division\n", + "# To find number of users for a)system A b)system B c)system C\n", + "\n", + "# Given data\n", + "GOS=0.02# # Grade of Service (Probability of bloacking)\n", + "lamda=2# # Average calls per hour\n", + "H=(3/60)# # Call duration in seconds\n", + "\n", + "Au=lamda*H# # Traffic intensity per user\n", + "\n", + "# a)To find number of users for System A\n", + "C1=19# # Number of channels used\n", + "A1=12# # Traffic intensity from Erlang B chart\n", + "U1=round(A1/Au)# # Number of users per cell\n", + "cells1=394\n", + "TU1=U1*cells1# # Total number of users\n", + "MP1=TU1/(2*10**6)*100# # Market penetration percentage\n", + "\n", + "# b)To find number of users for System B\n", + "C2=57# # No. of channels used\n", + "A2=45# # Traffic intensity from Erlang B chart\n", + "U2=round(A2/Au)# # Number of users per cell\n", + "cells2=98\n", + "TU2=U2*cells2# # Total no. of users\n", + "MP2=TU2/(2*10**6)*100# # Market penetration percentage\n", + "\n", + "# c)To find number of users for System C\n", + "C3=100# # Number of channels used\n", + "A3=88# # traffic intensity from Erlang B chart\n", + "U3=round(A3/Au)# # Number of users per cell\n", + "cells3=49\n", + "TU3=U3*cells3# # Total no. of users\n", + "MP3=TU3/(2*10**6)*100# # Market penetration percentage\n", + "\n", + "TU=TU1+TU2+TU3# # Total number of users in all 3 systems\n", + "MP=TU/(2*10**6)*100# # Combined Market penetration percentage\n", + "\n", + "# Displaying the result in command window\n", + "print \"\\n Total number of users in system A = %0.0f\"%(TU1)\n", + "print \"\\n The percentage market penetration of system A = %0.2f\"%(MP1)\n", + "print \"\\n \\n Total number of users in system B = %0.0f\"%(TU2)\n", + "print \"\\n The percentage market penetration of system B = %0.3f\"%(MP2)\n", + "print \"\\n \\n Total number of users in system C = %0.0f\"%(TU3)\n", + "print \"\\n The percentage market penetration of system C = %0.3f\"%(MP3)\n", + "print \"\\n \\n Total number of users in all 3 systems = %0.0f\"%(TU)\n", + "print \"\\n The combined Market penetration percentage of all systems = %0.3f\"%(MP)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 3.6 Page No.84" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + " Number of cells in given system = 31 cells\n", + "\n", + " \n", + " Number of channels per cell in given system = 95 channels/cell\n", + "\n", + " \n", + " Traffic intensity in given system = 84 Erlangs/cell\n", + "\n", + " \n", + " Maximum carried traffic in given system = 2604 Erlangs\n", + "\n", + " \n", + " Total number of users = 86800 users\n", + "\n", + " \n", + " Number of mobiles per unique channel = 130 mobiles/channel\n", + "\n", + " \n", + " Theoretically maximum number of served mobiles is the number of available channels in the system.\n", + "\n", + " Theoretical Maximum number of users could be served at one time = 2945 users\n", + "It is 3.4% of customer base.\n" + ] + } + ], + "source": [ + "# To find a)Number of cells in given area b)Number of channels/cell c)Traffic intensity per cell d)Maximum carried traffic e)Total number of users for 2% GOS f) Number of mobiles per unique channel g)Maximum number of users could be served at one time\n", + "\n", + "# Given data\n", + "Area=1300# # Total coverage area in m**2\n", + "R=4# # Radius of cell in m\n", + "N=7# # Frequecy reuse factor\n", + "S=40*10**6# # Allocated spectrum in Hz\n", + "Ch=60*10**3# # Channel width in Hz\n", + "\n", + "# a)Number of cells\n", + "CA=2.5981*R**2# # Area of hexagonal cell in m**2\n", + "Nc=round(Area/CA)# # Number of cells\n", + "\n", + "# Displaying the result in command window\n", + "print \"\\n Number of cells in given system = %0.0f cells\"%(Nc)\n", + "\n", + "# b)Number of channels/cell\n", + "C1=round(S/(Ch*N))# # Number of channels\n", + "\n", + "# Displaying the result in command window\n", + "print \"\\n \\n Number of channels per cell in given system = %0.0f channels/cell\"%(C1)\n", + "\n", + "# c) Traffic intensity per cell\n", + "C1=95# # Number of channels from b)\n", + "GOS=0.02# # Grade of service\n", + "A=84# # Traffic intensity from Erlang B chart\n", + "\n", + "# Displaying the result in command window\n", + "print \"\\n \\n Traffic intensity in given system = %0.0f Erlangs/cell\"%(A)\n", + "\n", + "# d)Maximum carried traffic\n", + "traffic=Nc*A# # Maximum carried traffic\n", + "\n", + "# Displaying the result in command window\n", + "print \"\\n \\n Maximum carried traffic in given system = %0.0f Erlangs\"%(traffic)\n", + "\n", + "# e)Total number of users for 2% GOS \n", + "trafficperuser=0.03# # Given traffic per user\n", + "U=traffic/trafficperuser# # Total number of users\n", + "\n", + "# Displaying the result in command window\n", + "print \"\\n \\n Total number of users = %0.0f users\"%(U)\n", + "\n", + "# f) Number of mobiles per unique channel\n", + "C=666# # Number of channels\n", + "mobilesperchannel=round(U/C)# # Number of mobiles per unique channel\n", + "\n", + "# Displaying the result in command window\n", + "print \"\\n \\n Number of mobiles per unique channel = %0.0f mobiles/channel\"%(mobilesperchannel)\n", + "\n", + "# g)Maximum number of users could be served at one time\n", + "print \"\\n \\n Theoretically maximum number of served mobiles is the number of available channels in the system.\"\n", + "C=C1*Nc# # Maximum number of users could be served at one time\n", + "\n", + "# Displaying the result in command window\n", + "print \"\\n Theoretical Maximum number of users could be served at one time = %0.0f users\"%(C)\n", + "print \"It is 3.4% of customer base.\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 3.7 Page 85" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + " Number of users per square km in given system = 62 users/sq km\n", + "\n", + " \n", + " Percentage of probability that delayed call have to wait longer than t=10 sec = 56.29 percent\n", + "\n", + " \n", + " Percentage of probability that call is delayed more than 10 sec = 2.81 percent\n" + ] + } + ], + "source": [ + "from math import exp\n", + "# To find a)number of users per square km b)probability that delayed call have to wait longer than t=10sec c)probability that call is delayed more than 10 sec\n", + "\n", + "# Given data\n", + "R=1.387# # Radius of cell in m\n", + "Area=2.598*R**2# # Area of hexagonal cell in m**2\n", + "cellpercluster=4# # Number of cells/cluster\n", + "channels=60# # Number of channels\n", + "\n", + "channelspercell=channels/cellpercluster# # Number of channels per cell\n", + "\n", + "# a)To find number of users per square km\n", + "A=0.029# # Traffic intensity per user\n", + "delayprob=0.05# # Grade of service\n", + "traffic=9# # Traffic intensity from Erlang chart C\n", + "U1=traffic/A# # Total number of users in 5sq.km.\n", + "U=round(U1/Area)# # Number of users per square km\n", + "\n", + "# Displaying the result in command window\n", + "print \"\\n Number of users per square km in given system = %0.0f users/sq km\"%(U)\n", + "\n", + "# b)To find the probability that delayed call have to wait longer than t=10sec\n", + "lamda=1# # Holding time\n", + "H1=A/lamda# # Duration of call\n", + "H=H1*3600# # Duration of call in second\n", + "t=10\n", + "Pr=exp(-(channelspercell-traffic)*t/H)*100# # probability that delayed call have to wait longer than t=10sec.\n", + "\n", + "# Displaying the result in command window\n", + "print \"\\n \\n Percentage of probability that delayed call have to wait longer than t=10 sec = %0.2f percent\"%(Pr)\n", + "\n", + "# c)To find the probability that call is delayed more than 10 sec\n", + "Pr10=delayprob*Pr# # probability that call is delayed more than 10 sec\n", + "\n", + "# Displaying the result in command window\n", + "print \"\\n \\n Percentage of probability that call is delayed more than 10 sec = %0.2f percent\"%(Pr10)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 3.8 Page 89" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + " Number of channels without use of microcell = 300 channels\n", + "\n", + " \n", + " Number of channels with the use of lettered microcells = 660 channels\n", + "\n", + " \n", + " Number of channels if all base stations are replaced by microcells = 1020 channels\n" + ] + } + ], + "source": [ + "# To find number of channels in 3 km by 3 km square centered around A in Figure 3.9 for a)without use of microcell b)with the use of lettered microcells c)all base stations are replaced by microcells\n", + "\n", + "# Given data\n", + "R=1# # Cell radius in km\n", + "r=0.5# # Micro-cell radius in km\n", + "Nc=60# # Number of channels in base station\n", + "\n", + "# a)To find number of channels without use of microcell\n", + "Nb1=5# # Number of base stations in given area\n", + "N1=Nb1*Nc# # Number of channels without use of microcell\n", + "\n", + "# b)To find number of channels with the use of lettered microcells\n", + "Nb2=6# # Number of lettered microcells\n", + "Nb2=Nb1+Nb2# # Total number of base stations in given area\n", + "N2=Nb2*Nc# # Number of channels with the use of lettered microcells\n", + "\n", + "# c)To find number of channels if all base stations are replaced by microcells\n", + "Nb3=12# # Number of all the microcells\n", + "Nb3=Nb1+Nb3# # Total number of base stations in given area\n", + "N3=Nb3*Nc# # Number of channels if all base stations are replaced by microcells\n", + "\n", + "# Displaying the result in command window\n", + "print \"\\n Number of channels without use of microcell = %0.0f channels\"%(N1)\n", + "print \"\\n \\n Number of channels with the use of lettered microcells = %0.0f channels\"%(N2)\n", + "print \"\\n \\n Number of channels if all base stations are replaced by microcells = %0.0f channels\"%(N3)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 3.9 Page 92" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + " Cell capacity of unsectored system = 1326 calls/hour\n", + "\n", + " \n", + " Cell capacity of 120 degree sectored system = 1008 calls/hour\n", + "\n", + " \n", + " Decrease in cell capacity in 120 degree sectored system = 23.98 percent\n" + ] + } + ], + "source": [ + "from __future__ import division\n", + "# To analyze trunking efficiency capacity of sectoring and unsectoring\n", + "\n", + "# Given data\n", + "H=2/60# # Average call duration in hour\n", + "GOS=0.01# # Probability of blocking\n", + "\n", + "# Unsectored system\n", + "C1=57# # Number of traffic channels per cell in unsectored system\n", + "A=44.2# # Carried traffic in unsectored system\n", + "calls1=1326# # Number of calls per hour in unsectored system from Erlangs B table\n", + "\n", + "# 120 degree sectored system\n", + "C2=C1/3# # Number of traffic channels per antenna sector in 120 degree sectored system\n", + "calls2=336# # Number of calls per hour in 120 degree sectored system from Erlangs B table\n", + "Ns1=3# # Number of sectors\n", + "capacity=Ns1*calls2# # Cell capacity or number of calls handled by system per hour\n", + "\n", + "dif=calls1-capacity# # decrease in cell capacity in 120 degree sectored system\n", + "percentdif=(dif/calls1)*100# # decrease in cell capacity in 120 degree sectored system in percentage\n", + "\n", + "# Displaying the result in command window\n", + "print \"\\n Cell capacity of unsectored system = %0.0f calls/hour\"%(calls1)\n", + "print \"\\n \\n Cell capacity of 120 degree sectored system = %0.0f calls/hour\"%(capacity)\n", + "print \"\\n \\n Decrease in cell capacity in 120 degree sectored system = %0.2f percent\"%(percentdif)" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 2", + "language": "python", + "name": "python2" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 2 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython2", + "version": "2.7.9" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/Wireless_Communications_Principles_and_Practices_by_T._S._Rappaport/Chap4.ipynb b/Wireless_Communications_Principles_and_Practices_by_T._S._Rappaport/Chap4.ipynb new file mode 100644 index 00000000..9bbf26ab --- /dev/null +++ b/Wireless_Communications_Principles_and_Practices_by_T._S._Rappaport/Chap4.ipynb @@ -0,0 +1,733 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter No.4 : Mobile radio propagation large scale path loss" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 4.1 Page No.109" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + " Far field distance = 6 meter\n" + ] + } + ], + "source": [ + "from __future__ import division\n", + "# To find far field distance for antenna with maximum dimensions and operating frequency\n", + "\n", + "\n", + "# Given data\n", + "D=1# # Maximum dimension in m\n", + "f=900*10**6# # Operating frequency in Hz\n", + "C=3*10**8# # Speed of light in m/sec\n", + "\n", + "lamda=C/f# # Carrier wavelength in m\n", + "\n", + "# To find far field distance\n", + "df=(2*D**2)/lamda# #Far field distance\n", + "\n", + "#Displaying the result in command window\n", + "print '\\n Far field distance = %0.0f meter'%(df)#" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 4.2 Page No.109" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + " Transmitter power = 47.0 dBm\n", + "\n", + " Transmitter power = 17.0 dBW\n", + "\n", + " Receiver power = -24.5 dBm\n", + "\n", + " Receiver power at 10km from antenna = -64.5 dBm\n" + ] + } + ], + "source": [ + "from __future__ import division\n", + "from math import log10,pi\n", + "# To find a)transmitter power in dBm b)Transmitter power in dBW and the received power of antenna in dBm at free space distance of 100m from antenna and 10km\n", + "\n", + "\n", + "# Given data\n", + "Pt=50# # Transmitter power in W\n", + "fc=900*10**6# # Carrier frequency in Hz\n", + "C=3*10**8# # Speed of light in m/s\n", + "\n", + "#a)Transmitter power in dBm\n", + "PtdBm=round(10*log10(Pt/(1*10**(-3))))# #Transmitter power in dBm\n", + "\n", + "# Displaying the result in command window\n", + "print '\\n Transmitter power = %0.1f dBm'%(PtdBm)#\n", + "\n", + "#b)Transmitter power in dBW\n", + "PtdBW=round(10*log10(Pt/1))# #Transmitter power in dBW\n", + "\n", + "# Displaying the result in command window\n", + "print '\\n Transmitter power = %0.1f dBW'%(PtdBW)#\n", + "\n", + "# To find receiver power at 100m\n", + "Gt=1# #Transmitter gain\n", + "Gr=1# #Receiver gain\n", + "d=100# #Free space distance from antenna in m\n", + "L=1# #System loss factor since no loss in system\n", + "lamda=C/fc# #Carrier wavelength in m\n", + "Pr=(Pt*Gt*Gr*lamda**2)/((4*pi)**2*d**2*L)# #Receiver power in W\n", + "PrdBm=10*log10(Pr/10**(-3))# #Receiver power in dBm\n", + "\n", + "#Displaying the result in command window\n", + "print '\\n Receiver power = %0.1f dBm'%(PrdBm)#\n", + "\n", + "#For Pr(10km)\n", + "d0=100# #Reference distance\n", + "d=10000# #Free space distance from antenna\n", + "Pr10km=PrdBm+20*log10(d0/d)# #Received power at 10km from antenna in dBm\n", + "\n", + "#Displaying the result in command window\n", + "print '\\n Receiver power at 10km from antenna = %0.1f dBm'%(Pr10km)#" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 4.3 Page no. 112" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + " Power at receiver = -91.5 dBW\n", + "\n", + " Power at receiver = -61.5 dBm\n", + "\n", + " \n", + " Magnitude of E-field at receiver = 0.0039 V/m\n", + "\n", + " \n", + " RMS voltage applied to receiver input = 0.375 mV\n" + ] + } + ], + "source": [ + "from __future__ import division\n", + "from math import sqrt,pi,log10\n", + "# To find a)power at receiver b)magnitude of E-field at receiver c)rms voltage applied to receiver input\n", + "\n", + "\n", + "# Given data\n", + "Pt=50# # Transmitter power in Watt\n", + "fc=900*10**6# # Carrier frequency in Hz\n", + "Gt=1# # Transmitter antenna gain\n", + "Gr=2# # Receiver antenna gain\n", + "Rant=50# # Receiver antenna resistance in ohm\n", + "\n", + "# a)Power at receiver\n", + "d=10*10**3# # Distance from antenna in meter\n", + "lamda=(3*10**8)/fc# # Carrier wavelength in meter\n", + "Prd1=10*log10((Pt*Gt*Gr*lamda**2)/((4*pi)**2*d**2))# # Power at transmitter in dBW\n", + "Prd=10*log10(((Pt*Gt*Gr*lamda**2)/((4*pi)**2*d**2))/(10**-3))# # Power at transmitter in dBm\n", + "\n", + "# Displaying the result in command window\n", + "print '\\n Power at receiver = %0.1f dBW'%(Prd1)#\n", + "print '\\n Power at receiver = %0.1f dBm'%(Prd)#\n", + "\n", + "# b)Magnitude of E-field at receiver\n", + "Ae=(Gr*lamda**2)/(4*pi)# # Aperture gain\n", + "Pr=10**(Prd1/10)# # Receiver power in W\n", + "E=sqrt((Pr*120*pi)/Ae)# # Magnitude of E-field at receiver\n", + "\n", + "# Displaying the result in command window\n", + "print '\\n \\n Magnitude of E-field at receiver = %0.4f V/m'%(E)#\n", + "\n", + "# c)rms voltage applied to receiver input\n", + "Vant=sqrt(Pr*4*Rant)*10**3# # rms voltage applied to receiver input\n", + "#Answer is varrying due to round-off error\n", + "\n", + "#Displaying the result in command window\n", + "print '\\n \\n RMS voltage applied to receiver input = %0.3f mV'%(Vant)#" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example no. 4.5 Page no. 119" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + " Brewster angle = 26.57 degree\n" + ] + } + ], + "source": [ + "from __future__ import division\n", + "from math import sqrt,asin,degrees\n", + "# To calculate the Brewster angle\n", + "\n", + "\n", + "# Given data\n", + "Er=4# # Permittivity\n", + "x=sqrt((Er-1)/(Er**2-1)) # Sine of brewster angle\n", + "theta=degrees(asin(x)) # Brewster angle\n", + "#Answer is varrying due to round off error\n", + "\n", + "# Displaying the result in command window\n", + "print '\\n Brewster angle = %0.2f degree'%(theta)#" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example no 4.6 Page no. 125" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + " Length of antenna = 0.0833 m\n", + " = 8.33 cm\n", + "\n", + " Effective aperture of receiving antenna = 0.016 m**2\n", + "\n", + " \n", + " The received power at mobile = 5.4 X 10**-13 W\n", + " = -122.68 dBW\n", + " = -92.68 dBm\n" + ] + } + ], + "source": [ + "from __future__ import division\n", + "from math import log10,sqrt,pi\n", + "# To find a)the length and effective aperture of receiving antenna b)the received power at mobile\n", + "\n", + "\n", + "# Given data\n", + "d=5*10**3# # distance of mobile from base station in m\n", + "E0=1*10**-3# # E-field at 1Km from transmitter in V/m\n", + "d0=1*10**3# # Distance from transmitter in m\n", + "f=900*10**6# # Carrier frequency used for the system in Hz\n", + "c=3*10**8# # Speed of ligth in m/s\n", + "gain=2.55# # Gain of receiving antenna in dB\n", + "G=10**(gain/10)# # Gain of receiving antenna\n", + "\n", + "# a)To find the length and effective aperture of receiving antenna\n", + "lamda=c/f# # Wavelength\n", + "L=lamda/4# # Length of antenna\n", + "Ae=(G*lamda**2)/(4*pi)# # Effective aperture of receiving antenna\n", + "\n", + "# Displaying the result in command window\n", + "print '\\n Length of antenna = %0.4f m'%(L)#\n", + "print ' = %0.2f cm'%(L*10**2)#\n", + "print '\\n Effective aperture of receiving antenna = %0.3f m**2'%(Ae)#\n", + "\n", + "# b)To find the received power at mobile\n", + "# Given data\n", + "ht=50# # Heigth of transmitting antenna\n", + "hr=1.5# # Heigth of receiving antenna\n", + "ERd=(2*E0*d0*2*pi*ht*hr)/(d**2*lamda)# # Electic field at distance d in V/m\n", + "Prd=((ERd**2/377)*Ae)# # The received power at mobile in W\n", + "PrddB=10*log10(Prd)# # The received power at mobile in dBW\n", + "PrddBm=10*log10(Prd/10**-3)# # The received power at mobile in dBm\n", + "Prd=((ERd**2/377)*Ae)*10**13# # The received power at mobile in 10**-13W\n", + "\n", + "# Displaying the result in command window\n", + "print '\\n \\n The received power at mobile = %0.1f X 10**-13 W'%(Prd)#\n", + "print ' = %0.2f dBW'%(PrddB)#\n", + "print ' = %0.2f dBm'%(PrddBm)#" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example no 4.7 Page no. 132" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + " a) For h=25m Fresnel diffraction parameter v = 2.74\n", + "\n", + " From the plot of Knife-edge diffraction gain as a function of Fresnel diffraction parameter, diffraction loss is 22dB.\n", + "\n", + " Using numerical approximation, diffraction loss for v > 2.4 = 21.7 dB\n", + "\n", + " Fresnel zone within which tip of obstruction lies = 3.75\n", + "\n", + " Therefore, the tip of obstruction completely blocks the first three Fresnel zones.\n", + "\n", + " \n", + " b) For h=0 Fresnel diffraction parameter v = 0\n", + "\n", + " From the plot of Knife-edge diffraction gain as a function of Fresnel diffraction parameter, diffraction loss is 6dB.\n", + "\n", + " Using numerical approximation, diffraction loss for v=0 = 6 dB\n", + "\n", + " Fresnel zone within which tip of obstruction lies = 0\n", + "\n", + " Therefore, the tip of obstruction lies in middle of first Fresnel zone.\n", + "\n", + " \n", + " c) For h=-25m Fresnel diffraction parameter v = -2.74\n", + "\n", + " From the plot of Knife-edge diffraction gain as a function of Fresnel diffraction parameter, diffraction loss is approximately 1dB.\n", + "\n", + " Using numerical approximation, diffraction loss for v < -1 = 0 in dB\n", + "\n", + " Fresnel zone within which tip of obstruction lies = 3.75\n", + "\n", + " Therefore, the tip of obstruction completely blocks the first three Fresnel zones but diffraction loss is negligible.\n" + ] + } + ], + "source": [ + "from __future__ import division\n", + "from math import log10,sqrt,pi\n", + "# To compute diffraction loss and identify Fresnel zone within which tip of obstruction lies for a)h=25m b)h=0 c)h=-25m\n", + "\n", + "# Given data\n", + "lamda=1/3# # Wavelength in meter\n", + "d1=1*10**3# # Distance between transmitter and obstructing screen in m\n", + "d2=1*10**3# # Distance between receiver and obstructing screen in m\n", + "\n", + "# a) For h=25m\n", + "h=25# # Effective heigth of obstruction screen in m\n", + "v=h*sqrt((2*(d1+d2))/(lamda*d1*d2))# # Fresnel diffraction parameter\n", + "print '\\n a) For h=25m Fresnel diffraction parameter v = %0.2f'%(v)#\n", + "print '\\n From the plot of Knife-edge diffraction gain as a function of Fresnel diffraction parameter, diffraction loss is 22dB.'\n", + "Gd=-20*log10(0.225/v)# # Diffraction loss for v>2.4 in dB\n", + "print '\\n Using numerical approximation, diffraction loss for v > 2.4 = %0.1f dB'%(Gd)#\n", + "delta=(h**2/2)*((d1+d2)/(d1*d2))# # Path length difference between direct and diffracted rays\n", + "n=(2*delta)/lamda# # Number of Fresnel zones in which the obstruction lies\n", + "print '\\n Fresnel zone within which tip of obstruction lies = %0.2f'%(n)#\n", + "print '\\n Therefore, the tip of obstruction completely blocks the first three Fresnel zones.'\n", + "\n", + "# b) For h=0\n", + "h=0# # Effective heigth of obstruction screen in m\n", + "v=h*sqrt((2*(d1+d2))/(lamda*d1*d2))# # Fresnel diffraction parameter\n", + "print '\\n \\n b) For h=0 Fresnel diffraction parameter v = %0.0f'%(v)#\n", + "print '\\n From the plot of Knife-edge diffraction gain as a function of Fresnel diffraction parameter, diffraction loss is 6dB.'\n", + "Gd=-20*log10(0.5-0.62*v)# # Diffraction loss for v=0 in dB\n", + "print '\\n Using numerical approximation, diffraction loss for v=0 = %0.0f dB'%(Gd)#\n", + "delta=(h**2/2)*((d1+d2)/(d1*d2))# # Path length difference between direct and diffracted rays\n", + "n=(2*delta)/lamda# # Number of Fresnel zones in which the obstruction lies\n", + "print '\\n Fresnel zone within which tip of obstruction lies = %0.0f'%(n)#\n", + "print '\\n Therefore, the tip of obstruction lies in middle of first Fresnel zone.'\n", + "\n", + "# c) For h=-25m\n", + "h=-25# # Effective heigth of obstruction screen in m\n", + "v=h*sqrt((2*(d1+d2))/(lamda*d1*d2))# # Fresnel diffraction parameter\n", + "print '\\n \\n c) For h=-25m Fresnel diffraction parameter v = %0.2f'%(v)#\n", + "print '\\n From the plot of Knife-edge diffraction gain as a function of Fresnel diffraction parameter, diffraction loss is approximately 1dB.'\n", + "Gd=0# # Diffraction loss for v<-1 in dB\n", + "print '\\n Using numerical approximation, diffraction loss for v < -1 = %0.0f in dB'%(Gd)#\n", + "delta=(h**2/2)*((d1+d2)/(d1*d2))# # Path length difference between direct and diffracted rays\n", + "n=(2*delta)/lamda# # Number of Fresnel zones in which the obstruction lies\n", + "print '\\n Fresnel zone within which tip of obstruction lies = %0.2f'%(n)#\n", + "print '\\n Therefore, the tip of obstruction completely blocks the first three Fresnel zones but diffraction loss is negligible.'" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example no 4.8 Page no. 133" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + " The loss due to knife-edge diffraction = 25.5 dB\n", + "\n", + " The heigth of obstacle required to induce 6dB diffraction loss = 4.17 m\n" + ] + } + ], + "source": [ + "from __future__ import division\n", + "from math import log10,sqrt,pi,atan\n", + "# To determine a)the loss due to knife-edge diffraction b)the heigth of obstacle required to induce 6dB diffraction loss\n", + "\n", + "\n", + "# Given data\n", + "f=900*10**6# # Operating frequency in Hz\n", + "c=3*10**8# # Speed of ligth in m/s\n", + "hr=25# # Heigth of receiver in m\n", + "ht=50# # Heigth of transmitter in m\n", + "h=100# # Heigth of obstruction in m\n", + "d1=10*10**3# # Distance between transmitter and obstruction in m\n", + "d2=2*10**3# # Distance between receiver and obstruction in m\n", + "\n", + "# a)To determine the loss due to knife-edge diffraction\n", + "lamda=c/f# # Operating wavelength in m\n", + "ht=ht-hr# # Hegth of transmitter after subtracting smallest heigth (hr)\n", + "h=h-hr# # Heigth of obstruction after subtracting smallest heigth (hr)\n", + "bet=atan((h-ht)/d1)# # From geometry of environment in rad\n", + "gamm=atan(h/d2)# # From geometry of environment in rad\n", + "alpha=bet+gamm# # From geometry of environment in rad\n", + "v=alpha*sqrt((2*d1*d2)/(lamda*(d1+d2)))# # Fresnel diffraction parameter\n", + "\n", + "# the loss due to knife-edge diffraction\n", + "Gd=-20*log10(0.225/v)# # Diffraction loss for v>2.4 in dB\n", + "\n", + "# Displaying the result in command window\n", + "print '\\n The loss due to knife-edge diffraction = %0.1f dB'%(Gd)#\n", + "\n", + "# b)To determine the heigth of obstacle required to induce 6dB diffraction loss\n", + "Gd=6# # Diffraction loss in dB\n", + "v=0# # Fresnel diffraction parameter from the plot of Knife-edge diffraction gain as a function of Fresnel diffraction parameter\n", + "# v=0 is possible only if alpha=0. Therefore bet=-gamm\n", + "# By considering this situation, the geometry of environment provides (h/d2)=(ht/(d1+d2))\n", + "h=(ht*d2)/(d1+d2)# # the heigth of obstacle required to induce 6dB diffraction loss\n", + "\n", + "# Displaying the result in command window\n", + "print '\\n The heigth of obstacle required to induce 6dB diffraction loss = %0.2f m'%(h)#" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example no 4.9 Page no. 143" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + " Loss exponent = 4\n", + "\n", + " The standard deviation about mean value = 6.16 dB\n", + "\n", + " The received power (at d=2 km) = -57.42 dBm\n", + "\n", + " The probability that received signal will be greater than -60dBm = 66.2 percent\n", + "\n", + " The percentage of area within 2 km = 92 percent\n" + ] + } + ], + "source": [ + "from __future__ import division\n", + "from math import log10,sqrt,erf\n", + "# To find a)the minimum mean square error b)the standard deviation about mean value c)received power at d=2 km d)the likelihood that the received signal level at 2 km e) the percentage of area within 2 km \n", + "\n", + "\n", + "# Given data\n", + "d0=100# # First receiver distance in meter\n", + "d1=200# # Second receiver distance in meter\n", + "d2=1000# # Third receiver distance in meter\n", + "d3=3000# # Fourth receiver distance in meter\n", + "p0=0# # Receved power of first receiver in dBm\n", + "p1=-20# # Receved power of second receiver in dBm\n", + "p2=-35# # Receved power of third receiver in dBm\n", + "p3=-70# # Receved power of forth receiver in dBm\n", + "\n", + "# a)To find the minimum mean square error\n", + "n=2887.8/654.306# # Loss exponent after differentiating and equating the squared error function with zero\n", + "\n", + "# Displaying the result in command window\n", + "print '\\n Loss exponent = %0.0f'%(n)#\n", + "\n", + "# b)To find the standard deviation about mean value\n", + "P0=-10*n*log10(d0/100)# # The estimate of p0 with path loss model\n", + "P1=-10*n*log10(d1/100)# # The estimate of p1 with path loss model\n", + "P2=-10*n*log10(d2/100)# # The estimate of p2 with path loss model\n", + "P3=-10*n*log10(d3/100)# # The estimate of p3 with path loss model\n", + "J=(p0-P0)**2+(p1-P1)**2+(p2-P2)**2+(p3-P3)**2# # Sum of squared error\n", + "SD=sqrt(J/4)# # The standard deviation about mean value\n", + "\n", + "# Displaying the result in command window\n", + "print '\\n The standard deviation about mean value = %0.2f dB'%(SD)#\n", + "# The decimal point is not given in the answer given in book.\n", + "\n", + "# c)To find received power at d=2 km\n", + "d=2000# # The distance of receiver\n", + "P=-10*n*log10(d/100)# # The estimate of p2 with path loss model\n", + "\n", + "# Displaying the result in command window\n", + "print '\\n The received power (at d=2 km) = %0.2f dBm'%(P)#\n", + "# Answer is varying due to round off error\n", + "\n", + "# d)To find the likelihood that the received signal level at 2 km\n", + "gam=-60# # The received power at 2km will be greater than this power\n", + "z=(gam-P)/SD#\n", + "Pr=(1/2)*(1-erf(z/sqrt(2)))# # The probability that received signal will be greater than -60dBm\n", + "\n", + "# Displaying the result in command window\n", + "print '\\n The probability that received signal will be greater than -60dBm = %0.1f percent'%(Pr*100)#\n", + "# Answer is varying due to round off error\n", + "\n", + "# e)To find the percentage of area within 2 km \n", + "A=92# # From figure 4.18, area receives coverage above -60dBm\n", + "\n", + "# Displaying the result in command window\n", + "print '\\n The percentage of area within 2 km = %0.0f percent'%(A)#" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example no 4.10 Page no. 152" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + " The power at receiver = -95.07 dBm\n" + ] + } + ], + "source": [ + "from __future__ import division\n", + "from math import log10,pi\n", + "# To find the power at receiver\n", + "\n", + "\n", + "# Given data\n", + "d=50*10**3# # Distance between transmitter and receiver in m\n", + "hte=100# # Effective heigth of transmitter in m\n", + "hre=10# # Effective heigth of receiver in m\n", + "EIRP=1*10**3# # Radiated power in Watt\n", + "f=900*10**6# # Operating frequency in Hz\n", + "c=3*10**8# # Speed of ligth in m/s\n", + "lamda=c/f# # operating wavelength in m\n", + "EIRP=20*log10(EIRP)# # Radiated power in dB\n", + "Gr=0# # Receiving gain in dB\n", + "\n", + "Lf=-10*log10(lamda**2/(4*pi*d)**2)# # Free space path loss in dB\n", + "Amu=43# # Attenuation relative to free space in dB from Okumuras curve\n", + "Garea=9# # Gain due to type of environment in dB from Okumuras curve\n", + "Ghte=20*log10(hte/200)# # Base station antenna heigth gain factor for 1000m > hte > 30m\n", + "Ghre=20*log10(hre/3)# # Mobile antenna heigth gain factor for 10m > hre > 3m\n", + "L50=Lf+Amu-Ghte-Ghre-Garea# # Total mean path loss\n", + "\n", + "# The median reeived power\n", + "Pr=EIRP-L50+Gr#\n", + "\n", + "#Displaying the result in command window\n", + "print '\\n The power at receiver = %0.2f dBm'%(Pr)#\n", + "\n", + "#Answer is varrying due to round-off error" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example no 4.11 Page no. 166" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + " The mean path loss at same floor = 130.2 dB\n", + "\n", + " The mean path loss at multiple floor = 108.6 dB\n" + ] + } + ], + "source": [ + "from math import log10\n", + "# To find the mean path loss\n", + "\n", + "\n", + "# Given data\n", + "d0=1# # Reference distance in m\n", + "d=30# # Distance from transmitter in m\n", + "nSF=3.27# # Exponent value for same floor\n", + "nMF=5.22# # Path loss exponent value for multiple floors\n", + "FAF=24.4# # Floor attenuation factor for specified floor in dB\n", + "n=2# # Number of blocks\n", + "PAF=13# # Particular attenuation factor for paricular obstruction in dB\n", + "PLSFd0=31.5# # Attenuation at reference distance for same floor in dB\n", + "PLMFd0=5.5# # Attenuation at reference distance for multiple floor in dB\n", + "\n", + "#Mean path loss at same floor\n", + "PL1=PLSFd0+10*nSF*log10(d/d0)+FAF+n*PAF#\n", + "\n", + "#Mean path loss at multiple floor\n", + "PL2=PLMFd0+10*nMF*log10(d/d0)+n*PAF#\n", + "\n", + "#Displaying the result in command window\n", + "print '\\n The mean path loss at same floor = %0.1f dB'%(PL1)#\n", + "print '\\n The mean path loss at multiple floor = %0.1f dB'%(PL2)#" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example no 4.12 Page no. 167" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + " Far field distance = 4 meter\n" + ] + } + ], + "source": [ + "from __future__ import division\n", + "# To find far field distance for antenna with maximum dimensions and operating frequency\n", + "\n", + "\n", + "# Given data\n", + "D=1# # Maximum dimension in m\n", + "f=600*10**6# # Operating frequency in Hz\n", + "C=3*10**8# # Speed of light in m/sec\n", + "\n", + "lamda=C/f# # Carrier wavelength in m\n", + "\n", + "# To find far field distance\n", + "df=(2*D**2)/lamda# #Far field distance\n", + "\n", + "#Displaying the result in command window\n", + "print '\\n Far field distance = %0.0f meter'%(df)#" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 2", + "language": "python", + "name": "python2" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 2 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython2", + "version": "2.7.9" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/Wireless_Communications_Principles_and_Practices_by_T._S._Rappaport/Chap5.ipynb b/Wireless_Communications_Principles_and_Practices_by_T._S._Rappaport/Chap5.ipynb new file mode 100644 index 00000000..fa49f419 --- /dev/null +++ b/Wireless_Communications_Principles_and_Practices_by_T._S._Rappaport/Chap5.ipynb @@ -0,0 +1,625 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter No.5 : Mobile radio propagation small scale propagation" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example no 5.1 Page no. 180" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + " The received carrier frequency when mobile is moving towards the transmitter = 1850.00017 MHz\n", + "\n", + " The received carrier frequency when mobile is moving away from the transmitter = 1849.999901 MHz\n", + "\n", + " The received carrier frequency when mobile is moving in the direction perpendicular to arrival direction of transmitted signal = 1850 MHz\n" + ] + } + ], + "source": [ + "from __future__ import division\n", + "from math import cos\n", + "# To compute received carrier frequency if mobile is moving a)towards the transmitter b)away from the transmitter c)in the direction perpendicular to arrival direction of transmitted signal\n", + "\n", + "\n", + "# Given data\n", + "fc=1850*10**6# # Carrier frequency in Hz\n", + "c=3*10**8# # Speed of ligth in m/s\n", + "v=60# # Speed of receiver (vehicle) in mph\n", + "v=v*0.44704# # Speed of receiver (vehicle) in m/s\n", + "lamda=0.162##c/f# # Wavelength in m\n", + "\n", + "# a)To compute received carrier frequency if mobile is moving towards the transmitter\n", + "theta=0# # Angle between direction of receiver and transmitter\n", + "fd=(v/lamda)*cos(theta)# # Doppler shift\n", + "f=(fc+fd)*10**-6# # Received carrier frequency in MHz\n", + "\n", + "# Displaying the result in command window\n", + "print '\\n The received carrier frequency when mobile is moving towards the transmitter = %0.5f MHz'%(f)#\n", + "\n", + "# b)To compute received carrier frequency if mobile is moving away from the transmitter\n", + "theta=180# # Angle between direction of receiver and transmitter\n", + "fd=(v/lamda)*cos(theta)# # Doppler shift\n", + "f=(fc+fd)*10**-6# # Received carrier frequency in MHz\n", + "\n", + "# Displaying the result in command window\n", + "print '\\n The received carrier frequency when mobile is moving away from the transmitter = %0.6f MHz'%(f)#\n", + "\n", + "# c)To compute received carrier frequency if mobile is moving in the direction perpendicular to arrival direction of transmitted signal\n", + "theta=90# # Angle between direction of receiver and transmitter\n", + "fd=(v/lamda)*cos(theta)# # Doppler shift\n", + "f=(fc+fd)*10**-6# # Received carrier frequency in MHz\n", + "\n", + "# Displaying the result in command window\n", + "print '\\n The received carrier frequency when mobile is moving in the direction perpendicular to arrival direction of transmitted signal = %0.0f MHz'%(f)#" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example no 5.2 Page no. 189" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + " The time delay width for RF radio channels = 1.5625 microsecond\n", + "\n", + " The time delay width for microcellular channels = 62.5 nanosecond\n", + "\n", + " The time delay width for indoor channels = 7.8125 nanosecond\n", + "\n", + " The maximum RF bandwidth for RF radio channels = 1.28 MHz\n", + "\n", + " The maximum RF bandwidth for microcellular channels = 32 MHz\n", + "\n", + " The maximum RF bandwidth for indoor channels = 256 MHz\n" + ] + } + ], + "source": [ + "from __future__ import division\n", + "# To find a)time delay width (deltat) b)maximum RF bandwidth\n", + "\n", + "\n", + "# Given data\n", + "tN1=100*10**-6# # Excess delays for RF radio channels\n", + "tN2=4*10**-6# # Excess delays for microcellular channels\n", + "tN3=500*10**-9# # Excess delays for indoor channels\n", + "N=64# # Number of multipath bins\n", + "\n", + "# a)To find time delay width (deltat)\n", + "deltat1=(tN1/N)*10**6# # Time delay width for RF radio channels\n", + "deltat2=(tN2/N)*10**9# # Time delay width for microcellular channels\n", + "deltat3=(tN3/N)*10**9# # Time delay width for indoor channels\n", + "\n", + "# Displaying the result in command window\n", + "print '\\n The time delay width for RF radio channels = %0.4f microsecond'%(deltat1)#\n", + "print '\\n The time delay width for microcellular channels = %0.1f nanosecond'%(deltat2)#\n", + "print '\\n The time delay width for indoor channels = %0.4f nanosecond'%(deltat3)#\n", + "\n", + "#b)To find maximum RF bandwidth\n", + "bandwidth1=(2/deltat1)# #Maximum RF bandwidth for RF radio channels in MHZ\n", + "bandwidth2=(2/deltat2)*10**3# #Maximum RF bandwidth for microcellular channels in MHZ\n", + "bandwidth3=(2/deltat3)*10**3# #Maximum RF bandwidth for indoor channels in MHZ\n", + "\n", + "#Displaying the result in command window\n", + "print '\\n The maximum RF bandwidth for RF radio channels = %0.2f MHz'%(bandwidth1)#\n", + "print '\\n The maximum RF bandwidth for microcellular channels = %0.0f MHz'%(bandwidth2)#\n", + "print '\\n The maximum RF bandwidth for indoor channels = %0.0f MHz'%(bandwidth3)#" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example no 5.3 Page no. 190" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + " The narrowband instantaneous power = 292 pW\n", + "\n", + " The narrowband instantaneous power (at t=0.1s) = 79.3 pW\n", + "\n", + " The narrowband instantaneous power (at t=0.2s) = 79.3 pW\n", + "\n", + " The narrowband instantaneous power (at t=0.3s) = 292 pW\n", + "\n", + " The narrowband instantaneous power (at t=0.4s) = 79.3 pW\n", + "\n", + " The narrowband instantaneous power (at t=0.5s) = 79.3 pW\n", + "\n", + " An average narrowband instantaneous power = 150 pW\n", + "\n", + " The wideband received power = 150 pW\n", + "\n", + " Comparing narrowband and wideband received power, it is observed that they are vertually identical. But CW signal fades over observation interval (0-0.5S)\n" + ] + } + ], + "source": [ + "from __future__ import division\n", + "from math import cos,pi,sqrt,sin\n", + "# To find average narrowband power & to compare average narrow band and wideband power\n", + "\n", + "\n", + "# Given data\n", + "v=10# # Velocity of moving mobile\n", + "f=1000*10**6# # Carrier frequency in Hz\n", + "c=3*10**8# # Speed of ligth in air (m/s)\n", + "P1=-70# # Received power of first component in dBm\n", + "P2=P1-3# # Received power of second component in dBm\n", + "theta=0# # Initial phase for both component\n", + "P1=(10**(P1/10))*10**-3# # Received power of first component in Watt\n", + "P2=(10**(P2/10))*10**-3# # Received power of second component in Watt\n", + "lamda=c/f# # Wavelength\n", + "\n", + "# Narrowband instantaneous power \n", + "rt2=(sqrt(P1)*cos(0)+sqrt(P2)*cos(0))**2# # Narrowband instantaneous power in pW\n", + "\n", + "# Displaying the result in command window\n", + "print '\\n The narrowband instantaneous power = %0.0f pW'%(rt2*10**12)#\n", + "\n", + "# Answer is varrying due to round-off error\n", + "\n", + "# To find average narrowband instantaneous power \n", + "t=0.1# # Time interval in seconds\n", + "theta=((2*pi*v*t)/lamda)/10# # Phase interval in rad\n", + "theta=theta*(180/pi)# # Phase interval in degree\n", + "theta1=theta# # Phase of first component at t=0.1s\n", + "theta2=-theta# # Phase of second component at t=0.1s\n", + "rt21=(sqrt(P1)*(complex(cos(pi/180*theta1),sin(pi/180*theta1)))+sqrt(P2)*(complex(cos(pi/180*theta2),sin(pi/180*theta2))))**2# # Narrowband instantaneous power in pW at t=0.1s\n", + "mgrt21=sqrt(((rt21.real))**2+((rt21.imag))**2)#\n", + "\n", + "# Displaying the result in command window\n", + "print '\\n The narrowband instantaneous power (at t=0.1s) = %0.1f pW'%(mgrt21*10**12)#\n", + "\n", + "theta1=theta1+theta# # Phase of first component at t=0.2s\n", + "theta2=theta2-theta# # Phase of second component at t=0.2s\n", + "rt22=(sqrt(P1)*(complex(cos(pi/180*theta1),sin(pi/180*theta1)))+sqrt(P2)*(complex(cos(pi/180*theta2),sin(pi/180*theta2))))**2# # Narrowband instantaneous power in pW at t=0.2s\n", + "mgrt22=sqrt(((rt22.real))**2+((rt22.imag))**2)#\n", + "\n", + "# Displaying the result in command window\n", + "print '\\n The narrowband instantaneous power (at t=0.2s) = %0.1f pW'%(mgrt22*10**12)#\n", + "\n", + "theta1=theta1+theta# # Phase of first component at t=0.3s\n", + "theta2=theta2-theta# # Phase of second component at t=0.3s\n", + "rt23=(sqrt(P1)*(complex(cos(pi/180*theta1),sin(pi/180*theta1)))+sqrt(P2)*(complex(cos(pi/180*theta2),sin(pi/180*theta2))))**2# #Narrowband instantaneous power in pW at t=0.3s\n", + "mgrt23=sqrt(((rt23.real))**2+((rt23.imag))**2)#\n", + "\n", + "# Displaying the result in command window\n", + "print '\\n The narrowband instantaneous power (at t=0.3s) = %0.0f pW'%(mgrt23*10**12)#\n", + "\n", + "mgrt24=mgrt21# # Narrowband instantaneous power in pW at t=0.4s due to repeating phase\n", + "\n", + "# Displaying the result in command window\n", + "print '\\n The narrowband instantaneous power (at t=0.4s) = %0.1f pW'%(mgrt24*10**12)#\n", + "\n", + "mgrt25=mgrt22# # Narrowband instantaneous power in pW at t=0.5s due to repeating phase\n", + "\n", + "# Displaying the result in command window\n", + "print '\\n The narrowband instantaneous power (at t=0.5s) = %0.1f pW'%(mgrt25*10**12)#\n", + "\n", + "rt=(rt2+mgrt21+mgrt22+mgrt23+mgrt24+mgrt25)/6# # The average narrowband instantaneous power in pW\n", + "\n", + "# Displaying the result in command window\n", + "print '\\n An average narrowband instantaneous power = %0.0f pW'%(rt*10**12)#\n", + "\n", + "# Wideband power\n", + "Pwb=(P1+P2)# # Widebnd received power in pW\n", + "\n", + "# Displaying the result in command window\n", + "print '\\n The wideband received power = %0.0f pW'%(Pwb*10**12)#\n", + "\n", + "print '\\n Comparing narrowband and wideband received power, it is observed that they are vertually identical. But CW signal fades over observation interval (0-0.5S)'" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example no 5.4 Page no. 201" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + " The RMS delay spread = 0.5 microseconds\n", + "\n", + " The maximum bit rate = 200 kbps\n" + ] + } + ], + "source": [ + "from __future__ import division\n", + "from math import sqrt\n", + "#To compute a)RMS delay spread b)maximum bit rate\n", + "\n", + "\n", + "#Given data\n", + "t1=0# #Excess delay of first signal\n", + "a1=0# #Power level of first signal in dB\n", + "t2=1*10**-6# #Excess delay of second signal\n", + "a2=0# #Power level of second signal in dB\n", + "a1=10**(a1)# #Power level of first signal in Watt\n", + "a2=10**(a2)# #Power level of second signal in Watt\n", + "\n", + "#a)To compute RMS delay spread\n", + "t=((a1*t1+a2*t2)/(a1+a2))*10**6# #Mean excess delay\n", + "t2=((a1*t1**2+a2*t2**2)/(a1+a2))*10**12# #Mean square excess delay\n", + "sigmat=sqrt(t2-t**2)# #RMS delay spread in microseconds\n", + "\n", + "#Displaying the result in command window\n", + "print '\\n The RMS delay spread = %0.1f microseconds'%(sigmat)#\n", + "\n", + "#b)To compute maximum bit rate\n", + "Ts=(sigmat*10**-6)/0.1# #Sampling time of BPSK modulated signal\n", + "Rs=(1/Ts)*10**-3# #Maximum bit rate in kbps\n", + "\n", + "#Displaying the result in command window\n", + "print '\\n The maximum bit rate = %0.0f kbps'%(Rs)#" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example no 5.5 Page no. 202" + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + " The maximum excess delay (10 dB) = 5 microsecond\n", + "\n", + " The mean excess delay = 4.38 microsecond\n", + "\n", + " The RMS delay spread = 1.37 microsecond\n", + "\n", + " The coherence bandwidth = 146 KHz\n", + "\n", + " Since coherence bandwidth is greater than 30 KHz, AMPS will work without an equalizer. However, GSM requires 200 KHz bandwidth which exceeds coherence bandwidth,\n", + " thus an equalizer would be needed for this channel\n" + ] + } + ], + "source": [ + "from __future__ import division\n", + "from math import sqrt\n", + "# To calculate mean excess delay, rms delay spread and maximum excess delay \n", + "\n", + "\n", + "# Given data\n", + "t10dB=5*10**-6# # By definition of maximum excess delay (10dB)\n", + "t1=0# # Excess delay of first signal in seconds\n", + "a1=-20# # Power level of first signal in dB\n", + "t2=1*10**-6# # Excess delay of second signal in seconds\n", + "a2=-10# # Power level of second signal in dB\n", + "t3=2*10**-6# # Excess delay of third signal in seconds\n", + "a3=-10# # Power level of third signal in dB\n", + "t4=5*10**-6# # Excess delay of fourth signal in seconds\n", + "a4=0# # Power level of fourth signal in dB\n", + "a1=10**(a1/10)# # Power level of first signal in Watt\n", + "a2=10**(a2/10)# # Power level of second signal in Watt\n", + "a3=10**(a3/10)# # Power level of third signal in Watt\n", + "a4=10**(a4/10)# # Power level of fourth signal in Watt\n", + "\n", + "# Mean excess delay\n", + "t=((a1*t1+a2*t2+a3*t3+a4*t4)/(a1+a2+a3+a4))# # Mean excess delay in seconds\n", + "tsquare=((a1*t1**2+a2*t2**2+a3*t3**2+a4*t4**2)/(a1+a2+a3+a4))# # Mean square excess delay\n", + "\n", + "# RMS delay spread\n", + "sigmat=sqrt(tsquare-t**2)# # RMS delay spread\n", + "\n", + "# Coherence bandwidth\n", + "Bc=1/(5*sigmat)# # 50% Coherence bandwidth\n", + "# The answer is varrying due to round-off error\n", + "\n", + "# Displaying the result in command window\n", + "print '\\n The maximum excess delay (10 dB) = %0.0f microsecond'%(t10dB*10**6)#\n", + "print '\\n The mean excess delay = %0.2f microsecond'%(t*10**6)#\n", + "print '\\n The RMS delay spread = %0.2f microsecond'%(sigmat*10**6)#\n", + "print '\\n The coherence bandwidth = %0.0f KHz'%(Bc*10**-3)#\n", + "print '\\n Since coherence bandwidth is greater than 30 KHz, AMPS will work without an equalizer. However, GSM requires 200 KHz bandwidth which exceeds coherence bandwidth,\\n thus an equalizer would be needed for this channel'" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example no 5.6 Page no. 204" + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + " The proper spatial sampling interval for small scale propagation = 1.41 cm\n", + "\n", + " The number of samples required over 10m travel distance = 707\n", + "\n", + " The time required to make these measurements = 0.2 seconds\n", + "\n", + " The Doppler spread for this channel = 316.67 Hz\n" + ] + } + ], + "source": [ + "from __future__ import division\n", + "from math import pi\n", + "# To determine proper spatial sampling interval for small scale propagation, number of samples required over 10m, time required to make these measurements and Doppler spread for this channel\n", + "\n", + "# Given data\n", + "fc=1900*10**6# # Carrier frequency in Hz\n", + "v=50# # Velocity of propagation in m/s\n", + "c=3*10**8# # Speed of ligth in air in m/s\n", + "Tc=(9*c)/(16*pi*v*fc)# # Coherence time\n", + "\n", + "# The spatial sampling interval\n", + "deltax=(v*Tc)/2# # Spatial sampling interval in meter\n", + "\n", + "# The number of samples required over 10m travel distance\n", + "d=10# # Distance to be travelled\n", + "Nx=d/deltax# # Number of samples required over 10m\n", + "# Answer is varrying due to round-off error\n", + "\n", + "# The time required to make these measurements\n", + "t=d/v# # Time required to make these measurements\n", + "\n", + "# Doppler spread for this channel\n", + "BD=(v*fc)/c# # Doppler spread for this channel\n", + "# Answer is varrying due to round-off error\n", + "\n", + "# Displaying the result in command window\n", + "print '\\n The proper spatial sampling interval for small scale propagation = %0.2f cm'%(deltax*10**2)#\n", + "print '\\n The number of samples required over 10m travel distance = %0.0f'%(Nx)#\n", + "print '\\n The time required to make these measurements = %0.1f seconds'%(t)#\n", + "print '\\n The Doppler spread for this channel = %0.2f Hz'%(BD)#" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example no 5.7 Page no. 224" + ] + }, + { + "cell_type": "code", + "execution_count": 12, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + " The positive-going level crossing rate = 18.44 crossings per second\n", + "\n", + " The maximum velocity of mobile = 24 Km/Hr\n" + ] + } + ], + "source": [ + "from math import exp,pi,sqrt\n", + "from __future__ import division\n", + "# To compute the positive-going lvel crossing rate and maximum velocity of mobile\n", + "\n", + "\n", + "\n", + "# Given data\n", + "rho=1# # Value of normalized level of fading amplitude to rms amplitude\n", + "fm=20# # Maximum Doppler frequency in Hz\n", + "fc=900*10**6# # Carrier frequency in Hz\n", + "c=3*10**8# # Speed of ligth in air in m/s\n", + "\n", + "# The positive-going level crossing rate\n", + "NR=sqrt(2*pi)*fm*rho*exp(-rho**2)# # Number of zero level crossings per second\n", + "lamda=c/fc# # Carrier wavelength\n", + "\n", + "# The maximum velocity of mobile\n", + "v=fm*lamda# # Maximum velocity of mobile in m/s\n", + "v=v*(18/5)# # Maximum velocity of mobile in km/hr\n", + "\n", + "# Displaying the result in command window\n", + "print '\\n The positive-going level crossing rate = %0.2f crossings per second'%(NR)#\n", + "print '\\n The maximum velocity of mobile = %0.0f Km/Hr'%(v)#" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example no 5.8 Page no. 225" + ] + }, + { + "cell_type": "code", + "execution_count": 13, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + " The average fade duration (for rho = 0.01) = 19.9 microseconds\n", + "\n", + " The average fade duration (for rho = 0.1) = 200 microseconds\n", + "\n", + " The average fade duration (for rho = 1) = 3.43 microseconds\n" + ] + } + ], + "source": [ + "from math import exp,pi,sqrt\n", + "from __future__ import division\n", + "\n", + "# To find the average fade duration\n", + "\n", + "\n", + "# Given data\n", + "rho1=0.01# # Threshold level\n", + "rho2=0.1# # Threshold level\n", + "rho3=1# # Threshold level\n", + "fm=200# # Doppler frequency\n", + "\n", + "t1=(exp(rho1**2)-1)/(rho1*fm*sqrt(2*pi))# # The average fade duration\n", + "t2=(exp(rho2**2)-1)/(rho2*fm*sqrt(2*pi))# # The average fade duration\n", + "t3=(exp(rho3**2)-1)/(rho3*fm*sqrt(2*pi))# # The average fade duration\n", + "\n", + "# Displaying the result in command window\n", + "print '\\n The average fade duration (for rho = 0.01) = %0.1f microseconds'%(t1*10**6)#\n", + "print '\\n The average fade duration (for rho = 0.1) = %0.0f microseconds'%(t2*10**6)#\n", + "print '\\n The average fade duration (for rho = 1) = %0.2f microseconds'%(t3*10**3)#" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example no 5.9 Page no. 225" + ] + }, + { + "cell_type": "code", + "execution_count": 15, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + " The average fade duration (for rho = 0.707) = 18.3 ms\n", + "\n", + " The bit period = 20 ms\n", + "\n", + " Since the bit period is greater than average fade duration, for 50bps datarate the signal undergoes fast Rayleigh fading.\n", + "\n", + " \n", + " The average fade duration of the threshold level below which bit error occurs (for rho = 0.1) = 0.002\n", + "\n", + " Since the average fade duration of the threshold level below which bit error occurs is less than duration of one bit,\n", + " only one bit on average will be lost\n" + ] + } + ], + "source": [ + "from math import exp,pi,sqrt\n", + "from __future__ import division\n", + "\n", + "# To find the average fade duration and average number of bit errors per second. & to determine whether the fading is slow or fast.\n", + "\n", + "# Given data\n", + "rho=0.707# # Threshold level\n", + "fm=20# # Doppler frequency\n", + "datarate=50# # Bit duration of binary digital modulation in bps\n", + "errho=0.1# # Threshold level below which bit error occurs\n", + "\n", + "t=(exp(rho**2)-1)/(rho*fm*sqrt(2*pi))# # The average fade duration \n", + "tb=1/datarate# # Bit period\n", + "t1=(exp(errho**2)-1)/(errho*fm*sqrt(2*pi))# # The average fade duration \n", + "\n", + "# Displaying the result in command window\n", + "print '\\n The average fade duration (for rho = 0.707) = %0.1f ms'%(t*10**3)#\n", + "print '\\n The bit period = %0.0f ms'%(tb*10**3)#\n", + "print '\\n Since the bit period is greater than average fade duration, for 50bps datarate the signal undergoes fast Rayleigh fading.'\n", + "print '\\n \\n The average fade duration of the threshold level below which bit error occurs (for rho = 0.1) = %0.3f'%(t1)#\n", + "print '\\n Since the average fade duration of the threshold level below which bit error occurs is less than duration of one bit,\\n only one bit on average will be lost'" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 2", + "language": "python", + "name": "python2" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 2 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython2", + "version": "2.7.9" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/Wireless_Communications_Principles_and_Practices_by_T._S._Rappaport/Chap6.ipynb b/Wireless_Communications_Principles_and_Practices_by_T._S._Rappaport/Chap6.ipynb new file mode 100644 index 00000000..b84f6c2f --- /dev/null +++ b/Wireless_Communications_Principles_and_Practices_by_T._S._Rappaport/Chap6.ipynb @@ -0,0 +1,710 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter No.6 : Modulation techniques for mobile radio" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example no 6.1 Page no. 260" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + " The carrier power = 8.47 kW\n", + "\n", + " The percentage of total power in carrier power = 84.7 percentage\n", + "\n", + " The power in each sideband = 0.763 kW\n" + ] + } + ], + "source": [ + "# To compute the carrier power, percentage of total power in carrier power and power in each sideband.\n", + "\n", + "\n", + "# Given data\n", + "PAM=10*10**3# # Power of transmitted AM signal\n", + "k=0.6# # Modulation index\n", + "\n", + "# To compute the carrier power\n", + "Pc=PAM/(1+k**2/2)# # The carrier power\n", + "\n", + "# To compute percentage of total power in carrier power\n", + "PercentPc=(Pc/PAM)*100# # Percentage of total power in carrier power\n", + "\n", + "# To compute power in each sideband\n", + "Psideband=(PAM-Pc)/2# # The power in each sideband\n", + "# Answer is varrying due to round-off error\n", + "\n", + "# Displaying the result in command window\n", + "print '\\n The carrier power = %0.2f kW'%(Pc*10**-3)#\n", + "print '\\n The percentage of total power in carrier power = %0.1f percentage'%(PercentPc)#\n", + "print '\\n The power in each sideband = %0.3f kW'%(Psideband*10**-3)#" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example no 6.2 Page no. 265" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + " The peak frequency deviation = 40 kHz\n", + "\n", + " The modulation index = 10\n" + ] + } + ], + "source": [ + "# To compute a)the peak frequency deviation b)the modulation index.\n", + "\n", + "\n", + "# Given data\n", + "kf=10*10**3# # Frequency deviation constant gain in Hz/V\n", + "fm=4*10**3# # Modulating frequency in Hz\n", + "A=4# # Maximum instantaneous value of input signal in V\n", + "\n", + "# To compute the peak frequency deviation\n", + "deltaf=A*kf# # The peak frequency deviation in Hz\n", + "\n", + "# To compute the modulation index\n", + "betaf=deltaf/fm# # The modulation index\n", + "\n", + "# Displaying the result in command window\n", + "print '\\n The peak frequency deviation = %0.0f kHz'%(deltaf*10**-3)#\n", + "print '\\n The modulation index = %0.0f'%(betaf)#" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example no 6.3 Page no. 267" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + " Using Carson rule, the IF bandwidth occupied by FM signal = 1200 kHz\n" + ] + } + ], + "source": [ + "# To determine the IF bandwidth necessary to pass the given signal.\n", + "\n", + "\n", + "# Given data\n", + "fm=100*10**3# # Modulating frequency in Hz\n", + "deltaf=500*10**3# # Peak frequency deviation in Hz\n", + "betaf=deltaf/fm# # Modulation index\n", + "\n", + "# The IF bandwidth occupied by FM signal using Carson's rule\n", + "BT=2*(betaf+1)*fm# # The IF bandwidth necessary to pass the given signal\n", + "\n", + "# Displaying the result in command window\n", + "print '\\n Using Carson rule, the IF bandwidth occupied by FM signal = %0.0f kHz'%(BT*10**-3)#" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example no 6.4 Page no. 273" + ] + }, + { + "cell_type": "code", + "execution_count": 11, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + " Value of Resistor required for RLC circuit = 1.273 kohm\n", + "\n", + " Value of Inductor required for RLC circuit = 10 microH\n", + "\n", + " Value of Capacitor required for RLC circuit = 10 pF\n" + ] + }, + { + "data": { + "image/png": "iVBORw0KGgoAAAANSUhEUgAAAY8AAAEZCAYAAABvpam5AAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3XmYXGWZ///3JwECIewJq0AiSQhggIAGXBiiKCKrGBRB\nZRgd1HFwH8fRUQNu6Nflp47LICLIIsiqqDCKShCQRUiHgEA0kMiSEFlCyEq2z++P5yn6dKW6u6q7\nuqu66n5dV11dfdanTk76rme7j2wTQggh1GJYowsQQghh6IngEUIIoWYRPEIIIdQsgkcIIYSaRfAI\nIYRQswgeIYQQahbBI7QVSfdL+qc6Hm+BpCPqdbwQhooIHmHQ5D+0L0jaoWx5h6QNkvYY6DLYfpnt\nP+bzniXp4v4eMr9CaCsRPMJgMvAIcEppgaTJwBa0+R9gSZs0ugwh1CKCRxhslwCnFX7/Z+AiQKUF\nko7Jt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5bbvzinDV9peD/wI+BXp8QNLuzlGaHG2T+lm1Zu62f7sgShHBI/Qjip9u39xme0bJe0D3J4H\nXy0jPf+gQ9LPSI9A/gcpzXep9vF14IrcIf7rwvF+RBrlMis3J/wDOJFu+khsr5V0MvA/krYg9bO8\nAVhhe5akpUSTVWgCMUkwhD6SNANYbvsbg3S+XYGbbFcawx/CoIqhuiH0z6B8+5J0GnAH8OnBOF8I\nvYmaRwghhJpFzSOEEELNIniEEEKoWQSPEEIINYvgEUIIoWYRPEIIIdQsgkcIIYSa/f9WprwvSAz2\nxAAAAABJRU5ErkJggg==\n", + "text/plain": [ + "<matplotlib.figure.Figure at 0x7f9a53a33e50>" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "source": [ + "from numpy import arange\n", + "from math import sqrt,pi,tan,atan\n", + "%matplotlib inline\n", + "from matplotlib.pyplot import plot,subplot,title,show,xlabel,ylabel\n", + "# To design an RLC network that implements an IF quadrature FM detector \n", + "\n", + "# Given data\n", + "fc=10.7*10**6# #Cut-off frequency in Hz\n", + "B=500*10**3# #Bandwidth in Hz\n", + "phi=5# #phase shift for good system in degree\n", + "Q=tan(pi/180*phi)/((fc+B/2)/fc-fc/(fc+B/2))# #Q-factor\n", + "L=10*10**(-6)# #Chosen value of inductor\n", + "R=Q*2*pi*fc*L# #Value of Resistor\n", + "c1=12.13*10**(-12)# #Chosen value of C1\n", + "c=(Q/(R*2*pi*fc))-c1# #Value of capacitor\n", + "\n", + "# Displaying the result in command window\n", + "print '\\n Value of Resistor required for RLC circuit = %0.3f kohm'%(R*10**(-3))#\n", + "print '\\n Value of Inductor required for RLC circuit = %0.0f microH'%(L*10**(6))#\n", + "print '\\n Value of Capacitor required for RLC circuit = %0.0f pF'%(c*10**(12))#\n", + "\n", + "# Magnitude plot\n", + "f=arange(0.95*10**7,1.2*10**7+0.1,0.05*10**7) # Frequency range for plotting in Hz\n", + "mgh=[]\n", + "for ff in f:\n", + " mgh.append((2*pi*ff*R*c1)/sqrt(1+Q**2*((ff**2-fc**2)/(ff*fc))**2)) # Magnitude transfer function\n", + "subplot(311)#\n", + "plot(f,mgh)#\n", + "#a=gca()#\n", + "#a.data_bounds=[0.95*10**7 0#1.2*10**7 2]# # To see the vertical line hiddden by the y axis\n", + "xlabel(\"Frequency\")#\n", + "ylabel(\"Magnitude\")\n", + "title(\"Magnitude response\")\n", + "\n", + "# Phase plot\n", + "f=0.95*10**7 # Initial frequency for plotting\n", + "phH=[]\n", + "for i in range(0,6):\n", + " if f<1.25*10**7 :\n", + " phH.append((pi/2)+atan(Q*((f**2-fc**2)/(f*fc)))) # Phase transfer function\n", + " f=f+0.05*10**7#\n", + " \n", + "f=arange(0.95*10**7,1.2*10**7+0.1,0.05*10**7)\n", + "subplot(313)#\n", + "plot(f,phH)#\n", + "#a=gca()#\n", + "#a.data_bounds=[0.95*10**7 1.2#1.2*10**7 2]# # To see the vertical line hiddden by the y axis\n", + "xlabel(\"Frequency\")\n", + "ylabel(\"Phase\")\n", + "title(\"Phase response\")\n", + "show()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example no 6.5 Page no. 277" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + " Using Carson rule, the analog bandwidth at 3 modulation index occupied by FM signal = 40 KHz\n", + "\n", + " Using Carson rule, the analog bandwidth at 5 modulation index occupied by FM signal = 60 KHz\n", + "\n", + " Improvement in output SNR by increasing modulation index = 6.2 dB\n", + "\n", + " \n", + " This improvement is achieved at the expenses of bandwidth. For modulation index = 3, a bandwidth of 40kHz is needed,\n", + " while for modulation index = 5 requires bandwidth = 60kHz.\n" + ] + } + ], + "source": [ + "from math import log10\n", + "# To determine the analog bandwidth, output SNR improvement if modulation index is increased from 3 to 5 and tradeoff bandwidth for this improvement.\n", + "\n", + "\n", + "# Given data\n", + "fm=5*10**3# # Audio bandwidth of FM signal\n", + "betaf1=3# # Initial modulation index\n", + "betaf2=5# # Final modulation index\n", + "\n", + "# To determine analog bandwidth\n", + "BT1=2*(betaf1+1)*fm# # The analog bandwidth\n", + "BT2=2*(betaf2+1)*fm# # The analog bandwidth\n", + "\n", + "# To determine output SNR improvement factor\n", + "SNR1=3*betaf1**3+3*betaf1**2# # Output SNR factor for modulation index=3\n", + "SNR1=10*log10(SNR1)# # Output SNR factor for modulation index=3 in dB\n", + "SNR2=3*betaf2**3+3*betaf2**2# # Output SNR factor for modulation index=3\n", + "SNR2=10*log10(SNR2)# # Output SNR factor for modulation index=3 in dB\n", + "\n", + "# To determine improvement in output SNR by increasing modulation index\n", + "improvedSNR=SNR2-SNR1# # Improvement in output SNR by increasing modulation index\n", + "\n", + "# Displaying the result in command window\n", + "print '\\n Using Carson rule, the analog bandwidth at 3 modulation index occupied by FM signal = %0.0f KHz'%(BT1*10**-3)#\n", + "print '\\n Using Carson rule, the analog bandwidth at 5 modulation index occupied by FM signal = %0.0f KHz'%(BT2*10**-3)#\n", + "print '\\n Improvement in output SNR by increasing modulation index = %0.1f dB'%(improvedSNR)#\n", + "print '\\n \\n This improvement is achieved at the expenses of bandwidth. For modulation index = 3, a bandwidth of 40kHz is needed,\\n while for modulation index = 5 requires bandwidth = 60kHz.'" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example no 6.6 Page no. 280" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + " The maximum theoretical datarate = 199.75 kbps\n", + "\n", + " The USDC data rate is 48.6 kbps, which is only about one fourth the theoretical limit under 20dB SNR condition.\n" + ] + } + ], + "source": [ + "from math import log10\n", + "# To determine the maximum theoretical datarate and to compare this rate to US digital cellular standard\n", + "\n", + "\n", + "# Given data\n", + "SNR=20# # Signal to noise ratio of wireless communication link in dB\n", + "B=30*10**3# # RF bandwidth in Hz\n", + "SNR=10**(SNR/10)# # Signal to noise ratio of wireless communication link\n", + "\n", + "# To determine the maximum theoretical datarate \n", + "C=B*(log10(1+SNR)/log10(2))# # The maximum theoretical datarate in bps\n", + "\n", + "# Displaying the result in command window\n", + "print '\\n The maximum theoretical datarate = %0.2f kbps'%(C*10**-3)#\n", + "print '\\n The USDC data rate is 48.6 kbps, which is only about one fourth the theoretical limit under 20dB SNR condition.'" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example no 6.7 Page no. 280" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + " The maximum theoretical datarate for 10dB SNR = 691.886 kbps\n", + "\n", + " The maximum theoretical datarate for 30dB SNR = 1.99 Mbps\n", + "\n", + " \n", + " The GSM data rate is 270.833 kbps, which is only about 40 percent of the theoretical limit of 10dB SNR condition\n", + " and about 14 percent of theoretical limit of 30dB SNR condition\n" + ] + } + ], + "source": [ + "from math import log10\n", + "# To determine the maximum theoretical datarate and to compare this rate to GSM standard\n", + "\n", + "\n", + "# Given data\n", + "SNR1=10# # Signal to noise ratio in dB\n", + "SNR2=30# # Signal to noise ratio in dB\n", + "B=200*10**3# # RF bandwidth of channel in Hz\n", + "\n", + "SNR1=10**(SNR1/10)# # Signal to noise ratio\n", + "SNR2=10**(SNR2/10)# # Signal to noise ratio\n", + "\n", + "# To determine the maximum theoretical datarate\n", + "C1=B*(log10(1+SNR1)/log10(2))# # The maximum theoretical datarate for SNR=10dB\n", + "C2=B*(log10(1+SNR2)/log10(2))# # The maximum theoretical datarate for SNR=30dB\n", + "\n", + "# Displaying the result in command window\n", + "print '\\n The maximum theoretical datarate for 10dB SNR = %0.3f kbps'%(C1*10**-3)#\n", + "print '\\n The maximum theoretical datarate for 30dB SNR = %0.2f Mbps'%(C2*10**-6)#\n", + "print '\\n \\n The GSM data rate is 270.833 kbps, which is only about 40 percent of the theoretical limit of 10dB SNR condition\\n and about 14 percent of theoretical limit of 30dB SNR condition'" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example no 6.8 Page no. 291" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + " The first zero-crossing RF bandwidth of rectangular pulse = 48.71 kHz\n", + "\n", + " The first zero-crossing RF bandwidth of cosine filter pulse = 32.88 kHz\n" + ] + } + ], + "source": [ + "# To find the first zero-crossing RF bandwidth of rectangular pulse and compare to raised cosine filter pulse\n", + "\n", + "\n", + "# Given data\n", + "RectTs=41.06*10**-6# # Symbol period of rectangular pulse\n", + "cosineTs=41.06*10**-6# # Symbol period of cosine filter pulse\n", + "alpha=0.35# # Rolloff factor of cosine filter pulse\n", + "\n", + "# To find the first zero-crossing RF bandwidth of rectangular pulse\n", + "B1=2/RectTs# # The first zero-crossing RF bandwidth of rectangular pulse\n", + "\n", + "# The first zero-crossing RF bandwidth of cosine filter pulse\n", + "B2=(1/cosineTs)*(1+alpha)# # The first zero-crossing RF bandwidth of cosine filter pulse\n", + "\n", + "# Displaying the result in command window\n", + "print '\\n The first zero-crossing RF bandwidth of rectangular pulse = %0.2f kHz'%(B1*10**-3)#\n", + "print '\\n The first zero-crossing RF bandwidth of cosine filter pulse = %0.2f kHz'%(B2*10**-3)#" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example no 6.9 Page no. 307" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + " Phase of signal during transmission of first bit pair 00 = -135 degree\n", + "\n", + " In-phase pulse produced during transmission of first bit pair 00 = -0.707\n", + "\n", + " Quadrature pulse produced during transmission of first bit pair 00 = -0.707\n", + "\n", + " \n", + " Phase of signal during transmission of second bit pair 10 = -180 degree\n", + "\n", + " In-phase pulse produced during transmission of second bit pair 10 = -1\n", + "\n", + " Quadrature pulse produced during transmission of second bit pair 10 = -0\n", + "\n", + " \n", + " Phase of signal during transmission of third bit pair 11 = -135 degree\n", + "\n", + " In-phase pulse produced during transmission of third bit pair 11 = -0.707\n", + "\n", + " Quadrature pulse produced during transmission of third bit pair 11 = -0.707\n" + ] + } + ], + "source": [ + "from math import pi,sin,cos\n", + "# To determine phase and values of Ik and Qk during transmission of bit stream 001011 using pi/4 DQPSK.\n", + "\n", + "\n", + "# Given data\n", + "theta0=0# # Initial phase in rad\n", + "phi1=pi/4# # Carrier phase shift for the input bit pair 11 [Feh91], [Rap91b]\n", + "phi2=(3*pi)/4# # Carrier phase shift for the input bit pair 01 [Feh91], [Rap91b]\n", + "phi3=(-3*pi)/4# # Carrier phase shift for the input bit pair 00 [Feh91], [Rap91b]\n", + "phi4=-pi/4# # Carrier phase shift for the input bit pair 10 [Feh91], [Rap91b]\n", + "\n", + "# For transmission of first pair of bits 00\n", + "theta1=theta0+phi3# # Phase of signal during transmission of first bit pair 00\n", + "I1=cos(theta1)# # In-phase pulse produced at the output of signal mapping\n", + "Q1=sin(theta1)# # Quadrature pulse produced at the output of signal mapping\n", + "\n", + "# For transmission of second pair of bits 10\n", + "theta2=theta1+phi4# # Phase of signal during transmission of second bit pair 10\n", + "I2=cos(theta2)# # In-phase pulse produced at the output of signal mapping\n", + "Q2=sin(theta2)# # Quadrature pulse produced at the output of signal mapping\n", + "\n", + "# For transmission of third pair of bits 11\n", + "theta3=theta2+phi1# # Phase of signal during transmission of third bit pair 11\n", + "I3=cos(theta3)# # In-phase pulse produced at the output of signal mapping\n", + "Q3=sin(theta3)# # Quadrature pulse produced at the output of signal mapping\n", + "\n", + "# Displaying the result in command window\n", + "print '\\n Phase of signal during transmission of first bit pair 00 = %0.0f degree'%(theta1*(180/pi))#\n", + "print '\\n In-phase pulse produced during transmission of first bit pair 00 = %0.3f'%(I1)#\n", + "print '\\n Quadrature pulse produced during transmission of first bit pair 00 = %0.3f'%(Q1)#\n", + "\n", + "print '\\n \\n Phase of signal during transmission of second bit pair 10 = %0.0f degree'%(theta2*(180/pi))#\n", + "print '\\n In-phase pulse produced during transmission of second bit pair 10 = %0.0f'%(I2)#\n", + "print '\\n Quadrature pulse produced during transmission of second bit pair 10 = %0.0f'%(Q2)#\n", + "\n", + "print '\\n \\n Phase of signal during transmission of third bit pair 11 = %0.0f degree'%(theta3*(180/pi))#\n", + "print '\\n In-phase pulse produced during transmission of third bit pair 11 = %0.3f'%(I3)#\n", + "print '\\n Quadrature pulse produced during transmission of third bit pair 11 = %0.3f'%(Q3)#" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example no 6.10 Page no. 310" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "S1 = 0\n", + "\n", + " S2 = 0\n", + "\n", + " S3 = 1\n", + "\n", + " S4 = 0\n", + "\n", + " S5 = 1\n", + "\n", + " S6 = 1\n" + ] + } + ], + "source": [ + "# To demonstrate how the received signal is detected properly using baseband differential detector.\n", + "\n", + "\n", + "# Given data\n", + "x1=-0.707#\n", + "y1=-0.707#\n", + "x2=0.707#\n", + "y2=-0.707#\n", + "x3=0.707#\n", + "y3=0.707#\n", + "\n", + "if x1<0:\n", + " print 'S1 = 0'\n", + "else:\n", + " print '\\n S1 = 1' \n", + " \n", + "if y1<0:\n", + " print '\\n S2 = 0'\n", + "else:\n", + " print '\\n S2 = 1' \n", + "\n", + "if x2<0 :\n", + " print '\\n S3 = 0'\n", + "else:\n", + " print '\\n S3 = 1' \n", + " \n", + "if y2<0:\n", + " print '\\n S4 = 0'\n", + "else:\n", + " print '\\n S4 = 1' \n", + " \n", + "if x3<0:\n", + " print '\\n S5 = 0'\n", + "else:\n", + " print '\\n S5 = 1' \n", + " \n", + "if y3<0 :\n", + " print '\\n S6 = 0'\n", + "else:\n", + " print '\\n S6 = 1' " + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example no 6.11 Page no. 321" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + " The 3-dB bandwidth-bit duration product = 67.500 kHz\n", + "\n", + " The 90 percent power bandwidth = 153.9 kHz\n" + ] + } + ], + "source": [ + "from __future__ import division\n", + "# To find 3-dB bandwidth for gaussian low pass filter to produce 0.25GMSK, 90% power bandwidth.\n", + "\n", + "\n", + "# Given data\n", + "Rb=270*10**3# # Channel data rate in bps\n", + "BT=0.25# # 3-dB bandwidth-bit duration product\n", + "\n", + "T=1/Rb# # Time\n", + "B=BT/T# # 3-dB bandwidth in Hz\n", + "# Answer is varrying due to round-off error\n", + "\n", + "# 90% power bandwidth\n", + "B1=0.57*Rb# # The 90% power bandwidth\n", + "# Answer is varrying due to round-off error\n", + "\n", + "# Displaying the result in command window\n", + "print '\\n The 3-dB bandwidth-bit duration product = %0.3f kHz'%(B*10**-3)#\n", + "print '\\n The 90 percent power bandwidth = %0.1f kHz'%(B1*10**-3)#" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example no 6.12 Page no. 321" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + " The 3-dB bandwidth-bit duration product = 66.500 kHz\n", + "\n", + " The 90 percent power bandwidth = 108.3 kHz\n" + ] + } + ], + "source": [ + "from __future__ import division\n", + "# To find 3-dB bandwidth for gaussian low pass filter to produce 0.25GMSK, 90% power bandwidth.\n", + "\n", + "\n", + "# Given data\n", + "Rb=190*10**3# # Channel data rate in bps\n", + "BT=0.35# # 3-dB bandwidth-bit duration product\n", + "\n", + "T=1/Rb# # Time\n", + "B=BT/T# # 3-dB bandwidth in Hz\n", + "# Answer is varrying due to round-off error\n", + "\n", + "# 90% power bandwidth\n", + "B1=0.57*Rb# # The 90% power bandwidth\n", + "# Answer is varrying due to round-off error\n", + "\n", + "# Displaying the result in command window\n", + "print '\\n The 3-dB bandwidth-bit duration product = %0.3f kHz'%(B*10**-3)#\n", + "print '\\n The 90 percent power bandwidth = %0.1f kHz'%(B1*10**-3)#" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 2", + "language": "python", + "name": "python2" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 2 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython2", + "version": "2.7.9" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/Wireless_Communications_Principles_and_Practices_by_T._S._Rappaport/Chap7.ipynb b/Wireless_Communications_Principles_and_Practices_by_T._S._Rappaport/Chap7.ipynb new file mode 100644 index 00000000..bc08f60a --- /dev/null +++ b/Wireless_Communications_Principles_and_Practices_by_T._S._Rappaport/Chap7.ipynb @@ -0,0 +1,144 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter No.7 : Equalization diversity and channel coding" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example no 7.3 Page no. 373" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + " The maximum Doppler shift = 66.67 Hz\n", + "\n", + " The coherence time of the channel = 6.35 ms\n", + "\n", + " The maximum number of symbols that could be transmitted with symbol rate 24.3 ksymbols/sec = 154 symbols\n" + ] + } + ], + "source": [ + "from __future__ import division\n", + "from math import pi,sqrt\n", + "# To determine a)the maximum Doppler shift b)the coherence time of the channel c)the maximum number of symbolsthat could be transmitted\n", + "\n", + "\n", + "#Given data\n", + "f=900*10**6# # Carrier frequency in Hz\n", + "c=3*10**8# # Speed of ligth in air (m/s)\n", + "v=80# # Velocity of mobile in km/hr\n", + "v=v*(5/18)# # Velocity of mobile in m/s\n", + "lamda=c/f# # Carrier wavelength in meter\n", + "\n", + "# a)To determine the maximum Doppler shift\n", + "fd=v/lamda# # The maximum Doppler shift in Hz\n", + "\n", + "# b)To determine the coherence time of the channel\n", + "Tc=sqrt(9/(16*pi*fd**2))# # The coherence time of the channel\n", + "# Answer is varrying due to round-off error\n", + "\n", + "# c)To determine the maximum number of symbols that could be transmitted with symbol rate 24.3 ksymbols/sec\n", + "Rs=24.3*10**3# # Symbol rate in symbols/sec\n", + "Nb=Tc*Rs# # The maximum number of transmitted symbols\n", + "\n", + "# Displaying the result in command window\n", + "print '\\n The maximum Doppler shift = %0.2f Hz'%(fd)#\n", + "print '\\n The coherence time of the channel = %0.2f ms'%(Tc*10**3)#\n", + "print '\\n The maximum number of symbols that could be transmitted with symbol rate 24.3 ksymbols/sec = %0.0f symbols'%(Nb)#" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example no 7.4 Page no. 383" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + " Probability that the SNR will drop below 10dB when 4 branch diversity is used = 0.000082\n", + "\n", + " Probability that the SNR will drop below 10dB when single branch diversity is used = 0.095\n", + "\n", + " \n", + " From above results, it is observed that without diversity the SNR drops below the specified threshold with a probability that is three orders of magnitude greater \n", + " than if four branch diversity is used.\n" + ] + } + ], + "source": [ + "from __future__ import division\n", + "from math import exp\n", + "# To determine probability that the SNR will drop below threshold SNR\n", + "\n", + "\n", + "# Given data\n", + "M1=4# # Number of branch diversity\n", + "M2=1# # Number of branch diversity\n", + "gamm=10# # Specified SNR threshold in dB\n", + "gamm=10**(gamm/10)# # Specified SNR threshold\n", + "Gamma=20# # Average SNR in dB\n", + "Gamma=10**(Gamma/10)# # Average SNR\n", + "\n", + "# Probability that the SNR will drop below 10dB when 4 branch diversity is used\n", + "P4=(1-exp(-gamm/Gamma))**M1# # Probability that the SNR will drop below 10dB\n", + "\n", + "# Probability that the SNR will drop below 10dB when single branch diversity is used\n", + "P1=(1-exp(-gamm/Gamma))**M2# # Probability that the SNR will drop below 10dB\n", + "\n", + "# Displaying the result in command window\n", + "print '\\n Probability that the SNR will drop below 10dB when 4 branch diversity is used = %0.6f'%(P4)#\n", + "print '\\n Probability that the SNR will drop below 10dB when single branch diversity is used = %0.3f'%(P1)#\n", + "print '\\n \\n From above results, it is observed that without diversity the SNR drops below the specified threshold with a probability that is three orders of magnitude greater \\n than if four branch diversity is used.'" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 2", + "language": "python", + "name": "python2" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 2 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython2", + "version": "2.7.9" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/Wireless_Communications_Principles_and_Practices_by_T._S._Rappaport/Chap8.ipynb b/Wireless_Communications_Principles_and_Practices_by_T._S._Rappaport/Chap8.ipynb new file mode 100644 index 00000000..dc21d23c --- /dev/null +++ b/Wireless_Communications_Principles_and_Practices_by_T._S._Rappaport/Chap8.ipynb @@ -0,0 +1,299 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter No. 8 : Speech coding" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example no 8.1 Page no. 420" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + " The mean square error distortion = 0.333\n", + "\n", + " The output signal-to-distortion ratio = 19.82 dB\n", + "\n", + " To minimize the distortion, we need to place the quantization levels closer at amplitudes close to 8 and farther at amplitudes close to zero.\n", + "\n", + " This quantizer would be optimal for an input with a uniform pdf.\n" + ] + } + ], + "source": [ + "from sympy.mpmath import quad\n", + "from math import log10\n", + "# To compute the mean square error distortion and output signal-to-distortion ratio.\n", + "\n", + "#Given data\n", + "l1=1# # 1st Quantization level\n", + "l2=3# # 2nd Quantization level\n", + "l3=5# # 3rd Quantization level\n", + "l4=7# # 4th Quantization level\n", + "\n", + "U1=(l1+l2)/2# # upper boundary of 1st level\n", + "U2=(l2+l3)/2# # upper boundary of 2nd level\n", + "U3=(l3+l4)/2# # upper boundary of 3rd level\n", + "U4=l4+(U1-l1)# # upper boundary of 4th level\n", + "L1=l1-(U1-l1)# # Lower boundary of 1st level\n", + "\n", + "D1=quad(lambda x:(x**3-2*x**2+x)/32,[L1,U1]) # Mean square error distortion of 1st level\n", + "D2=quad(lambda x:(x**3-6*x**2+9*x)/32,[U1,U2])# # Mean square error distortion of 2nd level\n", + "D3=quad(lambda x:(x**3-10*x**2+25*x)/32,[U2,U3])# # Mean square error distortion of 3rd level\n", + "D4=quad(lambda x:(x**3-14*x**2+49*x)/32,[U3,U4])# # Mean square error distortion of 4th level\n", + "D=D1+D2+D3+D4# # Total square error distortion\n", + "\n", + "P=quad(lambda x:x**3/32,[L1,U4])# # Signal power\n", + "\n", + "SDR=10*log10(P/D)# # Output signal-to-distortion ratio.\n", + "\n", + "# Displaying the result in command window\n", + "print '\\n The mean square error distortion = %0.3f'%(D)#\n", + "print '\\n The output signal-to-distortion ratio = %0.2f dB'%(SDR)#\n", + "print '\\n To minimize the distortion, we need to place the quantization levels closer at amplitudes close to 8 and farther at amplitudes close to zero.'\n", + "print '\\n This quantizer would be optimal for an input with a uniform pdf.'" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example no 8.2 Page no. 424" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + " Effective transmission bit rate = 64.5 kbps\n", + "\n", + " Peak signal to quantization noise ratio = 52.93 dB\n", + "\n", + " Average signal to quantization noise ratio = 48.16 dB\n" + ] + } + ], + "source": [ + "# To compute transmission bit rate, average and peak signal to quantization noise ratio\n", + "\n", + "\n", + "# Given data\n", + "fs=8*10**3# # Sampling frequency in Hz\n", + "n=8# # Number of bits per sample\n", + "stepsize=10*10**-3# # Time after which step size is recomputed\n", + "overhead=5# # Number of overhead bits\n", + "\n", + "N=fs*n# # Number of information bits pe second\n", + "Toverhead=overhead/stepsize# # The number of overhead bits/second\n", + "\n", + "# Effective transmission bit rate\n", + "bitrate=N+Toverhead# # Transmission bit rate in bps\n", + "\n", + "# Peak signal to quantization noise ratio\n", + "PSQNR=6.02*n+4.77# # Peak signal to quantization noise ratio in dB\n", + "\n", + "# Average signal to quantization noise ratio\n", + "ASQNR=6.02*n# # Average signal to quantization noise ratio in dB\n", + "\n", + "# Displaying the result in command window\n", + "print '\\n Effective transmission bit rate = %0.1f kbps'%(bitrate*10**-3)#\n", + "print '\\n Peak signal to quantization noise ratio = %0.2f dB'%(PSQNR)#\n", + "print '\\n Average signal to quantization noise ratio = %0.2f dB'%(ASQNR)#" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example no 8.3 Page no. 427" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + " Total encoding rate = 8.3 kbps\n" + ] + } + ], + "source": [ + "# To compute the minimum encoding rateof given 4 sub-band coder\n", + "\n", + "\n", + "# Given data\n", + "N=4# # Total number of sub-bands\n", + "L1=225# # Lower limit of first sub-band\n", + "U1=450# # Lower limit of first sub-band\n", + "L2=450# # Lower limit of second sub-band\n", + "U2=900# # Lower limit of second sub-band\n", + "L3=1000# # Lower limit of third sub-band\n", + "U3=1500# # Lower limit of third sub-band\n", + "L4=1800# # Lower limit of fourth sub-band\n", + "U4=2700# # Lower limit of fourth sub-band\n", + "E1=4# # Encoding bit of first sub-band\n", + "E2=3# # Encoding bit of second sub-band\n", + "E3=2# # Encoding bit of third sub-band\n", + "E4=1# # Encoding bit of fourth sub-band\n", + "\n", + "# Sampling rate of the sub-bands according to Nyquist theorem\n", + "sr1=2*(U1-L1)# # Sampling rate of first sub-band in samples/second\n", + "sr2=2*(U2-L2)# # Sampling rate of second sub-band in samples/second\n", + "sr3=2*(U3-L3)# # Sampling rate of third sub-band in samples/second\n", + "sr4=2*(U4-L4)# # Sampling rate of fourth sub-band in samples/second\n", + "\n", + "# Total encoding rate\n", + "SR=sr1*E1+sr2*E2+sr3*E3+sr4*E4# # Total encoding rate in bps\n", + "\n", + "# Displaying the result in command window\n", + "print '\\n Total encoding rate = %0.1f kbps'%(SR*10**-3)#" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example no 8.4 Page no. 439" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + " Maximum net data rate = 10.5 kbps\n" + ] + } + ], + "source": [ + "from __future__ import division\n", + "# To find the upper bound of the transmission bit rate\n", + "\n", + "\n", + "# Given data\n", + "FL=810*10**6# # Lower limit of forward channel frequency band\n", + "FU=826*10**6# # Upper limit of forward channel frequency band\n", + "N=1150# # Number of simultaneous users#\n", + "SE=1.68# # Spectral efficiency in bps/Hz\n", + "CR=0.5# # Coder rate\n", + "bandused=90/100# # 90% bandwidth is used\n", + "\n", + "bandwidth=bandused*(FU-FL)# # Total bandwidth available for traffic channels in Hz\n", + "Cbandwidth=bandwidth/N# # Maximum channel bandwidth in Hz\n", + "ChannelDR=SE*Cbandwidth# # Maximum channel data rate in bps\n", + "DR=ChannelDR*CR# # Maximum net data rate in bps\n", + "\n", + "# Displaying the result in command window\n", + "print '\\n Maximum net data rate = %0.1f kbps'%(DR*10**-3)#" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example no 8.5 Page no. 439" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + " The gross channel bit rate = 16.75 kbps\n" + ] + } + ], + "source": [ + "from __future__ import division\n", + "# To compute the gross channel data rate\n", + "\n", + "\n", + "# Given data\n", + "t=20*10**-3# # Duration of encoding of one block in second\n", + "B1=50# # The first bits in Type-1 channel\n", + "CRC1=10# # Number of CRC bits in Type-1 channel\n", + "FEC=0.5# # FEC rate for Type-1 channel\n", + "B2=132# # Next bits in Type-2 channel\n", + "CRC2=5# # Number of CRC bits in Type-2 channel\n", + "B3=78# # The last bits in Type-3 channel\n", + "\n", + "N1=(B1+CRC1)/FEC# # Total number of bits transmitted in Type-1 channel\n", + "N2=(B2+CRC2)# # Total number of bits transmitted in Type-2 channel\n", + "N3=B3# # Total number of bits transmitted in Type-3 channel\n", + "N=N1+N2+N3# # Total number of channel bits transmitted enery t seconda\n", + "\n", + "# The gross channel data rate\n", + "BR=N/t# # The gross channel data rate in bps\n", + "\n", + "# Displaying the result in command window\n", + "print '\\n The gross channel bit rate = %0.2f kbps'%(BR*10**-3)#\n" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 2", + "language": "python", + "name": "python2" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 2 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython2", + "version": "2.7.9" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/Wireless_Communications_Principles_and_Practices_by_T._S._Rappaport/Chap9.ipynb b/Wireless_Communications_Principles_and_Practices_by_T._S._Rappaport/Chap9.ipynb new file mode 100644 index 00000000..f8c54bf9 --- /dev/null +++ b/Wireless_Communications_Principles_and_Practices_by_T._S._Rappaport/Chap9.ipynb @@ -0,0 +1,464 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter No.9 : Multiple access techniques for wireless communications" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example no 9.1 Page no. 451" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + " IF frequency 1930 MHz lies inside the band\n", + "\n", + " IF frequency 1926 MHz lies inside the band\n", + "\n", + " IF frequency 1922 MHz lies inside the band\n", + "\n", + " IF frequency 1918 MHz lies inside the band\n", + "\n", + " IF frequency 1928 MHz lies inside the band\n", + "\n", + " IF frequency 1924 MHz lies inside the band\n", + "\n", + " IF frequency 1920 MHz lies inside the band\n", + "\n", + " IF frequency 1916 MHz lies inside the band\n", + "\n", + " IF frequency 1932 MHz lies inside the band\n", + "\n", + " IF frequency 1936 MHz lies inside the band\n", + "\n", + " IF frequency 1940 MHz lies inside the band\n", + "\n", + " IF frequency 1944 MHz lies outside the band\n", + "\n", + " IF frequency 1934 MHz lies inside the band\n", + "\n", + " IF frequency 1938 MHz lies inside the band\n", + "\n", + " IF frequency 1942 MHz lies outside the band\n", + "\n", + " IF frequency 1946 MHz lies outside the band\n" + ] + } + ], + "source": [ + "# To find the intermodulation frequencies generated \n", + "\n", + "\n", + "# Given data\n", + "f1=1930# # First carrier frequency\n", + "f2=1932# # second carrier frequency\n", + "F1=1920# # Lower frequency of the band\n", + "F2=1940# # Upper frequency of the band\n", + "\n", + "for n in range(0,4):\n", + " x1=(2*n+1)*f1-2*n*f2\n", + " if x1 <= F2:\n", + " print '\\n IF frequency %0.0f MHz lies inside the band'%(x1)#\n", + " else:\n", + " print '\\n IF frequency %0.0f MHz lies outside the band'%(x1)#\n", + " \n", + "\n", + "\n", + "for n in range(0,4):\n", + " x2=(2*n+2)*f1-(2*n+1)*f2\n", + " if x2 <= F2:\n", + " print '\\n IF frequency %0.0f MHz lies inside the band'%(x2)#\n", + " else:\n", + " print '\\n IF frequency %0.0f MHz lies outside the band'%(x2)#\n", + " \n", + "for n in range(0,4):\n", + " x3=(2*n+1)*f2-2*n*f1\n", + " if x3 <= F2 :\n", + " print '\\n IF frequency %0.0f MHz lies inside the band'%(x3)#\n", + " else:\n", + " print '\\n IF frequency %0.0f MHz lies outside the band'%(x3)#\n", + " \n", + "for n in range(0,4):\n", + " x4=(2*n+2)*f2-(2*n+1)*f1\n", + " if x4 <= F2:\n", + " print '\\n IF frequency %0.0f MHz lies inside the band'%(x4)#\n", + " else:\n", + " print '\\n IF frequency %0.0f MHz lies outside the band'%(x4)#\n", + " " + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example no 9.2 Page no. 452" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + " The number of channels available in FDMA system = 416\n" + ] + } + ], + "source": [ + "# To find number of channels available\n", + "\n", + "\n", + "# Given data\n", + "Bt=12.5*10**6# # Total spectrum allocation in Hz\n", + "Bguard=10*10**3# # Guard band allocated in Hz\n", + "Bc=30*10**3# # Channel bandwidth in Hz\n", + "\n", + "# The number of channels available\n", + "N=(Bt-2*Bguard)/Bc# # The number of channels available\n", + "\n", + "# Displaying the result in command window\n", + "print '\\n The number of channels available in FDMA system = %0.0f'%(N)#" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example no 9.3 Page no. 455" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + " The number of simultaneous users accommodated in GSM system = 1000\n" + ] + } + ], + "source": [ + "# To find number of simultaneous users accommodated in GSm\n", + "\n", + "\n", + "# Given data\n", + "m=8# # Maximum speech channels supported by single radio channel\n", + "Bc=200*10**3# # Radio channel bandwidth in Hz\n", + "Bt=25*10**6# # Total spectrum allocated for forward link\n", + "Bguard=0# # Guard band allocated in Hz\n", + "\n", + "# The number of simultaneous users accommodated in GSm\n", + "N=(m*(Bt-2*Bguard))/Bc# # The number of simultaneous users\n", + "\n", + "# Displaying the result in command window\n", + "print '\\n The number of simultaneous users accommodated in GSM system = %0.0f'%(N)#" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example no 9.4 Page no. 456" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + " The time duration of a bit = 3.692 microseconds\n", + "\n", + " The time duration of a slot = 0.577 ms\n", + "\n", + " The time duration of a frame = 4.615 ms\n", + "\n", + " The arrival time of new frame for its next transmission = 4.615 ms\n" + ] + } + ], + "source": [ + "# To find a)the time duration of a bit b)the time duration of a slot c)the time duration of a frame d)how long must a user occupying single time slot wait between two successive transmission\n", + "\n", + "\n", + "# Given data\n", + "N=8# # Number of time slots in each frame\n", + "Nb=156.25# # Number of in each time slot\n", + "DR=270.833*10**3# # Data rate of transmission in channel\n", + "\n", + "# a)To find the time duration of a bit \n", + "Tb=1/DR# # The time duration of a bit in sec\n", + "\n", + "# b)To find the time duration of a slot\n", + "Tslot=Nb*Tb# # The time duration of a slot\n", + "\n", + "# c)To find the time duration of a frame\n", + "Tf=N*Tslot# # The time duration of a frame\n", + "\n", + "#d) The waiting time between two successive transmission\n", + "Tw=Tf# # The arrival time of new frame for its next transmission\n", + "\n", + "# Displaying the result in command window\n", + "print '\\n The time duration of a bit = %0.3f microseconds'%(Tb*10**6)#\n", + "print '\\n The time duration of a slot = %0.3f ms'%(Tslot*10**3)#\n", + "print '\\n The time duration of a frame = %0.3f ms'%(Tf*10**3)#\n", + "print '\\n The arrival time of new frame for its next transmission = %0.3f ms'%(Tw*10**3)#" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example no 9.5 Page no. 456" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + " The frame efficiency = 74.24 percentage\n" + ] + } + ], + "source": [ + "# To find the frame efficiency\n", + "\n", + "\n", + "# Given data\n", + "Btrail=6# # Number of trailing bits per slot\n", + "Bg=8.25# # Number of guard bits per slot\n", + "Btrain=26# # Number of training bits per slot\n", + "Nb=2# # Number of burst\n", + "Bburst=58# # Number of bits in each burst\n", + "Nslot=8# # Number of slots in each frame\n", + "\n", + "N=Btrail+Bg+Btrain+2*Bburst# # Total number of bits in each slot\n", + "Nf=Nslot*N# # Total number of bits in a frame\n", + "bOH=Nslot*Btrail+Nslot*Bg+Nslot*Btrain# # Number of overhead bits per frame\n", + "\n", + "# To find the frame efficiency\n", + "nf=(1-(bOH/Nf))*100# # Frame efficiency\n", + "\n", + "# Displaying the result in command window\n", + "print '\\n The frame efficiency = %0.2f percentage'%(nf)#" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example no 9.6 Page no. 466" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + " The maximum throughput using ALOHA = 0.1839\n", + "\n", + " The maximum throughput using slotted ALOHA = 0.3679\n" + ] + } + ], + "source": [ + "from __future__ import division\n", + "from math import exp\n", + "# To determine the maximum throughput using ALOHA and slotted ALOHA\n", + "\n", + "\n", + "#The maximum throughput using ALOHA\n", + "Rmax=1/2# #Maximum rate of arrival calculated by equating ALOHA throughput formula derivative to zero\n", + "T=Rmax*exp(-1)# #The maximum throughput using ALOHA\n", + "\n", + "# Displaying the result in command window\n", + "print '\\n The maximum throughput using ALOHA = %0.4f'%(T)#\n", + "\n", + "#The maximum throughput using slotted ALOHA\n", + "Rmax=1# #Maximum rate of arrival calculated by equating slotted ALOHA throughput formula derivative to zero\n", + "T=Rmax*exp(-1)# #The maximum throughput using slotted ALOHA\n", + "\n", + "# Displaying the result in command window\n", + "print '\\n The maximum throughput using slotted ALOHA = %0.4f'%(T)#" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example no 9.7 Page no. 472" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + " Minimum C/I for system A when compared to the (C/I)min for particular system = 4.375 dB\n", + "\n", + " Minimum C/I for system B when compared to the (C/I)min for particular system = 1.96 dB\n", + "\n", + " Minimum C/I for system C when compared to the (C/I)min for particular system = 6 dB\n", + "\n", + " Minimum C/I for system D when compared to the (C/I)min for particular system = 9 dB\n", + "\n", + " \n", + " Based on comparison, the smallest value of C/I should be selected for maximum capacity. So, System B offers the best capacity.\n" + ] + } + ], + "source": [ + "from __future__ import division\n", + "from math import log10\n", + "# To evaluate 4 different radio standards and to choose the one with maximum capacity\n", + "\n", + "\n", + "# Given data\n", + "ABc=30*10**3# # Channel bandwidth of system A\n", + "ACImin=18# # The tolerable value of carrier to interference ratio for system A\n", + "BBc=25*10**3# # Channel bandwidth of system B\n", + "BCImin=14# # The tolerable value of carrier to interference ratio for system B\n", + "CBc=12.5*10**3# # Channel bandwidth of system C\n", + "CCImin=12# # The tolerable value of carrier to interference ratio for system C # Value of CCImin is given wrong in book\n", + "DBc=6.25*10**3# # Channel bandwidth of system D\n", + "DCImin=9# # The tolerable value of carrier to interference ratio for system D\n", + "Bc=6.25*10**3# # Bandwidth of particular system\n", + "\n", + "ACIeq=ACImin+20*log10(Bc/ABc)# # Minimum C/I for system A when compared to the (C/I)min for particular system\n", + "BCIeq=BCImin+20*log10(Bc/BBc)# # Minimum C/I for system B when compared to the (C/I)min for particular system\n", + "CCIeq=CCImin+20*log10(Bc/CBc)# # Minimum C/I for system C when compared to the (C/I)min for particular system\n", + "DCIeq=DCImin+20*log10(Bc/DBc)# # Minimum C/I for system D when compared to the (C/I)min for particular system\n", + "\n", + "# Displaying the result in command window\n", + "print '\\n Minimum C/I for system A when compared to the (C/I)min for particular system = %0.3f dB'%(ACIeq)#\n", + "print '\\n Minimum C/I for system B when compared to the (C/I)min for particular system = %0.2f dB'%(BCIeq)#\n", + "print '\\n Minimum C/I for system C when compared to the (C/I)min for particular system = %0.0f dB'%(CCIeq)# \n", + "print '\\n Minimum C/I for system D when compared to the (C/I)min for particular system = %0.0f dB'%(DCIeq)#\n", + "print '\\n \\n Based on comparison, the smallest value of C/I should be selected for maximum capacity. So, System B offers the best capacity.'" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example no 9.9 Page no. 472" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + " Maximum number of users using omnidirectional base station antenna and no voice activity = 14\n", + "\n", + " Maximum number of users using three-sectors at the base station antenna and voice activity (with alpha=3/8) = 107\n" + ] + } + ], + "source": [ + "# To determine the maximum number of users using a)omnidirectional base station antenna and no voice activity b)three-sectors at the base station and voice activity detection\n", + "\n", + "\n", + "# Given data\n", + "W=1.25*10**6# # Total RF bandwidth in Hz\n", + "R=9600# # Baseband information bit rate in bps\n", + "EbNo=10# # Minimum acceptable SNR in dB\n", + "\n", + "# a)Maximum number of users using omnidirectional base station antenna and no voice activity\n", + "N1=1+(W/R)/EbNo# # Maximum number of users using omnidirectional\n", + "\n", + "# b)Maximum number of users using three-sectors at the base station antenna and voice activity with alpha=3/8\n", + "alpha=3/8# # Voice activity factor\n", + "Ns=1+(1/alpha)*((W/R)/EbNo)# # Maximum number of users\n", + "N2=3*Ns# # Maximum number of users using three-sectors\n", + "\n", + "# Displaying the result in command window\n", + "print '\\n Maximum number of users using omnidirectional base station antenna and no voice activity = %0.0f'%(N1)#\n", + "print '\\n Maximum number of users using three-sectors at the base station antenna and voice activity (with alpha=3/8) = %0.0f'%(N2)#" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 2", + "language": "python", + "name": "python2" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 2 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython2", + "version": "2.7.9" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/Wireless_Communications_Principles_and_Practices_by_T._S._Rappaport/screenshots/MagNPhasePlot6.png b/Wireless_Communications_Principles_and_Practices_by_T._S._Rappaport/screenshots/MagNPhasePlot6.png Binary files differnew file mode 100644 index 00000000..b0d6ed2e --- /dev/null +++ b/Wireless_Communications_Principles_and_Practices_by_T._S._Rappaport/screenshots/MagNPhasePlot6.png diff --git a/Wireless_Communications_Principles_and_Practices_by_T._S._Rappaport/screenshots/MeanPathLoss4.png b/Wireless_Communications_Principles_and_Practices_by_T._S._Rappaport/screenshots/MeanPathLoss4.png Binary files differnew file mode 100644 index 00000000..1afc59b1 --- /dev/null +++ b/Wireless_Communications_Principles_and_Practices_by_T._S._Rappaport/screenshots/MeanPathLoss4.png diff --git a/Wireless_Communications_Principles_and_Practices_by_T._S._Rappaport/screenshots/NoOfChPerCell3.png b/Wireless_Communications_Principles_and_Practices_by_T._S._Rappaport/screenshots/NoOfChPerCell3.png Binary files differnew file mode 100644 index 00000000..b9a535e1 --- /dev/null +++ b/Wireless_Communications_Principles_and_Practices_by_T._S._Rappaport/screenshots/NoOfChPerCell3.png diff --git a/sample_notebooks/VivekMaindola/Chap3.ipynb b/sample_notebooks/VivekMaindola/Chap3.ipynb new file mode 100644 index 00000000..0865879b --- /dev/null +++ b/sample_notebooks/VivekMaindola/Chap3.ipynb @@ -0,0 +1,618 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter No.3 : The cellular concept system design fundamentals" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 3.1 Page No.61" + ] + }, + { + "cell_type": "code", + "execution_count": 14, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + " The number of channels available per cell for 4-cell reuse system = 165 channels\n", + "\n", + " One control channel and 160 voice channels would be assigned to each cell.\n", + "\n", + " \n", + " The number of channels available per cell for 7-cell reuse system = 95 channels\n", + "\n", + " Each cell would have one control channel, four cells would have 90 voice channels and three cells would have 91 voice channels.\n", + "\n", + " \n", + " The number of channels available per cell for 12-cell reuse system = 55 channels\n", + "\n", + " Each cell would have one control channel, eight cells would have 53 voice channels and four cells would have 54 voice channels.\n" + ] + } + ], + "source": [ + "from math import ceil\n", + "# To compute the number of channels available per cell for a)four-cell reuse system a)seven-cell reuse system a)12-cell reuse system\n", + "\n", + "# Given data\n", + "B=33*10**6# # Total bandwidth allocated to particular FDD system in Hz\n", + "Bc=25*10**3# # Bandwidth per channel in Hz\n", + "Nc=2# # Number of simplex channels\n", + "Bc=Bc*Nc# # Channel bandwidth in Hz\n", + "\n", + "Ntotal=B/Bc# # Total number of channels\n", + "\n", + "#a) To compute the number of channels available per cell for four-cell reuse system\n", + "N=4# # frequency reuse factor\n", + "chpercell=Ntotal/N# # number of channels available per cell for four-cell reuse system\n", + "\n", + "# Displaying the result in command window\n", + "print \"\\n The number of channels available per cell for 4-cell reuse system = %0.0f channels\"%(chpercell)\n", + "print \"\\n One control channel and 160 voice channels would be assigned to each cell.\"\n", + "\n", + "# b) To compute the number of channels available per cell for seven-cell reuse system\n", + "N=7# # frequency reuse factor\n", + "chpercell=ceil(Ntotal/N)# # number of channels available per cell for seven-cell reuse system\n", + "\n", + "# Answer is varrying due to round-off error\n", + "\n", + "# Displaying the result in command window\n", + "print \"\\n \\n The number of channels available per cell for 7-cell reuse system = %0.0f channels\"%(chpercell)\n", + "print \"\\n Each cell would have one control channel, four cells would have 90 voice channels and three cells would have 91 voice channels.\"\n", + "\n", + "# c) To compute the number of channels available per cell for 12-cell reuse system\n", + "N=12# # frequency reuse factor\n", + "chpercell=Ntotal/N# # number of channels available per cell for seven-cell reuse system\n", + "\n", + "# Displaying the result in command window\n", + "print \"\\n \\n The number of channels available per cell for 12-cell reuse system = %0.0f channels\"%(chpercell)\n", + "print \"\\n Each cell would have one control channel, eight cells would have 53 voice channels and four cells would have 54 voice channels.\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 3.2 Page No.72" + ] + }, + { + "cell_type": "code", + "execution_count": 15, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + " Signal to noise ratio for n=4 with frequency reuse factor N=7 = 18.66 dB\n", + "\n", + " Signal to noise ratio for n=3 with frequency reuse factor N=7 = 12.05 dB\n", + "\n", + " Signal to noise ratio for n=3 with frequency reuse factor N=12 = 15.56 dB\n", + "\n", + " Since SIR is for n=3 with frequency reuse factor N=7 greater than the minimum required, so N=12 is used.\n" + ] + } + ], + "source": [ + "from math import sqrt, log10\n", + "from __future__ import division\n", + "# To find frequency reuse factor for path loss exponent (n) a)n=4 b)n=3\n", + "\n", + "# Given data\n", + "SIdB=15# # Signal to interference(dB)\n", + "io=6# # Number of cochannel cell\n", + "\n", + "# For n=4\n", + "n1=4# # Path loss exponent\n", + "N1=7# # First consideration: frequency reuse factor N=7\n", + "DR1=sqrt(3*N1)# # Co-channel reuse ratio\n", + "si1=(1/io)*(DR1)**n1# # Signal to interference\n", + "sidB1=10*log10(si1)# # Signal to interference(dB)\n", + "\n", + "# For n=3\n", + "n2=3# # Path loss exmponent\n", + "si=(1/io)*(DR1)**n2# # Signal to interference for first consideration: frequency reuse factor N=7\n", + "sidB=10*log10(si)# # Signal to interference(dB)\n", + "\n", + "N2=12# # second consideration : frequency reuse factor N=12 since sidB<SIdB \n", + "DR2=sqrt(3*N2)# # Co-channel reuse ratio\n", + "si2=(1/io)*(DR2)**n2# # Signal to interference\n", + "sidB2=10*log10(si2)# # Signal to interference(dB)\n", + "\n", + "# Displaying the result in command window\n", + "print \"\\n Signal to noise ratio for n=4 with frequency reuse factor N=7 = %0.2f dB\"%(sidB1)\n", + "print \"\\n Signal to noise ratio for n=3 with frequency reuse factor N=7 = %0.2f dB\"%(sidB)\n", + "print \"\\n Signal to noise ratio for n=3 with frequency reuse factor N=12 = %0.2f dB\"%(sidB2)\n", + "print \"\\n Since SIR is for n=3 with frequency reuse factor N=7 greater than the minimum required, so N=12 is used.\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 3.4 Page No.80" + ] + }, + { + "cell_type": "code", + "execution_count": 16, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + " Total number of users for 1 channel = 1\n", + "\n", + " Total number of users for 5 channel = 11\n", + "\n", + " Total number of users for 10 channel = 40\n", + "\n", + " Total number of users for 20 channel = 111\n", + "\n", + " Total number of users for 100 channel = 809\n" + ] + } + ], + "source": [ + "# To find number of users for Number of channels (C) a)C=1 b)C=5 c)C=10 d)C=20 e)C=100\n", + "\n", + "# Given data\n", + "GOS=0.005# #G rade of Service\n", + "Au=0.1# # Traffic intensity per user\n", + "\n", + "# a)To find number of users for C=1\n", + "C1=1# # Number of channels\n", + "A1=0.005# # Total traffic intensity from Erlangs B chart\n", + "U1=(A1/Au)# # Number of users\n", + "U1=1# # Since one user could be supported on one channel\n", + "\n", + "# b)To find number of users for C=5\n", + "C2=5# # Number of channels\n", + "A2=1.13# # Total traffic intensity from Erlangs B chart\n", + "U2=round(A2/Au)# # Number of users\n", + "\n", + "# c)To find number of users for C=10\n", + "C3=10# # Number of channels\n", + "A3=3.96# # Total traffic intensity from Erlangs B chart\n", + "U3=round(A3/Au)# # Number of users\n", + "\n", + "# Answer is varrying due to round off error\n", + "\n", + "# d)To find number of users for C=20\n", + "C4=20# # Number of channels\n", + "A4=11.10# # Total traffic intensity from Erlangs B chart\n", + "U4=round(A4/Au)# # Number of users\n", + "\n", + "# Answer is varrying due to round off error\n", + "\n", + "# e)To find number of users for C=100\n", + "C5=100# # Number of channels\n", + "A5=80.9# # Total traffic intensity from Erlangs B chart\n", + "U5=round(A5/Au)# # Number of users\n", + "\n", + "# Displaying the result in command window\n", + "print \"\\n Total number of users for 1 channel = %0.0f\"%(U1)\n", + "print \"\\n Total number of users for 5 channel = %0.0f\"%(U2)\n", + "print \"\\n Total number of users for 10 channel = %0.0f\"%(U3)\n", + "print \"\\n Total number of users for 20 channel = %0.0f\"%(U4)\n", + "print \"\\n Total number of users for 100 channel = %0.0f\"%(U5)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 3.5 Page No.83" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + " Total number of users in system A = 47280\n", + "\n", + " The percentage market penetration of system A = 2.36\n", + "\n", + " \n", + " Total number of users in system B = 44100\n", + "\n", + " The percentage market penetration of system B = 2.205\n", + "\n", + " \n", + " Total number of users in system C = 43120\n", + "\n", + " The percentage market penetration of system C = 2.156\n", + "\n", + " \n", + " Total number of users in all 3 systems = 134500\n", + "\n", + " The combined Market penetration percentage of all systems = 6.725\n" + ] + } + ], + "source": [ + "from __future__ import division\n", + "# To find number of users for a)system A b)system B c)system C\n", + "\n", + "# Given data\n", + "GOS=0.02# # Grade of Service (Probability of bloacking)\n", + "lamda=2# # Average calls per hour\n", + "H=(3/60)# # Call duration in seconds\n", + "\n", + "Au=lamda*H# # Traffic intensity per user\n", + "\n", + "# a)To find number of users for System A\n", + "C1=19# # Number of channels used\n", + "A1=12# # Traffic intensity from Erlang B chart\n", + "U1=round(A1/Au)# # Number of users per cell\n", + "cells1=394\n", + "TU1=U1*cells1# # Total number of users\n", + "MP1=TU1/(2*10**6)*100# # Market penetration percentage\n", + "\n", + "# b)To find number of users for System B\n", + "C2=57# # No. of channels used\n", + "A2=45# # Traffic intensity from Erlang B chart\n", + "U2=round(A2/Au)# # Number of users per cell\n", + "cells2=98\n", + "TU2=U2*cells2# # Total no. of users\n", + "MP2=TU2/(2*10**6)*100# # Market penetration percentage\n", + "\n", + "# c)To find number of users for System C\n", + "C3=100# # Number of channels used\n", + "A3=88# # traffic intensity from Erlang B chart\n", + "U3=round(A3/Au)# # Number of users per cell\n", + "cells3=49\n", + "TU3=U3*cells3# # Total no. of users\n", + "MP3=TU3/(2*10**6)*100# # Market penetration percentage\n", + "\n", + "TU=TU1+TU2+TU3# # Total number of users in all 3 systems\n", + "MP=TU/(2*10**6)*100# # Combined Market penetration percentage\n", + "\n", + "# Displaying the result in command window\n", + "print \"\\n Total number of users in system A = %0.0f\"%(TU1)\n", + "print \"\\n The percentage market penetration of system A = %0.2f\"%(MP1)\n", + "print \"\\n \\n Total number of users in system B = %0.0f\"%(TU2)\n", + "print \"\\n The percentage market penetration of system B = %0.3f\"%(MP2)\n", + "print \"\\n \\n Total number of users in system C = %0.0f\"%(TU3)\n", + "print \"\\n The percentage market penetration of system C = %0.3f\"%(MP3)\n", + "print \"\\n \\n Total number of users in all 3 systems = %0.0f\"%(TU)\n", + "print \"\\n The combined Market penetration percentage of all systems = %0.3f\"%(MP)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 3.6 Page No.84" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + " Number of cells in given system = 31 cells\n", + "\n", + " \n", + " Number of channels per cell in given system = 95 channels/cell\n", + "\n", + " \n", + " Traffic intensity in given system = 84 Erlangs/cell\n", + "\n", + " \n", + " Maximum carried traffic in given system = 2604 Erlangs\n", + "\n", + " \n", + " Total number of users = 86800 users\n", + "\n", + " \n", + " Number of mobiles per unique channel = 130 mobiles/channel\n", + "\n", + " \n", + " Theoretically maximum number of served mobiles is the number of available channels in the system.\n", + "\n", + " Theoretical Maximum number of users could be served at one time = 2945 users\n", + "It is 3.4% of customer base.\n" + ] + } + ], + "source": [ + "# To find a)Number of cells in given area b)Number of channels/cell c)Traffic intensity per cell d)Maximum carried traffic e)Total number of users for 2% GOS f) Number of mobiles per unique channel g)Maximum number of users could be served at one time\n", + "\n", + "# Given data\n", + "Area=1300# # Total coverage area in m**2\n", + "R=4# # Radius of cell in m\n", + "N=7# # Frequecy reuse factor\n", + "S=40*10**6# # Allocated spectrum in Hz\n", + "Ch=60*10**3# # Channel width in Hz\n", + "\n", + "# a)Number of cells\n", + "CA=2.5981*R**2# # Area of hexagonal cell in m**2\n", + "Nc=round(Area/CA)# # Number of cells\n", + "\n", + "# Displaying the result in command window\n", + "print \"\\n Number of cells in given system = %0.0f cells\"%(Nc)\n", + "\n", + "# b)Number of channels/cell\n", + "C1=round(S/(Ch*N))# # Number of channels\n", + "\n", + "# Displaying the result in command window\n", + "print \"\\n \\n Number of channels per cell in given system = %0.0f channels/cell\"%(C1)\n", + "\n", + "# c) Traffic intensity per cell\n", + "C1=95# # Number of channels from b)\n", + "GOS=0.02# # Grade of service\n", + "A=84# # Traffic intensity from Erlang B chart\n", + "\n", + "# Displaying the result in command window\n", + "print \"\\n \\n Traffic intensity in given system = %0.0f Erlangs/cell\"%(A)\n", + "\n", + "# d)Maximum carried traffic\n", + "traffic=Nc*A# # Maximum carried traffic\n", + "\n", + "# Displaying the result in command window\n", + "print \"\\n \\n Maximum carried traffic in given system = %0.0f Erlangs\"%(traffic)\n", + "\n", + "# e)Total number of users for 2% GOS \n", + "trafficperuser=0.03# # Given traffic per user\n", + "U=traffic/trafficperuser# # Total number of users\n", + "\n", + "# Displaying the result in command window\n", + "print \"\\n \\n Total number of users = %0.0f users\"%(U)\n", + "\n", + "# f) Number of mobiles per unique channel\n", + "C=666# # Number of channels\n", + "mobilesperchannel=round(U/C)# # Number of mobiles per unique channel\n", + "\n", + "# Displaying the result in command window\n", + "print \"\\n \\n Number of mobiles per unique channel = %0.0f mobiles/channel\"%(mobilesperchannel)\n", + "\n", + "# g)Maximum number of users could be served at one time\n", + "print \"\\n \\n Theoretically maximum number of served mobiles is the number of available channels in the system.\"\n", + "C=C1*Nc# # Maximum number of users could be served at one time\n", + "\n", + "# Displaying the result in command window\n", + "print \"\\n Theoretical Maximum number of users could be served at one time = %0.0f users\"%(C)\n", + "print \"It is 3.4% of customer base.\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 3.7 Page 85" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + " Number of users per square km in given system = 62 users/sq km\n", + "\n", + " \n", + " Percentage of probability that delayed call have to wait longer than t=10 sec = 56.29 percent\n", + "\n", + " \n", + " Percentage of probability that call is delayed more than 10 sec = 2.81 percent\n" + ] + } + ], + "source": [ + "from math import exp\n", + "# To find a)number of users per square km b)probability that delayed call have to wait longer than t=10sec c)probability that call is delayed more than 10 sec\n", + "\n", + "# Given data\n", + "R=1.387# # Radius of cell in m\n", + "Area=2.598*R**2# # Area of hexagonal cell in m**2\n", + "cellpercluster=4# # Number of cells/cluster\n", + "channels=60# # Number of channels\n", + "\n", + "channelspercell=channels/cellpercluster# # Number of channels per cell\n", + "\n", + "# a)To find number of users per square km\n", + "A=0.029# # Traffic intensity per user\n", + "delayprob=0.05# # Grade of service\n", + "traffic=9# # Traffic intensity from Erlang chart C\n", + "U1=traffic/A# # Total number of users in 5sq.km.\n", + "U=round(U1/Area)# # Number of users per square km\n", + "\n", + "# Displaying the result in command window\n", + "print \"\\n Number of users per square km in given system = %0.0f users/sq km\"%(U)\n", + "\n", + "# b)To find the probability that delayed call have to wait longer than t=10sec\n", + "lamda=1# # Holding time\n", + "H1=A/lamda# # Duration of call\n", + "H=H1*3600# # Duration of call in second\n", + "t=10\n", + "Pr=exp(-(channelspercell-traffic)*t/H)*100# # probability that delayed call have to wait longer than t=10sec.\n", + "\n", + "# Displaying the result in command window\n", + "print \"\\n \\n Percentage of probability that delayed call have to wait longer than t=10 sec = %0.2f percent\"%(Pr)\n", + "\n", + "# c)To find the probability that call is delayed more than 10 sec\n", + "Pr10=delayprob*Pr# # probability that call is delayed more than 10 sec\n", + "\n", + "# Displaying the result in command window\n", + "print \"\\n \\n Percentage of probability that call is delayed more than 10 sec = %0.2f percent\"%(Pr10)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 3.8 Page 89" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + " Number of channels without use of microcell = 300 channels\n", + "\n", + " \n", + " Number of channels with the use of lettered microcells = 660 channels\n", + "\n", + " \n", + " Number of channels if all base stations are replaced by microcells = 1020 channels\n" + ] + } + ], + "source": [ + "# To find number of channels in 3 km by 3 km square centered around A in Figure 3.9 for a)without use of microcell b)with the use of lettered microcells c)all base stations are replaced by microcells\n", + "\n", + "# Given data\n", + "R=1# # Cell radius in km\n", + "r=0.5# # Micro-cell radius in km\n", + "Nc=60# # Number of channels in base station\n", + "\n", + "# a)To find number of channels without use of microcell\n", + "Nb1=5# # Number of base stations in given area\n", + "N1=Nb1*Nc# # Number of channels without use of microcell\n", + "\n", + "# b)To find number of channels with the use of lettered microcells\n", + "Nb2=6# # Number of lettered microcells\n", + "Nb2=Nb1+Nb2# # Total number of base stations in given area\n", + "N2=Nb2*Nc# # Number of channels with the use of lettered microcells\n", + "\n", + "# c)To find number of channels if all base stations are replaced by microcells\n", + "Nb3=12# # Number of all the microcells\n", + "Nb3=Nb1+Nb3# # Total number of base stations in given area\n", + "N3=Nb3*Nc# # Number of channels if all base stations are replaced by microcells\n", + "\n", + "# Displaying the result in command window\n", + "print \"\\n Number of channels without use of microcell = %0.0f channels\"%(N1)\n", + "print \"\\n \\n Number of channels with the use of lettered microcells = %0.0f channels\"%(N2)\n", + "print \"\\n \\n Number of channels if all base stations are replaced by microcells = %0.0f channels\"%(N3)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 3.9 Page 92" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + " Cell capacity of unsectored system = 1326 calls/hour\n", + "\n", + " \n", + " Cell capacity of 120 degree sectored system = 1008 calls/hour\n", + "\n", + " \n", + " Decrease in cell capacity in 120 degree sectored system = 0 percent\n" + ] + } + ], + "source": [ + "# To analyze trunking efficiency capacity of sectoring and unsectoring\n", + "\n", + "# Given data\n", + "H=2/60# # Average call duration in hour\n", + "GOS=0.01# # Probability of blocking\n", + "\n", + "# Unsectored system\n", + "C1=57# # Number of traffic channels per cell in unsectored system\n", + "A=44.2# # Carried traffic in unsectored system\n", + "calls1=1326# # Number of calls per hour in unsectored system from Erlangs B table\n", + "\n", + "# 120 degree sectored system\n", + "C2=C1/3# # Number of traffic channels per antenna sector in 120 degree sectored system\n", + "calls2=336# # Number of calls per hour in 120 degree sectored system from Erlangs B table\n", + "Ns1=3# # Number of sectors\n", + "capacity=Ns1*calls2# # Cell capacity or number of calls handled by system per hour\n", + "\n", + "dif=calls1-capacity# # decrease in cell capacity in 120 degree sectored system\n", + "percentdif=(dif/calls1)*100# # decrease in cell capacity in 120 degree sectored system in percentage\n", + "\n", + "# Displaying the result in command window\n", + "print \"\\n Cell capacity of unsectored system = %0.0f calls/hour\"%(calls1)\n", + "print \"\\n \\n Cell capacity of 120 degree sectored system = %0.0f calls/hour\"%(capacity)\n", + "print \"\\n \\n Decrease in cell capacity in 120 degree sectored system = %0.0f percent\"%(percentdif)" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 2", + "language": "python", + "name": "python2" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 2 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython2", + "version": "2.7.9" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} |