diff options
author | hardythe1 | 2015-06-03 15:27:17 +0530 |
---|---|---|
committer | hardythe1 | 2015-06-03 15:27:17 +0530 |
commit | df60071cf1d1c18822d34f943ab8f412a8946b69 (patch) | |
tree | ab059cf19bad4a1233a464ccf5d72cf8b3fb323c /Integrated_Circuits | |
parent | fba055ce5aa0955e22bac2413c33493b10ae6532 (diff) | |
download | Python-Textbook-Companions-df60071cf1d1c18822d34f943ab8f412a8946b69.tar.gz Python-Textbook-Companions-df60071cf1d1c18822d34f943ab8f412a8946b69.tar.bz2 Python-Textbook-Companions-df60071cf1d1c18822d34f943ab8f412a8946b69.zip |
add books
Diffstat (limited to 'Integrated_Circuits')
-rwxr-xr-x | Integrated_Circuits/Chapter1.ipynb | 706 | ||||
-rwxr-xr-x | Integrated_Circuits/Chapter2.ipynb | 228 | ||||
-rwxr-xr-x | Integrated_Circuits/Chapter3.ipynb | 1204 | ||||
-rwxr-xr-x | Integrated_Circuits/Chapter4.ipynb | 77 | ||||
-rwxr-xr-x | Integrated_Circuits/Chapter5.ipynb | 393 | ||||
-rwxr-xr-x | Integrated_Circuits/Chapter6.ipynb | 354 | ||||
-rwxr-xr-x | Integrated_Circuits/Chapter7.ipynb | 297 | ||||
-rwxr-xr-x | Integrated_Circuits/screenshots/Ex2.1.png | bin | 0 -> 32249 bytes | |||
-rwxr-xr-x | Integrated_Circuits/screenshots/Ex2.2.png | bin | 0 -> 18660 bytes | |||
-rwxr-xr-x | Integrated_Circuits/screenshots/Ex5.12.png | bin | 0 -> 24276 bytes |
10 files changed, 3259 insertions, 0 deletions
diff --git a/Integrated_Circuits/Chapter1.ipynb b/Integrated_Circuits/Chapter1.ipynb new file mode 100755 index 00000000..0141ff8d --- /dev/null +++ b/Integrated_Circuits/Chapter1.ipynb @@ -0,0 +1,706 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:862d4d2200cef4afafe4b0610190ff2ff686b747269183b5312528ef1b293d1a"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter01:Analog Integrated Circuit Design"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex1.1:Pg-10"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Ex 1.1\n",
+ "import math\n",
+ "VDD=1.8;#V\n",
+ "IREF=50;#micro A\n",
+ "IO=IREF;#micro A\n",
+ "L=0.5;#micro m\n",
+ "W=5;#micro m\n",
+ "Vt=0.5;#V\n",
+ "Kn_dash=250;#micro A/V**2\n",
+ "VGS=math.sqrt(IO/(1/2.0*Kn_dash*(W/L)))+Vt;#V\n",
+ "print VGS,\" is the Value of VGS(V) \"\n",
+ "R=(VDD-VGS)/(IREF*10**-6);#ohm\n",
+ "print R/1000,\" is the Value of R(kohm) \"\n",
+ "VDS2=VGS-Vt;#V\n",
+ "VO=VDS2;#V\n",
+ "print VO,\" is the Lowest value of VO(V) \"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "0.7 is the Value of VGS(V) \n",
+ "22.0 is the Value of R(kohm) \n",
+ "0.2 is the Lowest value of VO(V) \n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex1.3:Pg-12"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Ex 1.3\n",
+ "\n",
+ "VDD=1.8;#V\n",
+ "Vt=0.6;#V\n",
+ "mpCox=100;#a A/V**2\n",
+ "IREF=80;#micro A\n",
+ "VOmax=1.6;#V\n",
+ "VSG=VDD-VOmax+Vt;#V\n",
+ "VGS=-VSG;#V\n",
+ "VS=VDD;#V\n",
+ "VG=VGS+VS;#V\n",
+ "R=VG/(IREF*10**-6);#ohm\n",
+ "ID=IREF;#micro A\n",
+ "WbyL=2*ID*10**-6/(mpCox*10**-6)/(VGS+Vt)**2;#unitless\n",
+ "print VGS,\"= Value of VGS(V) \"\n",
+ "print VG,\"= Value of VG(V) \"\n",
+ "print R/1000,\"= Value of R(kohm) \"\n",
+ "print WbyL,\"= W/L ratio \"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "-0.8 = Value of VGS(V) \n",
+ "1.0 = Value of VG(V) \n",
+ "12.5 = Value of R(kohm) \n",
+ "40.0 = W/L ratio \n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex1.4:Pg-19"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Ex 1.4\n",
+ "\n",
+ "Beta=80;#unitless\n",
+ "print \"IREF=IC1+IC1/Beta+IO/Beta)\"\n",
+ "print \"IO/IREF=m implies IC1=IO/m as IC1=IREF\"\n",
+ "print \"IREF=IO*(1/m+1/m/Beta+1/Beta)\"\n",
+ "print \"IO/IREF=m/(1+1/Beta+m/Beta)\"\n",
+ "print \"IO/IREF=m*(1-5/100)\"#for large Beta\n",
+ "m=(1/(1-5.0/100)-1)*Beta-1;#Current transfer ratio\n",
+ "print round(m,2),\" is Largest current transfer ratio \"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "IREF=IC1+IC1/Beta+IO/Beta)\n",
+ "IO/IREF=m implies IC1=IO/m as IC1=IREF\n",
+ "IREF=IO*(1/m+1/m/Beta+1/Beta)\n",
+ "IO/IREF=m/(1+1/Beta+m/Beta)\n",
+ "IO/IREF=m*(1-5/100)\n",
+ "3.21 is Largest current transfer ratio \n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex1.7:pg-37"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Ex 1.7\n",
+ "\n",
+ "Beta=80;#untless\n",
+ "print \"g8=IC1+IC1/Beta+IO/Beta\"\n",
+ "print \"IO/IREF=m implies IC1=IO/m as IC1=IREF\"\n",
+ "print \"IREF=IO*(1/m+1/m/Beta+1/Beta\"\n",
+ "print \"IO/IREF=m/(1+1/Beta+m/Beta\"\n",
+ "print \"IO/IREF=m*(1-5/100)\"#for large Beta\n",
+ "m=(1/(1-5.0/100)-1)*Beta-1;#Current transfer ratio\n",
+ "print round(m,2),\"Largest current transfer ratio \"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "g8=IC1+IC1/Beta+IO/Beta\n",
+ "IO/IREF=m implies IC1=IO/m as IC1=IREF\n",
+ "IREF=IO*(1/m+1/m/Beta+1/Beta\n",
+ "IO/IREF=m/(1+1/Beta+m/Beta\n",
+ "IO/IREF=m*(1-5/100)\n",
+ "3.21 Largest current transfer ratio \n"
+ ]
+ }
+ ],
+ "prompt_number": 63
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex1.9:Pg-39"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Ex 1.9\n",
+ "\n",
+ "\n",
+ "Beta=20.0;#unitless\n",
+ "IObyIREF=1/(1+2/Beta);#Current gain\n",
+ "print round(IObyIREF,2),\" is Current gain \"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "0.91 is Current gain \n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex1.10:Pg-39"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Ex 1.10\n",
+ "\n",
+ "IREF=2;#mA\n",
+ "IO=IREF;#mA\n",
+ "VA2=90.0;#V\n",
+ "Vo1=1.0;#V\n",
+ "Vo2=10.0;#V\n",
+ "ro2=VA2/IO;#kohm\n",
+ "delVO=Vo2-Vo1;#V\n",
+ "delIO=delVO/ro2;#mA\n",
+ "Change=delIO/IO*100;#%\n",
+ "print Change,\" % is Change in Io \"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "10.0 % is Change in Io \n"
+ ]
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex1.11:Pg-40"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Ex 1.11\n",
+ "\n",
+ "import math\n",
+ "VBE3=0.7;#V\n",
+ "VBE1=0.7;#V\n",
+ "IREF1=100.0;#micro A\n",
+ "IC1=IREF1;#micro A\n",
+ "IREF2=1.0;#mA\n",
+ "IC2=IREF2;#mA\n",
+ "Beta=200.0;#unitless\n",
+ "#IC2/IC1=(IS*exp(VBE2/VT))/(IS*exp(VBE1/VT))\n",
+ "VT=26.0;#mV\n",
+ "deltaVBE=VT*10**-3*math.log(IC2/IC1);#V(deltaVBE=VBE2-VBE1)\n",
+ "deltaVx=2*deltaVBE;#V\n",
+ "IO=IREF1/(1+2.0/(Beta**2+Beta));#micro A\n",
+ "delIO=IC1-IO;#micro A\n",
+ "Change=delIO/IO*100;#%\n",
+ "print round(Change,4),\" % is Change in Io\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "0.005 % is Change in Io\n"
+ ]
+ }
+ ],
+ "prompt_number": 18
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex1.12:Pg-41"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Ex 1.12\n",
+ "\n",
+ "Iout=8;#micro A\n",
+ "VBE=0.7;#V\n",
+ "VCC=20.0;#V\n",
+ "Beta=80.0;#unitless\n",
+ "IREF=Iout*(1+2/Beta);#micro A\n",
+ "print IREF,\" is Reference current in micro A : \"\n",
+ "R=(VCC-VBE)/(IREF);#Mohm\n",
+ "print round(R,2),\" is Resistance in Mohm \"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "8.2 is Reference current in micro A : \n",
+ "2.35 is Resistance in Mohm \n"
+ ]
+ }
+ ],
+ "prompt_number": 22
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex1.13:Pg-42"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Ex 1.13\n",
+ "\n",
+ "Iout=1;#mA\n",
+ "VBE=0.7;#V\n",
+ "VCC=30.0;#V\n",
+ "Beta=100.0;#unitless\n",
+ "IREF=Iout*(1+2/Beta);#mA\n",
+ "print IREF,\" is Reference current in (mA) \"\n",
+ "R=(VCC-VBE)/(IREF);#kohm\n",
+ "print round(R,1),\"is Resistance in (kohm) \"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1.02 is Reference current in (mA) \n",
+ "28.7 is Resistance in (kohm) \n"
+ ]
+ }
+ ],
+ "prompt_number": 25
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex1.14:Pg-42"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Ex 1.14\n",
+ "\n",
+ "Iout=0.5;#mA\n",
+ "VBE=0.7;#V\n",
+ "VCC=5.0;#V\n",
+ "Beta=50.0;#unitless\n",
+ "IREF=Iout*(1+2/Beta);#mA\n",
+ "print IREF,\" is Reference current in (mA) \"\n",
+ "R=(VCC-VBE)/(IREF);#kohm\n",
+ "print round(R,3),\" is Resistance in (kohm) \"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "0.52 is Reference current in (mA) \n",
+ "8.269 is Resistance in (kohm) \n"
+ ]
+ }
+ ],
+ "prompt_number": 28
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex1.15:Pg-43"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Ex 1.15\n",
+ "\n",
+ "Iout=8;#micro A\n",
+ "VBE=0.7;#V\n",
+ "VCC=20.0;#V\n",
+ "Beta=100.0;#unitless\n",
+ "IREF=Iout*(1+2/Beta/(Beta+1));#micro A\n",
+ "print round(IREF,2),\" is Reference current in (micro A) \"\n",
+ "R=(VCC-2*VBE)/(IREF);#Mohm\n",
+ "print round(R,2),\" is Resistance in (Mohm) \"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "8.0 is Reference current in (micro A) \n",
+ "2.32 is Resistance in (Mohm) \n"
+ ]
+ }
+ ],
+ "prompt_number": 31
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex1.16:Pg-45"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Ex 1.16\n",
+ "\n",
+ "Beta=120;#unitless\n",
+ "VBE=0.7;#V\n",
+ "VCC=10.0;#V\n",
+ "R=5.6;#kohm\n",
+ "#IREF=IC1+I1;as Beta>>1\n",
+ "#I1=IC2+IB3;as Beta>>1\n",
+ "IREF=(VCC-VBE)/R;#mA\n",
+ "#IREF=IC*(2+1/Beta) or IREF=2*IC;as Beta>>1\n",
+ "IC=IREF/2;#mA\n",
+ "Iout=IC;#mA\n",
+ "print round(Iout,2),\"is Iout for the circuit in (mA) \"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "0.83 is Iout for the circuit in (mA) \n"
+ ]
+ }
+ ],
+ "prompt_number": 33
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex1.17:Pg-45"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Ex 1.17\n",
+ "import math\n",
+ "Iout=6;#micro A\n",
+ "IREF=1.2;#mA\n",
+ "VBE2=0.7;#V\n",
+ "VT=26.0;#mV\n",
+ "VCC=20.0;#V\n",
+ "Beta=120;#unitless\n",
+ "R=(VCC-VBE2)/IREF;#kohm\n",
+ "IC2=(IREF-Iout/Beta)/(1+1/Beta);#mA\n",
+ "RS=VT/Iout*math.log(IC2*1000/Iout);#kohm\n",
+ "print int(R),\"Kohm and \",round(RS,2),\"kohm are the Values of resistance R & Rs for widlar current source design\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "16 Kohm and 22.96 kohm are the Values of resistance R & Rs for widlar current source design\n"
+ ]
+ }
+ ],
+ "prompt_number": 40
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex1.18:Pg-47"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Ex 1.18\n",
+ "\n",
+ "import math\n",
+ "IREF=1;#mA\n",
+ "IO2=20.0;#micro A\n",
+ "IO3=40.0;#micro A\n",
+ "VBE1=0.7;#V\n",
+ "VT=26;#mV\n",
+ "VCC=10;#V\n",
+ "VEE=-VCC;#V\n",
+ "R=(VCC-VBE1-VEE)/IREF;#kohm\n",
+ "RE2=VT*10**-3/(IO2*10**-6)*math.log((IREF*10**-3)/(IO2*10**-6));#ohm\n",
+ "RE2=RE2/1000;#kohm\n",
+ "RE3=VT*10**-3/(IO3*10**-6)*math.log((IREF*10**-3)/(IO3*10**-6));#ohm\n",
+ "RE3=RE3/1000;#kohm\n",
+ "print R,\", \",round(RE2,3),\"and \", round(RE3,2),\" are Values of resistance R, RE2 & RE3 for widlar current source design in kohm \"\n",
+ "VBE2=VBE1-RE2*IO2*10**-3;#V\n",
+ "VBE3=VBE1-RE3*IO3*10**-3;#V\n",
+ "\n",
+ "print round(VBE2,3),\"and\",round(VBE3,3),\" are Values of VBE2 & VBE3 in V \"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "19.3 , 5.086 and 2.09 are Values of resistance R, RE2 & RE3 for widlar current source design in kohm \n",
+ "0.598 and 0.616 are Values of VBE2 & VBE3 in V \n"
+ ]
+ }
+ ],
+ "prompt_number": 49
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex1.19:Pg-48"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Ex 1.19\n",
+ "\n",
+ "Beta=100.0;#unitless\n",
+ "VBE=0.715;#V\n",
+ "VEE=10.0;#V\n",
+ "R=5.6;#kohm\n",
+ "IREF=(VEE-VBE)/R;#mA\n",
+ "IC1=IREF/(1+2/Beta);#mA\n",
+ "print round(IC1,2),\" is Collector current in each transistor is equal as all are identical. It in (mA) \"\n",
+ "IRC=3*IC1;#mA\n",
+ "print round(IRC,2),\"is Current through resistance Rc in (mA) \"\n",
+ " # the answer is slightly different in textbook due to approximation"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1.63 is Collector current in each transistor is equal as all are identical. It in (mA) \n",
+ "4.88 is Current through resistance Rc in (mA) \n"
+ ]
+ }
+ ],
+ "prompt_number": 52
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex1.20:Pg-49"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Ex 1.20\n",
+ "\n",
+ "Vout=5.0;#V\n",
+ "Beta=180.0;#unitless\n",
+ "VBE=0.7;#V\n",
+ "VEE=10.0;#V\n",
+ "Vout=5;#V\n",
+ "R1=22.0;#kohm\n",
+ "R2=2.2;#kohm\n",
+ "IREF=(VEE-VBE)/R1;#mA\n",
+ "IC=(IREF-VBE/R2)/(1+2/Beta);#mA\n",
+ "IC1=IC*1000;#micro A(as VBE1=VBE2 IC1=IC2)\n",
+ "IC2=IC*1000;#micro A\n",
+ "print round(IC2,2),\",\",round(IC1,2),\" are Current IC1 & IC2 in micro A \"\n",
+ "RC=(VEE-Vout)/(IC1*10**-3);#kohm\n",
+ "print round(RC,2),\"is Value of Rc in (kohm) \"\n",
+ "\n",
+ "#Answer is different in the textbook due to approximation\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "103.4 , 103.4 are Current IC1 & IC2 in micro A \n",
+ "48.36 is Value of Rc in (kohm) \n"
+ ]
+ }
+ ],
+ "prompt_number": 56
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex1.21:Pg-51"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Ex 1.21\n",
+ "\n",
+ "AQ2byA1=0.5;\n",
+ "AQ3byA1=0.25;\n",
+ "AQ4byA1=0.125;\n",
+ "VBE=0.7;#V\n",
+ "VCC=15.0;#V\n",
+ "R=20.0;#kohm\n",
+ "IC1=(VCC-VBE)/R;#mA\n",
+ "IC2=IC1*AQ2byA1;#mA\n",
+ "IC3=IC1*AQ3byA1;#mA\n",
+ "IC4=IC1*AQ4byA1;#mA\n",
+ "print round(IC2,4),\",\",round(IC3,3),\"and\",round(IC4,3),\"are the Values of current IC2, IC3 & IC4 in (mA) \"\n",
+ "#Value of IC4 is displayed wrong in the textbook.\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "0.3575 , 0.179 and 0.089 are the Values of current IC2, IC3 & IC4 in (mA) \n"
+ ]
+ }
+ ],
+ "prompt_number": 62
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Integrated_Circuits/Chapter2.ipynb b/Integrated_Circuits/Chapter2.ipynb new file mode 100755 index 00000000..b9dc8563 --- /dev/null +++ b/Integrated_Circuits/Chapter2.ipynb @@ -0,0 +1,228 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:cba451428c3d9c574800bbc1429b7e9efcd18af4b82f735faf4ac85b4ea52c65"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter02:The 741 IC OP-AMP"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex2.1:Pg-80"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Ex 2.1\n",
+ "\n",
+ "# data from fig of Ex2.1\n",
+ "VCC=5.0;#V\n",
+ "IS=10**-14.0;#A\n",
+ "RS=39*1000.0;#ohm\n",
+ "VBE12=0.7;#V(Assumed)\n",
+ "VBE11=0.7;#V(Assumed)\n",
+ "VEE=-5;#V\n",
+ "IREF=(VCC-VBE12-VBE11-VEE)/RS*10**6;#micro A\n",
+ "print \"Estimated input reference current , IREF(micro A)\",round(IREF,2)\n",
+ "VT=25*10**-3;#V(Thermal Voltage)\n",
+ "VBE=VT*log(IREF*10**-6/IS);#V\n",
+ "IREF=(VCC-VBE-VBE-VEE)/RS*10**6;#micro A\n",
+ "print \"More precise value of reference current , IREF(micro A)\",round(IREF,2)\n",
+ "#Replacing Vcc by 15 V in the original design\n",
+ "VCC2=15.0;#V\n",
+ "VEE2=-15.0;#V\n",
+ "IREF=(VCC2-VBE-VBE-VEE2)/RS*10**6;#micro A\n",
+ "VBE=VT*log(IREF*10**-6/IS);#V\n",
+ "R5=(VCC-VBE-VBE-VEE)/(IREF*10**-6);#ohm\n",
+ "R5=round(R5/1000);#kohm\n",
+ "print \"Value of R5(kohm) : \",R5"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Estimated input reference current , IREF(micro A) 220.51\n",
+ "More precise value of reference current , IREF(micro A) 225.88\n",
+ "Value of R5(kohm) : 12.0\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex2.2:Pg-81"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Ex 2.2\n",
+ "import math\n",
+ "# data from fig of Ex2.2\n",
+ "IC10=20*10**-6;#A\n",
+ "IREF=0.5*10**-3;#A\n",
+ "IS=10**-14;#A\n",
+ "VT=25*10**-3;#V(Thermal Voltage)\n",
+ "R4=VT/IC10*math.log(IREF/IC10);#ohm\n",
+ "print \"For Widlar current source design, the value of R4(kohm) : \",round(R4/1000,2)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "For Widlar current source design, the value of R4(kohm) : 4.02\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex2.3:Pg-82"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Ex 2.3\n",
+ "\n",
+ "import math\n",
+ "# given data\n",
+ "Gm1=10.0;#mA/V\n",
+ "Gm1=Gm1/1000;#A/V\n",
+ "Cc=50.0;#pF\n",
+ "Cc=Cc*10**-12;#F\n",
+ "Rt=10**8;#ohm(Shunting resistance with Cc)\n",
+ " # solution\n",
+ "Ao=Gm1*Rt;#unitless\n",
+ "fp=1/(2*math.pi*Rt*Cc);#Hz\n",
+ "ft=Gm1/(2*math.pi*Cc)/10**6;#MHz\n",
+ "print \"Frequency at which gain is maximum, fp in Hz\",round(fp,1)\n",
+ "print \"Unit gain frequency, ft(MHz)\",round(ft,1)\n",
+ "#Bode plot can not be plotted with the given data in the question by using python functions. \n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Frequency at which gain is maximum, fp in Hz 31.8\n",
+ "Unit gain frequency, ft(MHz) 31.8\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex2.4:Pg-83"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Ex 2.4\n",
+ "\n",
+ "import math\n",
+ "# given data\n",
+ "SR=10.0/10**-6;#V/s\n",
+ "Vout=10.0;#V(magnitude of output voltage)\n",
+ "fm=SR/(2*math.pi*Vout)/1000;#kHz\n",
+ "print \"Full power bandwidth(kHz)\",round(fm,1)\n",
+ "VT=25.0/1000;#V(Thermal voltage)\n",
+ "ft=SR/(2*math.pi*4*VT)/10.0**6;#MHz\n",
+ "print \"Unity gain bandwidth(MHz)\",round(ft,1)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Full power bandwidth(kHz) 159.2\n",
+ "Unity gain bandwidth(MHz) 15.9\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex2.5:Pg-84"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Ex 2.5\n",
+ "\n",
+ "VCC=5;#V\n",
+ "VEE=-5;#V\n",
+ "VBE=0.6;#V\n",
+ "VCE23=0.6;#V\n",
+ "VCE_sat=0.2;#V\n",
+ "Vo_max=VCC-VCE_sat-VBE;#V\n",
+ "Vo_min=VEE+VCE_sat+VBE+VCE23;#V\n",
+ "print \"Maximum output voltage(V)\",round(Vo_max,2)\n",
+ "print \"Minimum output voltage(V)\",round(Vo_min,2)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Maximum output voltage(V) 4.2\n",
+ "Minimum output voltage(V) -3.6\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Integrated_Circuits/Chapter3.ipynb b/Integrated_Circuits/Chapter3.ipynb new file mode 100755 index 00000000..86432c8d --- /dev/null +++ b/Integrated_Circuits/Chapter3.ipynb @@ -0,0 +1,1204 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:f9ba841d51e943eb842cd7b286030046166ba358e1dbe882cc0bc48bab2a1a28"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter3: Linear Application of IC Op-Amps"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex3.1:pg-95"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "R1=2.2#kohm\n",
+ "G=-100 #Voltage gain\n",
+ "Rf=-G*R1#kohm\n",
+ "print \"Value of Rf: \",Rf ,\"kohm\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Value of Rf: 220.0 kohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex3.2:pg-95"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "Vin=2.5 #mV\n",
+ "R1=2 #kohm\n",
+ "Rf=200 #kohm\n",
+ "G=-Rf/R1 #Gain\n",
+ "Vo=G*Vin/1000.0 #V\n",
+ "print \"Output Voltage Vo=\",Vo \n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Output Voltage Vo= -0.25\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex3.3:pg-96"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "G=-10 #Gain\n",
+ "Ri=100 #kohm input resistance \n",
+ "R1=Ri #kohm\n",
+ "R2=-G*R1 #kohm\n",
+ "print R1,\"is the Value of R1 in kohm \" \n",
+ "print int(R2/1000),\"the Value of R2 in Mohm \" \n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "100 is the Value of R1 in kohm \n",
+ "1 the Value of R2 in Mohm \n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex3.4:pg-119"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#Given\n",
+ "FT1=1 #Filter Transmission\n",
+ "FT2=0.99 #Filter Transmission\n",
+ "FT3=0.9 #Filter Transmission\n",
+ "FT4=0.1 #Filter Transmission\n",
+ "A1= int(-20*math.log10(FT1)) #dB\n",
+ "A2= round(-20*math.log10(FT2),3) #dB\n",
+ "A3= round(-20*math.log10(FT3),3) #dB\n",
+ "A4= -20*math.log10(FT4) #dB\n",
+ "print \"For filter transmission=1, Attenuation(dB)=\", A1 \n",
+ "print \"For filter transmission=0.99, Attenuation(dB)=\",A2 \n",
+ "print \"For filter transmission=0.9, Attenuation(dB)=\",A3\n",
+ "print \"For filter transmission=0.1, Attenuation(dB)=\",A4 \n",
+ " #Answer in the book is wrong for 0.99 filter transmission.\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "For filter transmission=1, Attenuation(dB)= 0\n",
+ "For filter transmission=0.99, Attenuation(dB)= 0.087\n",
+ "For filter transmission=0.9, Attenuation(dB)= 0.915\n",
+ "For filter transmission=0.1, Attenuation(dB)= 20.0\n"
+ ]
+ }
+ ],
+ "prompt_number": 24
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex3.5:pg-119"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given\n",
+ "import math\n",
+ "fo=2 #kHz\n",
+ "Ap=10.0 #Band pass gain\n",
+ "C=0.1 #micro F(have to choose C, 0.01<C<1)\n",
+ "R2=round(1/(2*math.pi*fo*math.pow(10,3)*C*math.pow(10,-6)),1) #ohm\n",
+ "R1=R2/Ap #ohm\n",
+ "print \"Design values are :\"\n",
+ "print C,\"is the Capacitance(micro F)\"\n",
+ "print int(round(R1)),\"is the Resistance R1(ohm)\"\n",
+ "print round(R2/1000.0,1),\"is the Resistance R2(kohm)\"\n",
+ " #Answer in the book is wrong R2 should be .8kohm instead of 8kohm.\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Design values are :\n",
+ "0.1 is the Capacitance(micro F)\n",
+ "80 is the Resistance R1(ohm)\n",
+ "0.8 is the Resistance R2(kohm)\n"
+ ]
+ }
+ ],
+ "prompt_number": 100
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex3.6:pg-129"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#Given\n",
+ "fo=1 #kHz\n",
+ "Ap=1.586 #Band pass gain\n",
+ "C=0.005 #micro F C1=C2=0.005(Assumed)\n",
+ "R=round(1/(2*math.pi*fo*math.pow(10,3)*C*math.pow(10,-6)),2) #ohm\n",
+ "Rf=10 #kohm(Assumed)\n",
+ "Ri=Rf/(Ap-1) #kohm\n",
+ "print \"Design values are :\" \n",
+ "print round(R/1000,2),\" is the Resistance in kohm, R1=R2=R\"\n",
+ "print round(Ri,2),\"is the Resistance Ri(kohm)\" \n",
+ "print Rf,\"is the Resistance Rf(kohm)\" \n",
+ "print C,\"is the Capacitance(micro F), C1=C2=C\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Design values are :\n",
+ "31.83 is the Resistance in kohm, R1=R2=R\n",
+ "17.06 is the Resistance Ri(kohm)\n",
+ "10 is the Resistance Rf(kohm)\n",
+ "0.005 is the Capacitance(micro F), C1=C2=C\n"
+ ]
+ }
+ ],
+ "prompt_number": 101
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex3.7:pg-134"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#Given\n",
+ "fo=3 #kHz\n",
+ "Ap=4 #Band pass gain\n",
+ "alfa=1.414 #for butterworth filter\n",
+ "C1=0.01 #micro F(Assumed)\n",
+ "C2=round(math.pow(alfa,2)*C1/4.0,3) #micro F\n",
+ "R=round(1/(2*math.pi*fo*math.pow(10,3)*math.sqrt(C1*math.pow(10,-6)*C2*math.pow(10,-6))*1000.0),3) #kohm\n",
+ "Rf=2*R #kohm(Assumed)\n",
+ "print \"Design values are :\" \n",
+ "print C1,\"is the Capacitance C1(micro F)\" \n",
+ "print C2,\"is the Capacitance C2(micro F)\" \n",
+ "print R,\"is the Resistance R(kohm)\" \n",
+ "print \"For offset minimization, Resistance Rf(kohm)=\",Rf\n",
+ " #/For additional pass band gain\n",
+ "Ri=10.0 #kohm(Assumed)\n",
+ "Rf=(Ap-1)*Ri #kohm\n",
+ "print \"For additional band pass gain:\" \n",
+ "print Ri,\"is the Resistance Ri(kohm)\" \n",
+ "print Rf,\"is the Resistance Rf(kohm)\" \n",
+ " #Answer in the book is incorrect for C2.\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Design values are :\n",
+ "0.01 is the Capacitance C1(micro F)\n",
+ "0.005 is the Capacitance C2(micro F)\n",
+ "7.503 is the Resistance R(kohm)\n",
+ "For offset minimization, Resistance Rf(kohm)= 15.006\n",
+ "For additional band pass gain:\n",
+ "10.0 is the Resistance Ri(kohm)\n",
+ "30.0 is the Resistance Rf(kohm)\n"
+ ]
+ }
+ ],
+ "prompt_number": 49
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex3.8:pg-136"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#Given \n",
+ "fo=2 #kHz\n",
+ "alfa=1.414 #for butterworth filter\n",
+ "Ap=3-alfa #band pass gain\n",
+ "RfBYRi=(Ap-1) #op-amp gain\n",
+ "C=0.05 #micro F(Assumed)\n",
+ "R=round(1/(2*math.pi*fo*10**3*C*10**-6)/1000,1) #kohm\n",
+ "#For offset minimization 2*R=Rf||Ri\n",
+ "Rf=round(2*R*RfBYRi+2*R,2) #kohm\n",
+ "Ri=round(Rf/RfBYRi,3) #kohm\n",
+ "print \"Design values are :\"\n",
+ "print C,\"is the Capacitance C(micro F)\" \n",
+ "print R,\"is the Resistance R(kohm)\" \n",
+ "print Rf,\"is the Resistance Rf(kohm)\"\n",
+ "print Ri,\"is the Resistance Ri(kohm)\" \n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Design values are :\n",
+ "0.05 is the Capacitance C(micro F)\n",
+ "1.6 is the Resistance R(kohm)\n",
+ "5.08 is the Resistance Rf(kohm)\n",
+ "8.669 is the Resistance Ri(kohm)\n"
+ ]
+ }
+ ],
+ "prompt_number": 102
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex3.9:pg-139"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Ex 3.9 \n",
+ "import math\n",
+ "fo=1.2 #kHz\n",
+ "alfa=1.414 #for butterworth filter\n",
+ "Ap=3-alfa #band pass gain\n",
+ "RfBYRi=(Ap-1) #op-amp gain\n",
+ "C=0.03 #micro F(have to choose C, 0.01<C<1)\n",
+ "R=round(1/(2*math.pi*fo*10**3*C*10**-6)/1000,1) #kohm\n",
+ "#For offset minimization 2*R=Rf||Ri\n",
+ "Rf=round(2*R*RfBYRi+2*R,2) #kohm\n",
+ "Ri=round(Rf/RfBYRi,1) #kohm\n",
+ "print \"Design values are :\" \n",
+ "print C,\"is the Capacitance(micro F)\" \n",
+ "print R,\"is the Resistance R(kohm)\" \n",
+ "print Rf,\"is the Resistance Rf(kohm)\" \n",
+ "print Ri,\"is the Resistance Ri(kohm)\" \n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Design values are :\n",
+ "0.03 is the Capacitance(micro F)\n",
+ "4.4 is the Resistance R(kohm)\n",
+ "13.96 is the Resistance Rf(kohm)\n",
+ "23.8 is the Resistance Ri(kohm)\n"
+ ]
+ }
+ ],
+ "prompt_number": 64
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex3.10:pg-141"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ " #Ex 3.10\n",
+ "import math \n",
+ "fL=200 #Hz\n",
+ "fH=1*1000 #Hz\n",
+ "Ap=4 #band pass gain\n",
+ "BW=fH-fL #Hz\n",
+ "f0=math.sqrt(fH*fL) #Hz\n",
+ "fc=math.sqrt(fH*fL) #Hz\n",
+ "Q=fc/BW #Quality factor\n",
+ "print round(Q,2),\"is the Quality factor \" \n",
+ "print \"As Q<12 it is wide band filter \" \n",
+ "print fL,\"is the Design values for high pass section with Ap1=2 & fL(Hz) : \" \n",
+ "Ap1=2 #band pass gain for high pass section\n",
+ "C=0.033 #micro F(have to choose C, 0.01<C<1)\n",
+ "R=int(1/(2*math.pi*fL*C*10 **-6)/1000.0) #kohm\n",
+ "RfBYRi=(Ap-1) #op-amp gain\n",
+ "Rf=2*R #kohm\n",
+ "Ri=2*R #kohm\n",
+ "print C,\"is the Capacitance(micro F) \" \n",
+ "print R,\"is the Resistance R(kohm) \" \n",
+ "print Rf,\"=Resistance Rf(kohm) \" \n",
+ "print Ri,\"=Resistance Ri(kohm) \" \n",
+ "print fH,\"=Design values for low pass section with Ap2=2 & fH(Hz) : \" \n",
+ "Ap2=2 #band pass gain for low pass section\n",
+ "C=0.033 #micro F(have to choose C, 0.01<C<1)\n",
+ "k=fL/fH #scaling factor\n",
+ "Rdash=0.2*R #kohm\n",
+ "Ri=2*Rdash #kohm\n",
+ "Rf=Ri #kohm(for Ap2=2)\n",
+ "print C,\"=Capacitance(micro F) \" \n",
+ "print Rdash,\"=Resistance Rdash(kohm) \" \n",
+ "print Rf,\"=Resistance Rf(kohm) \" \n",
+ "print Ri,\"=Resistance Ri(kohm) \" \n",
+ "print \"For design purpose use rounded value 10 kohm for Rf & Ri \" \n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "0.56 is the Quality factor \n",
+ "As Q<12 it is wide band filter \n",
+ "200 is the Design values for high pass section with Ap1=2 & fL(Hz) : \n",
+ "0.033 is the Capacitance(micro F) \n",
+ "24 is the Resistance R(kohm) \n",
+ "48 =Resistance Rf(kohm) \n",
+ "48 =Resistance Ri(kohm) \n",
+ "1000 =Design values for low pass section with Ap2=2 & fH(Hz) : \n",
+ "0.033 =Capacitance(micro F) \n",
+ "4.8 =Resistance Rdash(kohm) \n",
+ "9.6 =Resistance Rf(kohm) \n",
+ "9.6 =Resistance Ri(kohm) \n",
+ "For design purpose use rounded value 10 kohm for Rf & Ri \n"
+ ]
+ }
+ ],
+ "prompt_number": 103
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex3.11:pg-144"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Ex 3.11\n",
+ "import math \n",
+ "fL=200 #Hz\n",
+ "fH=1*1000 #Hz\n",
+ "Ap=4 #band pass gain\n",
+ "BW=fH-fL #Hz\n",
+ "f0=math.sqrt(fH*fL) #Hz\n",
+ "fc=math.sqrt(fH*fL) #Hz\n",
+ "Q=int(fc/BW) #Quality factor\n",
+ "print Q, \"=Quality factor\" \n",
+ "print \"As Q<10 it is wide band filter\" \n",
+ "print fH, \"=Design values for low pass section with Ap2=2 & fH(Hz) :\" \n",
+ "Ap2=2 #band pass gain for low pass section\n",
+ "C=0.03 #micro F(have to choose C, 0.01<C<1)\n",
+ "Rdash=round(1/(2*math.pi*fH*C*10**-6)/1000,1) #kohm\n",
+ "print C, \"=Capacitance(micro F)\" \n",
+ "print Rdash, \"=Resistance Rdash(kohm)\" \n",
+ "print \"Value of Resistance Rf & Ri can be choosen as 10 kohm for filter design.\" \n",
+ "print fL, \"=Design values for high pass section with Ap1=2 & fL(Hz) :\" \n",
+ "Ap1=2 #band pass gain for high pass section\n",
+ "C=0.05 #micro F(have to choose C, 0.01<C<1)\n",
+ "R=round(1/(2*math.pi*fL*C*10**-6)/1000,1) #kohm\n",
+ "RfBYRi=(Ap-1) #op-amp gain\n",
+ "print C, \"=Capacitance(micro F)\" \n",
+ "print R, \"=Resistance R(kohm)\" \n",
+ "print \"Value of Resistance Rf & Ri can be choosen as 10 kohm for filter design.\" \n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "0 =Quality factor\n",
+ "As Q<10 it is wide band filter\n",
+ "1000 =Design values for low pass section with Ap2=2 & fH(Hz) :\n",
+ "0.03 =Capacitance(micro F)\n",
+ "5.3 =Resistance Rdash(kohm)\n",
+ "Value of Resistance Rf & Ri can be choosen as 10 kohm for filter design.\n",
+ "200 =Design values for high pass section with Ap1=2 & fL(Hz) :\n",
+ "0.05 =Capacitance(micro F)\n",
+ "15.9 =Resistance R(kohm)\n",
+ "Value of Resistance Rf & Ri can be choosen as 10 kohm for filter design.\n"
+ ]
+ }
+ ],
+ "prompt_number": 104
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex3.12:pg-150"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Ex 3.12\n",
+ "import math\n",
+ "fo=1.2*1000 #Hz\n",
+ "Q=4 #Quality factor\n",
+ "Ap=10 #band pass gain\n",
+ "C=0.05 #micro F(have to choose C, 0.01<C<1)\n",
+ "R2=round(2*Q/(2*math.pi*fo*C*10** -6)/1000,2) #kohm\n",
+ "R1=round(R2/2/Ap,2) #kohm\n",
+ "R3=round(R1/(4*math.pi**2*R1*1000*R2*1000*(C*10** -6)** 2*fo** 2-1),2) #kohm\n",
+ "print \"Design values are :\" \n",
+ "print C,\"= Capacitance(micro F)\" \n",
+ "print R1,\"= Resistance R1(kohm)\" \n",
+ "print R2,\"= Resistance R2(kohm)\" \n",
+ "print R3*1000,\"= Resistance R3(ohm)\" \n",
+ "#Answer in the book is wrong for R3.\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Design values are :\n",
+ "0.05 = Capacitance(micro F)\n",
+ "1.06 = Resistance R1(kohm)\n",
+ "21.22 = Resistance R2(kohm)\n",
+ "480.0 = Resistance R3(ohm)\n"
+ ]
+ }
+ ],
+ "prompt_number": 105
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex3.13:pg-153"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Ex 3.13\n",
+ "import math\n",
+ "fH=100 #Hz\n",
+ "fL=1*1000 #Hz\n",
+ "print \"This filter is a combination of -:\" \n",
+ "print \"High pass filter having fH=100 Hz\" \n",
+ "print \"Low pass filter having fL=1 kHz\" \n",
+ "print \"And a summing amplifier\" \n",
+ "#High pass filter\n",
+ "print \"Design values for high pass section :\" \n",
+ "C=0.05 #micro F(have to choose C, 0.01<C<1)\n",
+ "R=round(1/(2*math.pi *fL*C*10 **-6)/1000,2) #kohm\n",
+ "Ap=2 #assumed\n",
+ "#Rf=Ri #for gain=2\n",
+ "Rf=10 #kohm(assumed)\n",
+ "Ri=10 #kohm(assumed)\n",
+ "print C,\"= Capacitance(micro F)\" \n",
+ "print R,\"= Resistance R(kohm)\" \n",
+ "print \"Value of Resistance Rf & Ri can be choosen as 10 kohm for filter design.\" \n",
+ "#Low pass filter\n",
+ "print \"Design values for low pass section :\" \n",
+ "C=0.1 #micro F(have to choose C, 0.01<C<1)\n",
+ "Rdash=round(1/(2*math.pi *fH*C*10 **-6)/1000,2) #kohm\n",
+ "Ap=2 #assumed\n",
+ "#Rfdash=Ridash #for gain=2\n",
+ "Rf_dash=10 #kohm(assumed)\n",
+ "Ri_dash=10 #kohm(assumed)\n",
+ "print C,\"= Capacitance(micro F)\" \n",
+ "print Rdash,\"= Resistance Rdash(kohm)\" \n",
+ "print \"Value of Resistance Rf_dash & Ri_dash can be choosen as 10 kohm for filter design.\" \n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "This filter is a combination of -:\n",
+ "High pass filter having fH=100 Hz\n",
+ "Low pass filter having fL=1 kHz\n",
+ "And a summing amplifier\n",
+ "Design values for high pass section :\n",
+ "0.05 = Capacitance(micro F)\n",
+ "3.18 = Resistance R(kohm)\n",
+ "Value of Resistance Rf & Ri can be choosen as 10 kohm for filter design.\n",
+ "Design values for low pass section :\n",
+ "0.1 = Capacitance(micro F)\n",
+ "15.92 = Resistance Rdash(kohm)\n",
+ "Value of Resistance Rf_dash & Ri_dash can be choosen as 10 kohm for filter design.\n"
+ ]
+ }
+ ],
+ "prompt_number": 106
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex3.14:pg-156"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Ex 3.14\n",
+ "import math\n",
+ "fN=50 #Hz\n",
+ "C=0.5 #micro F(have to choose C, 0.01<C<1)\n",
+ "R=round(1/(2*math.pi*fN*C*10 **-6)/1000,2) #kohm\n",
+ "print \"Design values are : \" \n",
+ "print C ,\"= Capacitance(micro F) \" \n",
+ "print R ,\"= Resistance R(kohm) \" \n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Design values are : \n",
+ "0.5 = Capacitance(micro F) \n",
+ "6.37 = Resistance R(kohm) \n"
+ ]
+ }
+ ],
+ "prompt_number": 107
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex3.15:pg-157"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Ex 3.15\n",
+ "import math\n",
+ "fo=1*1000#Hz\n",
+ "fo_dash=1.5*1000#Hz\n",
+ "C=0.01#micro F(have to choose C, 0.01<C<1)\n",
+ "R=round(1/(2*math.pi*fo*C*10**-6)/1000,3)#kohm\n",
+ "K=1.2*1000/fo_dash#scaling factor\n",
+ "Rdash=round(K*R,3)#/kohm\n",
+ "print \"Design values are :\"\n",
+ "print C,\"= Capacitance(micro F)\"\n",
+ "print R,\"= Resistance R(kohm)\"\n",
+ "print Rdash,\"= Resistance Rdash(kohm)\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Design values are :\n",
+ "0.01 = Capacitance(micro F)\n",
+ "15.915 = Resistance R(kohm)\n",
+ "12.732 = Resistance Rdash(kohm)\n"
+ ]
+ }
+ ],
+ "prompt_number": 108
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex3.16:pg-179"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Ex 3.16\n",
+ "Vf=0.0125 #V\n",
+ "Vo=0.5 #V\n",
+ "Beta=Vf/Vo #unitless\n",
+ "#A*Beta=1 for oscillation\n",
+ "A=1/Beta #gain\n",
+ "print A,\"= Minimum Gain\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "40.0 = Minimum Gain\n"
+ ]
+ }
+ ],
+ "prompt_number": 110
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex3.17:pg-179"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Ex 3.17\n",
+ "import math\n",
+ "R=50#kohm(R1=R2=R3=R)\n",
+ "C=60#pF(C1=C2=C3=C)\n",
+ "f=round(1/(2*math.pi*R*1000*C*10**-12*math.sqrt(6)),2)#Hz\n",
+ "print round(f/1000,3),\"= Frequency of oscillation(kHz)\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "21.658 = Frequency of oscillation(kHz)\n"
+ ]
+ }
+ ],
+ "prompt_number": 112
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex3.18:pg-185"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Ex 3.18\n",
+ "import math\n",
+ "f=2*1000#Hz\n",
+ "R=10#kohm(Assumed)(R1=R2=R)\n",
+ "C=1/(2*math.pi*R*1000*f)#F\n",
+ "print \"Value of resistance R1=R2 can be choosen as 10 kohm\"\n",
+ "print round(C*10**9,2),\"= Cpacitance(nF)\"\n",
+ "print \"Value of resistance R4 can be choosen as 10 kohm & R3=2*R4=20 kohm for Beta to be 1/3\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Value of resistance R1=R2 can be choosen as 10 kohm\n",
+ "7.96 = Cpacitance(nF)\n",
+ "Value of resistance R4 can be choosen as 10 kohm & R3=2*R4=20 kohm for Beta to be 1/3\n"
+ ]
+ }
+ ],
+ "prompt_number": 113
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex3.19:pg-185"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Ex 3.19\n",
+ "import math \n",
+ "R=200#kohm(R1=R2=R)\n",
+ "C=200#pF(C1=C2=C)\n",
+ "f=1/(2*math.pi*R*1000*C*10**-12)#Hz\n",
+ "print round(f*10**-3,3),\"= Frequency of oscillation(kHz)\"\n",
+ "#Answer in the book is wrong"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "3.979 = Frequency of oscillation(kHz)\n"
+ ]
+ }
+ ],
+ "prompt_number": 116
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex3.20:pg-187"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ " #Ex 3.20\n",
+ "import math\n",
+ "import numpy\n",
+ "omegaBYomega0=[0, 0.5, 1, 5, 10, 100] \n",
+ "T=numpy.zeros(6);\n",
+ "G=numpy.zeros(6);\n",
+ "A=numpy.zeros(6);\n",
+ "f=numpy.zeros(6);\n",
+ " #T=omega0/sqrt(omega0**2+omega**2) #Gain\n",
+ "for i in range(0,6):\n",
+ " T[i]=round(1/sqrt(1**2+omegaBYomega0[i]**2),3) #Gain \n",
+ " G[i]=round(20*math.log10(T[i]),2) #dB\n",
+ " A[i]=round(-20*math.log10(T[i]),2) #dB\n",
+ " f[i]=round(-math.atan(omegaBYomega0[i])*180/math.pi,2) #degree\n",
+ "\n",
+ "print \"omega/omega0 T(j*omega) (G(dB)) A(dB) f\"\n",
+ "for i in range(0,6):\n",
+ " print omegaBYomega0[i],\"\\t\\t\\t\\t\",T[i],\"\\t\\t\\t\\t\",G[i],\"\\t\\t\\t\\t\",A[i],\"\\t\\t\\t\\t\",f[i] \n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "omega/omega0 T(j*omega) (G(dB)) A(dB) f\n",
+ "0 \t\t\t\t1.0 \t\t\t\t0.0 \t\t\t\t-0.0 \t\t\t\t-0.0\n",
+ "0.5 \t\t\t\t0.894 \t\t\t\t-0.97 \t\t\t\t0.97 \t\t\t\t-26.57\n",
+ "1 \t\t\t\t0.707 \t\t\t\t-3.01 \t\t\t\t3.01 \t\t\t\t-45.0\n",
+ "5 \t\t\t\t0.196 \t\t\t\t-14.15 \t\t\t\t14.15 \t\t\t\t-78.69\n",
+ "10 \t\t\t\t0.1 \t\t\t\t-20.0 \t\t\t\t20.0 \t\t\t\t-84.29\n",
+ "100 \t\t\t\t0.01 \t\t\t\t-40.0 \t\t\t\t40.0 \t\t\t\t-89.43\n"
+ ]
+ }
+ ],
+ "prompt_number": 135
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex3.21:pg-188"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Ex 3.21\n",
+ "import math\n",
+ "omega1=0.1#rad/s\n",
+ "omega2=1.0#rad/s\n",
+ "omega3=10.0#rad/s\n",
+ "T1=round(1/math.sqrt(1+omega1**6))#Transfer function\n",
+ "T2=round(1/math.sqrt(1+omega2**6),3)#Transfer function\n",
+ "T3=round(1/math.sqrt(1+omega3**6),3)#Transfer function\n",
+ "f1=-math.atan((2*omega1-omega1**3)/real(1-2*omega1**2))*180/math.pi#degree\n",
+ "f2=-math.atan((2*omega2-omega2**3)/real(1-2*omega2**2))*180/math.pi#degree\n",
+ "f3=-math.atan((2*omega3-omega3**3)/real(1-2*omega3**2))*180/math.pi#degree\n",
+ "print \"Value of T= \",T1,\"& f1 for 0.1 rad/s:\",round(f1,1),\"degree\"\n",
+ "print \"Value of T= \",T2,\"& f2 for 1 rad/s: \",f2-180,\"degree\"\n",
+ "print \"Value of T= \",T3,\"& f3 for 10 rad/s: \",round(f3,2),\"degree\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Value of T= 1.0 & f1 for 0.1 rad/s: -11.5 degree\n",
+ "Value of T= 0.707 & f2 for 1 rad/s: -135.0 degree\n",
+ "Value of T= 0.001 & f3 for 10 rad/s: -78.52 degree\n"
+ ]
+ }
+ ],
+ "prompt_number": 145
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex3.22:pg-189"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ " #Ex 3.22\n",
+ "import math\n",
+ "f0=10*1000 #Hz(3-dB frequency)\n",
+ "DCgain=10 #dc gain\n",
+ "R1=10 #kohm\n",
+ "R2=DCgain*R1 #kohm\n",
+ "C=round(1/(2*math.pi*f0*R2*1000)*10**9,3) #nF\n",
+ "print \"Design values are :\"\n",
+ "print R2,\"= Resistance R2(kohm) \"\n",
+ "print C,\"= Capacitance C(nF)\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Design values are :\n",
+ "100 = Resistance R2(kohm) \n",
+ "0.159 = Capacitance C(nF)\n"
+ ]
+ }
+ ],
+ "prompt_number": 147
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex3.23:pg-190"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ " # Ex 3.23\n",
+ "import math\n",
+ "f0=100 # Hz(3-dB frequency)\n",
+ "Ri_inf=100 # kohm(High frequency input resistance)\n",
+ "Tinf=1 # high frequency gain\n",
+ "R1=Ri_inf # kohm\n",
+ "R2=Tinf*R1 # kohm\n",
+ "C=round(1/(2*math.pi*f0*R2*1000)*10**9,1) #nF\n",
+ "print \"Design values are :\"\n",
+ "print R2,\"= Resistance R1=R2(kohm) \"\n",
+ "print C,\"= Capacitance C(nF)\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Design values are :\n",
+ "100 = Resistance R1=R2(kohm) \n",
+ "15.9 = Capacitance C(nF)\n"
+ ]
+ }
+ ],
+ "prompt_number": 194
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex3.24:pg-190"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Ex 3.24 \n",
+ "import math\n",
+ "Ap=12 # dB(Pass band gain)\n",
+ "G=round(10**(Ap/20)) # gain(unitless)\n",
+ "Ri=100 # kohm(as high input impedence required)\n",
+ "R1=Ri # kohm\n",
+ "# Low pass filter design\n",
+ "ALP=-1\n",
+ "AHP=-4 # (to satisfy R2<=100 # kohm)\n",
+ "R2=-ALP*R1 # kohm\n",
+ "f0=10*1000 # Hz(3-dB frequency)\n",
+ "C=round(1/(2*math.pi*f0*R2*1000)*10**9,3) # nF\n",
+ "print \"Design values for low pass filter \" \n",
+ "print R2,\"= Resistance R1=R2 in kohm \" \n",
+ "print C,\"= Capacitance C(nF)\" \n",
+ "# High pass filter design\n",
+ "R3=25 # kohm(Assumed)\n",
+ "R4=-AHP*R3 # kohm\n",
+ "f0=100 # Hz(3-dB frequency)\n",
+ "C=round(1/(2*math.pi*f0*R3*1000)*10**9,1) # nF\n",
+ "print \"Design values for high pass filter \" \n",
+ "print R4,\",\",R3,\"= Resistance R3 & R4 in kohm respectively \" \n",
+ "print C,\"= Capacitance C(nF)\" \n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Design values for low pass filter \n",
+ "100 = Resistance R1=R2 in kohm \n",
+ "0.159 = Capacitance C(nF)\n",
+ "Design values for high pass filter \n",
+ "100 , 25 = Resistance R3 & R4 in kohm respectively \n",
+ "63.7 = Capacitance C(nF)\n"
+ ]
+ }
+ ],
+ "prompt_number": 193
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex3.25:pg-192"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ " #Ex 3.25 \n",
+ "import math \n",
+ "omega=10**4 #rad/s\n",
+ "C=10.0 #nF\n",
+ "fi1=math.radians(-30.0) #degree\n",
+ "fi2=math.radians(-90.0) #degree\n",
+ "fi3=math.radians(-120.0) #degree\n",
+ "fi4=math.radians(-150.0) #degree\n",
+ "R1=(math.tan(-fi1/2)/(C*10**-9*omega)/1000) #kohm\n",
+ "R2=math.tan(-fi2/2)/(C*10**-9*omega)/1000 #kohm\n",
+ "R3=math.tan(-fi3/2)/(C*10**-9*omega)/1000 #kohm\n",
+ "R4=math.tan(-fi4/2)/(C*10**-9*omega)/1000 #kohm\n",
+ "print \"For phase shift=-30 degree, Resistance(kohm=\",round(R1,2) \n",
+ "print \"For phase shift=-90 degree, Resistance(kohm)=\",round(R2,2)\n",
+ "print \"For phase shift=-120 degree, Resistance(kohm)=\",round(R3,2)\n",
+ "print \"For phase shift=-150 degree, Resistance(kohm)=\",round(R4,2)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "For phase shift=-30 degree, Resistance(kohm= 2.68\n",
+ "For phase shift=-90 degree, Resistance(kohm)= 10.0\n",
+ "For phase shift=-120 degree, Resistance(kohm)= 17.32\n",
+ "For phase shift=-150 degree, Resistance(kohm)= 37.32\n"
+ ]
+ }
+ ],
+ "prompt_number": 178
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex3.26:pg-194"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ " # Ex 3.26 \n",
+ "import math \n",
+ "omega1=0 # rad/s\n",
+ "omega2=inf # rad/s\n",
+ "omega0=math.degrees(10**4) # rad/s(Assumed)\n",
+ "fi1=math.atan(omega2/omega0)-math.atan(omega2/-omega0) # degree\n",
+ "fi2=math.atan(omega1/omega0)-math.atan(omega1/-omega0) # degree\n",
+ "print \"For omega=0 phase shift(degree)=\",int(fi1*180/math.pi)\n",
+ "print \"For omega=infinity phase shift(degree)=\",int(fi2*180/math.pi)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "For omega=0 phase shift(degree)= 180\n",
+ "For omega=infinity phase shift(degree)= 0\n"
+ ]
+ }
+ ],
+ "prompt_number": 187
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex3.28:pg-197"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Ex 3.28\n",
+ "import math\n",
+ "f0=1*1000 #Hz\n",
+ "BW=2*math.pi*50 #Hz\n",
+ "C=10 #nF\n",
+ "Q=2*math.pi*f0/BW #quality factor\n",
+ "R=1/(2*math.pi*f0*C*10**-9)/1000 #kohm\n",
+ "R1=10 #kohm(Assumed)\n",
+ "RF=10 #kohm(Assumed)\n",
+ "R3BYR2=2*Q-1\n",
+ "R2=10 #kohm(Assumed)\n",
+ "R3=R3BYR2*R2 #kohm\n",
+ "print \"Design values for KHN circuit:\"\n",
+ "print RF,\",\",R1,\"= Use Resistance R1 & RF in kohm\"\n",
+ "print R2,\"= Use Resistance R2 in kohm\"\n",
+ "print R3,\"= Resistance R3 in kohm\"\n",
+ "K=2-1/Q #scaling factor\n",
+ "CenterFrequency=K*Q\n",
+ "print CenterFrequency,\"= CenterFrequency \""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Design values for KHN circuit:\n",
+ "10 , 10 = Use Resistance R1 & RF in kohm\n",
+ "10 = Use Resistance R2 in kohm\n",
+ "390.0 = Resistance R3 in kohm\n",
+ "39.0 = CenterFrequency \n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Integrated_Circuits/Chapter4.ipynb b/Integrated_Circuits/Chapter4.ipynb new file mode 100755 index 00000000..19925529 --- /dev/null +++ b/Integrated_Circuits/Chapter4.ipynb @@ -0,0 +1,77 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:a53e3521832583abe0335811dcafa98f6c34443e5174472fc5c852275ef11b44"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter04: Digital Integrated Circuit Design"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex4.3:pg-230"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Ex 4.3\n",
+ "\n",
+ "VDD=3.0;#V(Supply Voltage)\n",
+ "VOH=VDD;#V\n",
+ "VOL=0.0;#V\n",
+ "Vth=VDD/2;#V\n",
+ "VIL=VDD/2;#V\n",
+ "VIH=VDD/2;#V\n",
+ "NMH=VOH-VIH;#V\n",
+ "NML=VIL-VOL;#V\n",
+ "print Vth,\"Vth(V)\"\n",
+ "print VIL,\"VIL(V)\"\n",
+ "print VIH,\"VIH(V)\"\n",
+ "print VOL,\"VOL(V)\"\n",
+ "print VOH,\"VOH(V)\"\n",
+ "print NML,\"NML(V)\"\n",
+ "print NMH,\"NMH(V)\"\n",
+ "#Gain=(VOH-VOL)/(VIH-VIL)=infinity as VIH=VIL;#Gain in the transition region\n",
+ "Gain=inf#\n",
+ "print Gain,\"Gain in the transition region\"\n",
+ "#Answer in the book is wrong for the gain.\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1.5 Vth(V)\n",
+ "1.5 VIL(V)\n",
+ "1.5 VIH(V)\n",
+ "0.0 VOL(V)\n",
+ "3.0 VOH(V)\n",
+ "1.5 NML(V)\n",
+ "1.5 NMH(V)\n",
+ "inf Gain in the transition region\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Integrated_Circuits/Chapter5.ipynb b/Integrated_Circuits/Chapter5.ipynb new file mode 100755 index 00000000..679409a2 --- /dev/null +++ b/Integrated_Circuits/Chapter5.ipynb @@ -0,0 +1,393 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:80346364d9467878bde7610e6e58f2864052653b0338be581053adfe2d70b16b"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter5: Non-Linear Applications of IC OP-AMPs"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex5.1:pg-283"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Ex 5.1\n",
+ "\n",
+ "\n",
+ "R1=100.0;#kohm\n",
+ "R2=86.0;#kohm\n",
+ "Vsat=15.0;#V\n",
+ "VUT=R2/(R1+R2)*Vsat;#V\n",
+ "VLT=R2/(R1+R2)*-Vsat;#V\n",
+ "print round(VUT,2),\"=VUT(V) \"\n",
+ "print round(VLT,2),\"=VLT(V) \"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "6.94 =VUT(V) \n",
+ "-6.94 =VLT(V) \n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex5.2:pg-283"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Ex 5.2\n",
+ "\n",
+ "Rf=100;#kohm\n",
+ "C=0.1;#micro F\n",
+ "T=2*Rf*1000*C*10**-6;#s\n",
+ "print T*10**3,\"Time period(ms)\"\n",
+ "f=1/T;#Hz\n",
+ "print f,\"Frequency(Hz) \"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "20.0 Time period(ms)\n",
+ "50.0 Frequency(Hz) \n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex5.3:pg-287"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Ex 5.3\n",
+ "\n",
+ "R=100.0;#kohm\n",
+ "C=0.01;#micro F\n",
+ "f=1/(2*R*10**3*C*10**-6);#Hz\n",
+ "print f,\"Frequency(Hz) \"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "500.0 Frequency(Hz) \n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex5.4:pg-287"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Ex 5.4\n",
+ "\n",
+ "f=1*1000.0;#HZ\n",
+ "Vs=15.0;#V\n",
+ "C=0.1;#micro F(Assumed)\n",
+ "R=1.0/(2*f*C*10**-6);#Hz\n",
+ "print \"For the required design value of R(kohm) \",R/1000.0\n",
+ "print \"R1 & R2 can be choosen as 10 kohm\"\n",
+ "#/Answer in the book is wrong\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "For the required design value of R(kohm) 5.0\n",
+ "R1 & R2 can be choosen as 10 kohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex5.5:pg-293"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Ex 5.5\n",
+ "\n",
+ "Vo=0.7;#V\n",
+ "Vsat=12.0;#V\n",
+ "R1=10.0;#kohm\n",
+ "R2=60.0;#kohm\n",
+ "Vth=R1/(R1+R2)*Vo;#V\n",
+ "iDmax=(Vsat-Vo)/R1-Vo/(R1+R2);#mA\n",
+ "print iDmax,\": Maximum current(mA) \"\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1.12 : Maximum current(mA) \n"
+ ]
+ }
+ ],
+ "prompt_number": 15
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex5.7:pg-294"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Ex 5.7\n",
+ "\n",
+ "\n",
+ "R1=10.0;#kohm\n",
+ "R2=16.0;#kohm\n",
+ "C=10.0;#nF\n",
+ "R=62.0;#kohm\n",
+ "Beta=R1/(R1+R2);#unitless\n",
+ "T=2*R*1000.0*C*10**-9*math.log((1+Beta)/(1-Beta));#seconds\n",
+ "f=1.0/T;#Hz\n",
+ "print round(f,1),\": Frequency of oscillations(Hz) \"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "994.5 : Frequency of oscillations(Hz) \n"
+ ]
+ }
+ ],
+ "prompt_number": 17
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex:5.8:pg-295"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Ex 5.8\n",
+ "\n",
+ "\n",
+ "#vo/v1=1+R2/R1;#\n",
+ "#For v2/v1 i.e. gain=2, R1 & R2 should be equal\n",
+ "Vpp=10.0;#V\n",
+ "R1=10.0;#kohm\n",
+ "R2=10.0;#kohm\n",
+ "#Avg=1/T*integrate('Vpp*math.sin(2*%pi*t/T)','t',0,T/2);\n",
+ "Avg=-Vpp/(2*math.pi)*(math.cos(math.pi)-math.cos(0));\n",
+ "print round(Avg,2),\": Average output voltage(V) \"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "3.18 : Average output voltage(V) \n"
+ ]
+ }
+ ],
+ "prompt_number": 24
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex5.9:pg-296"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Ex 5.9\n",
+ "\n",
+ "\n",
+ "#vo/v1=-2;#Gain for -ve inputs\n",
+ "voBYvi=-2;#Gain for -ve inputs\n",
+ "#vo/v1=0;#Gain for non -ve inputs\n",
+ "Rin=100;#kohm\n",
+ "R1=100;#kohm(R1=Rin)\n",
+ "R2=-R1*voBYvi;#kohm\n",
+ "print R1,\"and\",R2,\"are Values of R1 & R2(kohm) \"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "100 and 200 are Values of R1 & R2(kohm) \n"
+ ]
+ }
+ ],
+ "prompt_number": 27
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex5.11:pg-298"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Ex 5.11\n",
+ "\n",
+ "\n",
+ "f0=1.5;#kHz\n",
+ "Vopp=6;#V\n",
+ "Vsat=13.5;#V\n",
+ "#Let R2=10kohm\n",
+ "R2=10;#kohm\n",
+ "R3=R2*2*Vsat/Vopp;#kohm\n",
+ "#Let C1=0.05 micro F\n",
+ "C1=0.05;#micro F\n",
+ "R1=R3/(4*f0*1000*R2*1000*C1*10**-6);#kohm\n",
+ "print R1,\",\",R2,\",\",R3,\"are Values of R1, R2 & R3(kohm) \"\n",
+ "print C1,\": Value of C1(micro F)\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "15.0 , 10 , 45.0 are Values of R1, R2 & R3(kohm) \n",
+ "0.05 : Value of C1(micro F)\n"
+ ]
+ }
+ ],
+ "prompt_number": 29
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex5.12:pg-299"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Ex 5.12\n",
+ "\n",
+ "\n",
+ "tau=1;#ms\n",
+ "#R1/R2=1.8:9;given range\n",
+ "#Let R1/R2=1.8\n",
+ "R1BYR2=1.8;#ratio\n",
+ "Beta1=1.0/(R1BYR2+1);\n",
+ "R1BYR2=9.0;#ratio\n",
+ "Beta2=1.0/(R1BYR2+1);#unitless\n",
+ "#For fmin\n",
+ "Tmax=2.0*math.log((1+Beta1)/(1-Beta1));#ms\n",
+ "fmin=1000.0/Tmax;#Hz\n",
+ "#For fmax\n",
+ "Tmin=2*math.log((1+Beta2)/(1-Beta2));#ms\n",
+ "fmax=1/Tmin;#kHz\n",
+ "print \"Frequency range is \",round(fmin),\" Hz to \",round(fmax,1),\" kHz\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Frequency range is 669.0 Hz to 2.5 kHz\n"
+ ]
+ }
+ ],
+ "prompt_number": 34
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Integrated_Circuits/Chapter6.ipynb b/Integrated_Circuits/Chapter6.ipynb new file mode 100755 index 00000000..ab519b33 --- /dev/null +++ b/Integrated_Circuits/Chapter6.ipynb @@ -0,0 +1,354 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:8a254c33be18374a78b4f00ca9688168896a7d9ddc01623f880056b5f9ba95d9"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter6: A/D, D/A Converters"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex6.1:pg-311"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Ex 6.1 \n",
+ "n=8 #no. of bits\n",
+ "V1=0 #V\n",
+ "V2=5.12 #V\n",
+ "Res=2**n #resolution\n",
+ "print Res,\" =(a) Resolution\" \n",
+ "delVo=(V2-V1)/Res*1000 #mV/bit\n",
+ "print int(delVo),\" =(b) Output change per bit(mV/bit) \" \n",
+ "VFS=V2*(1-1/2**n) #V\n",
+ "print round(VFS,1),\" =(c) Full scale Output voltage(V) \" \n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "256 =(a) Resolution\n",
+ "20 =(b) Output change per bit(mV/bit) \n",
+ "5.1 =(c) Full scale Output voltage(V) \n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex6.2:pg-312"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Ex 6.2\n",
+ "import math\n",
+ "step=10.3 #mV\n",
+ "reading='101101111' #reading\n",
+ "Vo=step*int(reading,2)/1000 #V\n",
+ "print round(Vo,2),\" = Output voltage(V) \" \n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "3.78 = Output voltage(V) \n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex6.3:pg-312"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ " #Ex 6.3\n",
+ "n=8.0 #no. of bits\n",
+ "V=10 #volts\n",
+ "LSB=V*1/2**n #V\n",
+ "MSB=V*1/2**0 #V \n",
+ "VFS=MSB-LSB #V\n",
+ "print int(LSB*1000),\" = LSB(mV) \" \n",
+ "print MSB,\" = MSB(V) \" \n",
+ "print round(VFS,3),\" = VFS(V) \" \n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "39 = LSB(mV) \n",
+ "10 = MSB(V) \n",
+ "9.961 = VFS(V) \n"
+ ]
+ }
+ ],
+ "prompt_number": 19
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex6.4:pg-312"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ " #Ex 6.4\n",
+ "import math\n",
+ " #(i)2-bit DAC\n",
+ "n=2.0 #no. of bits\n",
+ "V=10.0 #max Voltage\n",
+ "step=V/2**n #V\n",
+ "reading='10' #input in binary\n",
+ "Vo=step*int(reading,2) #V\n",
+ "print Vo,\" =(i) Output Voltage(V) \" \n",
+ " #(ii)4-bit DAC\n",
+ "n=4.0 #no. of bits\n",
+ "step=V/2**n #V\n",
+ "reading='0110' #input in binary\n",
+ "Vo=step*int(reading,2) #V\n",
+ "print Vo,\" =(ii) Output Voltage(V) \" \n",
+ " #(i)8-bit DAC\n",
+ "n=8.0 #no. of bits\n",
+ "step=V/2**n #V\n",
+ "reading='10111100' #input in binary\n",
+ "Vo=step*int(reading,2) #V\n",
+ "print round(Vo,2),\" =(iii) Output Voltage(V) \" \n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "5.0 =(i) Output Voltage(V) \n",
+ "3.75 =(ii) Output Voltage(V) \n",
+ "7.34 =(iii) Output Voltage(V) \n"
+ ]
+ }
+ ],
+ "prompt_number": 25
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex6.5:pg-313"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ " #Ex 6.5\n",
+ "import math\n",
+ "n=8.0 #no. of bits\n",
+ "Res=20.0 #mV/bit(Resolution)\n",
+ "reading='00010110' #input in binary\n",
+ "Vo=Res*int(reading,2) #V\n",
+ "print Vo/1000,\" =(a) Output Voltage(V) \" \n",
+ "reading='10000000' #input in binary\n",
+ "Vo=Res*int(reading,2) #V\n",
+ "print Vo/1000,\" =(b) Output Voltage(V) \" \n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "0.44 =(a) Output Voltage(V) \n",
+ "2.56 =(b) Output Voltage(V) \n"
+ ]
+ }
+ ],
+ "prompt_number": 27
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex6.6:pg-313"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ " #Ex 6.6 \n",
+ "n=12 #no. of bits\n",
+ "Eoff=0.05 #% #maximum offset error\n",
+ "Vref=10.24 #V\n",
+ "Voffset=Eoff/100*Vref #V\n",
+ "print int(Voffset*1000),\" =(a) Offset voltage(mV) \" \n",
+ "delVo=Vref/2**n #V/bit\n",
+ "Voff_dash=Voffset/delVo #in terms of LSB\n",
+ "print int(Voff_dash),\" =(b) Offset voltage in terms of LSB \" \n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "5 =(a) Offset voltage(mV) \n",
+ "2 =(b) Offset voltage in terms of LSB \n"
+ ]
+ }
+ ],
+ "prompt_number": 29
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex6.7:pg-313"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ " #Ex 6.7 \n",
+ "n=8 #no. of bits\n",
+ "E=0.2 #% #maximum gain error\n",
+ "Vref=5.1 #V\n",
+ "V11=(100-E)*Vref/100 #V\n",
+ "print V11,\" =Minimum output voltage(V) \" \n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "5.0898 =Minimum output voltage(V) \n"
+ ]
+ }
+ ],
+ "prompt_number": 30
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex6.8:pg-326"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ " #Ex 6.8\n",
+ "n=8.0 #no. of bits\n",
+ "V=10.0 #V maximum\n",
+ "Vin=5.2 #V\n",
+ "oneLSB=V/2**n #V\n",
+ "print round(oneLSB*1000,1),\" =(a) Minimum voltage for 1 LSB in mV \" \n",
+ "Vifs=round(V-oneLSB,3) #V\n",
+ "\n",
+ "print Vifs,\" =(b) For all ones input voltage should be (V) \" \n",
+ "D=Vin/oneLSB #Digital output in decimal \n",
+ "print int(D),\" =(c) Digital Output \" \n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "39.1 =(a) Minimum voltage for 1 LSB in mV \n",
+ "9.961 =(b) For all ones input voltage should be (V) \n",
+ "133 =(c) Digital Output \n"
+ ]
+ }
+ ],
+ "prompt_number": 45
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex6.9:pg-326"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ " #Ex 6.9\n",
+ "n=8 #no. of bits\n",
+ "f=1 #MHz(Clock frequency) \n",
+ "TC=1/f*(n+1) #seconds\n",
+ "print TC,\" = time in micro seconds \" \n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "9 = time in micro seconds \n"
+ ]
+ }
+ ],
+ "prompt_number": 52
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Integrated_Circuits/Chapter7.ipynb b/Integrated_Circuits/Chapter7.ipynb new file mode 100755 index 00000000..92e5e7d4 --- /dev/null +++ b/Integrated_Circuits/Chapter7.ipynb @@ -0,0 +1,297 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:841a88d7e9e844c5ea929c5620ee175fbc10b920d638293263fe8c73afe043c7"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter7: Integrated Circuit Timer And Phase Locked Loops (PLL) "
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex7.1:pg-339"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Ex 7.1\n",
+ "RA=6.8 #kohm\n",
+ "RB=3.3 #kohm\n",
+ "C=0.1 #micro F\n",
+ "VCC=5 #V\n",
+ "t_high=0.695*(RA+RB)*C #ms\n",
+ "print round(t_high,1),\" =(a) t_high(ms) \" \n",
+ "t_low=0.695*RB*C #ms\n",
+ "print round(t_low,2),\" =(b) t_low(ms) \" \n",
+ "f=1.44/(RA+2*RB)/(C) #kHz\n",
+ "print round(f,2),\" =(c) Frequency of oscillation(kHz) \" \n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "0.7 =(a) t_high(ms) \n",
+ "0.23 =(b) t_low(ms) \n",
+ "1.07 =(c) Frequency of oscillation(kHz) \n"
+ ]
+ }
+ ],
+ "prompt_number": 20
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex7.2:pg-339"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Ex 7.2\n",
+ "RA=10 #kohm\n",
+ "C=0.1 #micro F\n",
+ "t=1.1*RA*C #ms\n",
+ "print t,\"= Timing interval(ms) \" \n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "1.1 = Timing interval(ms) \n"
+ ]
+ }
+ ],
+ "prompt_number": 21
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex7.3:pg-352"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Ex 7.3 \n",
+ "fc=500 #kHz(Free running frequuency)\n",
+ "fi=600 #kHz(Input signal frequuency)\n",
+ "BW=10 #kHz\n",
+ "out1=fi+fc #kHz(Phase detector output)\n",
+ "out2=fi-fc #kHz(Phase detector output)\n",
+ "print out2,out1,\"= Output of phase detector will be(kHz) \" \n",
+ "print \"Both components are not lying in the passband(i.e. 10 kHz). Hence loop will not acquire lock. \" \n",
+ " #fi+fc is calculated wrong in the book.\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "100 1100 = Output of phase detector will be(kHz) \n",
+ "Both components are not lying in the passband(i.e. 10 kHz). Hence loop will not acquire lock. \n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex7.4:pg-352"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Ex 7.4\n",
+ "import math \n",
+ "fo=10.0 #kHz\n",
+ "V=12.0 #V\n",
+ "fL=round(8*fo/(V-(-V)),2) #kHz(both +ve & -ve value)\n",
+ "C=10 #micro F(Assumed)\n",
+ "fC=round(math.sqrt(fL*10**3/(2*math.pi*3.6*10**3*C*10**-6)),2) #Fz(both +ve & -ve value)\n",
+ "print fC,fL,\"= Frequency fL & fC in kHz \" \n",
+ "LR=2*fL #kHz(Lock Range)\n",
+ "print round(LR,1),\"= Lock Range(kHz) \" \n",
+ "CR=2*fC #kHz(Capture rage)\n",
+ "print round(CR,1),\"= Capture Range(Hz) \" \n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "121.33 3.33 = Frequency fL & fC in kHz \n",
+ "6.7 = Lock Range(kHz) \n",
+ "242.7 = Capture Range(Hz) \n"
+ ]
+ }
+ ],
+ "prompt_number": 28
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex7.5:pg-353"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Ex 7.5\n",
+ "import math\n",
+ " \n",
+ "fo=100.0 #kHz(Free running frequency)\n",
+ "V=6.0 #V(both +ve & -ve value)\n",
+ "C=1 #micro F(Demodulation capacitor)\n",
+ "fL=round(8*fo/(V-(-V)),3) #Hz(both +ve & -ve value)\n",
+ "fC=math.sqrt(fL*1000/(2*math.pi*3.6*10**3*C*10**-6)) #kHzz(both +ve & -ve value)\n",
+ "LR=round(2*fL,2) #kHz(Lock range)\n",
+ "print LR,\"= Lock Range(kHz)\" \n",
+ "CR=round(2*fC/1000,2) #kHz(Capture range)\n",
+ "print CR,\"= Capture Range(kHz) \" \n",
+ "RT=10 #kohm(Assumed)\n",
+ "CT=1.2/(4*RT*1000*fo*10**3) #F\n",
+ "print \"Design values are:\" \n",
+ "print \"Resistance RT can be chooosen as 10 kohm. \" \n",
+ "print CT,\" =Capacitance CT(F) \" \n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "133.33 = Lock Range(kHz)\n",
+ "3.43 = Capture Range(kHz) \n",
+ "Design values are:\n",
+ "Resistance RT can be chooosen as 10 kohm. \n",
+ "3e-10 =Capacitance CT(F) \n"
+ ]
+ }
+ ],
+ "prompt_number": 39
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex7.7:pg-355"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ " #Ex 7.7\n",
+ "import math\n",
+ "C=1 #nF\n",
+ "T=10 #micro seconds(Output pulse duration)\n",
+ "R=round(T*10**-6/(C*10**-9*math.log(3))/1000,1) #kohm\n",
+ "print R,\" =(a) Value of R(kohm) \" \n",
+ "VCC=15 #V\n",
+ "T=20 #micro seconds(Output pulse duration)\n",
+ "VTH=VCC*(1-exp(-T*10**-6/(R*1000*C*10**-9))) #V\n",
+ "print round(VTH,1),\" =(b) Value of VTH(V) \" \n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "9.1 =(a) Value of R(kohm) \n",
+ "13.3 =(b) Value of VTH(V) \n"
+ ]
+ }
+ ],
+ "prompt_number": 41
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex7.8:pg-355"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ " #Ex 7.8\n",
+ "import math\n",
+ "C=680.0 #pF\n",
+ "f=50.0 #kHz(Square wave frequency)\n",
+ "D=75.0/100.0 #duty cycle\n",
+ "T=1/f*1000 #micro seconds\n",
+ "tHIGH=D*T #micro seconds\n",
+ "print tHIGH,\" = Value of tHIGH \"\n",
+ "tLOW=T-tHIGH #micro seconds\n",
+ "print tLOW,\" = Value of tLOW \" \n",
+ "RB=(tLOW*10**-6)/(0.69*C*10**-12) #ohm\n",
+ "RA=(tHIGH*10**-6)/(0.695*C*10**-12)-RB #ohm\n",
+ "print round(RA/1000,1),\" = Value of RA(kohm) \" \n",
+ "print round(RB/1000,2),\" = Value of RB(kohm) \" \n",
+ "# Answer in the book is wrong for RA i.e. 21.2"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "15.0 = Value of tHIGH \n",
+ "5.0 = Value of tLOW \n",
+ "21.1 = Value of RA(kohm) \n",
+ "10.66 = Value of RB(kohm) \n"
+ ]
+ }
+ ],
+ "prompt_number": 62
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Integrated_Circuits/screenshots/Ex2.1.png b/Integrated_Circuits/screenshots/Ex2.1.png Binary files differnew file mode 100755 index 00000000..9e7eba71 --- /dev/null +++ b/Integrated_Circuits/screenshots/Ex2.1.png diff --git a/Integrated_Circuits/screenshots/Ex2.2.png b/Integrated_Circuits/screenshots/Ex2.2.png Binary files differnew file mode 100755 index 00000000..a8938823 --- /dev/null +++ b/Integrated_Circuits/screenshots/Ex2.2.png diff --git a/Integrated_Circuits/screenshots/Ex5.12.png b/Integrated_Circuits/screenshots/Ex5.12.png Binary files differnew file mode 100755 index 00000000..365edb12 --- /dev/null +++ b/Integrated_Circuits/screenshots/Ex5.12.png |