diff options
Diffstat (limited to 'Electronics_Circuits_and_Systems_by_Y._N._Bapat/Ch4.ipynb')
-rw-r--r-- | Electronics_Circuits_and_Systems_by_Y._N._Bapat/Ch4.ipynb | 936 |
1 files changed, 936 insertions, 0 deletions
diff --git a/Electronics_Circuits_and_Systems_by_Y._N._Bapat/Ch4.ipynb b/Electronics_Circuits_and_Systems_by_Y._N._Bapat/Ch4.ipynb new file mode 100644 index 00000000..56fa8f97 --- /dev/null +++ b/Electronics_Circuits_and_Systems_by_Y._N._Bapat/Ch4.ipynb @@ -0,0 +1,936 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 4 - Field Effect Transistors" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 4_1 Page No. 98" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "IDSS = 0.01 ampere\n", + "VP= -4.00 volts\n", + "VGS = -2.00 volts\n", + "VDSmin =VGS-VP=2.00 volts\n", + "ID =IDSS*(1-VGS/VP)**2= 2.50e-03 ampere\n" + ] + } + ], + "source": [ + "from __future__ import division \n", + "IDSS=10*10**(-3)\n", + "print \"IDSS = %0.2f\"%(IDSS),\" ampere\" # maximum drain current\n", + "VP=(-4)\n", + "print \"VP= %0.2f\"%(VP),\" volts\" # pinch off voltage \n", + "VGS=(-2)\n", + "print \"VGS = %0.2f\"%(VGS),\" volts\" # gate to source voltage \n", + "VDSmin=VGS-VP\n", + "print \"VDSmin =VGS-VP=%0.2f\"%(VDSmin),\" volts\" # Drain to source voltage \n", + "ID=IDSS*(1-VGS/VP)**2\n", + "print \"ID =IDSS*(1-VGS/VP)**2= %0.2e\"%(ID),\" ampere\" # drain current" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 4_2 Page No. 99" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "IDSS = 0.01 ampere\n", + "VP= -4.00 volts\n", + "VGS = 0.00 volts\n", + "RDS = 1/[(2*(IDSS/(-VP)))*(1-VGS/VP)]=200.00 ohm\n", + "VGS = -2.00 volts\n", + "RDS = 1/[(2*(IDSS/(-VP)))*(1-VGS/VP)]=400.00 ohm\n" + ] + } + ], + "source": [ + "from __future__ import division \n", + "IDSS=10*10**(-3)\n", + "print \"IDSS = %0.2f\"%(IDSS),\" ampere\" # maximum drain current\n", + "VP=(-4)\n", + "print \"VP= %0.2f\"%(VP),\" volts\" # pinch off voltage \n", + "VGS=(0)\n", + "print \"VGS = %0.2f\"%(VGS),\" volts\" # gate to source voltage1 \n", + "RDS=1/((2*(IDSS/(-VP)))*(1-VGS/VP))#formula for JFET\n", + "print \"RDS = 1/[(2*(IDSS/(-VP)))*(1-VGS/VP)]=%0.2f\"%(RDS),\" ohm\" # drain to source resistance for VGS=0V\n", + "VGS=(-2)\n", + "print \"VGS = %0.2f\"%(VGS),\" volts\" # gate to source voltage2 \n", + "RDS=1/((2*(IDSS/(-VP)))*(1-VGS/VP))\n", + "print \"RDS = 1/[(2*(IDSS/(-VP)))*(1-VGS/VP)]=%0.2f\"%(RDS),\" ohm\" # drain to source resistance for VGS=(-2)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 4_3 Page No. 104" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "ID = 0.01 ampere\n", + "VDD= 24.00 volts\n", + "VT= 5.00 volts\n", + "VGS= 10.00 volts\n", + "KF = ID/(VGS-VT)**2 = 4.00e-04 A/V**2\n", + "VDS =VGS= 7.00 volts\n", + "ID =KF*(VGS-VT)**2= 1.60e-03 ampere\n", + "RL=(VDD-VDS)/ID= 1.06e+04 ohm\n" + ] + } + ], + "source": [ + "from __future__ import division \n", + "ID=10*10**(-3)\n", + "print \"ID = %0.2f\"%(ID),\" ampere\" # given drain current \n", + "VDD=(24)\n", + "print \"VDD= %0.2f\"%(VDD),\" volts\" # Drain voltage \n", + "VT=(5)\n", + "print \"VT= %0.2f\"%(VT),\" volts\" # Threshold voltage \n", + "VGS=(10)\n", + "print \"VGS= %0.2f\"%(VGS),\" volts\" # gate to source voltage1 \n", + "KF=ID/(VGS-VT)**2\n", + "print \"KF = ID/(VGS-VT)**2 = %0.2e\"%(KF),\" A/V**2\" # To calculate Scale factor for finding ID2\n", + "VDS=(7)\n", + "print \"VDS =VGS= %0.2f\"%(VDS),\" volts\" # drain to source voltage \n", + "VGS=(VDS)\n", + "ID=KF*(VGS-VT)**2\n", + "print \"ID =KF*(VGS-VT)**2= %0.2e\"%(ID),\" ampere\" # New drain current for VDS=24V\n", + "RL=(VDD-VDS)/ID\n", + "print \"RL=(VDD-VDS)/ID= %0.2e\"%(RL)+ \" ohm\" #calculation for load resistance at VDS=24V" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 4_4 Page No. 105" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "part(i) \n", + "IDSS = 0.01 ampere\n", + "VP= 2.00 volts\n", + "IDQ = 0.00 ampere\n", + "gm =[(2)*sqrt(IDQ*IDSS)]/VP= 4.70e-03 A/V\n", + "part(ii) \n", + "IDQ = 0.01 ampere\n", + "IDSS = 0.01 ampere\n", + "VP= 6.00 volts\n", + "gm =[(2)*sqrt(IDQ*IDSS)]/VP= 3.17e-03 A/V\n", + "part(iii) \n", + "IDQ = 1.00e-03 ampere\n", + "KF = 2.50e-04 A/V**2\n", + "gm =sqrt(4*IDQ*KF)= 1.00e-03 A/V\n", + "part(iv) \n", + "IDQ = 9.10e-04 ampere\n", + "KF = 3.75e-04 A/V**2\n", + "gm =sqrt(4*IDQ*KF)= 1.17e-03 A/V\n" + ] + } + ], + "source": [ + "from math import sqrt\n", + "from __future__ import division \n", + "print \"part(i) \"# part(i) of this question\n", + "IDSS=5*10**(-3)\n", + "print \"IDSS = %0.2f\"%(IDSS),\" ampere\" # maximum drain current JFET 1\n", + "VP=(2)\n", + "print \"VP= %0.2f\"%(VP),\" volts\" # pinch off voltage for JFET 1\n", + "IDQ=4.42*10**(-3)\n", + "print \"IDQ = %0.2f\"%(IDQ),\" ampere\" # drain current for JFET 1\n", + "gm=((2)*sqrt(IDQ*IDSS))/VP\n", + "print \"gm =[(2)*sqrt(IDQ*IDSS)]/VP= %0.2e\"%(gm),\" A/V\"# calculating transconductance for JFET with IDQ = 4.42 mA\n", + "\n", + "print \"part(ii) \"# part(ii) of this question\n", + "IDQ=6.04*10**(-3)\n", + "print \"IDQ = %0.2f\"%(IDQ),\" ampere\" # drain current for JFET 1\n", + "IDSS=15*10**(-3)\n", + "print \"IDSS = %0.2f\"%(IDSS),\" ampere\" # maximum drain current JFET2\n", + "VP=(6)\n", + "print \"VP= %0.2f\"%(VP),\" volts\" # pinch off voltage for JFET2 \n", + "gm=((2)*sqrt(IDQ*IDSS))/VP\n", + "print \"gm =[(2)*sqrt(IDQ*IDSS)]/VP= %0.2e\"%(gm),\" A/V\"# calculating transconductance for JFET with IDQ = 6.04 mA\n", + "\n", + "print \"part(iii) \"# part(iii) of this question\n", + "IDQ=1*10**(-3)\n", + "print \"IDQ = %0.2e\"%(IDQ),\" ampere\" # drain current for EMOSFET 1\n", + "KF=0.25*10**(-3)\n", + "print \"KF = %0.2e\"%(KF),\" A/V**2\" # Scale factor for finding EMOSFET1\n", + "gm=sqrt(4*IDQ*KF)\n", + "print \"gm =sqrt(4*IDQ*KF)= %0.2e\"%(gm),\" A/V\"# calculating transconductance for EMOSFET1 with IDQ = 1 mA\n", + "\n", + "print \"part(iv) \"# part(iv) of this question\n", + "IDQ=0.91*10**(-3)\n", + "print \"IDQ = %0.2e\"%(IDQ),\" ampere\" # drain current for EMOSFET 2\n", + "KF=0.375*10**(-3)\n", + "print \"KF = %0.2e\"%(KF),\" A/V**2\" # Scale factor for finding EMOSFET2\n", + "gm=sqrt(4*IDQ*KF)\n", + "print \"gm =sqrt(4*IDQ*KF)= %0.2e\"%(gm),\" A/V\"# calculating transconductance for EMOSFET2 with IDQ = 0.91 mA" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 4_5 Page No. 106" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "IDQmax = 0.01 ampere\n", + "IDQmin = 0.00 ampere\n", + "VDD= 20.00 volts\n", + "VDSmin= 6.00 volts\n", + "ID = 2.40e-03 ampere\n", + "VGG= 3.00 volts\n", + "Ri= 1.00e+05 ohm\n", + "RF= (VGG-0)/(ID-0)= 1250.00 ohm\n", + "R1= VDD*Ri/VGG= 6.67e+05 ohm\n", + "R2= R1*VGG/(VDD-VGG)= 1.18e+05 ohm\n", + "RL=[((VDD-VDSmin)/IDmax)-RF]=1550.00 ohm\n" + ] + } + ], + "source": [ + "from __future__ import division \n", + "IDQmax=5*10**(-3)\n", + "print \"IDQmax = %0.2f\"%(IDQmax),\" ampere\" # drain current for JFET for maximum transfer characteristics\n", + "IDmax=IDQmax# maximum drain current will be given by IDQmax\n", + "IDQmin=3*10**(-3)\n", + "print \"IDQmin = %0.2f\"%(IDQmin),\" ampere\" # drain current for JFET for minimum transfer characteristics \n", + "VDD=(20)\n", + "print \"VDD= %0.2f\"%(VDD),\" volts\" # Drain voltage supply\n", + "VDSmin=(6)\n", + "print \"VDSmin= %0.2f\"%(VDSmin),\" volts\" # minimum Drain to source voltage supply\n", + "ID=2.4*10**(-3)\n", + "print \"ID = %0.2e\"%(ID),\" ampere\" # drain current chosen for operation within max and min limits \n", + "VGG=3\n", + "print \"VGG= %0.2f\"%(VGG),\" volts\" # Gate voltage from fig.\n", + "Ri=100*10**(3)\n", + "print \"Ri= %0.2e\"%(Ri)+ \" ohm\" #eqivalent input resistance\n", + "RF=(VGG-0)/(ID-0)\n", + "print \"RF= (VGG-0)/(ID-0)= %0.2f\"%(RF)+ \" ohm\" #calculation for feedback resistance \n", + "R1=VDD*Ri/VGG #using formulae VGG=VDD*Ri/R1\n", + "print \"R1= VDD*Ri/VGG= %0.2e\"%(R1)+ \" ohm\" #calculation for first resistance R1 at input side\n", + "R2=R1*VGG/(VDD-VGG)\n", + "print \"R2= R1*VGG/(VDD-VGG)= %0.2e\"%(R2)+ \" ohm\" #calculation for second resistance R2 at input side\n", + "RL=(((VDD-VDSmin)/IDmax)-RF) # using formulae VDD=IDmax(RL+RF)+VDSmin\n", + "print \"RL=[((VDD-VDSmin)/IDmax)-RF]=%0.2f\"%(RL)+ \" ohm\" #Load resistance calculation" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 4_6 Page No. 107" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "IDSS = 0.05 ampere\n", + "VP= -10.00 volts\n", + "VGSQ= -5.00 volts\n", + "ID =IDSS*(1-VGS/VP)**2= 0.01 ampere\n", + "RF= (VGSQ)/(ID)= 400.00 ohm\n" + ] + } + ], + "source": [ + "from __future__ import division \n", + "IDSS=50*10**(-3)\n", + "print \"IDSS = %0.2f\"%(IDSS),\" ampere\" # maximum drain current JFET \n", + "VP=(-10)\n", + "print \"VP= %0.2f\"%(VP),\" volts\" # pinch off voltage for JFET \n", + "VGSQ=(-5)\n", + "print \"VGSQ= %0.2f\"%(VGSQ),\" volts\" # Gate operating point voltage \n", + "ID=IDSS*(1-VGSQ/VP)**2\n", + "print \"ID =IDSS*(1-VGS/VP)**2= %0.2f\"%(ID),\" ampere\" # drain current JFET \n", + "RF=abs(VGSQ/ID) \n", + "print \"RF= (VGSQ)/(ID)= %0.2f\"%(RF)+ \" ohm\" #calculation for feedback resistance " + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 4_7 Page No. 108" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "IDSS = 0.01 ampere\n", + "RL= 910.00 ohm\n", + "RF= 2290.00 ohm\n", + "R1= 1.20e+07 ohm\n", + "R2= 8.57e+06 ohm\n", + "VDD= 24.00 volts\n", + "VP= -2.00 volts\n", + "VGG= VDD*R2/(R1+R2)=10.00 volts\n", + "Quadratic equation =5.244*ID**(2)-55.76*ID+144=0\n", + "ID = 0.00 ampere\n", + "Since ID <=IDSS, hence ID=6.214 mA cannot be chosen, so we chose ID=4.42 mA\n", + "IDQ =0.00 A\n", + "VGSQ = VGG-IDQ*RF = -0.12 volts\n", + "VDSQ= VDD-IDQ*(RL+RF)= 9.86 volts\n", + "VDGQ = VDSQ-VGSQ =9.98 volts\n", + "VDGQ >magnitude_VP,Hence FET is in pinch off region\n" + ] + } + ], + "source": [ + "from sympy import symbols,solve\n", + "from __future__ import division \n", + "IDSS=5*10**(-3)\n", + "print \"IDSS = %0.2f\"%(IDSS),\" ampere\" # maximum drain current JFET \n", + "RL=910\n", + "print \"RL= %0.2f\"%(RL)+ \" ohm\" #Load resistance\n", + "RF=2.29*10**(3) \n", + "print \"RF= %0.2f\"%(RF)+ \" ohm\" # feedback resistance \n", + "R1=12*10**(6)\n", + "print \"R1= %0.2e\"%(R1)+ \" ohm\" # first resistance R1 at input side\n", + "R2=8.57*10**(6)\n", + "print \"R2= %0.2e\"%(R2)+ \" ohm\" # second resistance R2 at input side\n", + "VDD=(24)\n", + "print \"VDD= %0.2f\"%(VDD),\" volts\" # Drain voltage supply\n", + "VP=(-2)\n", + "print \"VP= %0.2f\"%(VP),\" volts\" # pinch off voltage for JFET \n", + "VGG=(VDD*R2)/(R1+R2)\n", + "print \"VGG= VDD*R2/(R1+R2)=%0.2f\"%(VGG),\" volts\" # Gate voltage for JFET\n", + "print \"Quadratic equation =5.244*ID**(2)-55.76*ID+144=0\"# Forming Quadratic equation using VGS = VGG-ID*RF and ID = IDSS(1-VGS/VP)**2 where ID in mA\n", + "p = [5.244, -55.76, 144]\n", + "P=symbols('P')\n", + "ID=solve(p[0]*P**2+p[1]*P+p[2])[0]*10**(-3)# values of ID converted into Ampere by multiplying by 10**(-3)\n", + "print \"ID = %0.2f\"%(ID),\" ampere\" # drain current JFET \n", + "print \"Since ID <=IDSS, hence ID=6.214 mA cannot be chosen, so we chose ID=4.42 mA\"\n", + "IDQ=4.42*10**(-3) \n", + "print \"IDQ =%0.2f\"%(IDQ),\" A\"#Since ID <=IDSS, hence ID=6.214 mA cannot be chosen, so we chose ID=4.42 mA\n", + "VGSQ=VGG-IDQ*RF\n", + "print \"VGSQ = VGG-IDQ*RF = %0.2f\"%(VGSQ),\" volts\" # Gate operating point voltage \n", + "VDSQ=VDD-IDQ*(RL+RF)\n", + "print \"VDSQ= VDD-IDQ*(RL+RF)= %0.2f\"%(VDSQ),\" volts\" # Drain voltage for JFET\n", + "VDGQ=VDSQ-VGSQ\n", + "print \"VDGQ = VDSQ-VGSQ =%0.2f\"%(VDGQ),\" volts\" # Drain-Gate voltage for JFET\n", + "print \"VDGQ >magnitude_VP,Hence FET is in pinch off region\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 4_8 Page No. 108" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "IDSS = 0.01 ampere\n", + "RL= 910.00 ohm\n", + "RF= 2290.00 ohm\n", + "R1= 1.20e+07 ohm\n", + "R2= 8.57e+06 ohm\n", + "VDD= 24.00 volts\n", + "VP= -6.00 volts\n", + "VGG= VDD*R2/(R1+R2)=10.00 volts\n", + "Quadratic equation =5.244*ID**(2)-75.68*ID+256=0\n", + "ID = 0.01 ampere\n", + "VDG= 9.08 volts\n", + "since VDG < magnitude_VP for ID=9.0189 mA which is inappropriate for JFET pinch off region ,hence ID=5.4128 mA is choosen !\n", + "IDQ =0.01 ampere\n", + "VGSQ = VGG-IDQ*RF = -2.39 volts\n", + "VDSQ= VDD-IDQ*(RL+RF)= 6.69 volts\n", + "VDGQ = VDSQ-VGSQ =9.08 volts\n", + "VDGQ > VP,Hence FET is in pinch off region\n" + ] + } + ], + "source": [ + "from sympy import symbols,solve\n", + "from __future__ import division \n", + "IDSS=15*10**(-3)\n", + "print \"IDSS = %0.2f\"%(IDSS),\" ampere\" # maximum drain current of JFET \n", + "RL=910\n", + "print \"RL= %0.2f\"%(RL)+ \" ohm\" #Load resistance\n", + "RF=2.29*10**(3) \n", + "print \"RF= %0.2f\"%(RF)+ \" ohm\" # feedback resistance \n", + "R1=12*10**(6)\n", + "print \"R1= %0.2e\"%(R1)+ \" ohm\" # first resistance R1 at input side\n", + "R2=8.57*10**(6)\n", + "print \"R2= %0.2e\"%(R2)+ \" ohm\" # second resistance R2 at input side\n", + "VDD=(24)\n", + "print \"VDD= %0.2f\"%(VDD),\" volts\" # Drain voltage supply\n", + "VP=(-6)\n", + "print \"VP= %0.2f\"%(VP),\" volts\" # pinch off voltage for JFET \n", + "VGG=(VDD*R2)/(R1+R2)\n", + "print \"VGG= VDD*R2/(R1+R2)=%0.2f\"%(VGG),\" volts\" # Gate voltage for JFET\n", + "print \"Quadratic equation =5.244*ID**(2)-75.68*ID+256=0\"# where ID in mA\n", + "p = [5.244, -75.68, 256]\n", + "P=symbols('P')\n", + "ID=solve(p[0]*P**2+p[1]*P+p[2])[0]*10**(-3)#values of ID converted into Ampere by multiplying by 10**(-3)\n", + "print \"ID = %0.2f\"%(ID),\" ampere\" # drain current JFET \n", + "VDG=VDD-(ID*RL)-VGG\n", + "print \"VDG= %0.2f\"%(VDG),\" volts\" # Drain-gate voltage for JFET\n", + "print \"since VDG < magnitude_VP for ID=9.0189 mA which is inappropriate for JFET pinch off region ,hence ID=5.4128 mA is choosen !\" \n", + "IDQ=5.41*10**(-3) # since VDG < magnitude_VP for ID=9.0189 mA which is inappropriate for JFET pinch off region ,hence ID=5.4128 mA is choosen !\n", + "print \"IDQ =%0.2f\"%(IDQ),\" ampere\"\n", + "VGSQ=VGG-IDQ*RF\n", + "print \"VGSQ = VGG-IDQ*RF = %0.2f\"%(VGSQ),\" volts\" # Gate operating point voltage \n", + "VDSQ=VDD-IDQ*(RL+RF)\n", + "print \"VDSQ= VDD-IDQ*(RL+RF)= %0.2f\"%(VDSQ),\" volts\" # Drain voltage for JFET\n", + "VDGQ=VDSQ-VGSQ\n", + "print \"VDGQ = VDSQ-VGSQ =%0.2f\"%(VDGQ),\" volts\" # Drain-Gate voltage for JFET\n", + "print \"VDGQ > VP,Hence FET is in pinch off region\"\n", + "\n", + "# NOTE :all values of book ans is wrong so give note-INCOMPLETE QUESTION\n", + "#Roots for drain current quadratic equation are wrong in the book thus value for VGSQ,VDSQ and VDGQ are also wrong" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 4_9 Page No. 112" + ] + }, + { + "cell_type": "code", + "execution_count": 13, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "RL= 12000.00 ohm\n", + "RF= 6000.00 ohm\n", + "R1= 1.20e+07 ohm\n", + "R2= 8.57e+06 ohm\n", + "VDD= 24.00 volts\n", + "VT= 3.00 volts\n", + "KF= 0.00 A/V**2\n", + "VGG= VDD*R2/(R1+R2)=10.00 volts\n", + "Quadratic equation =9*ID**(2)-25*ID+16=0\n", + "ID = 0.00 A\n", + "VGS = VGG-ID*RF = 4.00 volts\n", + "Since VGS < VT for ID=1.78 mA, hence ID = 1.78 mA cannot be chosen, so we chose ID= 1 mA as operating drain current IDQ\n", + "IDQ =0.00 A\n", + "VGSQ = VGG-IDQ*RF = 4.00 volts\n", + "VDSQ= VDD-IDQ*(RL+RF)= 6.00 volts\n" + ] + } + ], + "source": [ + "from sympy import symbols,solve\n", + "from __future__ import division \n", + "RL=12*10**(3)\n", + "print \"RL= %0.2f\"%(RL)+ \" ohm\" #Load resistance\n", + "RF=6*10**(3) \n", + "print \"RF= %0.2f\"%(RF)+ \" ohm\" # feedback resistance \n", + "R1=12*10**(6)\n", + "print \"R1= %0.2e\"%(R1)+ \" ohm\" # first resistance R1 at input side\n", + "R2=8.57*10**(6)\n", + "print \"R2= %0.2e\"%(R2)+ \" ohm\" # second resistance R2 at input side\n", + "VDD=(24)\n", + "print \"VDD= %0.2f\"%(VDD),\" volts\" # Drain voltage supply\n", + "VT=(3)\n", + "print \"VT= %0.2f\"%(VT),\" volts\" # Threshold voltage for n-channel EMOSFET\n", + "KF=0.25*10**(-3)\n", + "print \"KF= %0.2f\"%(KF),\" A/V**2\" # Constant for n-channel EMOSFET \n", + "VGG=(VDD*R2)/(R1+R2)\n", + "print \"VGG= VDD*R2/(R1+R2)=%0.2f\"%(VGG),\" volts\" # Gate voltage for n-channel EMOSFET \n", + "print \"Quadratic equation =9*ID**(2)-25*ID+16=0\"# IDS=KF*(VGS-VT)**2 and VGS=VGG-ID*RD ,so Quadratic equation formed is :IDS=KF*(VGG-ID*RD-VT)**2 where ID in mA\n", + "p = [9, -25, 16]\n", + "P=symbols('P')\n", + "ID=solve(p[0]*P**2+p[1]*P+p[2])[0]*10**(-3)#values of ID converted into Ampere by multiplying by 10**(-3)\n", + "print \"ID = %0.2f\"%(ID),\" A\" # drain current n-channel EMOSFET in Ampere \n", + "VGS=VGG-ID*RF# For ID=1.78 mA and ID=1mA\n", + "print \"VGS = VGG-ID*RF = %0.2f\"%(VGS),\" volts\" # Gate operating point voltage \n", + "print \"Since VGS < VT for ID=1.78 mA, hence ID = 1.78 mA cannot be chosen, so we chose ID= 1 mA as operating drain current IDQ\"\n", + "IDQ=1*10**(-3)\n", + "print \"IDQ =%0.2f\"%(IDQ),\"A\"#Since VGS < VT for ID=1.78 mA, hence ID = 1.78 mA cannot be chosen, so we chose ID= 1 mA as operating drain current IDQ\n", + "VGSQ=VGG-IDQ*RF\n", + "print \"VGSQ = VGG-IDQ*RF = %0.2f\"%(VGSQ),\" volts\" # Gate operating point voltage \n", + "VDSQ=VDD-IDQ*(RL+RF)\n", + "print \"VDSQ= VDD-IDQ*(RL+RF)= %0.2f\"%(VDSQ),\" volts\" # Drain voltage for n-channel EMOSFET \n", + "# NOTE:Value of VGS= -0.6676390 volts for ID=1.78 mA but in book given as -0.68 V" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 4_10 Page No. 113" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "RL= 12000.00 ohm\n", + "RF= 6000.00 ohm\n", + "R1= 1.20e+07 ohm\n", + "R2= 8.57e+06 ohm\n", + "VDD= 24.00 volts\n", + "VT= 3.00 volts\n", + "KF= 0.00 A/V**2\n", + "VGG= VDD*R2/(R1+R2)=10.00 volts\n", + "Quadratic equation =36*ID**(2)-86.67*ID+49=0\n", + "ID = 0.00 A\n", + "VGS = VGG-ID*RF = 4.56 volts\n", + "Since VGS < VT for ID=1.5 mA, hence ID = 1.5 mA cannot be chosen, so we chose ID= 0.91 mA as operating drain current IDQ\n", + "IDQ =0.00 A\n", + "change in IDQ = 9.00 percent\n", + "VGSQ = VGG-IDQ*RF = 4.54 volts\n", + "VDSQ= VDD-IDQ*(RL+RF)= 7.62 volts\n" + ] + } + ], + "source": [ + "from math import sqrt\n", + "from __future__ import division \n", + "RL=12*10**(3)\n", + "print \"RL= %0.2f\"%(RL)+ \" ohm\" #Load resistance\n", + "RF=6*10**(3) \n", + "print \"RF= %0.2f\"%(RF)+ \" ohm\" # feedback resistance \n", + "R1=12*10**(6)\n", + "print \"R1= %0.2e\"%(R1)+ \" ohm\" # first resistance R1 at input side\n", + "R2=8.57*10**(6)\n", + "print \"R2= %0.2e\"%(R2)+ \" ohm\" # second resistance R2 at input side\n", + "VDD=(24)\n", + "print \"VDD= %0.2f\"%(VDD),\" volts\" # Drain voltage supply\n", + "VT=(3)\n", + "print \"VT= %0.2f\"%(VT),\" volts\" # Threshold voltage for n-channel EMOSFET\n", + "KF=0.375*10**(-3)\n", + "print \"KF= %0.2f\"%(KF),\" A/V**2\" # Constant for n-channel EMOSFET \n", + "VGG=(VDD*R2)/(R1+R2)\n", + "print \"VGG= VDD*R2/(R1+R2)=%0.2f\"%(VGG),\" volts\" # Gate voltage for n-channel EMOSFET \n", + "print \"Quadratic equation =36*ID**(2)-86.67*ID+49=0\"# IDS=KF*(VGS-VT)**2 and VGS=VGG-ID*RD ,so Quadratic equation formed is :IDS=KF*(VGG-ID*RD-VT)**2 ,where ID in mA\n", + "p = [36, -86.67, 49]\n", + "P=symbols('P')\n", + "ID=solve(p[0]*P**2+p[1]*P+p[2])[0]*10**(-3)#values of ID converted into Ampere by multiplying by 10**(-3)\n", + "print \"ID = %0.2f\"%(ID),\" A\" # drain current n-channel EMOSFET in Ampere \n", + "VGS=VGG-ID*RF# Gate voltage for ID = 1.5 mA and ID = 0.91 mA\n", + "print \"VGS = VGG-ID*RF = %0.2f\"%(VGS),\" volts\" # Gate voltage \n", + "print \"Since VGS < VT for ID=1.5 mA, hence ID = 1.5 mA cannot be chosen, so we chose ID= 0.91 mA as operating drain current IDQ\"\n", + "IDQ=0.91*10**(-3)\n", + "print \"IDQ =%0.2f\"%(IDQ),\" A\"#Since VGS < VT for ID=1.5 mA, hence ID = 1.5 mA cannot be chosen, so we chose ID= 0.91 mA as operating drain current IDQ\n", + "change_IDQ=((1-0.91)*100)/(1)# \n", + "print \"change in IDQ = %0.2f\"%(change_IDQ),\" percent\"# Percent change in IDQ from value 1 mA from its actual value IDQ=0.91mA\n", + "VGSQ=VGG-IDQ*RF\n", + "print \"VGSQ = VGG-IDQ*RF = %0.2f\"%(VGSQ),\" volts\" # Gate operating point voltage \n", + "VDSQ=VDD-IDQ*(RL+RF)\n", + "print \"VDSQ= VDD-IDQ*(RL+RF)= %0.2f\"%(VDSQ),\" volts\" # Drain voltage for n-channel EMOSFET \n", + "\n", + "\n", + "# note: in the textbook author has given KF = .375 but I have work with KF = .375*10**-3A/V**2" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 4_11 Page No. 114" + ] + }, + { + "cell_type": "code", + "execution_count": 25, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "RF= 6000.00 ohm\n", + "VDD= 20.00 volts\n", + "part(i) \n", + "VT= 2.00 volts\n", + "KF= 0.00 A/V**2\n", + "ID = 0.00 A\n", + "RL=[VDD-VT-sqrt(ID/KF)]/ID= 16000.00 ohm\n", + "part(ii) \n", + "VT= 3.00 volts\n", + "KF= 0.00 A/V**2\n", + "Quadratic equation =(256)*ID**(2)-(546.67)*ID+289=0\n", + "ID = 0.00 A\n", + "VDS =VDD-ID*RL = 4.60 volts\n", + "IDQ =0.00 A\n", + "Percentage change= 3.80 percent\n" + ] + } + ], + "source": [ + "from math import sqrt\n", + "from sympy import symbols,solve\n", + "from __future__ import division \n", + "RF=6*10**(3) \n", + "print \"RF= %0.2f\"%(RF)+ \" ohm\" # feedback resistance \n", + "VDD=(20)\n", + "print \"VDD= %0.2f\"%(VDD),\" volts\" # Drain voltage supply\n", + "print \"part(i) \"# part(i) of this question\n", + "VT=(2)\n", + "print \"VT= %0.2f\"%(VT),\" volts\" # Threshold voltage for EMOSFET\n", + "KF=0.25*10**(-3)\n", + "print \"KF= %0.2f\"%(KF),\" A/V**2\" # Constant for EMOSFET \n", + "ID=1*10**(-3)\n", + "print \"ID = %0.2f\"%(ID),\" A\" # drain current EMOSFET in Ampere \n", + "RL=(VDD-VT-sqrt(ID/KF))/ID # Using formulae ID=KF*(VDD-ID*RL-VT)\n", + "print \"RL=[VDD-VT-sqrt(ID/KF)]/ID= %0.2f\"%(RL)+ \" ohm\" #Load resistance\n", + "print \"part(ii) \"# part(ii) of this question\n", + "VT=(3)\n", + "print \"VT= %0.2f\"%(VT),\" volts\" # Threshold voltage for EMOSFET\n", + "KF=0.375*10**(-3)\n", + "print \"KF= %0.2f\"%(KF),\" A/V**2\" # Constant for EMOSFET \n", + "print \"Quadratic equation =(256)*ID**(2)-(546.67)*ID+289=0\"#IDS=KF*(VGS-VT)**2 =KF*(VDS-VT)**2 and VDS=VDD-ID*RL,so Quadratic equation is:IDS=KF*(VDD-ID*RL-VT)**2 ,where ID in mA\n", + "p = [256, -546.66 , 289]\n", + "P=symbols('P')\n", + "ID=solve(p[0]*P**2+p[1]*P+p[2])[0]*10**(-3)#values of ID converted into Ampere by multiplying by 10**(-3)\n", + "print \"ID = %0.2f\"%(ID),\" A\" # drain current EMOSFET in Ampere \n", + "VDS=VDD-ID*RL# Drain voltage for ID = 1.173 mA and ID = 0.962 mA\n", + "print \"VDS =VDD-ID*RL = %0.2f\"%(VDS),\" volts\" # Drain voltage \n", + "IDQ=0.962*10**(-3)\n", + "print \"IDQ =%0.2f\"%(IDQ),\" A\"#Since VDS < VT for ID=1.173 mA, hence ID = 1.173 mA cannot be chosen, so we chose ID= 0.962 mA as operating drain current IDQ\n", + "Percentage_change=((1-0.962)*100)/(1)\n", + "print \"Percentage change= %0.2f\"%(Percentage_change),\" percent\"# Percent change in IDQ value from 1 mA(part(i)) to its value ( of part(ii))IDQ=0.91mA\n", + "# NOTE: part(ii):the values of ID = 1.173 mA or ID = 0.962 mA but in book given as ID= 1.197 mA and ID = 0.939 mA .Hence (correct) Percentage_change in ID= 3.8 % but in book given as 6.1 % \n", + "# ANS is not correct check &correct" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 4_12 Page No. 115" + ] + }, + { + "cell_type": "code", + "execution_count": 15, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "VDD= 5.00 volts\n", + "RL1= 1.25e+05 ohm\n", + "RL2= 2.00e+05 ohm\n", + "IDON1 =0.00 A\n", + "IDON2 =0.00 A\n", + "VDON1=VDD-IDON1*RL1= 0.64 volts\n", + "VDON2=VDD-IDON2*RL2= 0.50 volts\n" + ] + } + ], + "source": [ + "from __future__ import division \n", + "VDD=(5)\n", + "print \"VDD= %0.2f\"%(VDD),\" volts\" # Drain voltage supply\n", + "RL1=125*10**(3)\n", + "print \"RL1= %0.2e\"%(RL1)+ \" ohm\" #Load resistance\n", + "RL2=200*10**(3)\n", + "print \"RL2= %0.2e\"%(RL2)+ \" ohm\" #Load resistance\n", + "IDON1=34.88*10**(-6)\n", + "print \"IDON1 =%0.2f\"%(IDON1),\" A\"#Drain current for load line 1 from fig.\n", + "IDON2=22.5*10**(-6)\n", + "print \"IDON2 =%0.2f\"%(IDON2),\" A\"#Drain current for load line 2 from fig.\n", + "VDON1=VDD-IDON1*RL1\n", + "print \"VDON1=VDD-IDON1*RL1= %0.2f\"%(VDON1),\" volts\" # output voltage at drain terminal for IDON1\n", + "VDON2=VDD-IDON2*RL2\n", + "print \"VDON2=VDD-IDON2*RL2= %0.2f\"%(VDON2),\" volts\" # output voltage at drain terminal for IDON2" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 4_13 Page No. 120" + ] + }, + { + "cell_type": "code", + "execution_count": 28, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "IDSS = 0.01 ampere\n", + "VP= -4.00 volts\n", + "VGS= 0.00 volts\n", + "VDD= 10.00 volts\n", + "RL= 500.00 ohm\n", + "VDS=VDD-ID*RL= 5.00 volts\n", + "VDS>VP,so pinch off region\n", + "RL= 750.00 ohm\n", + "VDS=VDD-ID*RL= 2.50 volts\n", + "VDS<VP,so ohmic region\n" + ] + } + ], + "source": [ + "from __future__ import division \n", + "IDSS=10*10**(-3)\n", + "print \"IDSS = %0.2f\"%(IDSS),\" ampere\" # maximum drain current for n-channel DEMOSFET\n", + "ID=IDSS # since VGS=0V, so ID=maximum\n", + "VP=(-4)\n", + "print \"VP= %0.2f\"%(VP),\" volts\" # pinch off voltage \n", + "VGS=(0)\n", + "print \"VGS= %0.2f\"%(VGS),\" volts\" # Gate to source voltage \n", + "VDD=(10)\n", + "print \"VDD= %0.2f\"%(VDD),\" volts\" # Drain supply voltage \n", + "RL=0.5*10**(3)\n", + "print \"RL= %0.2f\"%(RL)+ \" ohm\" #Load resistance\n", + "VDS=VDD-ID*RL\n", + "print \"VDS=VDD-ID*RL= %0.2f\"%(VDS),\" volts\" # Drain to source voltage ,since VDS>VP DEMOSFET is in pinch off\n", + "print \"VDS>VP,so pinch off region\"\n", + "RL=0.75*10**(3)\n", + "print \"RL= %0.2f\"%(RL)+ \" ohm\" # New Load resistance value\n", + "VDS=VDD-ID*RL\n", + "print \"VDS=VDD-ID*RL= %0.2f\"%(VDS),\" volts\" # New Drain to source voltage for RL=750 ohm\n", + "print \"VDS<VP,so ohmic region\"# since VDS < VP DEMOSFET is in ohmic region for RL=750 ohm and hence will not operate as a current source" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 4_14 Page No. 122" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "KF1 = 2.50e-04 A/V**2\n", + "KF2 = 2.50e-04 A/V**2\n", + "IQ= 1.00e-03 ampere\n", + "VT1 = 2.00 volts\n", + "VT2 = 2.00 volts\n", + "VDD= 15.00 volts\n", + "IREF =IQ= 1.00e-03 ampere\n", + "VGS= VT1+sqrt(2*IREF/KF1)=4.83 volts\n", + "R= (VDD-VGS)/IREF=10171.57 ohm\n" + ] + } + ], + "source": [ + "from math import sqrt\n", + "from __future__ import division \n", + "KF1=0.25*10**(-3)\n", + "print \"KF1 = %0.2e\"%(KF1),\" A/V**2\" # Scale factor \n", + "KF2=KF1\n", + "print \"KF2 = %0.2e\"%(KF2),\" A/V**2\" # Scale factor \n", + "IQ=1*10**(-3)\n", + "print \"IQ= %0.2e\"%(IQ),\" ampere\" # constant current source value\n", + "VT1=2\n", + "print \"VT1 = %0.2f\"%(VT1),\" volts\"# Threshold voltage\n", + "VT2=VT1\n", + "print \"VT2 = %0.2f\"%(VT2),\" volts\"# Threshold voltage\n", + "VDD=(15)\n", + "print \"VDD= %0.2f\"%(VDD),\" volts\" # Drain supply voltage \n", + "IREF=IQ\n", + "print \"IREF =IQ= %0.2e\"%(IREF),\" ampere\" # Reference current value\n", + "VGS=VT1+sqrt(2*IREF/KF1) # Formulae\n", + "print \"VGS= VT1+sqrt(2*IREF/KF1)=%0.2f\"%(VGS),\" volts\" # Gate to source voltage \n", + "R=(VDD-VGS)/IREF\n", + "print \"R= (VDD-VGS)/IREF=%0.2f\"%(R)+ \" ohm\" # resistance value to obtain constant current\n", + "# ERROR NOTE:values of VGS and R (correct) are 4.8284271 volts and 10171.573 ohm respectively but given in book are VGS=4V and R=11 kilo ohms" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 4_15 Page No. 123" + ] + }, + { + "cell_type": "code", + "execution_count": 17, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "RON= 100.00 ohm\n", + "ROFF= 1.00e+10 ohm\n", + "Vip= 1.00 volts\n", + "Rs= 100.00 ohm\n", + "RL= 10000.00 ohm\n", + "part(i) \n", + "Vo=(Vip*RL)/(RL+RON+Rs)= 0.98 volts\n", + "ErON=[Vip*(RON+Rs)/(RL+RON+Rs)]*100= 1.96 percent\n", + "vOFF=(Vip*RL)/ROFF= 0.00 volts\n", + "OFF_isolation=20*log10(Vip/vOFF)= 120.00 dB\n", + "part(ii) \n", + "vOFF=(Vip*RON)/(Rs+RON)= 0.50 volts\n", + "OFF_isolation=20*log10((Rs+RON)/RON)= 6.02 dB\n" + ] + } + ], + "source": [ + "from math import log10\n", + "from __future__ import division \n", + "RON=100\n", + "print \"RON= %0.2f\"%(RON)+ \" ohm\" #ON resistance of analog series switch\n", + "ROFF=10**(10)\n", + "print \"ROFF= %0.2e\"%(ROFF)+ \" ohm\" #OFF resistance analog series switch\n", + "Vip=1\n", + "print \"Vip= %0.2f\"%(Vip),\" volts\"# Peak amplitude of analog voltage\n", + "Rs=100\n", + "print \"Rs= %0.2f\"%(Rs)+ \" ohm\" #Voltage source resistance\n", + "RL=10*10**(3)\n", + "print \"RL= %0.2f\"%(RL)+ \" ohm\" #Load resistance\n", + "print \"part(i) \"# part(i) of this question\n", + "Vo=(Vip*RL)/(RL+RON+Rs)\n", + "print \"Vo=(Vip*RL)/(RL+RON+Rs)= %0.2f\"%(Vo),\" volts\"# ON voltage\n", + "ErON=(Vip*(RON+Rs)/(RL+RON+Rs))*100\n", + "print \"ErON=[Vip*(RON+Rs)/(RL+RON+Rs)]*100= %0.2f\"%(ErON),\" percent\"# Output voltage error \n", + "vOFF=(Vip*RL)/ROFF\n", + "print \"vOFF=(Vip*RL)/ROFF= %0.2f\"%(vOFF),\" volts\"# Output voltage in OFF state\n", + "OFF_isolation=20*log10(Vip/vOFF)\n", + "print \"OFF_isolation=20*log10(Vip/vOFF)= %0.2f\"%(OFF_isolation),\" dB\" # OFF_isolation=20*log10(Vip/vOFF) in dB# Thus ON error and OFF isolation decrease with increasing values of RL.\n", + "print \"part(ii) \"# part(ii) of this question\n", + "vOFF=(Vip*RON)/(Rs+RON)\n", + "print \"vOFF=(Vip*RON)/(Rs+RON)= %0.2f\"%(vOFF),\" volts\"# Output voltage in OFF state for analog shunt switch\n", + "OFF_isolation=20*log10((Rs+RON)/RON)# OFF_isolation of shunt switch\n", + "print \"OFF_isolation=20*log10((Rs+RON)/RON)= %0.2f\"%(OFF_isolation),\" dB\"# Thus shunt switch is inferior to series switch in its OFF isolation property\n", + "\n", + "# ERROR NOTE: in question the author has given RL = 10K but in solution he has used RL = 1 k ... I have done programming using RL = 10 K." + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 2", + "language": "python", + "name": "python2" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 2 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython2", + "version": "2.7.9" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} |