diff options
Diffstat (limited to 'Linear_Integrated_Circuits_by_T._R._Ganesh_Babu')
11 files changed, 5522 insertions, 0 deletions
diff --git a/Linear_Integrated_Circuits_by_T._R._Ganesh_Babu/Chapter_1_Circuit_Configuration_for_Linear_Integrated_Ciruits.ipynb b/Linear_Integrated_Circuits_by_T._R._Ganesh_Babu/Chapter_1_Circuit_Configuration_for_Linear_Integrated_Ciruits.ipynb new file mode 100644 index 00000000..40471853 --- /dev/null +++ b/Linear_Integrated_Circuits_by_T._R._Ganesh_Babu/Chapter_1_Circuit_Configuration_for_Linear_Integrated_Ciruits.ipynb @@ -0,0 +1,607 @@ +{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# Chapter 1: Circuit Configuration for Linear Integrated Ciruits"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 1 Page No:1.81"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 1,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "adm= -1482.0\n",
+ "acm= -0.222\n",
+ "cmrr= 76.4838188131 db\n"
+ ]
+ }
+ ],
+ "source": [
+ "#given\n",
+ "rc=50000;#ohm\n",
+ "re=100000;#ohm\n",
+ "rs=10000;#ohm\n",
+ "rp=50000;#ohm\n",
+ "beta0=2000;\n",
+ "r0=400000;#ohm\n",
+ "\n",
+ "\n",
+ "\n",
+ "#determine adm,acm,cmrr\n",
+ "#calculation\n",
+ "rc1=(rc*r0)/(rc+r0);\n",
+ "adm=(-(beta0*rc1)/(rs+rp))#differential mode gain\n",
+ "acm=(-(beta0*rc1)/(rs+rp+2*re*(beta0+1e0)))#common mode gain\n",
+ "import math\n",
+ "cmrr=20*(math.log10((1+((2*re*(beta0+1))/(rs+rp)))))#common mode rejection ratio\n",
+ "\n",
+ "#result\n",
+ "print 'adm=',round(adm,3);\n",
+ "print 'acm=',round(acm,3);\n",
+ "print 'cmrr=',cmrr,'db'\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 2 Page No:1.83"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 1,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "maximum peak amplitude at 100khz 3.185 V\n"
+ ]
+ }
+ ],
+ "source": [
+ "#given\n",
+ "import math\n",
+ "sr=0.000001;#volt/sec\n",
+ "freq=100000;\n",
+ "vsat=12;\n",
+ "baw=100000;\n",
+ "#determine vx\n",
+ "\n",
+ "#calculation\n",
+ "vx=2*(1/(sr*2*3.14*freq))\n",
+ "\n",
+ "#result\n",
+ "print 'maximum peak amplitude at 100khz',round(vx,3),'V'\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 3 Page No: 1.84"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 2,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "slew rate= 5 volt/μsec\n"
+ ]
+ }
+ ],
+ "source": [
+ "#given\n",
+ "import math\n",
+ "V=20;\n",
+ "t=4;\n",
+ "#determine slew rate\n",
+ "#calculation\n",
+ "w=V/t\n",
+ "#result\n",
+ "print'slew rate=',w,'volt/μsec'\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 4 Page No: 1.84"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 3,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "max frequency of input is 79617.8343949 hz\n"
+ ]
+ }
+ ],
+ "source": [
+ "#given\n",
+ "import math\n",
+ "a=50;\n",
+ "vi=20e-3;\n",
+ "sr=0.5e6;\n",
+ "#determine max frequency\n",
+ "#calculation\n",
+ "vm=a*vi;\n",
+ "freq=sr/(2*3.14*vm)\n",
+ "#result\n",
+ "print 'max frequency of input is ',freq,'hz'\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 5 Page No: 1.84"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 4,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "max peak to peak input signal 0.398089171975 V\n"
+ ]
+ }
+ ],
+ "source": [
+ "#given\n",
+ "import math\n",
+ "sr=0.5e6;\n",
+ "freq=40e3;\n",
+ "a=10;\n",
+ "#determine max peak to peak input signal\n",
+ "#calculation\n",
+ "vm=sr/(2*3.14*freq);\n",
+ "vm=2*vm;\n",
+ "v1=vm/a\n",
+ "#result\n",
+ "print'max peak to peak input signal ',v1,'V'\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {
+ "collapsed": true
+ },
+ "source": [
+ "## Example 6 Page No: 1.85"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 5,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "noise 0.0063247 V\n"
+ ]
+ }
+ ],
+ "source": [
+ "#given\n",
+ "import math\n",
+ "adm=400;\n",
+ "cmrr=50;\n",
+ "vin1=50e-3;\n",
+ "vin2=60e-3;\n",
+ "vnoise=5e-3;\n",
+ "#calculation\n",
+ "v0=(vin2-vin1)*adm;\n",
+ "acm=adm/316.22;\n",
+ "v1=vnoise*acm\n",
+ "print'noise ',round(v1,7),'V'\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 7 Page No: 1.86"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 6,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "time to change from 0 t0 15 4e-07 sec\n",
+ "slew rate 1.5 volt/μsec\n"
+ ]
+ }
+ ],
+ "source": [
+ "#given\n",
+ "import math\n",
+ "sr=35e6;#volt/sec\n",
+ "vsat=15;#volt\n",
+ "#determine time to change from 0 to 15V\n",
+ "#calculation\n",
+ "c=100e-12;#farad\n",
+ "i=150e-6;#A\n",
+ "w=vsat/sr\n",
+ "w1=i/c;\n",
+ "#result\n",
+ "print'time to change from 0 t0 15 ',round(w,7),'sec'\n",
+ "print'slew rate',w1/1000000,'volt/μsec'\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 8 Page No: 1.86"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 7,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "bandwidth 21231.4225053 hz\n"
+ ]
+ }
+ ],
+ "source": [
+ "#given\n",
+ "import math\n",
+ "sr=2e6;#v/sec\n",
+ "vsat=15;#volt\n",
+ "#determine bandwidth \n",
+ "#calculation\n",
+ "\n",
+ "bw=sr/(2*3.14*vsat)\n",
+ "#result\n",
+ "print'bandwidth ',bw,'hz'\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 9 Page No: 1.87"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 8,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "output offset 3.0 V\n"
+ ]
+ }
+ ],
+ "source": [
+ "#given\n",
+ "import math\n",
+ "iin=30e-9;#A\n",
+ "a=1e5;\n",
+ "rin=1000;#ohm\n",
+ "#determine output offset voltage\n",
+ "#calculation\n",
+ "vid=iin*rin;\n",
+ "v0=a*vid\n",
+ "#result\n",
+ "print'output offset ',v0,'V'\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 10 Page No: 1.86"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 9,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "input offset current 4e-06 A\n",
+ "input base current 2.4e-05 A\n"
+ ]
+ }
+ ],
+ "source": [
+ "#given\n",
+ "import math\n",
+ "inb1=22e-6;#A\n",
+ "inb2=26e-6;#A\n",
+ "#determine input offset current input base current\n",
+ "#calculation\n",
+ "i1=inb2-inb1\n",
+ "i2=(inb2+inb1)/2\n",
+ "#result\n",
+ "print'input offset current ',i1,'A'\n",
+ "print'input base current ',i2,'A'\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example 11 Page No: 1.86"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 10,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "input base current 8e-08 A\n",
+ "input offset current 2e-08 A\n",
+ "input offset 2.0 V\n"
+ ]
+ }
+ ],
+ "source": [
+ "#given\n",
+ "import math\n",
+ "inb2=90e-9;#A\n",
+ "inb1=70e-9;#A\n",
+ "a=1e5;\n",
+ "#determine input offset current\n",
+ "#calculation\n",
+ "i1=(inb2+inb1)/2\n",
+ "i2=inb2-inb1\n",
+ "v1=((inb2-inb1)*1000)*a\n",
+ "print'input base current ',i1,'A'\n",
+ "print'input offset current ',i2,'A'\n",
+ "print'input offset ',v1,'V'\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 12 Page No: 1.87"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 2,
+ "metadata": {
+ "collapsed": false,
+ "scrolled": true
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "output voltage cmrr 100 0.051 V\n",
+ "output voltage cmrr 200 0.051 V\n",
+ "output voltage cmrr 450 0.05 V\n",
+ "output voltage cmrr 105 0.051 V\n"
+ ]
+ }
+ ],
+ "source": [
+ "#given\n",
+ "import math\n",
+ "vin1=150e-6;#volt\n",
+ "vin2=100e-6;#volt\n",
+ "a=1000;\n",
+ "from array import array\n",
+ "cmrr=array('i',[100,200,450,105])\n",
+ "#determine output voltage\n",
+ "#calculation\n",
+ "vc=(vin1+vin2)/2;\n",
+ "vd=(vin1-vin2);\n",
+ "j=0;\n",
+ "while j<=3 :v0=(a*vd*(1+(vc/(cmrr[j]*vd)))) ;print 'output voltage cmrr ',cmrr[j],' ',round(v0,3),'V';j=j+1;\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 13 Page No: 1.87"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 13,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "output voltage 0.003 V\n"
+ ]
+ }
+ ],
+ "source": [
+ "#given\n",
+ "import math\n",
+ "rin=100e3;#ohm\n",
+ "rf1=900e3;#ohm\n",
+ "vc=1;#volt\n",
+ "cmrr=70;\n",
+ "#determine the output voltage\n",
+ "#calculation\n",
+ "v0=(1+(rf1/rin))*vc/3160\n",
+ "print 'output voltage ',round(v0,3),'V'\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 14 Page No: 1.89"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 14,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "input voltage 0.08 V\n"
+ ]
+ }
+ ],
+ "source": [
+ "#given\n",
+ "import math\n",
+ "sr=0.5e6;#volt/sec\n",
+ "a=50;\n",
+ "freq=20e3;#hz\n",
+ "#determine max peak to peak voltage\n",
+ "#calculation\n",
+ "v1=sr/(2*3.14*freq*a)\n",
+ "print'input voltage ',round(v1,3),'V'\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 15 Page No: 1.90"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 15,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "max frequency 26.539 Khz\n"
+ ]
+ }
+ ],
+ "source": [
+ "#given\n",
+ "import math\n",
+ "sr=50e6;#volt/sec\n",
+ "rin=2;\n",
+ "vimax=10;\n",
+ "#determine max frequency\n",
+ "#calculation\n",
+ "vm=vimax*(1+rin);\n",
+ "freq=sr/(2*3.14*vm)/10e3;\n",
+ "print 'max frequency ',round(freq,3),'Khz'\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [],
+ "source": []
+ }
+ ],
+ "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.10"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 0
+}
diff --git a/Linear_Integrated_Circuits_by_T._R._Ganesh_Babu/Chapter_1_Circuit_Configuration_for_Linear_Integrated_Ciruits_1.ipynb b/Linear_Integrated_Circuits_by_T._R._Ganesh_Babu/Chapter_1_Circuit_Configuration_for_Linear_Integrated_Ciruits_1.ipynb new file mode 100644 index 00000000..40471853 --- /dev/null +++ b/Linear_Integrated_Circuits_by_T._R._Ganesh_Babu/Chapter_1_Circuit_Configuration_for_Linear_Integrated_Ciruits_1.ipynb @@ -0,0 +1,607 @@ +{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# Chapter 1: Circuit Configuration for Linear Integrated Ciruits"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 1 Page No:1.81"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 1,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "adm= -1482.0\n",
+ "acm= -0.222\n",
+ "cmrr= 76.4838188131 db\n"
+ ]
+ }
+ ],
+ "source": [
+ "#given\n",
+ "rc=50000;#ohm\n",
+ "re=100000;#ohm\n",
+ "rs=10000;#ohm\n",
+ "rp=50000;#ohm\n",
+ "beta0=2000;\n",
+ "r0=400000;#ohm\n",
+ "\n",
+ "\n",
+ "\n",
+ "#determine adm,acm,cmrr\n",
+ "#calculation\n",
+ "rc1=(rc*r0)/(rc+r0);\n",
+ "adm=(-(beta0*rc1)/(rs+rp))#differential mode gain\n",
+ "acm=(-(beta0*rc1)/(rs+rp+2*re*(beta0+1e0)))#common mode gain\n",
+ "import math\n",
+ "cmrr=20*(math.log10((1+((2*re*(beta0+1))/(rs+rp)))))#common mode rejection ratio\n",
+ "\n",
+ "#result\n",
+ "print 'adm=',round(adm,3);\n",
+ "print 'acm=',round(acm,3);\n",
+ "print 'cmrr=',cmrr,'db'\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 2 Page No:1.83"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 1,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "maximum peak amplitude at 100khz 3.185 V\n"
+ ]
+ }
+ ],
+ "source": [
+ "#given\n",
+ "import math\n",
+ "sr=0.000001;#volt/sec\n",
+ "freq=100000;\n",
+ "vsat=12;\n",
+ "baw=100000;\n",
+ "#determine vx\n",
+ "\n",
+ "#calculation\n",
+ "vx=2*(1/(sr*2*3.14*freq))\n",
+ "\n",
+ "#result\n",
+ "print 'maximum peak amplitude at 100khz',round(vx,3),'V'\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 3 Page No: 1.84"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 2,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "slew rate= 5 volt/μsec\n"
+ ]
+ }
+ ],
+ "source": [
+ "#given\n",
+ "import math\n",
+ "V=20;\n",
+ "t=4;\n",
+ "#determine slew rate\n",
+ "#calculation\n",
+ "w=V/t\n",
+ "#result\n",
+ "print'slew rate=',w,'volt/μsec'\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 4 Page No: 1.84"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 3,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "max frequency of input is 79617.8343949 hz\n"
+ ]
+ }
+ ],
+ "source": [
+ "#given\n",
+ "import math\n",
+ "a=50;\n",
+ "vi=20e-3;\n",
+ "sr=0.5e6;\n",
+ "#determine max frequency\n",
+ "#calculation\n",
+ "vm=a*vi;\n",
+ "freq=sr/(2*3.14*vm)\n",
+ "#result\n",
+ "print 'max frequency of input is ',freq,'hz'\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 5 Page No: 1.84"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 4,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "max peak to peak input signal 0.398089171975 V\n"
+ ]
+ }
+ ],
+ "source": [
+ "#given\n",
+ "import math\n",
+ "sr=0.5e6;\n",
+ "freq=40e3;\n",
+ "a=10;\n",
+ "#determine max peak to peak input signal\n",
+ "#calculation\n",
+ "vm=sr/(2*3.14*freq);\n",
+ "vm=2*vm;\n",
+ "v1=vm/a\n",
+ "#result\n",
+ "print'max peak to peak input signal ',v1,'V'\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {
+ "collapsed": true
+ },
+ "source": [
+ "## Example 6 Page No: 1.85"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 5,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "noise 0.0063247 V\n"
+ ]
+ }
+ ],
+ "source": [
+ "#given\n",
+ "import math\n",
+ "adm=400;\n",
+ "cmrr=50;\n",
+ "vin1=50e-3;\n",
+ "vin2=60e-3;\n",
+ "vnoise=5e-3;\n",
+ "#calculation\n",
+ "v0=(vin2-vin1)*adm;\n",
+ "acm=adm/316.22;\n",
+ "v1=vnoise*acm\n",
+ "print'noise ',round(v1,7),'V'\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 7 Page No: 1.86"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 6,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "time to change from 0 t0 15 4e-07 sec\n",
+ "slew rate 1.5 volt/μsec\n"
+ ]
+ }
+ ],
+ "source": [
+ "#given\n",
+ "import math\n",
+ "sr=35e6;#volt/sec\n",
+ "vsat=15;#volt\n",
+ "#determine time to change from 0 to 15V\n",
+ "#calculation\n",
+ "c=100e-12;#farad\n",
+ "i=150e-6;#A\n",
+ "w=vsat/sr\n",
+ "w1=i/c;\n",
+ "#result\n",
+ "print'time to change from 0 t0 15 ',round(w,7),'sec'\n",
+ "print'slew rate',w1/1000000,'volt/μsec'\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 8 Page No: 1.86"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 7,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "bandwidth 21231.4225053 hz\n"
+ ]
+ }
+ ],
+ "source": [
+ "#given\n",
+ "import math\n",
+ "sr=2e6;#v/sec\n",
+ "vsat=15;#volt\n",
+ "#determine bandwidth \n",
+ "#calculation\n",
+ "\n",
+ "bw=sr/(2*3.14*vsat)\n",
+ "#result\n",
+ "print'bandwidth ',bw,'hz'\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 9 Page No: 1.87"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 8,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "output offset 3.0 V\n"
+ ]
+ }
+ ],
+ "source": [
+ "#given\n",
+ "import math\n",
+ "iin=30e-9;#A\n",
+ "a=1e5;\n",
+ "rin=1000;#ohm\n",
+ "#determine output offset voltage\n",
+ "#calculation\n",
+ "vid=iin*rin;\n",
+ "v0=a*vid\n",
+ "#result\n",
+ "print'output offset ',v0,'V'\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 10 Page No: 1.86"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 9,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "input offset current 4e-06 A\n",
+ "input base current 2.4e-05 A\n"
+ ]
+ }
+ ],
+ "source": [
+ "#given\n",
+ "import math\n",
+ "inb1=22e-6;#A\n",
+ "inb2=26e-6;#A\n",
+ "#determine input offset current input base current\n",
+ "#calculation\n",
+ "i1=inb2-inb1\n",
+ "i2=(inb2+inb1)/2\n",
+ "#result\n",
+ "print'input offset current ',i1,'A'\n",
+ "print'input base current ',i2,'A'\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example 11 Page No: 1.86"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 10,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "input base current 8e-08 A\n",
+ "input offset current 2e-08 A\n",
+ "input offset 2.0 V\n"
+ ]
+ }
+ ],
+ "source": [
+ "#given\n",
+ "import math\n",
+ "inb2=90e-9;#A\n",
+ "inb1=70e-9;#A\n",
+ "a=1e5;\n",
+ "#determine input offset current\n",
+ "#calculation\n",
+ "i1=(inb2+inb1)/2\n",
+ "i2=inb2-inb1\n",
+ "v1=((inb2-inb1)*1000)*a\n",
+ "print'input base current ',i1,'A'\n",
+ "print'input offset current ',i2,'A'\n",
+ "print'input offset ',v1,'V'\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 12 Page No: 1.87"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 2,
+ "metadata": {
+ "collapsed": false,
+ "scrolled": true
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "output voltage cmrr 100 0.051 V\n",
+ "output voltage cmrr 200 0.051 V\n",
+ "output voltage cmrr 450 0.05 V\n",
+ "output voltage cmrr 105 0.051 V\n"
+ ]
+ }
+ ],
+ "source": [
+ "#given\n",
+ "import math\n",
+ "vin1=150e-6;#volt\n",
+ "vin2=100e-6;#volt\n",
+ "a=1000;\n",
+ "from array import array\n",
+ "cmrr=array('i',[100,200,450,105])\n",
+ "#determine output voltage\n",
+ "#calculation\n",
+ "vc=(vin1+vin2)/2;\n",
+ "vd=(vin1-vin2);\n",
+ "j=0;\n",
+ "while j<=3 :v0=(a*vd*(1+(vc/(cmrr[j]*vd)))) ;print 'output voltage cmrr ',cmrr[j],' ',round(v0,3),'V';j=j+1;\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 13 Page No: 1.87"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 13,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "output voltage 0.003 V\n"
+ ]
+ }
+ ],
+ "source": [
+ "#given\n",
+ "import math\n",
+ "rin=100e3;#ohm\n",
+ "rf1=900e3;#ohm\n",
+ "vc=1;#volt\n",
+ "cmrr=70;\n",
+ "#determine the output voltage\n",
+ "#calculation\n",
+ "v0=(1+(rf1/rin))*vc/3160\n",
+ "print 'output voltage ',round(v0,3),'V'\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 14 Page No: 1.89"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 14,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "input voltage 0.08 V\n"
+ ]
+ }
+ ],
+ "source": [
+ "#given\n",
+ "import math\n",
+ "sr=0.5e6;#volt/sec\n",
+ "a=50;\n",
+ "freq=20e3;#hz\n",
+ "#determine max peak to peak voltage\n",
+ "#calculation\n",
+ "v1=sr/(2*3.14*freq*a)\n",
+ "print'input voltage ',round(v1,3),'V'\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 15 Page No: 1.90"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 15,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "max frequency 26.539 Khz\n"
+ ]
+ }
+ ],
+ "source": [
+ "#given\n",
+ "import math\n",
+ "sr=50e6;#volt/sec\n",
+ "rin=2;\n",
+ "vimax=10;\n",
+ "#determine max frequency\n",
+ "#calculation\n",
+ "vm=vimax*(1+rin);\n",
+ "freq=sr/(2*3.14*vm)/10e3;\n",
+ "print 'max frequency ',round(freq,3),'Khz'\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [],
+ "source": []
+ }
+ ],
+ "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.10"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 0
+}
diff --git a/Linear_Integrated_Circuits_by_T._R._Ganesh_Babu/Chapter_2_Applications_Of_Operational_Amplifier.ipynb b/Linear_Integrated_Circuits_by_T._R._Ganesh_Babu/Chapter_2_Applications_Of_Operational_Amplifier.ipynb new file mode 100644 index 00000000..7106978b --- /dev/null +++ b/Linear_Integrated_Circuits_by_T._R._Ganesh_Babu/Chapter_2_Applications_Of_Operational_Amplifier.ipynb @@ -0,0 +1,871 @@ +{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "#Chapter 2 Applications Of Operational Amplifier"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example 1 pagenumber 2.86"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 1,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "R1= 100.0 kohm\n",
+ "R2= 10 kohm\n",
+ "R3= 1 kohm\n"
+ ]
+ }
+ ],
+ "source": [
+ "#given\n",
+ "Rf=10;#ohm\n",
+ "gain1=0.1;\n",
+ "gain2=1;\n",
+ "gain3=10;\n",
+ "#determine r1,r1,r3 \n",
+ "\n",
+ "print 'R1=',Rf/gain1,'kohm';\n",
+ "print 'R2=',Rf/gain2,'kohm';\n",
+ "print 'R3=',Rf/gain3,'kohm';\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example 2 pagenumber 2.86"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 1,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "output voltage 3.0 volt\n"
+ ]
+ }
+ ],
+ "source": [
+ "#given\n",
+ "v1=5;#volt\n",
+ "v2=2;#volt\n",
+ "rf1=10e3;#ohm\n",
+ "r1=10e3;#ohm\n",
+ "#determine output voltage\n",
+ "v0=-((-v1*rf1/r1)-(-v2*rf1/r1));#output voltage\n",
+ "print 'output voltage ',v0,'volt'\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example 4 pagenumber 2.87"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 7,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "switch off gain 1.0\n",
+ "switch on gain -2.0\n"
+ ]
+ }
+ ],
+ "source": [
+ "#given\n",
+ "r1=10e3;#ohm\n",
+ "rf1=20e3;#ohm\n",
+ "r2=5e3;#ohm\n",
+ "#determine gain of amplifier\n",
+ "a1=1+rf1/r1;#gain\n",
+ "a2=-rf1/r1;\n",
+ "print 'switch off gain ',a1+a2;\n",
+ "print 'switch on gain',a2;"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {
+ "collapsed": true
+ },
+ "source": [
+ "##Example 5 pagenumber 2.87"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 10,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "output voltage 6.0 volt\n"
+ ]
+ }
+ ],
+ "source": [
+ "#given\n",
+ "v1=2;#volt\n",
+ "v2=3;#volt\n",
+ "r1=1e3;#ohm\n",
+ "rf1=5e3;#ohm\n",
+ "r2=8e3;#ohm\n",
+ "#determine output voltage\n",
+ "v11=v2*r2/(r2+r1);#output voltage\n",
+ "print 'output voltage ',(1+rf1/r1)*(v2-v1),'volt'\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example 6 pagenumber 2.90"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 19,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "gain amplifer 4.5\n"
+ ]
+ }
+ ],
+ "source": [
+ "#given\n",
+ "r1=2e3;#ohm\n",
+ "rf1=8e3;#ohm\n",
+ "A=45;\n",
+ "#determine gain\n",
+ "a=1+(rf1/r1)\n",
+ "gain=A/(1+A/a);\n",
+ "print 'gain amplifer ',gain\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example 7 pagenumber 2.91"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 20,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "commom mode rejection ratio 929.0\n"
+ ]
+ }
+ ],
+ "source": [
+ "#given\n",
+ "r1=1e3;#ohm\n",
+ "r2=100e3;#ohm\n",
+ "rf1=90e3;#ohm\n",
+ "#determine cmrr\n",
+ "ac=10e3/(r1+r2);#common mode gain\n",
+ "ad=(rf1+r1*((r2)/(r1+r2)*2))/r1;#differential mode gaih\n",
+ "print 'commom mode rejection ratio ',ad/ac#error in book\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example 8 pagenumber 2.92"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 52,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "output current -4.0 mA\n"
+ ]
+ }
+ ],
+ "source": [
+ "#given\n",
+ "ii1=2e-3;#A\n",
+ "rf1=2e3;#ohm\n",
+ "r0=2e3;#ohm\n",
+ "#determine output current\n",
+ "i0=-(ii1+(ii1*rf1)/r0)#output current\n",
+ "\n",
+ "print 'output current',i0*1e3,'mA'\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example 10 pagenumber 2.94"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 1,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "output voltage -0.0 volt\n"
+ ]
+ }
+ ],
+ "source": [
+ "#given\n",
+ "v1=5;#volt\n",
+ "v2=2;#volt\n",
+ "r1=10e3;#ohm\n",
+ "rf1=r1;#ohm\n",
+ "#determine output voltage\n",
+ "v01=-v1*(rf1/r1);#output voltage\n",
+ "v0=-(rf1/r1)*(v01+v1)\n",
+ "\n",
+ "print 'output voltage ',v0,'volt'\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example 11 pagenumber 2.95"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 3,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "output voltage -5.0 v1 + 2.0 v2\n"
+ ]
+ }
+ ],
+ "source": [
+ "#given\n",
+ "rf1=10e3;#ohm\n",
+ "r1=2e3;#ohm\n",
+ "r2=5e3;#ohm\n",
+ "#determine output voltage\n",
+ "print 'output voltage ',-rf1/r1,'v1 +',rf1/r2,'v2'\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example 13 pagenumber 2.97"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 7,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "R1= 1.592 Kohm\n",
+ "Ri= 10 Kohm\n",
+ "Rf= 5.76 Kohm\n"
+ ]
+ }
+ ],
+ "source": [
+ "#given\n",
+ "freq=1e3;#hz\n",
+ "c=0.1e-6;#farad\n",
+ "#determine rf ri r1\n",
+ "r1=1/(2*3.14*freq*c)\n",
+ "print 'R1=',round(r1/1e3,3),'Kohm'\n",
+ "print 'Ri= 10 Kohm'\n",
+ "ri=10e3;\n",
+ "rf=(1.576-1)*ri;\n",
+ "print 'Rf=',rf/1000,'Kohm'\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example 14 pagenumber 2.97"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 10,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "R1= 796.0 ohm\n",
+ "R2= 9.0 ohm\n",
+ "R3= 32.0 ohm\n"
+ ]
+ }
+ ],
+ "source": [
+ "#given\n",
+ "fc=3e3;#hz\n",
+ "q=30;\n",
+ "af=20;\n",
+ "c=0.1e-6;#farad\n",
+ "#determine r1 r2 r3\n",
+ "r1=q/(2*3.14*fc*c*af)\n",
+ "r2=q/(2*3.14*fc*c*(2*q*q-af))\n",
+ "r3=q/(3.14*fc*c)/1e3;\n",
+ "print 'R1=',round(r1),'ohm'\n",
+ "print 'R2=',round(r2),'ohm'\n",
+ "print 'R3=',round(r3),'ohm'\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example 15 pagenumber 2.98"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 12,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "R= 11.0 Kohm\n",
+ "Rf1= 66.0 Kohm\n"
+ ]
+ }
+ ],
+ "source": [
+ "#given\n",
+ "fc=1.5e3;#hz\n",
+ "c=0.01e-6;#farad\n",
+ "r1=33e3;#ohm\n",
+ "#determine rf1\n",
+ "r=1/(2*3.14*fc*c)\n",
+ "rf1=2*r1\n",
+ "print 'R= ',round(r/1e3),'Kohm'\n",
+ "print 'Rf1=',round(rf1/1e3),'Kohm'\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example 16 pagenumber 2.99"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 20,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "R1= 3.18 Kohm\n",
+ "R2= 723.8 ohm\n"
+ ]
+ }
+ ],
+ "source": [
+ "#given\n",
+ "f1=500;#hz\n",
+ "f2=2.2e3;#hz\n",
+ "a=5;\n",
+ "c=0.1e-6;#farad\n",
+ "rf1=10e3;#ohm\n",
+ "#determine r1 r2\n",
+ "r1=1/(2*3.14*f1*c)\n",
+ "r2=1/(2*3.14*f2*c)\n",
+ "print 'R1=',round(r1/1000,2),'Kohm'\n",
+ "print 'R2=',round(r2,1),'ohm'\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example 17 pagenumber 2.100"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 54,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Vin 0.1 volt\n"
+ ]
+ }
+ ],
+ "source": [
+ "#given\n",
+ "R=100e3;#ohm\n",
+ "IB=1e-6;#A\n",
+ "Vt=25e-3;#volt\n",
+ "v0=0;#volt\n",
+ "#determine Vin\n",
+ "Vin=(v0*2.3*Vt)+(R*IB);#input voltage\n",
+ "print \"Vin \",round(Vin,3),\" volt\"\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example 18 pagenumber 2.101"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 24,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "R1= 1885.0 Kohm\n",
+ "R2= 29 ohm\n"
+ ]
+ }
+ ],
+ "source": [
+ "#given\n",
+ "freq=100;#hz\n",
+ "c=0.1e-6;#farad\n",
+ "#determine r1 r2\n",
+ "r2=29;#assume\n",
+ "r1=((0.065/(freq*c))*10)*r2\n",
+ "print 'R1=',round(r1/1e3,3),'Kohm'\n",
+ "print 'R2= 29 ohm'\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example 19 pagenumber 2.101"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 56,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "R1= 10.0 Kohm\n",
+ "Rf1= 5.0 Kohm\n"
+ ]
+ }
+ ],
+ "source": [
+ "#given\n",
+ "freq=15.9e3;#hz\n",
+ "a=1.5;\n",
+ "#determine rf1 r1\n",
+ "c=0.001e-6;#farad\n",
+ "r1=1/(2*3.14*freq*c)\n",
+ "rf1=(a-1)*(1/(2*3.14*freq*c))#feedback resistance\n",
+ "print 'R=',round(r1/1e3,1),'Kohm'\n",
+ "print'Rf=',round(rf1/1e3,1),'Kohm'\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example 20 pagenumber 2.103"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 25,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "output voltage 14.7 volt\n"
+ ]
+ }
+ ],
+ "source": [
+ "#given\n",
+ "v1=2;#volt\n",
+ "v2=3;#volt\n",
+ "v3=6;#volt\n",
+ "v4=8;#volt\n",
+ "rf1=50e3;#ohm\n",
+ "r1=40e3;#ohm\n",
+ "r2=25e3;#ohm\n",
+ "r3=10e3;#ohm\n",
+ "r4=20e3;#ohm\n",
+ "#determine output voltage\n",
+ "v0x=-(v1*rf1/r1)-(v2*rf1/r2);\n",
+ "vn=12e3*v3/(r3+12e3)+(7.5e3*v4/(r4+7.5e3));\n",
+ "v0y=(1+rf1/(r1*r2/(r1+r2)))*vn;\n",
+ "print 'output voltage ',round(v0x+v0y,1),'volt'\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example 22 pagenumber 2.105"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 4,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "output voltage -25 volt\n"
+ ]
+ },
+ {
+ "data": {
+ "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYUAAAEZCAYAAAB4hzlwAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAHeFJREFUeJzt3Xu8bXO9//HXm51q51oqEm2FOkqSUg6yqsNRCZtfyaYT\n+vX4PbrpdCGXOrbq/NBtnzrx6zyQVDgbIVKiskSnKPdCqBRRsVNulct+//4YYy1zL3OtNddaY84x\n55jv5+MxH3vOcZnzMzvO+sz3+I7xHbJNREQEwEp1FxAREf0jTSEiIsalKURExLg0hYiIGJemEBER\n49IUIiJiXJpCRA9J2lfSJXXXETGZNIVoDEm3SnpQ0n0tj8/XXVdVJH1a0k2S7pV0g6S3tqzbRNI3\nJP1R0jJJ50vapM56YzClKUSTGNjZ9motjwPqLqpC91N8v9WBtwGfk7R1uW4N4GxgE+CZwOXAN2qp\nMgZamkIMBUn/T9IZLa+PlvTd8vlakr5Z/sr+k6Rz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4gCYsG6th\n4uc/rrnZvpniJkXXAZ+Q9NH2XytiZtIUosnuA1ar4o3Kab83sD1KcXOSNYBVKWbsPaBlu7FDVRcC\n/2escUhaC7gJWCDpeeU2bwUunuajfwAsKt/jdRSD50haF/ib7ZOBTzPJ3PgRM5WmEI1lexnF+MB1\n7QaaWfFX+sRf8RNfrwx8VdK1FId3PlfeTOfjwBPKweGfAUeU2x8P/JZimvCrgb1s/41iuuLTy/d5\nBPjiJLWMvT6C4i5uPwMWAr8pl29GMX5xFfDRso6IOcvU2RERMS5JISIixqUpRETEuDSFiIgYl6YQ\nERHj0hQiImJcmkJERIxLU4iIiHFpChERMe7/A5+nZCRnS2RUAAAAAElFTkSuQmCC\n",
+ "text/plain": [
+ "<matplotlib.figure.Figure at 0xa347f60>"
+ ]
+ },
+ "metadata": {},
+ "output_type": "display_data"
+ }
+ ],
+ "source": [
+ "#given\n",
+ "%matplotlib inline\n",
+ "from matplotlib.pyplot import plot, text, xlabel, ylabel, show, axes, title, gca\n",
+ "from numpy import arange, nditer\n",
+ "rc1=1;\n",
+ "vi=5;#volt\n",
+ "c=1e-6;#farad\n",
+ "r=1e6;#ohm\n",
+ "#determine output voltage\n",
+ "v0=-(1/rc1)*(vi*5)#output voltage\n",
+ "from array import array\n",
+ "x=array('f',[0,1,2,3,4,5,6])\n",
+ "y=array('f',[0,-5,-10,-15,-20,-25,-30])\n",
+ "plot(x,y) \n",
+ "title(\"Example 22\")\n",
+ "xlabel(\"t in seconds\")\n",
+ "ylabel(\"output voltage in volts\")\n",
+ "print 'output voltage ',v0,'volt';\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example 23 paenumber 2.106"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 45,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "output voltage 0.01 -0.414 volt\n",
+ "output voltage 0.1 -0.474 volt\n",
+ "output voltage 1.0 -0.533 volt\n"
+ ]
+ }
+ ],
+ "source": [
+ "#given\n",
+ "from array import array\n",
+ "vi=array('f',[10e-3,100e-3,1]);\n",
+ "r1=1e3;#ohm\n",
+ "i1=10e-13;#A\n",
+ "#determine output voltage\n",
+ "w=0;\n",
+ "import math\n",
+ "while w<3 : v0=-(0.02571)*(math.log(vi[w]/(i1*r1))); print'output voltage',round(vi[w],3),round(v0,3),'volt'; w=w+1;#error in book\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example 24 pagenumber 2.107"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 37,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "output voltage 0.067 volt\n"
+ ]
+ }
+ ],
+ "source": [
+ "#given\n",
+ "k1=1.38e-23;#j/k\n",
+ "t1=298;#k\n",
+ "q=1.6e-19;#columb\n",
+ "vi=10e-3;#volt\n",
+ "ri=10e3;#ohm\n",
+ "#determine output voltage\n",
+ "import math\n",
+ "v0=-(k1*t1/q)*0.4343*math.log(vi/ri)/2.303;#output voltage\n",
+ "print 'output voltage ',round(v0,3),'volt'\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example 25 pagenumber 2.108"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 39,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "output voltage 14751.04 volt\n"
+ ]
+ }
+ ],
+ "source": [
+ "#given\n",
+ "rf1=10e3;#ohm\n",
+ "vi=1e-2;#volt\n",
+ "#determine output voltage\n",
+ "import math\n",
+ "v0=math.exp(-vi/26e-3)*rf1*2.167;#output voltage\n",
+ "print'output voltage ',round(v0,2),'volt'\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example 26 pagenumber 2.109"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 18,
+ "metadata": {
+ "collapsed": false,
+ "scrolled": true
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "quality factor 3.333\n",
+ "lower frequency 1291.781 hz\n",
+ "upper frequency 1741.781 hz\n"
+ ]
+ }
+ ],
+ "source": [
+ "#given\n",
+ "freq=1.5e3;#hz\n",
+ "bw=450;#hz\n",
+ "#determine qualityfactor f1 f2\n",
+ "q=freq/bw;#quality factor\n",
+ "import math\n",
+ "f1=freq*math.sqrt(1+(1/(4*q*q)))-freq/(2*q);#lower frequency\n",
+ "f2=freq*math.sqrt(1+(1/(4*q*q)))+bw/2;#upper frequency\n",
+ "print'quality factor ',round(q,3)\n",
+ "print'lower frequency ',round(f1,3),'hz'\n",
+ "print'upper frequency ',round(f2,3),'hz'\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Exammple 27 pagenumber 2.109"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 34,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Rf 7.962 Kohm\n",
+ "R1 796.178 ohm\n",
+ "Cf 0.01 μfarad\n"
+ ]
+ }
+ ],
+ "source": [
+ "#given\n",
+ "freq=200;#hz\n",
+ "vi=2;#volt\n",
+ "c1=0.1e-6;#farad\n",
+ "freqb=2000;#hz\n",
+ "#determine cf1 rf1 r1\n",
+ "rf1=1/(2*3.14*freq*c1);#feedback resistance\n",
+ "r1=1/(2*3.14*c1*freqb);#input resistance\n",
+ "cf1=r1*c1/rf1;#feedback capacitance\n",
+ "print'Rf ',round(rf1/1e3,3),' Kohm'\n",
+ "print'R1 ',round(r1,3),'ohm'\n",
+ "print'Cf ',round(cf1*1e6,3),' μfarad'#error in book\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+ "source": []
+ }
+ ],
+ "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.10"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 0
+}
diff --git a/Linear_Integrated_Circuits_by_T._R._Ganesh_Babu/Chapter_2_Applications_Of_Operational_Amplifier_1.ipynb b/Linear_Integrated_Circuits_by_T._R._Ganesh_Babu/Chapter_2_Applications_Of_Operational_Amplifier_1.ipynb new file mode 100644 index 00000000..7106978b --- /dev/null +++ b/Linear_Integrated_Circuits_by_T._R._Ganesh_Babu/Chapter_2_Applications_Of_Operational_Amplifier_1.ipynb @@ -0,0 +1,871 @@ +{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "#Chapter 2 Applications Of Operational Amplifier"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example 1 pagenumber 2.86"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 1,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "R1= 100.0 kohm\n",
+ "R2= 10 kohm\n",
+ "R3= 1 kohm\n"
+ ]
+ }
+ ],
+ "source": [
+ "#given\n",
+ "Rf=10;#ohm\n",
+ "gain1=0.1;\n",
+ "gain2=1;\n",
+ "gain3=10;\n",
+ "#determine r1,r1,r3 \n",
+ "\n",
+ "print 'R1=',Rf/gain1,'kohm';\n",
+ "print 'R2=',Rf/gain2,'kohm';\n",
+ "print 'R3=',Rf/gain3,'kohm';\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example 2 pagenumber 2.86"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 1,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "output voltage 3.0 volt\n"
+ ]
+ }
+ ],
+ "source": [
+ "#given\n",
+ "v1=5;#volt\n",
+ "v2=2;#volt\n",
+ "rf1=10e3;#ohm\n",
+ "r1=10e3;#ohm\n",
+ "#determine output voltage\n",
+ "v0=-((-v1*rf1/r1)-(-v2*rf1/r1));#output voltage\n",
+ "print 'output voltage ',v0,'volt'\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example 4 pagenumber 2.87"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 7,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "switch off gain 1.0\n",
+ "switch on gain -2.0\n"
+ ]
+ }
+ ],
+ "source": [
+ "#given\n",
+ "r1=10e3;#ohm\n",
+ "rf1=20e3;#ohm\n",
+ "r2=5e3;#ohm\n",
+ "#determine gain of amplifier\n",
+ "a1=1+rf1/r1;#gain\n",
+ "a2=-rf1/r1;\n",
+ "print 'switch off gain ',a1+a2;\n",
+ "print 'switch on gain',a2;"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {
+ "collapsed": true
+ },
+ "source": [
+ "##Example 5 pagenumber 2.87"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 10,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "output voltage 6.0 volt\n"
+ ]
+ }
+ ],
+ "source": [
+ "#given\n",
+ "v1=2;#volt\n",
+ "v2=3;#volt\n",
+ "r1=1e3;#ohm\n",
+ "rf1=5e3;#ohm\n",
+ "r2=8e3;#ohm\n",
+ "#determine output voltage\n",
+ "v11=v2*r2/(r2+r1);#output voltage\n",
+ "print 'output voltage ',(1+rf1/r1)*(v2-v1),'volt'\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example 6 pagenumber 2.90"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 19,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "gain amplifer 4.5\n"
+ ]
+ }
+ ],
+ "source": [
+ "#given\n",
+ "r1=2e3;#ohm\n",
+ "rf1=8e3;#ohm\n",
+ "A=45;\n",
+ "#determine gain\n",
+ "a=1+(rf1/r1)\n",
+ "gain=A/(1+A/a);\n",
+ "print 'gain amplifer ',gain\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example 7 pagenumber 2.91"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 20,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "commom mode rejection ratio 929.0\n"
+ ]
+ }
+ ],
+ "source": [
+ "#given\n",
+ "r1=1e3;#ohm\n",
+ "r2=100e3;#ohm\n",
+ "rf1=90e3;#ohm\n",
+ "#determine cmrr\n",
+ "ac=10e3/(r1+r2);#common mode gain\n",
+ "ad=(rf1+r1*((r2)/(r1+r2)*2))/r1;#differential mode gaih\n",
+ "print 'commom mode rejection ratio ',ad/ac#error in book\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example 8 pagenumber 2.92"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 52,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "output current -4.0 mA\n"
+ ]
+ }
+ ],
+ "source": [
+ "#given\n",
+ "ii1=2e-3;#A\n",
+ "rf1=2e3;#ohm\n",
+ "r0=2e3;#ohm\n",
+ "#determine output current\n",
+ "i0=-(ii1+(ii1*rf1)/r0)#output current\n",
+ "\n",
+ "print 'output current',i0*1e3,'mA'\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example 10 pagenumber 2.94"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 1,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "output voltage -0.0 volt\n"
+ ]
+ }
+ ],
+ "source": [
+ "#given\n",
+ "v1=5;#volt\n",
+ "v2=2;#volt\n",
+ "r1=10e3;#ohm\n",
+ "rf1=r1;#ohm\n",
+ "#determine output voltage\n",
+ "v01=-v1*(rf1/r1);#output voltage\n",
+ "v0=-(rf1/r1)*(v01+v1)\n",
+ "\n",
+ "print 'output voltage ',v0,'volt'\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example 11 pagenumber 2.95"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 3,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "output voltage -5.0 v1 + 2.0 v2\n"
+ ]
+ }
+ ],
+ "source": [
+ "#given\n",
+ "rf1=10e3;#ohm\n",
+ "r1=2e3;#ohm\n",
+ "r2=5e3;#ohm\n",
+ "#determine output voltage\n",
+ "print 'output voltage ',-rf1/r1,'v1 +',rf1/r2,'v2'\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example 13 pagenumber 2.97"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 7,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "R1= 1.592 Kohm\n",
+ "Ri= 10 Kohm\n",
+ "Rf= 5.76 Kohm\n"
+ ]
+ }
+ ],
+ "source": [
+ "#given\n",
+ "freq=1e3;#hz\n",
+ "c=0.1e-6;#farad\n",
+ "#determine rf ri r1\n",
+ "r1=1/(2*3.14*freq*c)\n",
+ "print 'R1=',round(r1/1e3,3),'Kohm'\n",
+ "print 'Ri= 10 Kohm'\n",
+ "ri=10e3;\n",
+ "rf=(1.576-1)*ri;\n",
+ "print 'Rf=',rf/1000,'Kohm'\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example 14 pagenumber 2.97"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 10,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "R1= 796.0 ohm\n",
+ "R2= 9.0 ohm\n",
+ "R3= 32.0 ohm\n"
+ ]
+ }
+ ],
+ "source": [
+ "#given\n",
+ "fc=3e3;#hz\n",
+ "q=30;\n",
+ "af=20;\n",
+ "c=0.1e-6;#farad\n",
+ "#determine r1 r2 r3\n",
+ "r1=q/(2*3.14*fc*c*af)\n",
+ "r2=q/(2*3.14*fc*c*(2*q*q-af))\n",
+ "r3=q/(3.14*fc*c)/1e3;\n",
+ "print 'R1=',round(r1),'ohm'\n",
+ "print 'R2=',round(r2),'ohm'\n",
+ "print 'R3=',round(r3),'ohm'\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example 15 pagenumber 2.98"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 12,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "R= 11.0 Kohm\n",
+ "Rf1= 66.0 Kohm\n"
+ ]
+ }
+ ],
+ "source": [
+ "#given\n",
+ "fc=1.5e3;#hz\n",
+ "c=0.01e-6;#farad\n",
+ "r1=33e3;#ohm\n",
+ "#determine rf1\n",
+ "r=1/(2*3.14*fc*c)\n",
+ "rf1=2*r1\n",
+ "print 'R= ',round(r/1e3),'Kohm'\n",
+ "print 'Rf1=',round(rf1/1e3),'Kohm'\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example 16 pagenumber 2.99"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 20,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "R1= 3.18 Kohm\n",
+ "R2= 723.8 ohm\n"
+ ]
+ }
+ ],
+ "source": [
+ "#given\n",
+ "f1=500;#hz\n",
+ "f2=2.2e3;#hz\n",
+ "a=5;\n",
+ "c=0.1e-6;#farad\n",
+ "rf1=10e3;#ohm\n",
+ "#determine r1 r2\n",
+ "r1=1/(2*3.14*f1*c)\n",
+ "r2=1/(2*3.14*f2*c)\n",
+ "print 'R1=',round(r1/1000,2),'Kohm'\n",
+ "print 'R2=',round(r2,1),'ohm'\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example 17 pagenumber 2.100"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 54,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Vin 0.1 volt\n"
+ ]
+ }
+ ],
+ "source": [
+ "#given\n",
+ "R=100e3;#ohm\n",
+ "IB=1e-6;#A\n",
+ "Vt=25e-3;#volt\n",
+ "v0=0;#volt\n",
+ "#determine Vin\n",
+ "Vin=(v0*2.3*Vt)+(R*IB);#input voltage\n",
+ "print \"Vin \",round(Vin,3),\" volt\"\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example 18 pagenumber 2.101"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 24,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "R1= 1885.0 Kohm\n",
+ "R2= 29 ohm\n"
+ ]
+ }
+ ],
+ "source": [
+ "#given\n",
+ "freq=100;#hz\n",
+ "c=0.1e-6;#farad\n",
+ "#determine r1 r2\n",
+ "r2=29;#assume\n",
+ "r1=((0.065/(freq*c))*10)*r2\n",
+ "print 'R1=',round(r1/1e3,3),'Kohm'\n",
+ "print 'R2= 29 ohm'\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example 19 pagenumber 2.101"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 56,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "R1= 10.0 Kohm\n",
+ "Rf1= 5.0 Kohm\n"
+ ]
+ }
+ ],
+ "source": [
+ "#given\n",
+ "freq=15.9e3;#hz\n",
+ "a=1.5;\n",
+ "#determine rf1 r1\n",
+ "c=0.001e-6;#farad\n",
+ "r1=1/(2*3.14*freq*c)\n",
+ "rf1=(a-1)*(1/(2*3.14*freq*c))#feedback resistance\n",
+ "print 'R=',round(r1/1e3,1),'Kohm'\n",
+ "print'Rf=',round(rf1/1e3,1),'Kohm'\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example 20 pagenumber 2.103"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 25,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "output voltage 14.7 volt\n"
+ ]
+ }
+ ],
+ "source": [
+ "#given\n",
+ "v1=2;#volt\n",
+ "v2=3;#volt\n",
+ "v3=6;#volt\n",
+ "v4=8;#volt\n",
+ "rf1=50e3;#ohm\n",
+ "r1=40e3;#ohm\n",
+ "r2=25e3;#ohm\n",
+ "r3=10e3;#ohm\n",
+ "r4=20e3;#ohm\n",
+ "#determine output voltage\n",
+ "v0x=-(v1*rf1/r1)-(v2*rf1/r2);\n",
+ "vn=12e3*v3/(r3+12e3)+(7.5e3*v4/(r4+7.5e3));\n",
+ "v0y=(1+rf1/(r1*r2/(r1+r2)))*vn;\n",
+ "print 'output voltage ',round(v0x+v0y,1),'volt'\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example 22 pagenumber 2.105"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 4,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "output voltage -25 volt\n"
+ ]
+ },
+ {
+ "data": {
+ "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYUAAAEZCAYAAAB4hzlwAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAHeFJREFUeJzt3Xu8bXO9//HXm51q51oqEm2FOkqSUg6yqsNRCZtfyaYT\n+vX4PbrpdCGXOrbq/NBtnzrx6zyQVDgbIVKiskSnKPdCqBRRsVNulct+//4YYy1zL3OtNddaY84x\n55jv5+MxH3vOcZnzMzvO+sz3+I7xHbJNREQEwEp1FxAREf0jTSEiIsalKURExLg0hYiIGJemEBER\n49IUIiJiXJpCRA9J2lfSJXXXETGZNIVoDEm3SnpQ0n0tj8/XXVdVJH1a0k2S7pV0g6S3tqzbRNI3\nJP1R0jJJ50vapM56YzClKUSTGNjZ9motjwPqLqpC91N8v9WBtwGfk7R1uW4N4GxgE+CZwOXAN2qp\nMgZamkIMBUn/T9IZLa+PlvTd8vlakr5Z/sr+k6RzJa3Xsu2opI9L+mGZPs6RtLakkyX9RdLlkp7T\nsv1ySe+V9EtJd0n6pCRNUtcLJF1Y/rq/UdKbJvsOthfbvql8fjlwCbB1+fontk+0/WfbjwD/ATxf\n0lpz+18u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dRSD50haF/ib7ZOBTzPJ3PgRM5WmEI1lexnF+MB1\n7QaaWfFX+sRf8RNfrwx8VdK1FId3PlfeTOfjwBPKweGfAUeU2x8P/JZimvCrgb1s/41iuuLTy/d5\nBPjiJLWMvT6C4i5uPwMWAr8pl29GMX5xFfDRso6IOcvU2RERMS5JISIixqUpRETEuDSFiIgYl6YQ\nERHj0hQiImJcmkJERIxLU4iIiHFpChERMe7/A5+nZCRnS2RUAAAAAElFTkSuQmCC\n",
+ "text/plain": [
+ "<matplotlib.figure.Figure at 0xa347f60>"
+ ]
+ },
+ "metadata": {},
+ "output_type": "display_data"
+ }
+ ],
+ "source": [
+ "#given\n",
+ "%matplotlib inline\n",
+ "from matplotlib.pyplot import plot, text, xlabel, ylabel, show, axes, title, gca\n",
+ "from numpy import arange, nditer\n",
+ "rc1=1;\n",
+ "vi=5;#volt\n",
+ "c=1e-6;#farad\n",
+ "r=1e6;#ohm\n",
+ "#determine output voltage\n",
+ "v0=-(1/rc1)*(vi*5)#output voltage\n",
+ "from array import array\n",
+ "x=array('f',[0,1,2,3,4,5,6])\n",
+ "y=array('f',[0,-5,-10,-15,-20,-25,-30])\n",
+ "plot(x,y) \n",
+ "title(\"Example 22\")\n",
+ "xlabel(\"t in seconds\")\n",
+ "ylabel(\"output voltage in volts\")\n",
+ "print 'output voltage ',v0,'volt';\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example 23 paenumber 2.106"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 45,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "output voltage 0.01 -0.414 volt\n",
+ "output voltage 0.1 -0.474 volt\n",
+ "output voltage 1.0 -0.533 volt\n"
+ ]
+ }
+ ],
+ "source": [
+ "#given\n",
+ "from array import array\n",
+ "vi=array('f',[10e-3,100e-3,1]);\n",
+ "r1=1e3;#ohm\n",
+ "i1=10e-13;#A\n",
+ "#determine output voltage\n",
+ "w=0;\n",
+ "import math\n",
+ "while w<3 : v0=-(0.02571)*(math.log(vi[w]/(i1*r1))); print'output voltage',round(vi[w],3),round(v0,3),'volt'; w=w+1;#error in book\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example 24 pagenumber 2.107"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 37,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "output voltage 0.067 volt\n"
+ ]
+ }
+ ],
+ "source": [
+ "#given\n",
+ "k1=1.38e-23;#j/k\n",
+ "t1=298;#k\n",
+ "q=1.6e-19;#columb\n",
+ "vi=10e-3;#volt\n",
+ "ri=10e3;#ohm\n",
+ "#determine output voltage\n",
+ "import math\n",
+ "v0=-(k1*t1/q)*0.4343*math.log(vi/ri)/2.303;#output voltage\n",
+ "print 'output voltage ',round(v0,3),'volt'\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example 25 pagenumber 2.108"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 39,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "output voltage 14751.04 volt\n"
+ ]
+ }
+ ],
+ "source": [
+ "#given\n",
+ "rf1=10e3;#ohm\n",
+ "vi=1e-2;#volt\n",
+ "#determine output voltage\n",
+ "import math\n",
+ "v0=math.exp(-vi/26e-3)*rf1*2.167;#output voltage\n",
+ "print'output voltage ',round(v0,2),'volt'\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example 26 pagenumber 2.109"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 18,
+ "metadata": {
+ "collapsed": false,
+ "scrolled": true
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "quality factor 3.333\n",
+ "lower frequency 1291.781 hz\n",
+ "upper frequency 1741.781 hz\n"
+ ]
+ }
+ ],
+ "source": [
+ "#given\n",
+ "freq=1.5e3;#hz\n",
+ "bw=450;#hz\n",
+ "#determine qualityfactor f1 f2\n",
+ "q=freq/bw;#quality factor\n",
+ "import math\n",
+ "f1=freq*math.sqrt(1+(1/(4*q*q)))-freq/(2*q);#lower frequency\n",
+ "f2=freq*math.sqrt(1+(1/(4*q*q)))+bw/2;#upper frequency\n",
+ "print'quality factor ',round(q,3)\n",
+ "print'lower frequency ',round(f1,3),'hz'\n",
+ "print'upper frequency ',round(f2,3),'hz'\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Exammple 27 pagenumber 2.109"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 34,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Rf 7.962 Kohm\n",
+ "R1 796.178 ohm\n",
+ "Cf 0.01 μfarad\n"
+ ]
+ }
+ ],
+ "source": [
+ "#given\n",
+ "freq=200;#hz\n",
+ "vi=2;#volt\n",
+ "c1=0.1e-6;#farad\n",
+ "freqb=2000;#hz\n",
+ "#determine cf1 rf1 r1\n",
+ "rf1=1/(2*3.14*freq*c1);#feedback resistance\n",
+ "r1=1/(2*3.14*c1*freqb);#input resistance\n",
+ "cf1=r1*c1/rf1;#feedback capacitance\n",
+ "print'Rf ',round(rf1/1e3,3),' Kohm'\n",
+ "print'R1 ',round(r1,3),'ohm'\n",
+ "print'Cf ',round(cf1*1e6,3),' μfarad'#error in book\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+ "source": []
+ }
+ ],
+ "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.10"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 0
+}
diff --git a/Linear_Integrated_Circuits_by_T._R._Ganesh_Babu/Chapter_4_Analog_to_Digital_and_Digital_to_Analog_converters.ipynb b/Linear_Integrated_Circuits_by_T._R._Ganesh_Babu/Chapter_4_Analog_to_Digital_and_Digital_to_Analog_converters.ipynb new file mode 100644 index 00000000..8136593e --- /dev/null +++ b/Linear_Integrated_Circuits_by_T._R._Ganesh_Babu/Chapter_4_Analog_to_Digital_and_Digital_to_Analog_converters.ipynb @@ -0,0 +1,815 @@ +{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "#Chapter 4 Analog to Digital and Digital to Analog converters"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example 1 pagenumber 4.38"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 1,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "output voltage 5.0 volt\n"
+ ]
+ }
+ ],
+ "source": [
+ "#given\n",
+ "z='0101';\n",
+ "n=4;\n",
+ "vof=15;#volt\n",
+ "#determine v0\n",
+ "r=vof/(pow(2,n)-1);\n",
+ "v0=r*int(z,2);#output voltage\n",
+ "print 'output voltage ',round(v0,3),'volt';\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example 2 pagenumber 4.38"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 2,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "output offset 5.1 volt\n",
+ "output voltage 3.84 volt\n"
+ ]
+ }
+ ],
+ "source": [
+ "#given\n",
+ "r=20e-3;\n",
+ "z='11000000';\n",
+ "n=8;\n",
+ "#determine output voltage output offset voltage\n",
+ "vof=r*(pow(2,n)-1);#output offsetvoltage\n",
+ "v0=r*int(z,2);#output voltage\n",
+ "print 'output offset ',round(vof,3),'volt';\n",
+ "print 'output voltage ',round(v0,3),'volt';\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example 3 pagenumber 4.38"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 2,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "output voltage 0111 = 2331.0 milivolt\n",
+ "output voltage 1111 = 4995.0 milivolt\n"
+ ]
+ }
+ ],
+ "source": [
+ "#given\n",
+ "n=4;\n",
+ "import numpy as np\n",
+ "z=np.array(['0111','1111']);\n",
+ "vref=5;#volt\n",
+ "#determine v0\n",
+ "r=vref*pow(10,3)/(pow(2,n)-1)\n",
+ "i=0;\n",
+ "while i<2 : v0=r*int(z[i],2); print'output voltage ',z[i],' = ',round(v0),'milivolt';i=i+1;\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example 4 pagenumber 4.39"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 5,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "full scale output voltage 31.77 volt\n",
+ "Resolution 0.03 %\n",
+ "output voltage 15.24 volt\n"
+ ]
+ }
+ ],
+ "source": [
+ "#given\n",
+ "n=12;\n",
+ "r=8e-3;#volt\n",
+ "z='011101110001';\n",
+ "#determine output voltage\n",
+ "vof=r*pow(2,n)-1;\n",
+ "v0=r*int(z,2);#output voltage\n",
+ "r=r*1e2/vof;\n",
+ "print'full scale output voltage',round(vof,2),'volt';\n",
+ "print'Resolution',round(r,2),'%';\n",
+ "print'output voltage ',round(v0,3),'volt';\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example 5 pagenumber 4.39"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 12,
+ "metadata": {
+ "collapsed": false,
+ "scrolled": true
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "minumum number of bits 16384\n",
+ "minmum voltage 610.0 μvolt\n",
+ "quantization error 176.0 μvolt\n",
+ "sampling rate 5.0 Khz\n",
+ "aperture time 0.01 μsecond\n",
+ "converter 84 dB\n"
+ ]
+ }
+ ],
+ "source": [
+ "#given\n",
+ "fs=1e3;#hz\n",
+ "r=0.01;\n",
+ "vref=10;#volt\n",
+ "#determine n vmin rms fs1 t1 z\n",
+ "r=0.01/100;\n",
+ "n=14;\n",
+ "print'minumum number of bits ',pow(2,14);\n",
+ "vm=vref*pow(10,6)/pow(2,n);#minmum voltage\n",
+ "print'minmum voltage ',round(vm),'μvolt';\n",
+ "import math\n",
+ "eq=vref/(pow(2,n)*2*math.sqrt(3));#quantization error\n",
+ "print'quantization error ',round(eq*pow(10,6)),'μvolt';\n",
+ "fs1=5*fs;#sampling rate\n",
+ "print'sampling rate ',fs1/1e3,'Khz';\n",
+ "t1=1/(2*3.14*fs*pow(2,n));#aperture time\n",
+ "print'aperture time ',round(t1*pow(10,6),3),'μsecond';#error in book\n",
+ "print'converter ',6*n,'dB';\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example 6 pagenumber 4.40"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 8,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "R = 5.0 Kohm\n",
+ "I at 1100 = 1.4 mA\n"
+ ]
+ }
+ ],
+ "source": [
+ "#given\n",
+ "vref=10;#volt\n",
+ "Is=1.875e-3;#A\n",
+ "#determine R I\n",
+ "n=4;\n",
+ "v0=vref*pow(10,3)/pow(2,n)*(1*pow(2,(n-1))+1*pow(2,(n-2))+1*pow(2,(n-3))+1*pow(2,(n-4)));\n",
+ "r=v0/((Is)*pow(10,6));\n",
+ "print'R = ',round(r,3),' Kohm';\n",
+ "v0=vref*pow(10,3)/pow(2,n)*(1*pow(2,(n-1))+1*pow(2,(n-2)));\n",
+ "print'I at 1100 = ',round(v0/pow(10,3)/r,3),'mA';\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example 7 pagenumber 4.41"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 9,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "N= 6.0\n"
+ ]
+ }
+ ],
+ "source": [
+ "#given\n",
+ "vmin=1e-3;#volt\n",
+ "vref=10;#volt\n",
+ "q=0.01;\n",
+ "#determine n\n",
+ "import math\n",
+ "n=math.log10(((0.5)/0.01)+1)/math.log10(2);\n",
+ "print'N= ',round(n);\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {
+ "collapsed": false
+ },
+ "source": [
+ "##Example 8 pagenumber 4.42"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 15,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "R in percent 0.392 %\n"
+ ]
+ }
+ ],
+ "source": [
+ "#given\n",
+ "n=8;\n",
+ "#determine R\n",
+ "r=1*100e0/(pow(2,n)-1);\n",
+ "print'R in percent ',round(r,3),'%';\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example 9 pagenumber 4.42"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 12,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Resolution in percent 3.0 %\n"
+ ]
+ }
+ ],
+ "source": [
+ "#given\n",
+ "n=5;\n",
+ "#determine resolution\n",
+ "r=1*100/(pow(2,n)-1);#Resolution\n",
+ "print'Resolution in percent ',round(r,3),'%';\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example 10 pagenumber 4.42"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 17,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "minimum voltage each bit 300.0 milivolt\n",
+ "output voltage at 100110 = 12.063 volt\n"
+ ]
+ }
+ ],
+ "source": [
+ "#given\n",
+ "import numpy as np\n",
+ "z=np.array(['111111','100110']);\n",
+ "vref1=20;#volt\n",
+ "#determine output voltage\n",
+ "e=1*pow(10,3)/int(z[0],2)*vref1;#minimum voltage\n",
+ "print'minimum voltage each bit ',round(e,3),'milivolt';\n",
+ "e=int(z[1],2)*1e0/int(z[0],2)*vref1;#output voltage\n",
+ "print'output voltage at ',z[1],' = ',round(e,3),'volt';\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {
+ "collapsed": true
+ },
+ "source": [
+ "##Example 11 pagenumber 4.43"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 22,
+ "metadata": {
+ "collapsed": false,
+ "scrolled": true
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Resolution 0.02 volt\n",
+ "Resolution in percent 0.024 %\n"
+ ]
+ }
+ ],
+ "source": [
+ "#given\n",
+ "import math\n",
+ "n=12;\n",
+ "vref1=50e0;#volt\n",
+ "vref2=-50e0;#volt\n",
+ "#determine Resolution\n",
+ "r=float((vref1-vref2)/(pow(2,n)-(1)));\n",
+ "print'Resolution ',round(r,2),'volt';\n",
+ "r=1*1e2/(pow(2,n)-(1));\n",
+ "print'Resolution in percent ',round(r,3),'%';\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {
+ "collapsed": true
+ },
+ "source": [
+ "##Example 12 pagenumber 4.43"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 21,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Resolution 19.55 milivolt\n",
+ "Resolution in percent 0.098 %\n"
+ ]
+ }
+ ],
+ "source": [
+ "#given\n",
+ "n=10e0;\n",
+ "vref1=-10e0;#volt\n",
+ "vref2=10e0;#volt\n",
+ "#determine Resolution \n",
+ "r=(vref2-vref1)/(pow(2,n)-(1));#Resolution\n",
+ "print'Resolution ',round(r*1e3,2),'milivolt';\n",
+ "r=100/(pow(2,n)-(1));\n",
+ "print'Resolution in percent ',round(r,3),'%';\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {
+ "collapsed": true
+ },
+ "source": [
+ "##Example 13 pagenumber 4.43"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 30,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Resolution in percent 0.024 %\n"
+ ]
+ }
+ ],
+ "source": [
+ "#given\n",
+ "n=12e0;\n",
+ "#determine Resolution \n",
+ "r=1/(pow(2,n)-(1));\n",
+ "r=r*100;#Resolution\n",
+ "print'Resolution in percent ',round(r,3),'%';\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example 14 pagenumber 4.44"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 20,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "change in voltage 178.0 milivolt\n"
+ ]
+ }
+ ],
+ "source": [
+ "#given\n",
+ "n=7;\n",
+ "vmax=25.4;#volt\n",
+ "#determine voltage \n",
+ "r=1*pow(10,3)/(pow(2,n)-1);\n",
+ "print'change in voltage ',round(r*vmax),'milivolt';\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example 15 pagenumber 4.44"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 21,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "N = 11.0\n"
+ ]
+ }
+ ],
+ "source": [
+ "#given\n",
+ "r=5e-3;#volt\n",
+ "vref=8;#volt \n",
+ "#determine N\n",
+ "import math\n",
+ "n=math.log10(1/(r/vref)+(1))/math.log10(2);\n",
+ "print'N =',round(n);\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example 16 pagenumber 4.44"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 22,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "conversion time = 9.0 μs\n"
+ ]
+ }
+ ],
+ "source": [
+ "#given\n",
+ "fs=1e6;#hz\n",
+ "n=8;\n",
+ "#determine conversion time\n",
+ "tc=(1/fs)*(n+1);\n",
+ "print'conversion time = ',round(tc*pow(10,6),(3)),'μs';\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example 17 pagenumber 4.45"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 23,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "output voltage 1000.0 volt\n"
+ ]
+ }
+ ],
+ "source": [
+ "#given\n",
+ "vref=10;#volt\n",
+ "vin=100e-3;#volt\n",
+ "#determine output voltage\n",
+ "v0=vref*vin/pow(10,-3);#output voltage\n",
+ "print'output voltage ',round(v0),'volt';\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example 18 pagenumber 4.45"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 24,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Resolution of 1th 62.5 μA\n",
+ "Output current 937.5 μA\n"
+ ]
+ }
+ ],
+ "source": [
+ "#given\n",
+ "n=4;\n",
+ "z='1111';\n",
+ "r=10e3;#ohm\n",
+ "r1=20e3;#ohm\n",
+ "vref=10;#volt\n",
+ "#determine Resolution output current\n",
+ "r=((1)*pow(10,6)/pow(2,n))*vref/r;#Resolution\n",
+ "print'Resolution of 1th ',round(r,3),'μA';\n",
+ "iout=r*int(z,2);#Output current\n",
+ "print'Output current ',round(iout,3),'μA';#error in book\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example 19 pagenumber 4.45"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 25,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "minimum input voltage 39.0 milivolt\n",
+ "input voltage at 1s 10.0 volt\n",
+ "decimal at 5.2 volt = 0b10000101\n"
+ ]
+ }
+ ],
+ "source": [
+ "#given\n",
+ "n=8;\n",
+ "vref=10;#volt\n",
+ "#determine input voltage\n",
+ "vmin=vref*pow(10,3)/pow(2,n);#minimum input voltage\n",
+ "print'minimum input voltage ',round(vmin,3),'milivolt';\n",
+ "vif=vref-vmin/pow(10,3);#input voltage\n",
+ "print'input voltage at 1s ',round(vif,3),'volt';\n",
+ "vin=5.2;\n",
+ "D=vin/vmin;D=133;z=bin(D);\n",
+ "print'decimal at ',round(vin,3),'volt = ',z;\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example 20 pagenumber 4.46"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 25,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "output voltage at 01 = 2.5 volt\n",
+ "output voltage at 0111 = 4.37 volt\n",
+ "output voltage at 10111100 = 7.36 volt\n"
+ ]
+ }
+ ],
+ "source": [
+ "#given\n",
+ "vref=10;#volt\n",
+ "import numpy as np\n",
+ "z=np.array(['01','0111','10111100']);\n",
+ "n=2;\n",
+ "#determine output voltage\n",
+ "v0=vref*1e0/pow(2,2);#output voltage\n",
+ "print'output voltage at ',z[0],' = ',round(v0,3),'volt';\n",
+ "n=4\n",
+ "v0=vref*1e0*(1*pow(10,3)/pow(2,2)+1*pow(10,3)/pow(2,3)+1*pow(10,3)/pow(2,4));#output voltage\n",
+ "print'output voltage at ',z[1],' = ',round(v0/pow(10,3),3),'volt';\n",
+ "v0=vref*(1*pow(10,3)*1e0/2+1*pow(10,3)/pow(2,3)+1*pow(10,3)/pow(2,4)+1*pow(10,3)/pow(2,5)+1*pow(10,3)/pow(2,6)+1*pow(10,3)/pow(2,8));\n",
+ "print'output voltage at ',z[2],' = ',round(v0/pow(10,3),3),'volt';\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example 21 pagenumber 4.46"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 23,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "output voltage at 0110 = 3.75 volt\n"
+ ]
+ }
+ ],
+ "source": [
+ "#given\n",
+ "n=4;\n",
+ "z='0110';\n",
+ "vref=10e0;\n",
+ "#determine output voltage\n",
+ "v0=vref*(1*pow(10,3)/pow(2,2)+1*pow(10,3)/pow(2,3));#output voltage\n",
+ "print'output voltage at ',z,' = ',round(v0/pow(10,3),3),'volt';\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example 22 pagenumber 4.47"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 26,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "SNRmax = 61.96 dB\n",
+ "ENOB = 9.0\n"
+ ]
+ }
+ ],
+ "source": [
+ "#given\n",
+ "n=10;\n",
+ "vfs=10.24;#volt\n",
+ "distortion=56;#dB\n",
+ "#determine ENOB SNRmax\n",
+ "import math\n",
+ "q=vfs/(pow(2,n)*math.sqrt(12));\n",
+ "snrmax=(6.02*n+1.76);\n",
+ "print'SNRmax = ',round(snrmax,3),'dB';\n",
+ "en=(distortion-1.76)/6.02;\n",
+ "print'ENOB = ',round(en);\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+ "source": []
+ }
+ ],
+ "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.10"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 0
+}
diff --git a/Linear_Integrated_Circuits_by_T._R._Ganesh_Babu/Chapter_4_Analog_to_Digital_and_Digital_to_Analog_converters_1.ipynb b/Linear_Integrated_Circuits_by_T._R._Ganesh_Babu/Chapter_4_Analog_to_Digital_and_Digital_to_Analog_converters_1.ipynb new file mode 100644 index 00000000..8136593e --- /dev/null +++ b/Linear_Integrated_Circuits_by_T._R._Ganesh_Babu/Chapter_4_Analog_to_Digital_and_Digital_to_Analog_converters_1.ipynb @@ -0,0 +1,815 @@ +{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "#Chapter 4 Analog to Digital and Digital to Analog converters"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example 1 pagenumber 4.38"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 1,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "output voltage 5.0 volt\n"
+ ]
+ }
+ ],
+ "source": [
+ "#given\n",
+ "z='0101';\n",
+ "n=4;\n",
+ "vof=15;#volt\n",
+ "#determine v0\n",
+ "r=vof/(pow(2,n)-1);\n",
+ "v0=r*int(z,2);#output voltage\n",
+ "print 'output voltage ',round(v0,3),'volt';\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example 2 pagenumber 4.38"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 2,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "output offset 5.1 volt\n",
+ "output voltage 3.84 volt\n"
+ ]
+ }
+ ],
+ "source": [
+ "#given\n",
+ "r=20e-3;\n",
+ "z='11000000';\n",
+ "n=8;\n",
+ "#determine output voltage output offset voltage\n",
+ "vof=r*(pow(2,n)-1);#output offsetvoltage\n",
+ "v0=r*int(z,2);#output voltage\n",
+ "print 'output offset ',round(vof,3),'volt';\n",
+ "print 'output voltage ',round(v0,3),'volt';\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example 3 pagenumber 4.38"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 2,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "output voltage 0111 = 2331.0 milivolt\n",
+ "output voltage 1111 = 4995.0 milivolt\n"
+ ]
+ }
+ ],
+ "source": [
+ "#given\n",
+ "n=4;\n",
+ "import numpy as np\n",
+ "z=np.array(['0111','1111']);\n",
+ "vref=5;#volt\n",
+ "#determine v0\n",
+ "r=vref*pow(10,3)/(pow(2,n)-1)\n",
+ "i=0;\n",
+ "while i<2 : v0=r*int(z[i],2); print'output voltage ',z[i],' = ',round(v0),'milivolt';i=i+1;\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example 4 pagenumber 4.39"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 5,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "full scale output voltage 31.77 volt\n",
+ "Resolution 0.03 %\n",
+ "output voltage 15.24 volt\n"
+ ]
+ }
+ ],
+ "source": [
+ "#given\n",
+ "n=12;\n",
+ "r=8e-3;#volt\n",
+ "z='011101110001';\n",
+ "#determine output voltage\n",
+ "vof=r*pow(2,n)-1;\n",
+ "v0=r*int(z,2);#output voltage\n",
+ "r=r*1e2/vof;\n",
+ "print'full scale output voltage',round(vof,2),'volt';\n",
+ "print'Resolution',round(r,2),'%';\n",
+ "print'output voltage ',round(v0,3),'volt';\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example 5 pagenumber 4.39"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 12,
+ "metadata": {
+ "collapsed": false,
+ "scrolled": true
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "minumum number of bits 16384\n",
+ "minmum voltage 610.0 μvolt\n",
+ "quantization error 176.0 μvolt\n",
+ "sampling rate 5.0 Khz\n",
+ "aperture time 0.01 μsecond\n",
+ "converter 84 dB\n"
+ ]
+ }
+ ],
+ "source": [
+ "#given\n",
+ "fs=1e3;#hz\n",
+ "r=0.01;\n",
+ "vref=10;#volt\n",
+ "#determine n vmin rms fs1 t1 z\n",
+ "r=0.01/100;\n",
+ "n=14;\n",
+ "print'minumum number of bits ',pow(2,14);\n",
+ "vm=vref*pow(10,6)/pow(2,n);#minmum voltage\n",
+ "print'minmum voltage ',round(vm),'μvolt';\n",
+ "import math\n",
+ "eq=vref/(pow(2,n)*2*math.sqrt(3));#quantization error\n",
+ "print'quantization error ',round(eq*pow(10,6)),'μvolt';\n",
+ "fs1=5*fs;#sampling rate\n",
+ "print'sampling rate ',fs1/1e3,'Khz';\n",
+ "t1=1/(2*3.14*fs*pow(2,n));#aperture time\n",
+ "print'aperture time ',round(t1*pow(10,6),3),'μsecond';#error in book\n",
+ "print'converter ',6*n,'dB';\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example 6 pagenumber 4.40"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 8,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "R = 5.0 Kohm\n",
+ "I at 1100 = 1.4 mA\n"
+ ]
+ }
+ ],
+ "source": [
+ "#given\n",
+ "vref=10;#volt\n",
+ "Is=1.875e-3;#A\n",
+ "#determine R I\n",
+ "n=4;\n",
+ "v0=vref*pow(10,3)/pow(2,n)*(1*pow(2,(n-1))+1*pow(2,(n-2))+1*pow(2,(n-3))+1*pow(2,(n-4)));\n",
+ "r=v0/((Is)*pow(10,6));\n",
+ "print'R = ',round(r,3),' Kohm';\n",
+ "v0=vref*pow(10,3)/pow(2,n)*(1*pow(2,(n-1))+1*pow(2,(n-2)));\n",
+ "print'I at 1100 = ',round(v0/pow(10,3)/r,3),'mA';\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example 7 pagenumber 4.41"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 9,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "N= 6.0\n"
+ ]
+ }
+ ],
+ "source": [
+ "#given\n",
+ "vmin=1e-3;#volt\n",
+ "vref=10;#volt\n",
+ "q=0.01;\n",
+ "#determine n\n",
+ "import math\n",
+ "n=math.log10(((0.5)/0.01)+1)/math.log10(2);\n",
+ "print'N= ',round(n);\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {
+ "collapsed": false
+ },
+ "source": [
+ "##Example 8 pagenumber 4.42"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 15,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "R in percent 0.392 %\n"
+ ]
+ }
+ ],
+ "source": [
+ "#given\n",
+ "n=8;\n",
+ "#determine R\n",
+ "r=1*100e0/(pow(2,n)-1);\n",
+ "print'R in percent ',round(r,3),'%';\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example 9 pagenumber 4.42"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 12,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Resolution in percent 3.0 %\n"
+ ]
+ }
+ ],
+ "source": [
+ "#given\n",
+ "n=5;\n",
+ "#determine resolution\n",
+ "r=1*100/(pow(2,n)-1);#Resolution\n",
+ "print'Resolution in percent ',round(r,3),'%';\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example 10 pagenumber 4.42"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 17,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "minimum voltage each bit 300.0 milivolt\n",
+ "output voltage at 100110 = 12.063 volt\n"
+ ]
+ }
+ ],
+ "source": [
+ "#given\n",
+ "import numpy as np\n",
+ "z=np.array(['111111','100110']);\n",
+ "vref1=20;#volt\n",
+ "#determine output voltage\n",
+ "e=1*pow(10,3)/int(z[0],2)*vref1;#minimum voltage\n",
+ "print'minimum voltage each bit ',round(e,3),'milivolt';\n",
+ "e=int(z[1],2)*1e0/int(z[0],2)*vref1;#output voltage\n",
+ "print'output voltage at ',z[1],' = ',round(e,3),'volt';\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {
+ "collapsed": true
+ },
+ "source": [
+ "##Example 11 pagenumber 4.43"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 22,
+ "metadata": {
+ "collapsed": false,
+ "scrolled": true
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Resolution 0.02 volt\n",
+ "Resolution in percent 0.024 %\n"
+ ]
+ }
+ ],
+ "source": [
+ "#given\n",
+ "import math\n",
+ "n=12;\n",
+ "vref1=50e0;#volt\n",
+ "vref2=-50e0;#volt\n",
+ "#determine Resolution\n",
+ "r=float((vref1-vref2)/(pow(2,n)-(1)));\n",
+ "print'Resolution ',round(r,2),'volt';\n",
+ "r=1*1e2/(pow(2,n)-(1));\n",
+ "print'Resolution in percent ',round(r,3),'%';\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {
+ "collapsed": true
+ },
+ "source": [
+ "##Example 12 pagenumber 4.43"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 21,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Resolution 19.55 milivolt\n",
+ "Resolution in percent 0.098 %\n"
+ ]
+ }
+ ],
+ "source": [
+ "#given\n",
+ "n=10e0;\n",
+ "vref1=-10e0;#volt\n",
+ "vref2=10e0;#volt\n",
+ "#determine Resolution \n",
+ "r=(vref2-vref1)/(pow(2,n)-(1));#Resolution\n",
+ "print'Resolution ',round(r*1e3,2),'milivolt';\n",
+ "r=100/(pow(2,n)-(1));\n",
+ "print'Resolution in percent ',round(r,3),'%';\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {
+ "collapsed": true
+ },
+ "source": [
+ "##Example 13 pagenumber 4.43"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 30,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Resolution in percent 0.024 %\n"
+ ]
+ }
+ ],
+ "source": [
+ "#given\n",
+ "n=12e0;\n",
+ "#determine Resolution \n",
+ "r=1/(pow(2,n)-(1));\n",
+ "r=r*100;#Resolution\n",
+ "print'Resolution in percent ',round(r,3),'%';\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example 14 pagenumber 4.44"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 20,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "change in voltage 178.0 milivolt\n"
+ ]
+ }
+ ],
+ "source": [
+ "#given\n",
+ "n=7;\n",
+ "vmax=25.4;#volt\n",
+ "#determine voltage \n",
+ "r=1*pow(10,3)/(pow(2,n)-1);\n",
+ "print'change in voltage ',round(r*vmax),'milivolt';\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example 15 pagenumber 4.44"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 21,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "N = 11.0\n"
+ ]
+ }
+ ],
+ "source": [
+ "#given\n",
+ "r=5e-3;#volt\n",
+ "vref=8;#volt \n",
+ "#determine N\n",
+ "import math\n",
+ "n=math.log10(1/(r/vref)+(1))/math.log10(2);\n",
+ "print'N =',round(n);\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example 16 pagenumber 4.44"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 22,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "conversion time = 9.0 μs\n"
+ ]
+ }
+ ],
+ "source": [
+ "#given\n",
+ "fs=1e6;#hz\n",
+ "n=8;\n",
+ "#determine conversion time\n",
+ "tc=(1/fs)*(n+1);\n",
+ "print'conversion time = ',round(tc*pow(10,6),(3)),'μs';\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example 17 pagenumber 4.45"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 23,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "output voltage 1000.0 volt\n"
+ ]
+ }
+ ],
+ "source": [
+ "#given\n",
+ "vref=10;#volt\n",
+ "vin=100e-3;#volt\n",
+ "#determine output voltage\n",
+ "v0=vref*vin/pow(10,-3);#output voltage\n",
+ "print'output voltage ',round(v0),'volt';\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example 18 pagenumber 4.45"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 24,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Resolution of 1th 62.5 μA\n",
+ "Output current 937.5 μA\n"
+ ]
+ }
+ ],
+ "source": [
+ "#given\n",
+ "n=4;\n",
+ "z='1111';\n",
+ "r=10e3;#ohm\n",
+ "r1=20e3;#ohm\n",
+ "vref=10;#volt\n",
+ "#determine Resolution output current\n",
+ "r=((1)*pow(10,6)/pow(2,n))*vref/r;#Resolution\n",
+ "print'Resolution of 1th ',round(r,3),'μA';\n",
+ "iout=r*int(z,2);#Output current\n",
+ "print'Output current ',round(iout,3),'μA';#error in book\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example 19 pagenumber 4.45"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 25,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "minimum input voltage 39.0 milivolt\n",
+ "input voltage at 1s 10.0 volt\n",
+ "decimal at 5.2 volt = 0b10000101\n"
+ ]
+ }
+ ],
+ "source": [
+ "#given\n",
+ "n=8;\n",
+ "vref=10;#volt\n",
+ "#determine input voltage\n",
+ "vmin=vref*pow(10,3)/pow(2,n);#minimum input voltage\n",
+ "print'minimum input voltage ',round(vmin,3),'milivolt';\n",
+ "vif=vref-vmin/pow(10,3);#input voltage\n",
+ "print'input voltage at 1s ',round(vif,3),'volt';\n",
+ "vin=5.2;\n",
+ "D=vin/vmin;D=133;z=bin(D);\n",
+ "print'decimal at ',round(vin,3),'volt = ',z;\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example 20 pagenumber 4.46"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 25,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "output voltage at 01 = 2.5 volt\n",
+ "output voltage at 0111 = 4.37 volt\n",
+ "output voltage at 10111100 = 7.36 volt\n"
+ ]
+ }
+ ],
+ "source": [
+ "#given\n",
+ "vref=10;#volt\n",
+ "import numpy as np\n",
+ "z=np.array(['01','0111','10111100']);\n",
+ "n=2;\n",
+ "#determine output voltage\n",
+ "v0=vref*1e0/pow(2,2);#output voltage\n",
+ "print'output voltage at ',z[0],' = ',round(v0,3),'volt';\n",
+ "n=4\n",
+ "v0=vref*1e0*(1*pow(10,3)/pow(2,2)+1*pow(10,3)/pow(2,3)+1*pow(10,3)/pow(2,4));#output voltage\n",
+ "print'output voltage at ',z[1],' = ',round(v0/pow(10,3),3),'volt';\n",
+ "v0=vref*(1*pow(10,3)*1e0/2+1*pow(10,3)/pow(2,3)+1*pow(10,3)/pow(2,4)+1*pow(10,3)/pow(2,5)+1*pow(10,3)/pow(2,6)+1*pow(10,3)/pow(2,8));\n",
+ "print'output voltage at ',z[2],' = ',round(v0/pow(10,3),3),'volt';\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example 21 pagenumber 4.46"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 23,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "output voltage at 0110 = 3.75 volt\n"
+ ]
+ }
+ ],
+ "source": [
+ "#given\n",
+ "n=4;\n",
+ "z='0110';\n",
+ "vref=10e0;\n",
+ "#determine output voltage\n",
+ "v0=vref*(1*pow(10,3)/pow(2,2)+1*pow(10,3)/pow(2,3));#output voltage\n",
+ "print'output voltage at ',z,' = ',round(v0/pow(10,3),3),'volt';\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example 22 pagenumber 4.47"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 26,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "SNRmax = 61.96 dB\n",
+ "ENOB = 9.0\n"
+ ]
+ }
+ ],
+ "source": [
+ "#given\n",
+ "n=10;\n",
+ "vfs=10.24;#volt\n",
+ "distortion=56;#dB\n",
+ "#determine ENOB SNRmax\n",
+ "import math\n",
+ "q=vfs/(pow(2,n)*math.sqrt(12));\n",
+ "snrmax=(6.02*n+1.76);\n",
+ "print'SNRmax = ',round(snrmax,3),'dB';\n",
+ "en=(distortion-1.76)/6.02;\n",
+ "print'ENOB = ',round(en);\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+ "source": []
+ }
+ ],
+ "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.10"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 0
+}
diff --git a/Linear_Integrated_Circuits_by_T._R._Ganesh_Babu/Chapter_5_Special_Integrated_Circuits.ipynb b/Linear_Integrated_Circuits_by_T._R._Ganesh_Babu/Chapter_5_Special_Integrated_Circuits.ipynb new file mode 100644 index 00000000..e51854b5 --- /dev/null +++ b/Linear_Integrated_Circuits_by_T._R._Ganesh_Babu/Chapter_5_Special_Integrated_Circuits.ipynb @@ -0,0 +1,468 @@ +{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {
+ "collapsed": true
+ },
+ "source": [
+ "#Chapter 5 Special Integrated Circuits"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example 1 pagenumber 5.95"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 1,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "R1 72.0 Kohm\n"
+ ]
+ }
+ ],
+ "source": [
+ "#given\n",
+ "w=8e-3;#second\n",
+ "c1=0.1e-6;#farad\n",
+ "#determine r1\n",
+ "r1=w/(1.11*c1);\n",
+ "print'R1 ',round(r1/1e3),'Kohm'\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example 2 pagenumber 5.95"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 2,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "frequency 9.667 Khz\n",
+ "dutycycle 0.667\n"
+ ]
+ }
+ ],
+ "source": [
+ "#given\n",
+ "ra=5e3;#ohm\n",
+ "rb=ra;\n",
+ "c1=0.01e-6;#farad\n",
+ "#determine frequency dutycycle\n",
+ "freq=1.45/((ra+2*rb)*c1);#frequency\n",
+ "w=(ra+rb)/(ra+2*rb);#dutycycle\n",
+ "print'frequency ',round(freq/1e3,3),'Khz'\n",
+ "print'dutycycle ',round(w,3)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {
+ "collapsed": true
+ },
+ "source": [
+ "##Example 3 pagenumber 5.96"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 5,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Ra 3.625 Kohm\n",
+ "Rb 1.813 Kohm\n"
+ ]
+ }
+ ],
+ "source": [
+ "#given\n",
+ "freq=2e3;#hz\n",
+ "w=0.75;\n",
+ "c1=0.1e-6;#farad\n",
+ "#determine ra rb\n",
+ "#for 0.75 dutycycle rb=0.5*ra\n",
+ "ra=1.45/freq*(1/(c1*2));\n",
+ "rb=0.5*round(ra);\n",
+ "print'Ra ',round(ra/1e3,3),'Kohm'\n",
+ "print'Rb ',round(rb/1e3,3),'Kohm'\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {
+ "collapsed": true
+ },
+ "source": [
+ "##Example 4 pagenumber 5.97"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 2,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "on time 0.062 milisecond\n",
+ "tof 0.047 milisecond\n",
+ "frequency 9.177 Khz\n",
+ "duty cycle 0.139\n"
+ ]
+ }
+ ],
+ "source": [
+ "#given\n",
+ "ra=2.2e3;#ohm\n",
+ "rb=6.8e3;#ohm\n",
+ "c1=0.01e-6;#farad\n",
+ "#determine ontime offtime frequency dutycycle\n",
+ "t1=0.69*(ra+rb)*c1;#on time\n",
+ "t2=0.69*rb*c1;#tof\n",
+ "freq=1.45/((ra+2*rb)*c1);#frequency\n",
+ "w=ra/(ra+2*rb);#duty cycle\n",
+ "print'on time ',round(t1*1e3,3),'milisecond'\n",
+ "print'tof ',round(t2*1e3,3),'milisecond'\n",
+ "print'frequency ',round(freq/1e3,3),'Khz'\n",
+ "print'duty cycle ',round(w,3)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {
+ "collapsed": true
+ },
+ "source": [
+ "##Example 5 pagenumber 5.98"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 9,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Ra 2.854 Mohm\n",
+ "Rb 2.943 Mohm\n"
+ ]
+ }
+ ],
+ "source": [
+ "#given\n",
+ "t1=4;#second\n",
+ "t2=2;#second\n",
+ "c1=1e-6;#farad\n",
+ "#detemine ra rb\n",
+ "t12=t1+t2;\n",
+ "w=t1/t12;\n",
+ "#ra=0.97*rb\n",
+ "rb=(t1/(0.69*c1))/(1+0.97);\n",
+ "ra=0.97*rb;\n",
+ "print'Ra ',round(ra/1e6,3),'Mohm'\n",
+ "print'Rb ',round(rb/1e6,3),'Mohm'\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {
+ "collapsed": true
+ },
+ "source": [
+ "##Example 6 pagenumber 5.99"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 11,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "R1 540.5 Kohm\n"
+ ]
+ }
+ ],
+ "source": [
+ "#given\n",
+ "t1=6;#second\n",
+ "c1=10e-6;#farad\n",
+ "#determine r1\n",
+ "r1=t1/(1.11*c1);\n",
+ "print'R1 ',round(r1/1e3,1),'Kohm'\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example 7 pagenumber 5.100"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 33,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "rms voltage 1.0 volt\n"
+ ]
+ }
+ ],
+ "source": [
+ "#given\n",
+ "en=20e-9;#volt/sqrt(z)\n",
+ "fce=20;#hz\n",
+ "inw=0.5e-12;#A/sqrt(hz)\n",
+ "fci=20e3\n",
+ "#determine voltage current spectraldensities rmsnoise\n",
+ "r1=r1;\n",
+ "import math\n",
+ "en=math.pow(fce*math.log(fci/fce)+(fci-fce),en);\n",
+ "print'rms voltage ',round(en,3),'volt'\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {
+ "collapsed": true
+ },
+ "source": [
+ "##Example 7 pagenumber 5.100"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 38,
+ "metadata": {
+ "collapsed": false,
+ "scrolled": true
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "voltage 12.167 nanovolt/sqrt(hz)\n",
+ "current 0.001 nA/sqrt(hz)\n",
+ "rms voltage 1.0 volt\n"
+ ]
+ }
+ ],
+ "source": [
+ "#given\n",
+ "r1=9*1e3;#ohm\n",
+ "k1=1.38*1e-23;\n",
+ "t1=298;#k\n",
+ "#determine voltage current spectraldensities rmsnoise\n",
+ "r1=r1;\n",
+ "import math\n",
+ "er=math.sqrt(4e0*k1*t1*r1);#voltage\n",
+ "i1=er/r1;#current\n",
+ "er12=1/er;\n",
+ "w=20e3-20;\n",
+ "er1=math.pow(w,er*1e0);#rms voltage\n",
+ "print'voltage ',round(er*1e9,3),'nanovolt/sqrt(hz)'\n",
+ "print'current ',round(i1*1e9,3),'nA/sqrt(hz)'\n",
+ "print'rms voltage ',round(er1,3),'volt'\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# Example 8 pagenumber 5.100"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 39,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "voltage 12.167 nanovolt\n",
+ "current 1.352 pA\n",
+ "rms voltage 0.9 volt\n"
+ ]
+ }
+ ],
+ "source": [
+ "#given\n",
+ "r1=9e3;#ohm\n",
+ "k1=1.38*1e-23\n",
+ "t1=298;#kelvin\n",
+ "#determine voltage current spectraldensities rmsnoise\n",
+ "r1=r1;\n",
+ "import math\n",
+ "er=math.sqrt(4*k1*t1*r1);#voltage\n",
+ "i1=er/r1;#current\n",
+ "er12=1/er;\n",
+ "w=20e3-20;#width constant\n",
+ "er1=r1/10e3;#rms voltage\n",
+ "print'voltage ',round(er*1e9,3),'nanovolt';\n",
+ "print'current ',round(i1*1e12,3),'pA';\n",
+ "print'rms voltage ',round(er1,3),'volt';#error in book\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {
+ "collapsed": true
+ },
+ "source": [
+ "##Example 9 pagenumber 5.101"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 24,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "signal to noise id 1.0 = 61.933 dB\n",
+ "signal to noise id 0.001 = 31.933 dB\n"
+ ]
+ }
+ ],
+ "source": [
+ "#given\n",
+ "fh=2e6;#hz\n",
+ "id=[1e-6,1e-9];\n",
+ "i=0;\n",
+ "import math\n",
+ "while i<2 :\n",
+ " In=math.sqrt(2*1.602e-19*id[i]*fh);\n",
+ " print'signal to noise id ',round((id[i]*1e6),3),' = ',round(20*math.log10(id[i]/In),3),'dB';\n",
+ " i=i+1;\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example 10 pagenumber 5.101"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 26,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "rms voltage 1257.142 μvolt\n"
+ ]
+ }
+ ],
+ "source": [
+ "#given\n",
+ "r1=100e3;#ohm\n",
+ "rf=250e3;#ohm\n",
+ "r3=70e3;#ohm\n",
+ "fce=200;#hz\n",
+ "fci=2e3;#hz\n",
+ "ft=1e6;#hz\n",
+ "enw=20e-9;\n",
+ "inw=0.5e-12;\n",
+ "f1=0.1;\n",
+ "#determine RMS voltage\n",
+ "import math\n",
+ "fa=ft/(1+(rf/r1));\n",
+ "rn=r1*rf/(r1+rf);\n",
+ "p=fce*math.log(fa/f1)+1.57*fa-f1;\n",
+ "q=(r3*r3+rn*rn)*(fci*math.log(fa/f1)+1.5*fa-f1);\n",
+ "r=1.65e-20*(r3+rn)*(1.57*fa-f1);\n",
+ "en=(1+rf/r1)*(enw*enw+p+inw*inw*q+r);\n",
+ "\n",
+ "print'rms voltage ',round(math.sqrt(en),3),'μvolt';#error in book\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+ "source": []
+ }
+ ],
+ "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.10"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 0
+}
diff --git a/Linear_Integrated_Circuits_by_T._R._Ganesh_Babu/Chapter_5_Special_Integrated_Circuits_1.ipynb b/Linear_Integrated_Circuits_by_T._R._Ganesh_Babu/Chapter_5_Special_Integrated_Circuits_1.ipynb new file mode 100644 index 00000000..e51854b5 --- /dev/null +++ b/Linear_Integrated_Circuits_by_T._R._Ganesh_Babu/Chapter_5_Special_Integrated_Circuits_1.ipynb @@ -0,0 +1,468 @@ +{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {
+ "collapsed": true
+ },
+ "source": [
+ "#Chapter 5 Special Integrated Circuits"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example 1 pagenumber 5.95"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 1,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "R1 72.0 Kohm\n"
+ ]
+ }
+ ],
+ "source": [
+ "#given\n",
+ "w=8e-3;#second\n",
+ "c1=0.1e-6;#farad\n",
+ "#determine r1\n",
+ "r1=w/(1.11*c1);\n",
+ "print'R1 ',round(r1/1e3),'Kohm'\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example 2 pagenumber 5.95"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 2,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "frequency 9.667 Khz\n",
+ "dutycycle 0.667\n"
+ ]
+ }
+ ],
+ "source": [
+ "#given\n",
+ "ra=5e3;#ohm\n",
+ "rb=ra;\n",
+ "c1=0.01e-6;#farad\n",
+ "#determine frequency dutycycle\n",
+ "freq=1.45/((ra+2*rb)*c1);#frequency\n",
+ "w=(ra+rb)/(ra+2*rb);#dutycycle\n",
+ "print'frequency ',round(freq/1e3,3),'Khz'\n",
+ "print'dutycycle ',round(w,3)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {
+ "collapsed": true
+ },
+ "source": [
+ "##Example 3 pagenumber 5.96"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 5,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Ra 3.625 Kohm\n",
+ "Rb 1.813 Kohm\n"
+ ]
+ }
+ ],
+ "source": [
+ "#given\n",
+ "freq=2e3;#hz\n",
+ "w=0.75;\n",
+ "c1=0.1e-6;#farad\n",
+ "#determine ra rb\n",
+ "#for 0.75 dutycycle rb=0.5*ra\n",
+ "ra=1.45/freq*(1/(c1*2));\n",
+ "rb=0.5*round(ra);\n",
+ "print'Ra ',round(ra/1e3,3),'Kohm'\n",
+ "print'Rb ',round(rb/1e3,3),'Kohm'\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {
+ "collapsed": true
+ },
+ "source": [
+ "##Example 4 pagenumber 5.97"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 2,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "on time 0.062 milisecond\n",
+ "tof 0.047 milisecond\n",
+ "frequency 9.177 Khz\n",
+ "duty cycle 0.139\n"
+ ]
+ }
+ ],
+ "source": [
+ "#given\n",
+ "ra=2.2e3;#ohm\n",
+ "rb=6.8e3;#ohm\n",
+ "c1=0.01e-6;#farad\n",
+ "#determine ontime offtime frequency dutycycle\n",
+ "t1=0.69*(ra+rb)*c1;#on time\n",
+ "t2=0.69*rb*c1;#tof\n",
+ "freq=1.45/((ra+2*rb)*c1);#frequency\n",
+ "w=ra/(ra+2*rb);#duty cycle\n",
+ "print'on time ',round(t1*1e3,3),'milisecond'\n",
+ "print'tof ',round(t2*1e3,3),'milisecond'\n",
+ "print'frequency ',round(freq/1e3,3),'Khz'\n",
+ "print'duty cycle ',round(w,3)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {
+ "collapsed": true
+ },
+ "source": [
+ "##Example 5 pagenumber 5.98"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 9,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Ra 2.854 Mohm\n",
+ "Rb 2.943 Mohm\n"
+ ]
+ }
+ ],
+ "source": [
+ "#given\n",
+ "t1=4;#second\n",
+ "t2=2;#second\n",
+ "c1=1e-6;#farad\n",
+ "#detemine ra rb\n",
+ "t12=t1+t2;\n",
+ "w=t1/t12;\n",
+ "#ra=0.97*rb\n",
+ "rb=(t1/(0.69*c1))/(1+0.97);\n",
+ "ra=0.97*rb;\n",
+ "print'Ra ',round(ra/1e6,3),'Mohm'\n",
+ "print'Rb ',round(rb/1e6,3),'Mohm'\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {
+ "collapsed": true
+ },
+ "source": [
+ "##Example 6 pagenumber 5.99"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 11,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "R1 540.5 Kohm\n"
+ ]
+ }
+ ],
+ "source": [
+ "#given\n",
+ "t1=6;#second\n",
+ "c1=10e-6;#farad\n",
+ "#determine r1\n",
+ "r1=t1/(1.11*c1);\n",
+ "print'R1 ',round(r1/1e3,1),'Kohm'\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example 7 pagenumber 5.100"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 33,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "rms voltage 1.0 volt\n"
+ ]
+ }
+ ],
+ "source": [
+ "#given\n",
+ "en=20e-9;#volt/sqrt(z)\n",
+ "fce=20;#hz\n",
+ "inw=0.5e-12;#A/sqrt(hz)\n",
+ "fci=20e3\n",
+ "#determine voltage current spectraldensities rmsnoise\n",
+ "r1=r1;\n",
+ "import math\n",
+ "en=math.pow(fce*math.log(fci/fce)+(fci-fce),en);\n",
+ "print'rms voltage ',round(en,3),'volt'\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {
+ "collapsed": true
+ },
+ "source": [
+ "##Example 7 pagenumber 5.100"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 38,
+ "metadata": {
+ "collapsed": false,
+ "scrolled": true
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "voltage 12.167 nanovolt/sqrt(hz)\n",
+ "current 0.001 nA/sqrt(hz)\n",
+ "rms voltage 1.0 volt\n"
+ ]
+ }
+ ],
+ "source": [
+ "#given\n",
+ "r1=9*1e3;#ohm\n",
+ "k1=1.38*1e-23;\n",
+ "t1=298;#k\n",
+ "#determine voltage current spectraldensities rmsnoise\n",
+ "r1=r1;\n",
+ "import math\n",
+ "er=math.sqrt(4e0*k1*t1*r1);#voltage\n",
+ "i1=er/r1;#current\n",
+ "er12=1/er;\n",
+ "w=20e3-20;\n",
+ "er1=math.pow(w,er*1e0);#rms voltage\n",
+ "print'voltage ',round(er*1e9,3),'nanovolt/sqrt(hz)'\n",
+ "print'current ',round(i1*1e9,3),'nA/sqrt(hz)'\n",
+ "print'rms voltage ',round(er1,3),'volt'\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# Example 8 pagenumber 5.100"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 39,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "voltage 12.167 nanovolt\n",
+ "current 1.352 pA\n",
+ "rms voltage 0.9 volt\n"
+ ]
+ }
+ ],
+ "source": [
+ "#given\n",
+ "r1=9e3;#ohm\n",
+ "k1=1.38*1e-23\n",
+ "t1=298;#kelvin\n",
+ "#determine voltage current spectraldensities rmsnoise\n",
+ "r1=r1;\n",
+ "import math\n",
+ "er=math.sqrt(4*k1*t1*r1);#voltage\n",
+ "i1=er/r1;#current\n",
+ "er12=1/er;\n",
+ "w=20e3-20;#width constant\n",
+ "er1=r1/10e3;#rms voltage\n",
+ "print'voltage ',round(er*1e9,3),'nanovolt';\n",
+ "print'current ',round(i1*1e12,3),'pA';\n",
+ "print'rms voltage ',round(er1,3),'volt';#error in book\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {
+ "collapsed": true
+ },
+ "source": [
+ "##Example 9 pagenumber 5.101"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 24,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "signal to noise id 1.0 = 61.933 dB\n",
+ "signal to noise id 0.001 = 31.933 dB\n"
+ ]
+ }
+ ],
+ "source": [
+ "#given\n",
+ "fh=2e6;#hz\n",
+ "id=[1e-6,1e-9];\n",
+ "i=0;\n",
+ "import math\n",
+ "while i<2 :\n",
+ " In=math.sqrt(2*1.602e-19*id[i]*fh);\n",
+ " print'signal to noise id ',round((id[i]*1e6),3),' = ',round(20*math.log10(id[i]/In),3),'dB';\n",
+ " i=i+1;\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example 10 pagenumber 5.101"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 26,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "rms voltage 1257.142 μvolt\n"
+ ]
+ }
+ ],
+ "source": [
+ "#given\n",
+ "r1=100e3;#ohm\n",
+ "rf=250e3;#ohm\n",
+ "r3=70e3;#ohm\n",
+ "fce=200;#hz\n",
+ "fci=2e3;#hz\n",
+ "ft=1e6;#hz\n",
+ "enw=20e-9;\n",
+ "inw=0.5e-12;\n",
+ "f1=0.1;\n",
+ "#determine RMS voltage\n",
+ "import math\n",
+ "fa=ft/(1+(rf/r1));\n",
+ "rn=r1*rf/(r1+rf);\n",
+ "p=fce*math.log(fa/f1)+1.57*fa-f1;\n",
+ "q=(r3*r3+rn*rn)*(fci*math.log(fa/f1)+1.5*fa-f1);\n",
+ "r=1.65e-20*(r3+rn)*(1.57*fa-f1);\n",
+ "en=(1+rf/r1)*(enw*enw+p+inw*inw*q+r);\n",
+ "\n",
+ "print'rms voltage ',round(math.sqrt(en),3),'μvolt';#error in book\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+ "source": []
+ }
+ ],
+ "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.10"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 0
+}
diff --git a/Linear_Integrated_Circuits_by_T._R._Ganesh_Babu/screenshots/Chapter_1Circuit_Configuration_for_Linear_Integrated_Ciruits.png b/Linear_Integrated_Circuits_by_T._R._Ganesh_Babu/screenshots/Chapter_1Circuit_Configuration_for_Linear_Integrated_Ciruits.png Binary files differnew file mode 100644 index 00000000..e7cd82b6 --- /dev/null +++ b/Linear_Integrated_Circuits_by_T._R._Ganesh_Babu/screenshots/Chapter_1Circuit_Configuration_for_Linear_Integrated_Ciruits.png diff --git a/Linear_Integrated_Circuits_by_T._R._Ganesh_Babu/screenshots/Chapter_2_Applications_Of_Operational_Amplifier.png b/Linear_Integrated_Circuits_by_T._R._Ganesh_Babu/screenshots/Chapter_2_Applications_Of_Operational_Amplifier.png Binary files differnew file mode 100644 index 00000000..6a3c582f --- /dev/null +++ b/Linear_Integrated_Circuits_by_T._R._Ganesh_Babu/screenshots/Chapter_2_Applications_Of_Operational_Amplifier.png diff --git a/Linear_Integrated_Circuits_by_T._R._Ganesh_Babu/screenshots/Chapter_4_Analog_to_Digital_and_Digital_to_Analog_converters.png b/Linear_Integrated_Circuits_by_T._R._Ganesh_Babu/screenshots/Chapter_4_Analog_to_Digital_and_Digital_to_Analog_converters.png Binary files differnew file mode 100644 index 00000000..1bd71d3a --- /dev/null +++ b/Linear_Integrated_Circuits_by_T._R._Ganesh_Babu/screenshots/Chapter_4_Analog_to_Digital_and_Digital_to_Analog_converters.png |