diff options
author | Prashant S | 2020-04-14 10:25:32 +0530 |
---|---|---|
committer | GitHub | 2020-04-14 10:25:32 +0530 |
commit | 06b09e7d29d252fb2f5a056eeb8bd1264ff6a333 (patch) | |
tree | 2b1df110e24ff0174830d7f825f43ff1c134d1af /Electronics_Circuits_and_Systems_by_Y_N_Bapat | |
parent | abb52650288b08a680335531742a7126ad0fb846 (diff) | |
parent | 476705d693c7122d34f9b049fa79b935405c9b49 (diff) | |
download | all-scilab-tbc-books-ipynb-master.tar.gz all-scilab-tbc-books-ipynb-master.tar.bz2 all-scilab-tbc-books-ipynb-master.zip |
Initial commit
Diffstat (limited to 'Electronics_Circuits_and_Systems_by_Y_N_Bapat')
14 files changed, 5317 insertions, 0 deletions
diff --git a/Electronics_Circuits_and_Systems_by_Y_N_Bapat/1-Vacuum_tubes_and_semiconductors.ipynb b/Electronics_Circuits_and_Systems_by_Y_N_Bapat/1-Vacuum_tubes_and_semiconductors.ipynb new file mode 100644 index 0000000..e4cedcd --- /dev/null +++ b/Electronics_Circuits_and_Systems_by_Y_N_Bapat/1-Vacuum_tubes_and_semiconductors.ipynb @@ -0,0 +1,382 @@ +{ +"cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 1: Vacuum tubes and semiconductors" + ] + }, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 1.1: small_signal_parameters.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//Ex_1.1\n", +"//refer to fig 1.2(c) and given d.c operating points VGKQ=-2 V,VAKQ=250 V,IAQ=-1.2 mA\n", +"clc\n", +"VAK2=300\n", +"disp('VAK2 = '+string(VAK2)+' volts') // value of anode voltage2 \n", +"VAK1=170\n", +"disp('VAK1 = '+string(VAK1)+' volts') // value of anode voltage1 \n", +"IA2=2*10^(-3)\n", +"disp('IA2 = '+string(IA2)+' ampere') // value of anode current2\n", +"IA1=0*10^(-3)\n", +"disp('IA1 = '+string(IA1)+' ampere') // value of anode current1\n", +"rP=(VAK2-VAK1)/(IA2-IA1)//anode resistance at VGK=VGKQ\n", +"disp('resistance,rP =(VAK2-VAK1)/(IA2-IA1)='+string(rP)+' ohm') //calculation\n", +"VGK2=-2.5\n", +"disp('VGK2 = '+string(VGK2)+' volts') // value of grid voltage2 \n", +"VGK3=-1.5\n", +"disp('VGK1 = '+string(VGK3)+' volts') // value of grid voltage1\n", +"VAK3=200\n", +"disp('VAK3 = '+string(VAK3)+' volts') // value of anode voltage1 \n", +"u=(VAK2-VAK3)/(VGK2-VGK3)//amplification factor at IA=IAQ\n", +"disp('amplification factor,u =(VAK2-VAK1)/(VGK2-VGK1)='+string(u)+' unitless ') //calculation\n", +"IA4=2.2*10^(-3)\n", +"disp('IA4 = '+string(IA4)+' ampere') // value of anode current4\n", +"IA3=0.5*10^(-3)\n", +"disp('IA1 = '+string(IA3)+' ampere') // value of anode current1\n", +"gm=(IA4-IA3)/(VGK2-VGK3)// transconductance at VAK=VAKQ\n", +"disp('transconductance,gm =(IAK4-IAK3)/(VGK2-VGK3)='+string(gm)+' ampere/volt ') //calculation\n", +"//mistake of negative sign for answers for u(amplification factor) and gm(transconductance)in book" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 1.2: CRT_parameters.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//Ex1_2\n", +"clc\n", +"d=0.5*10^(-2)\n", +"disp('d = '+string(d)+'metre') //initializing value of distance b/w plates\n", +"l=2*10^(-2)\n", +"disp('l = '+string(l)+'metre') //initializing value of length of plates\n", +"L=20*10^(-2)\n", +"disp('L = '+string(L)+'metre') //initializing value of distance b/w centre of plates and screen\n", +"Va=2000\n", +"disp('Va = '+string(Va)+'volts') ////initializing value ofanode voltage\n", +"Vd=100\n", +"disp('Vd = '+string(Vd)+'volts') //initializing value of deflecting voltage\n", +"m=9.11*10^(-31)\n", +"disp('m = '+string(m)+'Kg') //mass of electron\n", +"q=1.6*10^(-19)\n", +"disp('q = '+string(q)+'coulomb') //charge on an electron\n", +"disp('horizontal beam velocity,Vx =(2*Va*q/m)^(0.5) metre/second') //formula\n", +"Vx =(2*Va*q/m)^(0.5)\n", +"disp('horizontal beam velocity,Vx =(2*Va*q/m)^(0.5)= '+string(Vx)+' metre/second')//calculation\n", +"disp('transit time,t1 =(l/Vx) second') //formula\n", +"t1=(l/Vx)\n", +"disp('transit time,t1 =(l/Vx)= '+string(t1)+' second')//calculation\n", +"disp('vertical beam velocity,Vy =(q*Vd*l/d*m*Vx) metre/second') //formula\n", +"Vy=((q*Vd*l)/(d*m*Vx))\n", +"disp('vertical beam velocity,Vy =(q*Vd*l/d*m*Vx)= '+string(Vy)+' metre/second')//calculation\n", +"disp('vertical displacement,D =((l*L*Vd)/(2*d*Va) metre')//formula\n", +"D =(l*L*Vd)/(2*d*Va)\n", +"disp('vertical displacement,D =((l*L*Vd)/(2*d*Va)='+string(D)+' metre')//calculation\n", +"disp('sensitivity of CRT,S =(0.5*l*L)/(d*Va) metre/volt')//formula\n", +"S =(0.5*l*L)/(d*Va)\n", +"disp('sensitivity of CRT,S =(0.5*l*L)/(d*Va)='+string(S)+' metre/volt')//calculation\n", +"\n", +"\n", +"" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 1.3: Find_deflection_of_electron_beam.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//Ex1-3\n", +"clc\n", +"m=9.11*10^(-31)\n", +"disp('m = '+string(m)+' Kg') //mass of electron\n", +"q=1.6*10^(-19)\n", +"disp('q = '+string(q)+' coulomb') //charge on an electron\n", +"B=1.5*10^(-3)\n", +"disp('B = '+string(B)+ ' wb/m^2') //initializing value of magnetic field\n", +"l=5*10^(-2)\n", +"disp('l = '+string(l)+' metre') //initializing axial length of magnetic field\n", +"L=30*10^(-2)\n", +"disp('L = '+string(L)+' metre') //initializing value of distance of screen from centre of magnetic field\n", +"Va=10000\n", +"disp('Va = '+string(Va)+' volts') ////initializing value of anode voltage\n", +"disp('horizontal beam velocity,Vx =(2*Va*q/m)^(0.5) metre/second') //formula\n", +"Vx =(2*Va*q/m)^(0.5)\n", +"disp('horizontal beam velocity,Vx =(2*Va*q/m)^(0.5)= '+string(Vx)+' metre/second')//calculation\n", +"disp('radius,r =(m*Vx)/(B*q) metre') //formula\n", +"r =(m*Vx)/(B*q)\n", +"disp('radius,r =(m*Vx)/(B*q)= '+string(r)+' metre')//calculation\n", +"disp('deflection,D =(L*l)/r) metre')//formula\n", +"D =(L*l)/r\n", +"disp('deflection,D =(L*l)/r)='+string(D)+' metre')//calculation" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 1.4: calculate_drift_velocity.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//Ex-1.4\n", +"clc\n", +"q=1.6*10^(-19)\n", +"disp('q = '+string(q)+'coulomb') //charge on an electron\n", +"I=10\n", +"disp('I = '+string(I)+'Ampere') //initializing value of current\n", +"r=64.25\n", +"disp('radius,r = '+string(r)+' mils')//initializing value of radius of wire\n", +"function[metres]=mils2metres(mils)\n", +"metres=(mils*2.54)/(1000*100)\n", +"endfunction\n", +"[r1]=mils2metres(r) \n", +"disp('r1 = '+string(r1)+' metre')\n", +"n=5*10^(28)\n", +"disp('n = '+string(n)+' electrons/m^3') // electrons concentration in copper\n", +"A=(%pi*r1^2) //formulae \n", +"disp('cross sectional area,A =(%pi*r1^2)= '+string(A)+' square metre')//calculation\n", +"v=(I)/(A*q*n)//formulae(I=A*q*n*v)\n", +"disp('drift velocity,v=(I)/(A*q*n)='+string(v)+' metre/second')//calculation\n", +"\n", +" " + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 1.5: calculation_of_resistance.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//Ex1_5\n", +"clc\n", +"A=10*10^(-6); p1=10^(-4); p2=10^(3);p3=10^(10);l=1*10^(-2); //initializations\n", +"disp('cross sectional area,A ='+string(A)+'merer square') \n", +"disp('resitivity(rho),p1 ='+string(p1)+' ohm-m')\n", +"disp('resitivity(rho),p2 ='+string(p2)+' ohm-m')\n", +"disp('resitivity(rho),p3 ='+string(p3)+' ohm-m')\n", +"disp('conductor length,l ='+string(l)+' metre')\n", +"disp(' resistance for copper,R = p1*l/A = '+string(p1*l/A)+'ohm') //calculations for copper\n", +"disp(' resistance for silicon,R = p2*l/A = '+string(p2*l/A)+'ohm') //calculations for silicon\n", +"disp(' resistance for glass,R = p3*l/A = '+string(p3*l/A)+'ohm') //calculations for glass" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 1.6: parameters_for_Silicon_atoms.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//Ex1_6\n", +"clc\n", +"ni = 1.45*10^10 //initializations\n", +"nV = 5*10^22 //initializations\n", +"un = 1500 //initializations\n", +"up = 0475//initializations\n", +"T = 300 //initializations\n", +"I=10^(-6)\n", +"disp('I = '+string(I)+'Ampere') //initializing value of current\n", +"A=(50*10^(-4))^2; l=0.5 //initializations\n", +"q=1.59*10^(-19) //charge on an electron\n", +"disp('intrinsic charge concentration,ni = '+string(ni)+' /centimetre cube')\n", +"disp('silicon atoms concntration, nV = '+string(nV)+' /centimetre cube ')\n", +"\n", +"disp('electron mobility,un = '+string(un)+' cm.sq/V-s')\n", +"disp('hole mobility,up = '+string(up)+'cm.sq/V-s')\n", +"disp('temperature,T = '+string(T)+'K')\n", +"disp('q = '+string(q)+'coulomb') //charge on an electron\n", +"disp('cross sectional area,A ='+string(A)+'cm square') \n", +"disp('conductor length,l ='+string(l)+'cm')\n", +" N=nV/ni\n", +"disp('relative concentration,N =nV/ni= '+string(N)+' silicon atoms per electron -hole pair') //calculation\n", +"sigma=(1.59*10^(-19)*(1.45*10^10)*(1500+0475))\n", +"disp('intrinsic conductivityi,sigma =(1.59*10^(-19)*(1.45*10^10)*(1500+0475))= '+string(sigma)+' (ohm-cm)^-1') //calculation\n", +"pi =(1/sigma)//formulae\n", +"disp('resitivity(rho),pi =(1/sigma)='+string(pi)+' ohm-cm')//calculation\n", +"R=(2.22*10^5*0.5)/0.000025\n", +"disp(' resistance for silicon,R =((2.22*10^5*0.5)/0.000025) = '+string(R)+' ohm') //calculations for silicon\n", +"V=I*R\n", +"disp(' voltage drop,V =I*R = '+string(V)+' V') //calculations " + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 1.7: N_type_Silicon_parameters.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//Ex1_7\n", +"clc\n", +"ni = 1.45*10^10 //initializations\n", +"nV = 5*10^22 //initializations\n", +"un = 1500 //initializations\n", +"up = 0475//initializations\n", +"T = 300 //initializations\n", +"I=10^(-6)\n", +"disp('I = '+string(I)+'Ampere') //initializing value of current\n", +"A=(50*10^(-4))^2; l=0.5 //initializations\n", +"q=1.59*10^(-19) //charge on an electron\n", +"disp('intrinsic charge concentration,ni = '+string(ni)+' /centimetre cube')\n", +"disp('silicon atoms concntration, nV = '+string(nV)+' /centimetre cube ')\n", +"\n", +"disp('electron mobility,un = '+string(un)+' cm.sq/V-s')\n", +"disp('hole mobility,up = '+string(up)+' cm.sq/V-s')\n", +"disp('temperature,T = '+string(T)+' K')\n", +"disp('q = '+string(q)+'coulomb') //charge on an electron\n", +"disp('cross sectional area,A ='+string(A)+' cm square') \n", +"disp('conductor length,l ='+string(l)+' cm')\n", +"nD=nV/10^6//formulae\n", +"disp('donor concentration,nD= nV/10^6='+string(nD)+' /cm.cube')//calculation\n", +"nn=nD//formulae\n", +"disp('resulting mobile electron concentration,nn= nD='+string(nn)+' /cm.cube')//calculation\n", +"pn= ni^2/nD//formulae\n", +"disp('resulting hole concentration,pn= ni^2/nD='+string(pn)+' /cm.cube')//calculation\n", +"sigma=q*nD*un//formulae\n", +"disp('n-type semiconductor conductivity,sigma=q*nD*un= '+string(sigma)+' (ohm-cm)^-1') //calculation\n", +"pn =(1/sigma)\n", +"disp('doped silicon resitivity(rho),pn =(1/sigma)='+string(pn)+' ohm-cm')//calculation\n", +"R=(0.084*0.5)/A\n", +"disp(' resistance for silicon,R =((0.084*0.5)/A) = '+string(R)+' ohm') //calculations for silicon\n", +"V=I*R\n", +"disp(' voltage drop,V =I*R = '+string(V)+' V') //calculations " + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 1.8: diffusion_hole_current.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//Ex1_8\n", +"clc\n", +"q=1.59*10^(-19) //charge on an electron\n", +"disp('q = '+string(q)+'coulomb') //charge on an electron\n", +"d=0.037\n", +"disp('dimension of semiconductor,d='+string(d)+' cm')\n", +"A=(d^2) //area formulae for square shaped semiconductor\n", +"disp('cross sectional area,A =d^2='+string(A)+' cm square') \n", +"x=10^(-4)\n", +"disp('thickness,x ='+string(x)+' cm')\n", +"x0=0\n", +"disp('thickness,x0 ='+string(x0)+' cm')\n", +"p=9.22*10^(15)//\n", +"disp('hole concentration at x,p= '+string(p)+' /cm-cube')//calculation\n", +"p0=0//\n", +"disp('hole concentration at x0,p0= '+string(p0)+' /cm-cube')//calculation\n", +"dp=(p-p0)//formulae\n", +"dx=(x-x0)//formulae\n", +"disp(' change in concentration at ,dp= '+string(dp)+' /cm-cube')//calculation\n", +"disp('change in thickness,dx= '+string(dx)+' cm')//calculation\n", +"(dp/dx)==(p-p0)/(x-x0)//formulae\n", +"disp(' slope,(dp/dx) =(p-p0)/(x-x0)='+string(dp/dx)+' holes/cm-cube')//calculation\n", +"Dp=12\n", +"disp('hole diffusion constant,Dp= '+string(Dp)+' cm-sq/s')//calculation\n", +"Ip=A*q*Dp*(dp/dx)\n", +"disp(' hole diffusion current,Ip =A*q*Dp*(dp/dx)='+string(Ip)+' ampere')//calculation" + ] + } +], +"metadata": { + "kernelspec": { + "display_name": "Scilab", + "language": "scilab", + "name": "scilab" + }, + "language_info": { + "file_extension": ".sce", + "help_links": [ + { + "text": "MetaKernel Magics", + "url": "https://github.com/calysto/metakernel/blob/master/metakernel/magics/README.md" + } + ], + "mimetype": "text/x-octave", + "name": "scilab", + "version": "0.7.1" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/Electronics_Circuits_and_Systems_by_Y_N_Bapat/10-Combinational_Logic_Systems.ipynb b/Electronics_Circuits_and_Systems_by_Y_N_Bapat/10-Combinational_Logic_Systems.ipynb new file mode 100644 index 0000000..eb401c3 --- /dev/null +++ b/Electronics_Circuits_and_Systems_by_Y_N_Bapat/10-Combinational_Logic_Systems.ipynb @@ -0,0 +1,324 @@ +{ +"cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 10: Combinational Logic Systems" + ] + }, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 10.10: convert_binary_to_hexadecimal.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//Ex10_10\n", +"clc\n", +"x='1001000';\n", +"disp('Binary number='+string(x))//binary value\n", +"d=bin2dec(x)//binary to decimal\n", +"h=dec2hex(d)//decimal to hexa decimal\n", +"disp('Eqivalent hexadecimal number='+string(h))" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 10.11: Convert_decimal_to_BCD.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//Ex10_11\n", +"//for two digit decimal value to convert into BCD\n", +"clc\n", +"x=72;\n", +"n=2// length of decimal input\n", +"f=10^(n-1)\n", +"z =int( x/f) // taking MSB of input string\n", +"y=x-(z*10^(n-1)) // taking LSB of input string\n", +"disp('Decimal number='+string(x))\n", +"str1=dec2bin(z,4)// for 4 bit binary of MSB digit i.e 7 here\n", +"str2=dec2bin(y,4)//for 4 bit binary of LSB digit i.e 2 \n", +"disp(' Binary number of 7 ='+string(str1))\n", +"disp(' Binary number of 2 ='+string(str2))\n", +"disp('Eqivalent BCD of 72='+string(str1)+string(str2))// Binary coded decimal for 72\n", +"" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 10.1: Convert_decimal_to_binary.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//Ex10_1\n", +"clc\n", +"x=72;//given value in Decimal\n", +"disp('Decimal number='+string(x))\n", +"str=dec2bin(x)\n", +"disp('Eqivalent Binary number='+string(str))//Binary value\n", +"\n", +"\n", +"" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 10.2: Convert_binary_to_decimal.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//Ex10_2\n", +"clc\n", +"x='1001000';//Binary value\n", +"disp('Binary number='+string(x))\n", +"str=bin2dec(x)\n", +"disp('Eqivalent Decimal number='+string(str))//decimal value\n", +"\n", +"\n", +"" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 10.3: Convert_binary_to_octal.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//Ex10_3\n", +"clc\n", +"b='1001000';\n", +"disp('Binary number='+string(b))//Binary value\n", +"d=bin2dec(b)// Binary to decimal value\n", +"o=dec2oct(d)// Decimal to octal\n", +"disp('Eqivalent Octal number='+string(o))\n", +"\n", +"" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 10.4: Convert_decimal_to_octal.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//Ex10_4\n", +"clc\n", +"x=72;\n", +"disp('Decimal number='+string(x))//Decimal value\n", +"str=dec2oct(x)//decimal to octal\n", +"disp('Eqivalent Octal number='+string(str))\n", +"\n", +"\n", +"" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 10.5: Convert_octal_to_binary.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//Ex10_5\n", +"clc\n", +"x='110';\n", +"disp('Octal number='+string(x))//octal value\n", +"y=oct2dec(x)// octal to decimal\n", +"str=dec2bin(y)//decimal to binary\n", +"disp('Eqivalent Binary number='+string(str))\n", +"\n", +"" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 10.6: Convert_octal_to_decimal.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//Ex10_6\n", +"clc\n", +"x='110';\n", +"disp('Octal number='+string(x))// octal value\n", +"str=oct2dec(x)//octal to decimal\n", +"disp('Eqivalent Decimal number='+string(str))\n", +"" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 10.7: Convert_decimal_to_hexadecimal.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//Ex10_7\n", +"clc\n", +"x=72;\n", +"disp('Decimal number='+string(x))//decimal value\n", +"str=dec2hex(x)// decimal to hexadecimal\n", +"disp('Eqivalent Hexadecimal number='+string(str))\n", +"\n", +"" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 10.8: Convert_hexadecimal_to_decimal.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//Ex10_8\n", +"clc\n", +"h='48';\n", +"disp('Hexadecimal number='+string(h))// value in hexadecimal\n", +"d=hex2dec(h)//hexadecimal to decimal\n", +"disp('Eqivalent Decimal number='+string(d))" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 10.9: Convert_hexadecimal_to_binary.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//Ex10_9\n", +"clc\n", +"h='48';\n", +"disp('Hexadecimal number='+string(h))//hexadecimal\n", +"d=hex2dec(h)// converting hexadecimal to decimal\n", +"str=dec2bin(d)// converting decimal to binary\n", +"disp('Eqivalent Binary number='+string(str))" + ] + } +], +"metadata": { + "kernelspec": { + "display_name": "Scilab", + "language": "scilab", + "name": "scilab" + }, + "language_info": { + "file_extension": ".sce", + "help_links": [ + { + "text": "MetaKernel Magics", + "url": "https://github.com/calysto/metakernel/blob/master/metakernel/magics/README.md" + } + ], + "mimetype": "text/x-octave", + "name": "scilab", + "version": "0.7.1" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/Electronics_Circuits_and_Systems_by_Y_N_Bapat/11-Sequential_Logic_Systems.ipynb b/Electronics_Circuits_and_Systems_by_Y_N_Bapat/11-Sequential_Logic_Systems.ipynb new file mode 100644 index 0000000..4ca04f0 --- /dev/null +++ b/Electronics_Circuits_and_Systems_by_Y_N_Bapat/11-Sequential_Logic_Systems.ipynb @@ -0,0 +1,128 @@ +{ +"cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 11: Sequential Logic Systems" + ] + }, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 11.1: Find_maximum_operating_clock_frequency_for_flip_flop.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//Ex11_1\n", +"clc\n", +"tsu=20*10^(-9)\n", +"disp('tsu= '+string(tsu)+' seconds') // Input set-up time of second flip flop\n", +"tpd=30*10^(-9)\n", +"disp('tpd= '+string(tpd)+' seconds') // Input set-up time of first flip flop\n", +"Tmin=tpd+tsu\n", +"disp('Tmin=tpd+tsu= '+string(Tmin)+' seconds') // Minimum allowed time interval b/w threshold levels of two consecutive triggering clock edges activating two flip-flops\n", +"fCkmax=1/Tmin // formulae \n", +"disp('fCkmax=1/Tmin = '+string(fCkmax)+' Hz')// Maximum clock frequency at which flip-flop can operate reliably" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 11.4: Find_maximum_counting_rate_for_3_bit_ripple_count.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//Ex11_4\n", +"clc\n", +"tphL=40*10^(-9)\n", +"disp('tphL= '+string(tphL)+' seconds') // Time taken from Clear to output\n", +"n=3\n", +"disp('n= '+string(n))// Number of bits in counter i.e no. of flip-flops used\n", +"fmax=1/(n*tphL) // Using formulae fmax<= 1/(n*tphL)\n", +"disp('fmax=1/(n*tphL) = '+string(fmax)+' Hz')// Maximum counting rate at which flip-flop can operate reliably\n", +"" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 11.6: Find_display_count_for_decade_counter.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//Ex11_6\n", +"clc\n", +"fs=2*10^(3) \n", +"disp('fs= '+string(fs)+' Hz')// sine wave input signal frequency\n", +"fB=1*10^(6)\n", +"disp('fB= '+string(fB)+' Hz')// input Time-Base clock frequency\n", +"\n", +"disp('part(i)')// part(i)of question\n", +"fb=fB/(10^5)\n", +"disp('fb= fB/(10^5)='+string(fb)+' Hz')// Time-Base frequency for 5 decade counter\n", +"delta_t=1/fb\n", +"disp('delta_t=1/fb= '+string(delta_t)+' seconds') // Gate Time interval\n", +"DISP1=fs*delta_t\n", +"disp('fs*delta_t= '+string(DISP1))// Display indication for 5 decade counter\n", +"disp('Display indication=0200')// Display indication as 4-bit\n", +"\n", +"disp('part(ii)')// part(ii)of question\n", +"fb=fB/(10^3)\n", +"disp('fb=fB/(10^3)= '+string(fb)+' Hz')// Time-Base frequency for 3 decade counter\n", +"delta_t=1/fb\n", +"disp('delta_t=1/fb= '+string(delta_t)+' seconds') // Gate Time interval for 3 decade counter\n", +"DISP2=fs*delta_t\n", +"disp('fs*delta_t= '+string(DISP2))// Display indication for 3 decade counter\n", +"disp('Display indication=0002')// Display indication as 4-bit" + ] + } +], +"metadata": { + "kernelspec": { + "display_name": "Scilab", + "language": "scilab", + "name": "scilab" + }, + "language_info": { + "file_extension": ".sce", + "help_links": [ + { + "text": "MetaKernel Magics", + "url": "https://github.com/calysto/metakernel/blob/master/metakernel/magics/README.md" + } + ], + "mimetype": "text/x-octave", + "name": "scilab", + "version": "0.7.1" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/Electronics_Circuits_and_Systems_by_Y_N_Bapat/12-Waveshaping_and_Waveform_Generation.ipynb b/Electronics_Circuits_and_Systems_by_Y_N_Bapat/12-Waveshaping_and_Waveform_Generation.ipynb new file mode 100644 index 0000000..cf9ddfa --- /dev/null +++ b/Electronics_Circuits_and_Systems_by_Y_N_Bapat/12-Waveshaping_and_Waveform_Generation.ipynb @@ -0,0 +1,248 @@ +{ +"cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 12: Waveshaping and Waveform Generation" + ] + }, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 12.1: Find_parameters_for_op_amp_based_schmitt_trigger.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//Ex12_1\n", +"clc\n", +"VEE=15\n", +"disp('VEE= '+string(VEE)+' volts') // voltage supply \n", +"VCC=15\n", +"disp('VCC= '+string(VCC)+' volts') // voltage supply\n", +"VHI=+5\n", +"disp('VHI= '+string(VHI)+' volts') // output voltage upper limit\n", +"VLO=-5\n", +"disp('VLO= '+string(VLO)+' volts') // output voltage Lower limit\n", +"Vo=-VLO\n", +"IZmin=1*10^(-3)\n", +"disp('IZmin= '+string(IZmin)+' A') // Zener diode current rating\n", +"SR=0.5*10^(6)\n", +"disp('SR= '+string(SR)+' volts/seconds')//Slew rate\n", +"RB=100\n", +"disp('RB= '+string(RB)+ ' ohm') // resistance\n", +"RA=10*10^(3) \n", +"disp('RA= '+string(RA)+ ' ohm') // resistance\n", +"A = 5000\n", +"disp('A = '+string(A))//op-amp gain\n", +"VREF=1\n", +"disp('VREF= '+string(VREF)+' volts') // Reference- voltage \n", +"disp('part(i)')\n", +"RD=(VCC-Vo)/IZmin\n", +"disp('RD=(VCC-Vo)/IZmin= '+string(RD)+ ' ohm') // Series dropping-resistance\n", +"\n", +"disp('part(ii)')\n", +"t=(VHI-VLO)/SR\n", +"disp('t=(VHI-VLO)/SR= '+string(t)+' seconds')// Time required to swing the output\n", +"tp=10*t\n", +"disp('tp=(VHI-VLO)/SR= '+string(tp)+' seconds')// Pulse width\n", +"fmax=1/(2*tp) \n", +"disp('fmax=1/(2*tp) = '+string(fmax)+' Hz')// Maximum frequency of operation of OP-AMP comparator\n", +"disp('part(iii)')\n", +"B=RB/(RA+RB)\n", +"disp('B=RB/(RA+RB)= '+string(B))//Feedback factor\n", +"VLTP=(VLO*B)+[VREF*(RA/(RA+RB))]\n", +"disp('VLTP=(VLO*B)+[VREF*(RA/(RA+RB))]= '+string(VLTP)+' volts') // Lower trigger point\n", +"VUTP=(VHI*B)+[VREF*(RA/(RA+RB))]\n", +"disp('VUTP=(VHI*B)+[VREF*(RA/(RA+RB))]= '+string(VUTP)+' volts') // Upper trigger point\n", +"VH=VUTP-VLTP\n", +"disp('VH=VUTP-VLTP= '+string(VH)+' volts') // Hysteresis voltage " + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 12.2: Calculate_component_values_for_astable_multivibrator.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//Ex12_2\n", +"clc\n", +"Vo=14\n", +"disp('Vo= '+string(Vo)+' volts') // output voltage\n", +"f=500 \n", +"disp('f = '+string(f)+' Hz')//frequency\n", +"IB2=500*10^(-9)\n", +"disp('IB2= '+string(IB2)+' A') //base- Current\n", +"B=0.5\n", +"disp('B='+string(B))//Feedback factor\n", +"vf=B*Vo\n", +"disp('vf=B*Vo= +'+string(vf)+', -'+string(vf)+' volts') // Feedback voltage\n", +"IR=100*IB2// Taking IR as 100 times that of IB2\n", +"disp('IR=100*IB2= '+string(IR)+' A') // Current in RB resistor\n", +"RB=vf/IR\n", +"disp('RB=vf/IR= '+string(RB)+ ' ohm') // resistance\n", +"RA=RB*((1/B)-1)// Using formulae B=RA/(RA+RB)\n", +"disp('RA=RB*((1/B)-1)= '+string(RA)+ ' ohm') // resistance\n", +"RF=100*10^(3)//Choosing RF=100k\n", +"disp('RF= '+string(RF)+ ' ohm') //Feedback resistance\n", +"C1=1/[2*RF*f*log(1+(2*RB/RA))]\n", +"disp('C1=1/[2*RF*f*log(1+(2*RB/RA))]= '+string(C1)+' farad') // calculated capacitance value" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 12.3: Find_capacitor_C2_for_triangular_wave_generator.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//Ex12_3\n", +"clc\n", +"Vo=14\n", +"disp('Vo= '+string(Vo)+' volts') // output voltage\n", +"f=500 \n", +"disp('f = '+string(f)+' Hz')//frequency\n", +"R2=10*10^(3)\n", +"disp('R2= '+string(R2)+ ' ohm') // resistance\n", +"VTW=14\n", +"disp('VTW= '+string(VTW)+' volts') // Triangular peak-peak output voltage\n", +"T=1/f\n", +"C2=(Vo*T)/(2*VTW*R2)\n", +"disp('C2=(Vo*T)/(2*VTW*R2)= '+string(C2)+' farad') // calculated capacitance value for deriving triangular wave from square wave astable multivibrator" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 12.4: Find_sweep_rate_and_amplitude_Vsw_for_sweep_generator.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//Ex12_4\n", +"clc\n", +"VI=-15\n", +"disp('VI= '+string(VI)+' volts') // Input voltage\n", +"TSW=2*10^(-3)\n", +"disp('TSW= '+string(TSW)+' seconds')// triangular wave Sweep time\n", +"R=10*10^(3)\n", +"disp('R= '+string(R)+ ' ohm') // resistance as ckt. parameter\n", +"C=0.5*10^(-6)\n", +"disp('C= '+string(C)+' farad') // capacitance as ckt. parameter\n", +"S=-VI/(R*C)\n", +"disp('Sweep rate=VI/(R*C)='+string(S)+ ' V/s') // Sweep rate for sweep generator\n", +"VSW=TSW*S\n", +"disp('VSW=TSW*S= '+string(VSW)+' volts') // Sweep voltage amplitude\n", +"\n", +"\n", +"// note in book author has not provided any variable for sweep rate ... but here I have used 'S' for it ." + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 12.5: Find_parameters_for_feedback_op_amp_soft_limiter_circuit.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//Ex12_5\n", +"clc\n", +"VEE=15\n", +"disp('VEE= '+string(VEE)+' volts') // voltage supply \n", +"VCC=15\n", +"disp('VCC= '+string(VCC)+' volts') // voltage supply\n", +"R1=10*10^(3)\n", +"disp('R1= '+string(R1)+ ' ohm') // resistance\n", +"RF=20*10^(3) \n", +"disp('RF= '+string(RF)+ ' ohm') // Feedback resistance\n", +"RB1=3*10^(3)\n", +"disp('R1= '+string(R1)+ ' ohm') // resistance\n", +"RB2=RB1\n", +"RF1=1*10^(3) \n", +"disp('RF1= '+string(RF1)+ ' ohm') // Feedback resistance\n", +"RF2=RF1\n", +"Av=1*10^(3)\n", +"disp('Av= '+string(Av))\n", +"disp('part(i)')\n", +"VBR1= (VCC*RF1)/RB1\n", +"VBR2 = VBR1\n", +"disp('VBR1=VBR2=(VCC*RF1)/RB1= '+string(VBR1)+' volts') //Limit values at the break points and VBR=VBR1=VBR2\n", +"So=-RF/R1\n", +"disp('So=-RF/R1= '+string(So))// slope of Transfer characteristic at zero crossings \n", +"S1=-(RF1/R1)\n", +"disp('S1=S2=-RF1/R1= '+string(S1))// slope of Transfer characteristic at the extreme ends\n", +"VSL=(-VBR1/So)\n", +"disp('VSL=VSU=(-VBR1/So)= '+string(VSL)+' volts') // magnitude of input voltage required to produce vo=VBR\n", +"VSU=VSL\n", +"disp('part(ii)')\n", +"VSU=(VBR2/Av)//Formulae\n", +"disp('VSU=VSL=(VBR2/Av)= -'+string(VSU)+', +'+string(VSU)+' volts') // magnitude of input voltage required to produce vo=VBR in case gain Av is very large" + ] + } +], +"metadata": { + "kernelspec": { + "display_name": "Scilab", + "language": "scilab", + "name": "scilab" + }, + "language_info": { + "file_extension": ".sce", + "help_links": [ + { + "text": "MetaKernel Magics", + "url": "https://github.com/calysto/metakernel/blob/master/metakernel/magics/README.md" + } + ], + "mimetype": "text/x-octave", + "name": "scilab", + "version": "0.7.1" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/Electronics_Circuits_and_Systems_by_Y_N_Bapat/13-Non_Linear_Analog_Systems.ipynb b/Electronics_Circuits_and_Systems_by_Y_N_Bapat/13-Non_Linear_Analog_Systems.ipynb new file mode 100644 index 0000000..4d66554 --- /dev/null +++ b/Electronics_Circuits_and_Systems_by_Y_N_Bapat/13-Non_Linear_Analog_Systems.ipynb @@ -0,0 +1,141 @@ +{ +"cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 13: Non Linear Analog Systems" + ] + }, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 13.1: output_voltage_for_log_amplifier.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//Ex13_1\n", +"clc\n", +"VT=26*10^(-3)\n", +"disp('VT= '+string(VT)+' volts') // Thermal voltage \n", +"R1=5*10^(3)\n", +"disp('R1= '+string(R1)+ ' ohm') // resistance\n", +"Iso=1*10^(-10)\n", +"disp(' Iso = '+string(Iso)+' ampere') // Scale factor (as current)directly proportional to cross-section area of EBJ \n", +"\n", +"disp('part(i)')\n", +"vs=1*10^(-3)\n", +"disp('vs= '+string(vs)+' volts') // Input voltage1\n", +"vo=-VT*[log(vs/(Iso*R1))]\n", +"disp('vo=-VT*[log(vs/(Iso*R1))]= '+string(vo)+' volts') // Output voltage of Log OP-AMP for input1 i.e vs = 1 mV\n", +"\n", +"disp('part(ii)')\n", +"vs=10*10^(-3)\n", +"disp('vs= '+string(vs)+' volts') // Input voltage2\n", +"vo=-VT*[log(vs/(Iso*R1))]\n", +"disp('vo=-VT*[log(vs/(Iso*R1))]= '+string(vo)+' volts') // Output voltage of Log OP-AMP for input1 i.e vs = 10 mV\n", +"\n", +"disp('part(iii)')\n", +"vs=100*10^(-3)\n", +"disp('vs= '+string(vs)+' volts') // Input voltage3\n", +"vo=-VT*[log(vs/(Iso*R1))]\n", +"disp('vo=-VT*[log(vs/(Iso*R1))]= '+string(vo)+' volts') // Output voltage of Log OP-AMP for input1 i.e vs = 100 mV\n", +"\n", +"disp('part(iv)')\n", +"vs=1\n", +"disp('vs= '+string(vs)+' volts') // Input voltage4\n", +"vo=-VT*[log(vs/(Iso*R1))]\n", +"disp('vo=-VT*[log(vs/(Iso*R1))]= '+string(vo)+' volts') // Output voltage of Log OP-AMP for input1 i.e vs = 1V" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 13.2: output_voltage_for_log_amplifier.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//Ex13_2\n", +"clc\n", +"VT=26*10^(-3)\n", +"disp('VT= '+string(VT)+' volts') // Thermal voltage \n", +"R1=100*10^(3)\n", +"disp('R1= '+string(R1)+ ' ohm') // resistance\n", +"Iso=50*10^(-9)\n", +"disp(' Iso = '+string(Iso)+' ampere') // Scale factor (as current)directly proportional to cross-section area of EBJ \n", +"vs=2.5\n", +"disp('vs= '+string(vs)+' volts') // Input voltage\n", +"vo=-VT*[log(vs/(Iso*R1))]\n", +"disp('vo=-VT*[log(vs/(Iso*R1))]= '+string(vo)+' volts') // Output voltage of Log OP-AMP for input1 i.e vs = 2.5 V" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 13.3: output_for_antilog_amplifier.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//Ex13_3\n", +"clc\n", +"VT=26*10^(-3)\n", +"disp('VT= '+string(VT)+' volts') // Thermal voltage \n", +"RF=100*10^(3)\n", +"disp('RF= '+string(RF)+ ' ohm') // resistance\n", +"Iso=50*10^(-9)\n", +"disp(' Iso = '+string(Iso)+' ampere') // Scale factor (as current)directly proportional to cross-section area of EBJ \n", +"vs=-0.162\n", +"disp('vs= '+string(vs)+' volts') // Input voltage\n", +"vo=Iso*RF*(exp(-vs/VT))\n", +"disp('vo=Iso*RF*(exp(-vs/VT))= '+string(vo)+' volts') // Output voltage of Antilog OP-AMP for input1 i.e vs = -0.162 V" + ] + } +], +"metadata": { + "kernelspec": { + "display_name": "Scilab", + "language": "scilab", + "name": "scilab" + }, + "language_info": { + "file_extension": ".sce", + "help_links": [ + { + "text": "MetaKernel Magics", + "url": "https://github.com/calysto/metakernel/blob/master/metakernel/magics/README.md" + } + ], + "mimetype": "text/x-octave", + "name": "scilab", + "version": "0.7.1" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/Electronics_Circuits_and_Systems_by_Y_N_Bapat/14-Digital_Analog_Systems.ipynb b/Electronics_Circuits_and_Systems_by_Y_N_Bapat/14-Digital_Analog_Systems.ipynb new file mode 100644 index 0000000..fa030d0 --- /dev/null +++ b/Electronics_Circuits_and_Systems_by_Y_N_Bapat/14-Digital_Analog_Systems.ipynb @@ -0,0 +1,237 @@ +{ +"cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 14: Digital Analog Systems" + ] + }, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 14.1: Find_quantization_error_and_resolution.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//Ex14_1 Refer fig 14.1(b) and (c)\n", +"clc\n", +"n=3\n", +"disp('n= '+string(n))// Number of bits \n", +"L=2^(n)\n", +"disp('L=2^(n)= '+string(L))// Number of quantization levels\n", +"VFS=10\n", +"disp('VFS= '+string(VFS)+' volts') // Maximum value of analog input voltage\n", +"Q.E=VFS/L\n", +"disp('Q.E=VFS/L= '+string(Q.E))// Quantization error\n", +"disp('Q.E= +0.625,-0.625')// To make Quantization error symmetrical ittaken as (-Q.E/2) negative and positive value(+Q.E/2)\n", +"Resolution=(100/2^(n))//Formulae\n", +"disp('Resolution=(100/2^(n))= '+string(Resolution)+' percent')//Resolution\n", +"disp('Resolution= '+string(+Resolution)+' percent,'+string(-Resolution)+' percent')// Since Resolution is (+)as well as (-)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 14.2: Find_parameters_for_3_bit_ADC.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//Ex14_2 \n", +"clc\n", +"n=3\n", +"disp('n= '+string(n))// Number of bits \n", +"L=2^(n)\n", +"disp('L=2^(n)= '+string(L))// Number of quantization levels\n", +"VFS=1024*10^(-3)\n", +"disp('VFS= '+string(VFS)+' volts') // Maximum value of analog input voltage\n", +"\n", +"disp('part(i)')// Part(i)\n", +"LSB=VFS/(2^n)\n", +"disp('LSB=VFS/(2^n)= '+string(LSB)+' volts') // Lowest significant bit of 3-bit ADC\n", +"\n", +"disp('part(ii)')// Part(ii)\n", +"disp('vh= 64 to 192 mV with offset') // Analog voltage corresponding to binary word 001\n", +"\n", +"disp('part(iii)')// Part(iii)\n", +"I.E=(LSB)/2\n", +"disp('Inherent error,I.E= (LSB)/2= -'+string(I.E)+' V,+'+string(I.E)+' V')// Inherent error in each binary word\n", +"\n", +"disp('part(iv)')// Part(iv)\n", +"Resolution=(1*10^(-3))\n", +"disp('Resolution= '+string(Resolution)+' V')//Resolution\n", +"VFS=1\n", +"disp('VFS= '+string(VFS)+' V') // Maximum value of analog input voltage2\n", +"k=VFS/(Resolution)\n", +"disp('k=VFS/(Resolution)= '+string(k)) // 'k' taken only for calculation purpose\n", +"disp('number of bits=10')// since k =[VFS/(Resolution)]is approximately equal to 2^10,\n", +"disp('so 10-bit ADC required')" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 14.3: Find_output_voltage_for_weighted_resistor_DAC.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//Ex14_3\n", +"clc\n", +"VREF=-10\n", +"disp('VREF= '+string(VREF)+' V') // Reference voltage\n", +"RF=5*10^(3)\n", +"disp('RF= '+string(RF)+ ' ohm') //Feedback resistance\n", +"R=10*10^(3)\n", +"disp('R= '+string(R)+ ' ohm') // resistance\n", +"vLSB=(-RF*VREF)/(8*R)// Since IF=I/8,so vLSB=(-RF*IF)=(-RF*I/8)=(-RF*VREF/8*R)\n", +"disp('vLSB=(-RF*VREF)/(8*R)='+string(vLSB)+' V') // Equivalent voltage for binary word 0001\n", +"vo=-2*vLSB// Since current IF=I/4\n", +"disp('vo = -2*vLSB ='+string(vo)+' V') // Equivalent voltage for binary word 0010=2 (in decimal)\n", +"vo=-15*vLSB// Since current IF=I+(I/2)+(I/4)+(I/8)=(15*I/8),so vo=15*VLSB\n", +"disp('vo= -15*vLSB ='+string(vo)+' V') // Equivalent voltage for binary word 0010=2 (in decimal)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 14.4: Output_for_resistor_ladder_DAC.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//Ex14_4\n", +"clc\n", +"VREF=-10\n", +"disp('VREF= '+string(VREF)+' V') // Reference voltage\n", +"RF=5*10^(3)\n", +"disp('RF= '+string(RF)+ ' ohm') //Feedback resistance\n", +"R=10*10^(3)\n", +"disp('R= '+string(R)+ ' ohm') // resistance\n", +"vMSB=-(RF*VREF)/(2*R)// Since IF=I/2,so vMSB=(-RF*IF)=(-RF*I/2)=(-RF*VREF/2*R)\n", +"disp('vMSB=-(RF*VREF)/(2*R)='+string(vMSB)+' V') // Equivalent voltage for binary word 1000=8(in decimal)\n", +"vo2=vMSB/2// Since current IF=I/4\n", +"disp('vo2 = vMSB/2 ='+string(vo2)+' V') // Equivalent voltage for binary word 0100=4 (in decimal)\n", +"vo3=(15/8)*vMSB// Since current IF=I+(I/2)+(I/4)+(I/8)+(I/16)=(15*I/6),so vo=(15/8)*VMSB\n", +"disp('vo3= (15/8)*vMSB ='+string(vo3)+' V') // Equivalent voltage for binary word 1111=15 (in decimal)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 14.5: Quantization_error_and_percentage_resolution_for_12_bit_DAC.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//Ex14_5\n", +"clc\n", +"n=12\n", +"disp('n= '+string(n))// Number of bits\n", +"VFS=50\n", +"disp('VFS= '+string(VFS)+' volts') // Maximum value of analog input voltage\n", +"S=VFS/(2^n)\n", +"disp('S=VFS/(2^n)= '+string(S)+' volts') // Maximum quantization error\n", +"Resolution=(100/2^(n))//Formulae\n", +"disp('Resolution=(100/2^(n))= -'+string(Resolution)+' percent, +'+string(Resolution)+' percent')// Since Resolution is (+)as well as (-)\n", +"" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 14.7: Find_highest_analog_input_frequency_for_12_bit_ADC.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//Ex14_7\n", +"clc\n", +"n=12\n", +"disp('n= '+string(n))// Number of bits\n", +"t=5*10^(-6)\n", +"disp('t= '+string(t)+' A')\n", +"Vsp=10\n", +"disp('Vsp= '+string(Vsp)+' volts') // value of analog input voltage\n", +"LSB=Vsp/(2^n)\n", +"disp('LSB=Vsp/(2^n)= '+string(LSB)+' volts') // Lowest significant bit of 12-bit ADC\n", +"disp('LSB/2= -'+string(LSB/2)+' V, -'+string(LSB/2)+' V') \n", +"SR=(LSB/2)/t\n", +"disp('SR=(LSB/2)/t= '+string(SR)+' V/s')\n", +"fmax=SR/(2*%pi*Vsp)\n", +"disp('f = SR/(2*%pi*Vsp)='+string(fmax)+' Hz')// Highest frequency allowed at the input\n", +"" + ] + } +], +"metadata": { + "kernelspec": { + "display_name": "Scilab", + "language": "scilab", + "name": "scilab" + }, + "language_info": { + "file_extension": ".sce", + "help_links": [ + { + "text": "MetaKernel Magics", + "url": "https://github.com/calysto/metakernel/blob/master/metakernel/magics/README.md" + } + ], + "mimetype": "text/x-octave", + "name": "scilab", + "version": "0.7.1" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/Electronics_Circuits_and_Systems_by_Y_N_Bapat/2-The_Semiconductor_diode.ipynb b/Electronics_Circuits_and_Systems_by_Y_N_Bapat/2-The_Semiconductor_diode.ipynb new file mode 100644 index 0000000..1073f98 --- /dev/null +++ b/Electronics_Circuits_and_Systems_by_Y_N_Bapat/2-The_Semiconductor_diode.ipynb @@ -0,0 +1,384 @@ +{ +"cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 2: The Semiconductor diode" + ] + }, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 2.1: calculate_diode_current.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//Ex2_1\n", +"clc\n", +"IR=50*10^(-9)\n", +"disp('IR = '+string(IR)+' ampere') // value of Reverse saturation current\n", +"VT=26*10^(-3)\n", +"disp(' Thermal voltage,VT= '+string(VT)+'volt')\n", +"VAK1=(-0.25)// diode junction voltage\n", +"disp('Junction voltage,VAK1='+string(VAK1)+'volt')\n", +"IA =IR*[exp(VAK1/(2*VT))-1]// formulae for diode current\n", +"disp('Diode current,IA =IR*(exp(VAK1/(2*VT))-1)= '+string(IR*(exp(VAK1/(2*VT))-1))+' ampere') // calculation\n", +"VAK2=(+0.25)\n", +"disp('Junction voltage,VAK2='+string(VAK2)+'volt')\n", +"IA =IR*[exp(VAK2/(2*VT))-1]\n", +"disp('Diode current,IA =IR*(exp(VAK2/(2*VT))-1)= '+string(IA)+' ampere') // calculation\n", +"VAK3=(+0.5)\n", +"disp('Junction voltage,VAK3='+string(VAK3)+'volt')\n", +"disp('Diode current,IA =IR*(exp(VAK3/(2*VT))-1)= '+string(IR*(exp(VAK3/(2*VT))-1))+' ampere') // calculation\n", +"VAK4=(+0.6)\n", +"disp('Junction voltage,VAK4='+string(VAK4)+'volt')\n", +"disp('Diode current,IA =IR*(exp(VAK4/(2*VT))-1)= '+string(IR*(exp(VAK4/(2*VT))-1))+' ampere') // calculation\n", +"VAK5=(+0.7)\n", +"disp('Junction voltage,VAK3='+string(VAK5)+'volt')\n", +"disp('Diode current,IA =IR*(exp(VAK5/(2*VT))-1)= '+string(IR*(exp(VAK5/(2*VT))-1))+' ampere') // calculation\n", +"VAK6=(+0.8)\n", +"disp('Junction voltage,VAK3='+string(VAK6)+'volt')\n", +"disp('Diode current,IA =IR*(exp(VAK6/(2*VT))-1)= '+string(IR*(exp(VAK6/(2*VT))-1))+' ampere') // calculation" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 2.2: Diode_current_and_diode_junction_voltage_calculation.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//Ex2_2\n", +"//refer to fig 2.1(c) ,fig.2.3(b) and fig.2.3(c)\n", +"clc\n", +"VF=5\n", +"disp('source voltage,VF = '+string(VF)+ ' volts')//initialization\n", +"VD=0.7\n", +"disp('voltage drop,VD = '+string(VD)+ ' volts')//initialization\n", +"R=5*10^(3)\n", +"disp('resistance,R = '+string(R)+ 'ohm')//initialization\n", +"RF=100\n", +"disp('resistance,R = '+string(RF)+ 'ohm')//initialization\n", +"VR=0.6\n", +"disp('VR = '+string(VR)+ ' volts')//initialization\n", +"IA=(VF-VD)/R //formulae\n", +"disp('Diode current ,IA = '+string(IA)+' ampere') // calculation\n", +"IA=(VF-VR)/(R+RF)// Formulae\n", +"disp(' using large signal model,IA = '+string(IA)+' ampere') // calculation\n", +"VAK=(VR+IA*RF)// Formulae\n", +"disp('Junction voltage,VAK ='+ string(VAK)+' volts')//calculation" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 2.3: small_signal_forward_and_reverse_resistance.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//Ex2_3\n", +"clc\n", +"VT=26*10^(-3)\n", +"disp(' Thermal voltage,VT= '+string(VT)+' volt')//initialization\n", +"IR=50*10^(-9)\n", +"disp('IR = '+string(IR)+' ampere') // value of Reverse saturation current\n", +"VAK1=(0.7)// diode junction voltage\n", +"disp('Junction voltage,VAK1='+string(VAK1)+' volt')//initialization\n", +"gf=(IR/(2*VT))*exp(VAK1/(2*VT)) //Formulae\n", +"disp('Forward conductance,gf='+string(gf)+' mho')\n", +"rf=1/gf //Formulae\n", +"disp('Forward resistance,rf = '+string(rf)+ ' ohm')\n", +"VAK2=(-0.7)\n", +"gr=(IR/(2*VT))*exp(VAK2/(2*VT)) //Formulae\n", +"disp('Reverse conductance,gr='+string(gr)+' mho')\n", +"rr=1/gr //Formulae\n", +"disp(' Reverse resistance,rr = '+string(rr)+ ' ohm')" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 2.4: various_parameters_for_two_diode_rectifier.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//Ex2_4\n", +"clc\n", +"Vi=10\n", +"disp('input voltage,Vi = '+string(Vi)+' volts') //initialization\n", +"Rs=0.2\n", +"disp('resistance,Rs = '+string(Rs)+ 'ohm') //initialization\n", +"RL=10\n", +"disp('resistance,RL = '+string(RL)+ 'ohm') //initialization\n", +"VD=0.7\n", +"disp('input voltage,VD = '+string(VD)+' volts') //initialization\n", +"Vim=Vi*sqrt(2) //Formulae\n", +"Iim=(Vim-VD)/(RL+Rs) //Formulae\n", +"disp(' Peak load current ,Iim =(Vim-VD)/(RL+Rs) ='+string(Iim)+' ampere') // calculation\n", +"Ildc=(2*Iim/(%pi)) //Formulae\n", +"disp(' D.C load current ,Ildc =(2*Iim/(%pi)) ='+string(Ildc)+' ampere') // calculation\n", +"Iadc=(Ildc/2) //Formulae\n", +"disp(' diode d.c current ,Iadc =(Ildc/2)= '+string(Iadc)+' ampere') // calculation\n", +"PIV=2*Vim //Formulae\n", +"disp('peak inverse voltage ,PIV = 2*Vim='+string(PIV)+' volts') // calculation\n", +"Vldc=Ildc*RL //Formulae\n", +"disp('D.C output voltage,Vldc=Ildc*RL= '+string(Vldc)+' volts') // calculation\n", +"" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 2.5: calculation_of_resistance.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//Ex2_5\n", +"clc\n", +"Idc=1*10^(-3)\n", +"disp(' D.C load current ,Idc = '+string(Idc)+' ampere') //initialization\n", +"Vi=2.5\n", +"disp('input voltage,Vi = '+string(Vi)+' volts')//initialization\n", +"Vim=Vi*sqrt(2)\n", +"VD=0.7\n", +"disp('voltage drop,VD = '+string(VD)+ ' volts') //initialization\n", +"Rm=50\n", +"disp('resistance,Rm = '+string(Rm)+ ' ohm') //initialization\n", +"R=[(2/%pi)*((Vim-2*VD)/Idc)-Rm] //Formulae\n", +"disp('resistance,R =[(2/%pi)*((Vim-2*VD)/Idc)-Rm]= '+string(R)+ ' ohm')\n", +"\n", +"// NOTE: VALUE OF R=1310 ohm as given in book but here calculated ans is 1309.5231ohm " + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 2.6: full_wave_rectifier_parameters.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//Ex2_6\n", +"clc\n", +"Vi=10\n", +"disp('input voltage,Vi = '+string(Vi)+' volts') //initialization\n", +"Vim=Vi*sqrt(2)\n", +"f1=50\n", +"disp('frequency,f1='+string(f1)+' hertz') //initialization\n", +"RL=1100\n", +"disp('resistance,RL = '+string(RL)+ ' ohm') //initialization\n", +"C=50*10^(-6)\n", +"r=1/[(4*sqrt(3))*f1*RL*C] // Formulae\n", +"disp('Ripple factor,r = '+string(r)+'')\n", +"x=1/(4*f1*RL*C) // Formulae\n", +"VLDC=Vim/(1+x) // Formulae\n", +"disp('output voltage,VLDC = VLDC=Vim/(1+x)='+string(VLDC)+' volts') //calculation\n", +"VR=(Vim-VLDC)/(VLDC) // Formulae\n", +"disp(' voltage Regulation,VR =(Vim-VLDC)/(VLDC)= '+string(VR)+' volts') //calculation\n", +"Vr=VLDC*r // Formulae\n", +"disp('Ripple output voltage,Vr = Vr=VLDC*r='+string(Vr)+' volts')//calculation" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 2.7: Zener_diode_parameters.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//Ex2_7\n", +"clc\n", +"VI=10\n", +"disp('input voltage,VI = '+string(VI)+' volts') //initialization\n", +"Vz=5\n", +"disp('diode voltage,Vz = '+string(Vz)+' volts') //initialization\n", +"Rz=100\n", +"disp('resistance,Rz = '+string(Rz)+ ' ohm') //initialization\n", +"RD=500\n", +"disp('resistance,RD = '+string(RD)+ ' ohm') //initialization\n", +"DVI=25\n", +"disp('percentage change in VI,DVI= '+string(DVI)+' volts') //initialization\n", +"DVL=(DVI)*(Rz/(RD+Rz)) //Formulae\n", +"disp('percentage change in VL,DVL=(DVI)*(Rz/(RD+Rz))= '+string(DVL)+' %')\n", +"R0=(RD*Rz)/(RD+Rz) //Formulae\n", +"disp('Output resistance,R0 =(RD*Rz)/(RD+Rz)= '+string(R0)+ ' ohm')\n", +"VImax=12.5\n", +"Izmax=(VImax-Vz)/(RD+Rz) //Formulae\n", +"disp('resistance,RD = '+string(RD)+ ' ohm')\n", +"PZmax=(Izmax*Vz) //Formulae\n", +"disp('Power dissipated,PZmax =PZmax=(Izmax*Vz)= '+string(PZmax)+ ' watt')\n", +"Prd=(Izmax*Izmax*RD) //Formulae\n", +"disp('Power dissipated,Prd=Prd=(Izmax*Izmax*RD)= '+string(Prd)+ ' watt')\n", +"PD=(PZmax+Prd) //Formulae\n", +"disp('Power dissipated,PD = '+string(PD)+ ' watt')\n", +"RL=0.5*(10^3)\n", +"disp('resistance,RL = '+string(RL)+ ' ohm') //initialization\n", +"%VR=(R0*100)/RL //Formulae\n", +"disp(' voltage Regulation Percentage,%VR =(R0/RL)*(100)= '+string(%VR)+'% ')" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 2.8: reference_voltage_and_temperature_coefficient.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//Ex2_8\n", +"clc\n", +"Vz=10 //initialization\n", +"disp('diode voltage,Vz = '+string(Vz)+' volts')\n", +"TC1=(10*0.02)/(100) //calculation\n", +"disp(' Zener diode TC1 = '+string(TC1)+' V/degree celsius')\n", +"VD=0.7\n", +"disp(' voltage drop,VD = '+string(VD)+' volts')\n", +"TC2=(-2.5*10^(-3)) //calculation\n", +"disp('Si diode TC = '+string(TC2)+' V/degree celsius')\n", +"Vref1=VD+Vz\n", +"disp('Combined voltage ,Vref=VD+Vz= '+string(Vref1)+' volts')\n", +"TC3=(TC1+TC2) //calculation\n", +"disp(' Combined TC = '+string(TC3)+' V/degree celsius')\n", +"TC=(TC1+TC2)*100/(Vref1) //calculation\n", +"disp('New Combined TC = (TC1+TC2)*100/(Vref1)='+string(TC)+' percent/degree celsius')\n", +"T1=25//temperature\n", +"T2=50// new temperature\n", +"Vref=Vref1-((-TC3)*(T2-T1))//calculation\n", +"disp('New Combined reference voltage ,Vref= Vref1-((-TC3)*(T2-T1))='+string(Vref)+' volts')" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 2.9: load_voltage_and_current.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//Ex2_9\n", +"clc\n", +"Vi1=0.2\n", +"disp('input voltage,Vi1 = '+string(Vi1)+' volts') //initialization\n", +"VD=0.7\n", +"disp(' voltage drop,VD = '+string(VD)+' volts') //initialization\n", +"RL=5*(10^3)\n", +"disp('resistance,RL = '+string(RL)+ ' ohm') //initialization\n", +"Vcc=5\n", +"disp('Supply voltage,Vcc = '+string(Vcc)+' volts')\n", +"V01=VD+Vi1 //Formulae\n", +"disp('output voltage ,V01 ==VD+Vi1 = '+string(V01)+' volts') \n", +"IL1=(Vcc-V01)/RL //Formulae\n", +"disp(' output current ,IL1=IL1=(Vcc-V01)/RL = '+string(IL1)+' ampere') // calculation\n", +"Vi2=5\n", +"disp('input voltage,Vi2 = '+string(Vi2)+' volts') //initialization\n", +"V02=3*VD //Formulae\n", +"disp('output voltage ,V02 =3*VD= '+string(V02)+' volts')\n", +"IL2=(Vcc-V02)/RL //Formulae\n", +"disp(' output current ,IL2= IL2=(Vcc-V02)/RL = '+string(IL2)+' ampere') // calculation\n", +"VAK=V02-Vi2 //Formulae\n", +"disp(' Diode voltage ,VAK = V02-Vi2 = '+string(VAK)+' volts')\n", +"\n", +"//NOTE:correct value of IL2=0.58 mA but in book given as 0.592mA" + ] + } +], +"metadata": { + "kernelspec": { + "display_name": "Scilab", + "language": "scilab", + "name": "scilab" + }, + "language_info": { + "file_extension": ".sce", + "help_links": [ + { + "text": "MetaKernel Magics", + "url": "https://github.com/calysto/metakernel/blob/master/metakernel/magics/README.md" + } + ], + "mimetype": "text/x-octave", + "name": "scilab", + "version": "0.7.1" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/Electronics_Circuits_and_Systems_by_Y_N_Bapat/3-Bipolar_Junction_Transistor.ipynb b/Electronics_Circuits_and_Systems_by_Y_N_Bapat/3-Bipolar_Junction_Transistor.ipynb new file mode 100644 index 0000000..1b1e700 --- /dev/null +++ b/Electronics_Circuits_and_Systems_by_Y_N_Bapat/3-Bipolar_Junction_Transistor.ipynb @@ -0,0 +1,527 @@ +{ +"cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 3: Bipolar Junction Transistor" + ] + }, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 3.10: Find_maximum_allowed_power_dissipation_at_25_and_75_degree_celsius.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//Ex3_10\n", +"clc\n", +"TJmax=175\n", +"disp('TJmax= '+string(TJmax)+ 'degree celsius') //maximum allowed junction temperature\n", +"theta=0.5\n", +"disp('theta= '+string(theta)+ 'degree celsius/mW ') //thermal resistances b/w junction to ambient\n", +"change_T=TJmax-25//temperature difference\n", +"PDmax=change_T/theta\n", +"disp('at 25 degree celsius,PDmax=(TJmax-25 )/theta = '+string(PDmax)+ ' mW ') //maximum allowed power dissipation at TA=25 degree celsius\n", +"change_T=TJmax-75\n", +"PDmax2=change_T/theta\n", +"disp('at 75 degree celsius,PDmax2= (TJmax-75)/theta = '+string(PDmax2)+ ' mW ') //maximum allowed power dissipation at TA=75 degree celsius" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 3.11: Find_maximum_allowed_power_dissipation_at_25_and_75_degree_celsius.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//Ex3_11\n", +"clc\n", +"TJmax=175\n", +"disp('TJmax= '+string(TJmax)+ ' degree celsius') //maximum allowed junction temperature\n", +"theta=0.1\n", +"disp('theta= '+string(theta)+ ' degree celsius/mW ') //thermal resistances b/w junction to ambient\n", +"change_T=TJmax-25 //temperature difference\n", +"PDmax=change_T/theta\n", +"disp('at 25 degree celsius,PDmax=(TJmax-25 )/theta = '+string(PDmax)+ ' mW ') //maximum allowed power dissipation at TA=25 degree celsius\n", +"change_T=TJmax-75 //temperature difference\n", +"PDmax=change_T/theta\n", +"disp('at 75 degree celsius,PDmax= (TJmax-75)/theta = '+string(PDmax)+ ' mW ') //maximum allowed power dissipation at TA=75 degree celsius" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 3.12: Calculate_resistance_R_for_BJT_current_mirror.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//Ex3_12\n", +"clc\n", +"VBE=(0.7)\n", +"disp('VBE = '+string(VBE)+' volts') // value of base-emitter voltage\n", +"VCC=10\n", +"disp('VCC = '+string(VCC)+' volts') // collector supply voltage \n", +"IREF=5*10^(-3)\n", +"disp('IREF =IQ= '+string(IREF)+' ampere') // current mirror source current\n", +"R=(VCC-VBE)/(IREF)// formulae\n", +"disp('R=(VCC-VBE)/(IREF)= '+string(R)+ ' ohm') //resistance" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 3.1: BJT_current_and_voltages.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//Ex3_1\n", +"clc\n", +"Vcc=15\n", +"disp('Vcc = '+string(Vcc)+' volts') //initialization\n", +"VBB=1\n", +"disp('VBB = '+string(VBB)+' volts') //initialization\n", +"VBE=0.7\n", +"disp('VBE = '+string(VBE)+' volts') //initialization\n", +"RB=5*(10^3)\n", +"disp('resistance,RB = '+string(RB)+ ' ohm') //initialization\n", +"RL=650\n", +"disp('resistance,RL = '+string(RL)+ ' ohm') //initialization\n", +"Bf=200\n", +"disp('Gain,Bf = '+string(Bf)+ ' ') //initialization\n", +"IB=(VBB-VBE)/RB //Formulae\n", +"disp('IB =(VBB-VBE)/RB = '+string(IB)+' ampere') //calculation\n", +"IC=IB*Bf //Formulae\n", +"disp('IC =IB*Bf= '+string(IC)+' ampere')//calculation\n", +"IE=IB+IC //Formulae\n", +"disp('IE = IB+IC='+string(IE)+' ampere')//calculation\n", +"VCE=Vcc-IC*RL //Formulae\n", +"disp('VCE =Vcc-IC*RL= '+string(VCE)+' volts') //calculation\n", +"VCB=VCE-VBE //Formulae\n", +"disp('VCB = VCE-VBE='+string(VCB)+' volts')//calculation\n", +"RB=(Vcc-VBE)/IB //Formulae\n", +"disp('resistance,RB =(Vcc-VBE)/IB= '+string(RB)+ ' ohm') //calculation" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 3.2: find_current_gain_and_voltage_gain.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//refer BJT characteristics in fig3.2(a)and fig3.4(a)\n", +"//Ex3_2\n", +"clc\n", +"Vbe1=0.025\n", +"disp('Vbe1 = '+string(Vbe1)+' volts') // value of base-emitter voltage1\n", +"Vbe2=(-0.025)\n", +"disp('Vbe2 = '+string(Vbe2)+' volts') // value of base-emitter voltage2\n", +"ib1=20*10^(-6)\n", +"disp('ib1 = '+string(ib1)+' ampere') // value of base current1\n", +"ib2=(-20*10^(-6))\n", +"disp('ib2 = '+string(ib2)+' ampere')// value of base current2\n", +"IBQ=60*10^(-6)\n", +"disp('IBQ = '+string(IBQ)+' ampere') // operating point\n", +"ICP=15.5*10^(-3)\n", +"disp('ICP = '+string(ICP)+' ampere') // initialization\n", +"ICR=8.5*10^(-3)\n", +"disp('ICR = '+string(ICR)+' ampere') // initialization\n", +"VCEP=5\n", +"disp('VCEP = '+string(VCEP)+' volts') // value of collector-emitter voltage1\n", +"VCER=9\n", +"disp('VCER = '+string(VCER)+' volts') // value of collector-emitter voltage2\n", +"change_IC=ICP-ICR //change in collector current\n", +"disp('change_IC = '+string(change_IC)+' ampere')\n", +"change_VCE=VCER-VCEP //change in collector voltage\n", +"disp('change_VCE = '+string(change_VCE)+' volts') \n", +"change_VBE=Vbe1-Vbe2\n", +"change_IB=ib1-ib2\n", +"AV=(change_VCE/change_VBE) //formulae voltage gain\n", +"disp('AV = '+string(AV)+' ')//voltage gain\n", +"AI=change_IC/change_IB //formulae current gain\n", +"disp('AI = '+string(AI)+' ')" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 3.3: Find_transconductance_gm_and_hybrid_parameter_hie_and_unity_gain_frequency.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//Ex3_3\n", +"clc\n", +"ICQ=12*10^(-3)\n", +"disp('ICQ = '+string(ICQ)+' ampere') // collector current\n", +"B=200\n", +"disp('B = '+string(B)+' ') //BJT gain\n", +"Cbe=100*10^(-12)// capacitance\n", +"disp('capacitance,Cbe = '+string(Cbe)+' F ')\n", +"VT=26*10^(-3)\n", +"disp('VT = '+string(VT)+' volts') // thermal voltage\n", +"gm=(ICQ/VT) //transconductance\n", +"disp('gm =(ICQ/VT)= '+string(gm)+' A/V')\n", +"hie=B/gm //forward resistance hybrid parameter\n", +"disp('hie =(B/gm)= '+string(hie)+' ohm')\n", +"fT=((1/2)*(gm/Cbe)*(1/%pi)) //unity gain frequency formulae\n", +"disp('fT =((1/2)*(gm/Cbe)*(1/%pi))= '+string(fT)+' hertz')" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 3.4: operating_point_of_BJT.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//Ex3_4\n", +"//refer fig3.2(a)\n", +"clc\n", +"VCC=20\n", +"disp('VCC = '+string(VCC)+' volts') // collector supply voltage \n", +"VBB=VCC\n", +"RL=5*(10^3)\n", +"disp('RL= '+string(RL)+ ' ohm') //resistance\n", +"RB=965*(10^3)\n", +"disp('RB = '+string(RB)+ ' ohm') //initialization base resistance\n", +"VBE=(0.7)\n", +"disp('VBE = '+string(VBE)+' volts') // value of base-emitter voltage\n", +"BF=50\n", +"disp('BF = '+string(BF)+' ') //BJT gain\n", +"ICO=10*10^(-9)\n", +"disp('ICO = '+string(ICO)+' ampere') // collector reverse bias current\n", +"Vi=0\n", +"disp('Vi = '+string(Vi)+' volts') // value of input\n", +"IBQ=(VCC-VBE)/RB //base current as operating point\n", +"disp('IBQ = '+string(IBQ)+' ampere')\n", +"ICQ=BF*IBQ //operating point (collector current)\n", +"disp('ICQ =BF*IBQ= '+string(ICQ)+' ampere') // calculation\n", +"VCEQ=VCC-ICQ*RL // collector-emitter voltage as operating point\n", +"disp('VCEQ =VCC-ICQ*RL = '+string(VCEQ)+' volts') //calculation" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 3.5: Find_operating_point_of_BJT.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//Ex3_5\n", +"clc\n", +"BF1=100\n", +"disp('BF1 = '+string(BF1)+' ') //BJT gain\n", +"VCC=20\n", +"disp('VCC = '+string(VCC)+' volts') // collector supply voltage \n", +"VBB=VCC\n", +"RL=5*(10^3)\n", +"disp('resistance,RL= '+string(RL)+ ' ohm') //initialization\n", +"RB=965*(10^3)\n", +"disp('resistance,RB = '+string(RB)+ ' ohm') //initialization\n", +"VBE=(0.7)\n", +"disp('VBE = '+string(VBE)+' volts') // value of base-emitter voltage\n", +"ICO=10*10^(-9)\n", +"disp('ICO = '+string(ICO)+' ampere') // collector reverse bias current\n", +"Vi=0\n", +"disp('Vi = '+string(Vi)+' volts') // value of input\n", +"IBQ=(VCC-VBE)/RB //base current as operating point\n", +"disp('IBQ = '+string(IBQ)+' ampere')\n", +"ICQ1=BF1*IBQ //operating point (collector current)\n", +"disp('ICQ1 =BF1*IBQ= '+string(ICQ1)+' ampere') // calculation\n", +"VCEQ1=VCC-ICQ1*RL // collector-emitter voltage as operating point\n", +"disp('VCEQ1 =VCC-ICQ1*RL = '+string(VCEQ1)+' volts') //calculation" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 3.6: Find_operating_point_of_BJT.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//Ex3_6\n", +"clc\n", +"VBE2=(0.5)\n", +"disp('VBE2 = '+string(VBE2)+' volts') // value of base-emitter voltage\n", +"VCC=20\n", +"disp('VCC = '+string(VCC)+' volts') // collector supply voltage \n", +"BF2=150\n", +"disp('BF2 = '+string(BF2)+' ') //BJT gain\n", +"ICO2=500*10^(-9)\n", +"disp('ICO2 = '+string(ICO2)+' ampere') // collector reverse bias current\n", +"RB=965*(10^3)\n", +"disp('RB = '+string(RB)+ ' ohm') //initialization base resistance\n", +"RL=5*(10^3)\n", +"disp('RL= '+string(RL)+ ' ohm') // load resistance\n", +"IBQ2=(VCC-VBE2)/RB //base current as operating point\n", +"disp('IBQ2 = (VCC-VBE2)/RB='+string(IBQ2)+' ampere')\n", +"ICQ2=(BF2*IBQ2) //operating point (collector current)\n", +"disp('ICQ2 =BF2*IBQ2= '+string(ICQ2)+' ampere') // \n", +"dICQ2=BF2*ICO2 // increase in reverse bias current\n", +"disp('dICQ2 =BF2*ICO2= '+string(dICQ2)+' ampere') // \n", +"ICQ3=ICQ2+dICQ2\n", +"disp('ICQ3 =ICQ2+dICQ2= '+string(ICQ3)+' ampere') // calculation\n", +"VCEQ3=VCC-ICQ3*RL // collector-emitter voltage as operating point\n", +"disp('VCEQ3 =VCC-ICQ3*RL = '+string(VCEQ3)+' volts') //calculation\n", +"//NOTE: Calculated ans for VCEQ3=4.4695596 volts but in book it is given as 4.625volts(due to approximations done in) \n", +" \n", +" " + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 3.7: Calculate_extreme_variation_in_operating_collector_current_ICQ.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//Ex3_7\n", +"clc\n", +"VCC=20\n", +"disp('VCC = '+string(VCC)+' volts') // collector supply voltage \n", +"RL=5*(10^3)\n", +"disp('resistance,RL= '+string(RL)+ ' ohm') //initialization\n", +"R1=90*(10^3)\n", +"disp('resistance,R1 = '+string(R1)+ ' ohm') //initialization\n", +"R2=10*(10^3)\n", +"disp('resistance,R2 = '+string(R2)+ ' ohm') //initialization \n", +"Rc=1*(10^3)\n", +"disp('resistance,Rc = '+string(Rc)+ ' ohm') // resistance at collector\n", +"VBEmax=(0.7)\n", +"disp('VBEmax = '+string(VBEmax)+' volts') // maximum base-emitter voltage\n", +"VBEmin=(0.5)\n", +"disp('VBEmin = '+string(VBEmin)+' volts') // minimum base-emitter voltage\n", +"BFmax=150\n", +"disp('BFmax = '+string(BFmax)+' ') //BJT gain maximum\n", +"BFmin=50\n", +"disp('BFmin = '+string(BFmin)+' ') //BJT gain minimum\n", +"ICOmax=500*10^(-9)\n", +"disp('ICOmax = '+string(ICOmax)+' ampere') // maximum collector reverse bias current\n", +"ICOmin=10*10^(-9)\n", +"disp('ICOmin = '+string(ICOmin)+' ampere') // minimum collector reverse bias current\n", +"VBB=(VCC*R2)/(R1+R2)\n", +"disp('VBB = '+string(VBB)+' volts') // Base supply voltage \n", +"RB=(R1*R2)/(R1+R2)\n", +"disp('RB = (R1*R2)/(R1+R2)='+string(RB)+ ' ohm') // eqivalent base resistance\n", +"ICmin=[(BFmin*(VBB-VBEmax)+(RB+Rc)*(1+BFmin)*ICOmin)/(RB+Rc*(1+BFmin))] // minimum collector current\n", +"disp('ICmin = '+string(ICmin)+' ampere')\n", +"VCEQmax=VCC-ICmin*RL // maximum collector-emitter voltage (d.c value)\n", +"disp('VCEQmax =VCC-ICmin*RL = '+string(VCEQmax)+' volts') //calculation\n", +"ICmax=[(BFmax*(VBB-VBEmin)+(RB+Rc)*(1+BFmax)*ICOmax)/(RB+Rc*(1+BFmax))] // maximum collector current\n", +"disp('ICmax = '+string(ICmax)+' ampere')\n", +"VCEQmin=VCC-ICmax*RL // minimum collector-emitter voltage (d.c value)\n", +"disp('VCEQmin =VCC-ICmax*RL = '+string(VCEQmin)+' volts') //calculation\n", +"change_IC=ICmax-ICmin\n", +"disp('change_IC= '+string(change_IC)+' ampere') // extreme variation in collector current\n", +"// ERROR - NOTE: Extreme variation in collector current given in book is 0.397 mA but calculated correct ans is 0.3276 mA \n", +" " + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 3.8: find_value_of_collector_current_Ic_and_check_is_BJT_in_active_region.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//Ex3_8\n", +"clc\n", +"VCC=20\n", +"disp('VCC = '+string(VCC)+' volts') // collector supply voltage \n", +"RL=2*(10^3)\n", +"disp('RL= '+string(RL)+ ' ohm') //resistance\n", +"R1=100*(10^3)\n", +"R2=R1\n", +"disp('R1 =R2= '+string(R1)+ ' ohm') //resistance\n", +"VBE=(0.7)\n", +"disp('VBE = '+string(VBE)+' volts') // base-emitter voltage\n", +"BF=100\n", +"disp('BF = '+string(BF)+' ') //BJT gain\n", +"ICO=0\n", +"VBB=(VCC*R2)/(R1+R2)\n", +"disp('VBB = '+string(VBB)+' volts') // Base supply voltage \n", +"RB=(R1*R2)/(R1+R2)\n", +"disp('RB = (R1*R2)/(R1+R2)='+string(RB)+ ' ohm') // eqivalent base resistance\n", +"IC=[(BF*(VBB-VBE))/(RB+RL*(1+BF))] // collector current\n", +"disp('IC = '+string(IC)+' ampere')\n", +"VE=IC*RL\n", +"disp('VE = '+string(VE)+' volts') // emitter voltage\n", +"VB=VBE+VE\n", +"disp('VB = '+string(VB)+' volts') // base voltage\n", +"VCB=VCC-VB\n", +"disp('VCB = '+string(VCB)+' volts') // collector-base voltage\n", +"//hence BJT in active region." + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 3.9: find_forced_vaue_of_current_gain_for_BJT_in_saturation_region.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//Ex3_9\n", +"clc\n", +"VCC=5\n", +"disp('VCC = '+string(VCC)+' volts') // collector supply voltage \n", +"RL=250\n", +"disp('RL= '+string(RL)+ ' ohm') //initialization\n", +"RB=25*10^(3)\n", +"disp('RB ='+string(RB)+ ' ohm') // base resistance\n", +"VCS=(0.2)\n", +"disp('VCS = '+string(VCS)+' volts') // voltage\n", +"BF=200\n", +"disp('BF = '+string(BF)+' ') //BJT gain\n", +"VBS=(0.8)\n", +"disp('VBS = '+string(VBS)+' volts') // base-emitter voltage for BJT switch\n", +"VI=5\n", +"disp('VI = '+string(VI)+' volts')// input voltage\n", +"VCON=0.3\n", +"disp('VCON = '+string(VCON)+' volts')\n", +"ICON=(VCC-VCON)/RL\n", +"disp('ICON = (VCC-VCON)/RL='+string(ICON)+' ampere')//collector current for saturated BJT\n", +"IBON=(ICON)/BF\n", +"disp('IBON = (ICON)/BF='+string(IBON)+' ampere')//Base current for saturated BJT\n", +"IBS=(VI-VBS)/RB\n", +"disp('IBS = (VI-VBS)/RB='+string(IBS)+' ampere')//Base-emitter current for saturated BJT\n", +"ICS=(VCC-VCS)/RL\n", +"disp('ICS = (VCC-VCS)/RL='+string(ICS)+' ampere')//Collector-emitter current for saturated BJT\n", +"Bforced=ICS/IBS\n", +"disp('Bforced = ICS/IBS='+string(Bforced)+' ') //BJT forced gain\n", +"//IBS>>IBON hence BJT in saturation\n", +"\n", +"\n", +"" + ] + } +], +"metadata": { + "kernelspec": { + "display_name": "Scilab", + "language": "scilab", + "name": "scilab" + }, + "language_info": { + "file_extension": ".sce", + "help_links": [ + { + "text": "MetaKernel Magics", + "url": "https://github.com/calysto/metakernel/blob/master/metakernel/magics/README.md" + } + ], + "mimetype": "text/x-octave", + "name": "scilab", + "version": "0.7.1" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/Electronics_Circuits_and_Systems_by_Y_N_Bapat/4-Field_Effect_Transistors.ipynb b/Electronics_Circuits_and_Systems_by_Y_N_Bapat/4-Field_Effect_Transistors.ipynb new file mode 100644 index 0000000..cb721b0 --- /dev/null +++ b/Electronics_Circuits_and_Systems_by_Y_N_Bapat/4-Field_Effect_Transistors.ipynb @@ -0,0 +1,688 @@ +{ +"cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 4: Field Effect Transistors" + ] + }, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 4.10: EX4_10.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//Ex4_10\n", +"clc\n", +"RL=12*10^(3)\n", +"disp('RL= '+string(RL)+ ' ohm') //Load resistance\n", +"RF=6*10^(3) \n", +"disp('RF= '+string(RF)+ ' ohm') // feedback resistance \n", +"R1=12*10^(6)\n", +"disp('R1= '+string(R1)+ ' ohm') // first resistance R1 at input side\n", +"R2=8.57*10^(6)\n", +"disp('R2= '+string(R2)+ ' ohm') // second resistance R2 at input side\n", +"VDD=(24)\n", +"disp('VDD= '+string(VDD)+' volts') // Drain voltage supply\n", +"VT=(3)\n", +"disp('VT= '+string(VT)+' volts') // Threshold voltage for n-channel EMOSFET\n", +"KF=0.375*10^(-3)\n", +"disp('KF= '+string(KF)+' A/V^2') // Constant for n-channel EMOSFET \n", +"VGG=(VDD*R2)/(R1+R2)\n", +"disp('VGG= VDD*R2/(R1+R2)='+string(VGG)+' volts') // Gate voltage for n-channel EMOSFET \n", +"disp('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", +"ID=roots(p)*10^(-3)//values of ID converted into Ampere by multiplying by 10^(-3)\n", +"disp('ID = '+string(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", +"disp('VGS = VGG-ID*RF = '+string(VGS)+' volts') // Gate voltage \n", +"disp('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", +"disp('IDQ ='+string(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", +"disp('change in IDQ = '+string(change_IDQ)+' percent')// Percent change in IDQ from value 1 mA from its actual value IDQ=0.91mA\n", +"VGSQ=VGG-IDQ*RF\n", +"disp('VGSQ = VGG-IDQ*RF = '+string(VGSQ)+' volts') // Gate operating point voltage \n", +"VDSQ=VDD-IDQ*(RL+RF)\n", +"disp('VDSQ= VDD-IDQ*(RL+RF)= '+string(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: Calculate_load_resistance_RL_and_percentage_change_in_drain_current_ID_for_JFET.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//Ex4_11 Refer fig 4.7(b)// ANS is not correct check &correct\n", +"clc\n", +"RF=6*10^(3) \n", +"disp('RF= '+string(RF)+ ' ohm') // feedback resistance \n", +"VDD=(20)\n", +"disp('VDD= '+string(VDD)+' volts') // Drain voltage supply\n", +"disp('part(i) ')// part(i) of this question\n", +"VT=(2)\n", +"disp('VT= '+string(VT)+' volts') // Threshold voltage for EMOSFET\n", +"KF=0.25*10^(-3)\n", +"disp('KF= '+string(KF)+' A/V^2') // Constant for EMOSFET \n", +"ID=1*10^(-3)\n", +"disp('ID = '+string(ID)+' A') // drain current EMOSFET in Ampere \n", +"RL=[VDD-VT-sqrt(ID/KF)]/ID // Using formulae ID=KF*(VDD-ID*RL-VT)\n", +"disp('RL=[VDD-VT-sqrt(ID/KF)]/ID= '+string(RL)+ ' ohm') //Load resistance\n", +"disp('part(ii) ')// part(ii) of this question\n", +"VT=(3)\n", +"disp('VT= '+string(VT)+' volts') // Threshold voltage for EMOSFET\n", +"KF=0.375*10^(-3)\n", +"disp('KF= '+string(KF)+' A/V^2') // Constant for EMOSFET \n", +"disp('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", +"ID=roots(p)*10^(-3)//values of ID converted into Ampere by multiplying by 10^(-3)\n", +"disp('ID = '+string(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", +"disp('VDS =VDD-ID*RL = '+string(VDS)+' volts') // Drain voltage \n", +"IDQ=0.962*10^(-3)\n", +"disp('IDQ ='+string(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", +"disp('Percentage change= '+string(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 % " + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 4.12: Find_ON_stage_output_voltage_VDON_for_EMOSFET.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//Ex4_12 Refer fig 4.9(a)and fig 4.9(b)\n", +"clc\n", +"VDD=(5)\n", +"disp('VDD= '+string(VDD)+' volts') // Drain voltage supply\n", +"RL1=125*10^(3)\n", +"disp('RL1= '+string(RL1)+ ' ohm') //Load resistance\n", +"RL2=200*10^(3)\n", +"disp('RL2= '+string(RL2)+ ' ohm') //Load resistance\n", +"IDON1=34.88*10^(-6)\n", +"disp('IDON1 ='+string(IDON1)+' A')//Drain current for load line 1 from fig.\n", +"IDON2=22.5*10^(-6)\n", +"disp('IDON2 ='+string(IDON2)+' A')//Drain current for load line 2 from fig.\n", +"VDON1=VDD-IDON1*RL1\n", +"disp('VDON1=VDD-IDON1*RL1= '+string(VDON1)+' volts') // output voltage at drain terminal for IDON1\n", +"VDON2=VDD-IDON2*RL2\n", +"disp('VDON2=VDD-IDON2*RL2= '+string(VDON2)+' volts') // output voltage at drain terminal for IDON2" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 4.13: Verify_DEMOSFET_act_as_DC_constant_current_source.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//Ex4_13\n", +"clc\n", +"IDSS=10*10^(-3)\n", +"disp('IDSS = '+string(IDSS)+' ampere') // maximum drain current for n-channel DEMOSFET\n", +"ID=IDSS // since VGS=0V, so ID=maximum\n", +"VP=(-4)\n", +"disp('VP= '+string(VP)+' volts') // pinch off voltage \n", +"VGS=(0)\n", +"disp('VGS= '+string(VGS)+' volts') // Gate to source voltage \n", +"VDD=(10)\n", +"disp('VDD= '+string(VDD)+' volts') // Drain supply voltage \n", +"RL=0.5*10^(3)\n", +"disp('RL= '+string(RL)+ ' ohm') //Load resistance\n", +"VDS=VDD-ID*RL\n", +"disp('VDS=VDD-ID*RL= '+string(VDS)+' volts') // Drain to source voltage ,since VDS>VP DEMOSFET is in pinch off\n", +"disp('VDS>VP,so pinch off region')\n", +"RL=0.75*10^(3)\n", +"disp('RL= '+string(RL)+ ' ohm') // New Load resistance value\n", +"VDS=VDD-ID*RL\n", +"disp('VDS=VDD-ID*RL= '+string(VDS)+' volts') // New Drain to source voltage for RL=750 ohm\n", +"disp('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: Find_resistance_value_to_obtain_constant_current_source_for_MOS_current_mirror.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//Ex4_14\n", +"clc\n", +"KF1=0.25*10^(-3)\n", +"disp('KF1 = '+string(KF1)+' A/V^2') // Scale factor \n", +"KF2=KF1\n", +"disp('KF2 = '+string(KF2)+' A/V^2') // Scale factor \n", +"IQ=1*10^(-3)\n", +"disp('IQ= '+string(IQ)+' ampere') // constant current source value\n", +"VT1=2\n", +"disp('VT1 = '+string(VT1)+' volts')// Threshold voltage\n", +"VT2=VT1\n", +"disp('VT2 = '+string(VT2)+' volts')// Threshold voltage\n", +"VDD=(15)\n", +"disp('VDD= '+string(VDD)+' volts') // Drain supply voltage \n", +"IREF=IQ\n", +"disp('IREF =IQ= '+string(IREF)+' ampere') // Reference current value\n", +"VGS=VT1+sqrt(2*IREF/KF1) // Formulae\n", +"disp('VGS= VT1+sqrt(2*IREF/KF1)='+string(VGS)+' volts') // Gate to source voltage \n", +"R=(VDD-VGS)/IREF\n", +"disp('R= (VDD-VGS)/IREF='+string(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: Determine_ON_voltage_and_off_isolation_errors_for_RL_and_analog_shunt_switch.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//Ex4_15\n", +"clc\n", +"RON=100\n", +"disp('RON= '+string(RON)+ ' ohm') //ON resistance of analog series switch\n", +"ROFF=10^(10)\n", +"disp('ROFF= '+string(ROFF)+ ' ohm') //OFF resistance analog series switch\n", +"Vip=1\n", +"disp('Vip= '+string(Vip)+' volts')// Peak amplitude of analog voltage\n", +"Rs=100\n", +"disp('Rs= '+string(Rs)+ ' ohm') //Voltage source resistance\n", +"RL=10*10^(3)\n", +"disp('RL= '+string(RL)+ ' ohm') //Load resistance\n", +"disp('part(i) ')// part(i) of this question\n", +"Vo=(Vip*RL)/(RL+RON+Rs)\n", +"disp('Vo=(Vip*RL)/(RL+RON+Rs)= '+string(Vo)+' volts')// ON voltage\n", +"ErON=[Vip*(RON+Rs)/(RL+RON+Rs)]*100\n", +"disp('ErON=[Vip*(RON+Rs)/(RL+RON+Rs)]*100= '+string(ErON)+' percent')// Output voltage error \n", +"vOFF=(Vip*RL)/ROFF\n", +"disp('vOFF=(Vip*RL)/ROFF= '+string(vOFF)+' volts')// Output voltage in OFF state\n", +"OFF_isolation=20*log10(Vip/vOFF)\n", +"disp('OFF_isolation=20*log10(Vip/vOFF)= '+string(OFF_isolation)+' dB') // OFF_isolation=20*log10(Vip/vOFF) in dB// Thus ON error and OFF isolation decrease with increasing values of RL.\n", +"disp('part(ii) ')// part(ii) of this question\n", +"vOFF=(Vip*RON)/(Rs+RON)\n", +"disp('vOFF=(Vip*RON)/(Rs+RON)= '+string(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", +"disp('OFF_isolation=20*log10((Rs+RON)/RON)= '+string(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.\n", +"\n", +"" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 4.1: Find_drain_to_source_voltage_VDS_and_drain_current_ID_for_JFET.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//Ex4_1\n", +"clc\n", +"IDSS=10*10^(-3)\n", +"disp('IDSS = '+string(IDSS)+' ampere') // maximum drain current\n", +"VP=(-4)\n", +"disp('VP= '+string(VP)+' volts') // pinch off voltage \n", +"VGS=(-2)\n", +"disp('VGS = '+string(VGS)+' volts') // gate to source voltage \n", +"VDSmin=VGS-VP\n", +"disp('VDSmin =VGS-VP='+string(VDSmin)+' volts') // Drain to source voltage \n", +"ID=IDSS*(1-VGS/VP)^2\n", +"disp('ID =IDSS*(1-VGS/VP)^2= '+string(ID)+' ampere') // drain current" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 4.2: Find_drain_to_source_resistance_RDS_for_JFET.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//Ex4_2\n", +"clc\n", +"IDSS=10*10^(-3)\n", +"disp('IDSS = '+string(IDSS)+' ampere') // maximum drain current\n", +"VP=(-4)\n", +"disp('VP= '+string(VP)+' volts') // pinch off voltage \n", +"VGS=(0)\n", +"disp('VGS = '+string(VGS)+' volts') // gate to source voltage1 \n", +"RDS=1/[(2*(IDSS/(-VP)))*(1-VGS/VP)]//formula for JFET\n", +"disp('RDS = 1/[(2*(IDSS/(-VP)))*(1-VGS/VP)]='+string(RDS)+' ohm') // drain to source resistance for VGS=0V\n", +"VGS=(-2)\n", +"disp('VGS = '+string(VGS)+' volts') // gate to source voltage2 \n", +"RDS=1/[(2*(IDSS/(-VP)))*(1-VGS/VP)]\n", +"disp('RDS = 1/[(2*(IDSS/(-VP)))*(1-VGS/VP)]='+string(RDS)+' ohm') // drain to source resistance for VGS=(-2)\n", +"\n", +"" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 4.3: Find_load_resistance_RL_for_EMOSFET.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//Ex4_3\n", +"clc\n", +"ID=10*10^(-3)\n", +"disp('ID = '+string(ID)+' ampere') // given drain current \n", +"VDD=(24)\n", +"disp('VDD= '+string(VDD)+' volts') // Drain voltage \n", +"VT=(5)\n", +"disp('VT= '+string(VT)+' volts') // Threshold voltage \n", +"VGS=(10)\n", +"disp('VGS= '+string(VGS)+' volts') // gate to source voltage1 \n", +"KF=ID/(VGS-VT)^2\n", +"disp('KF = ID/(VGS-VT)^2 = '+string(KF)+' A/V^2') // To calculate Scale factor for finding ID2\n", +"VDS=(7)\n", +"disp('VDS =VGS= '+string(VDS)+' volts') // drain to source voltage \n", +"VGS=(VDS)\n", +"ID=KF*(VGS-VT)^2\n", +"disp('ID =KF*(VGS-VT)^2= '+string(ID)+' ampere') // New drain current for VDS=24V\n", +"RL=(VDD-VDS)/ID\n", +"disp('RL=(VDD-VDS)/ID= '+string(RL)+ ' ohm') //calculation for load resistance at VDS=24V\n", +"" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 4.4: calculate_transconductance_gm_for_FETs_at_various_device_parameters.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//Ex4_4\n", +"clc\n", +"disp('part(i) ')// part(i) of this question\n", +"IDSS=5*10^(-3)\n", +"disp('IDSS = '+string(IDSS)+' ampere') // maximum drain current JFET 1\n", +"VP=(2)\n", +"disp('VP= '+string(VP)+' volts') // pinch off voltage for JFET 1\n", +"IDQ=4.42*10^(-3)\n", +"disp('IDQ = '+string(IDQ)+' ampere') // drain current for JFET 1\n", +"gm=[(2)*sqrt(IDQ*IDSS)]/VP\n", +"disp('gm =[(2)*sqrt(IDQ*IDSS)]/VP= '+string(gm)+' A/V')// calculating transconductance for JFET with IDQ = 4.42 mA\n", +"\n", +"disp('part(ii) ')// part(ii) of this question\n", +"IDQ=6.04*10^(-3)\n", +"disp('IDQ = '+string(IDQ)+' ampere') // drain current for JFET 1\n", +"IDSS=15*10^(-3)\n", +"disp('IDSS = '+string(IDSS)+' ampere') // maximum drain current JFET2\n", +"VP=(6)\n", +"disp('VP= '+string(VP)+' volts') // pinch off voltage for JFET2 \n", +"gm=[(2)*sqrt(IDQ*IDSS)]/VP\n", +"disp('gm =[(2)*sqrt(IDQ*IDSS)]/VP= '+string(gm)+' A/V')// calculating transconductance for JFET with IDQ = 6.04 mA\n", +"\n", +"disp('part(iii) ')// part(iii) of this question\n", +"IDQ=1*10^(-3)\n", +"disp('IDQ = '+string(IDQ)+' ampere') // drain current for EMOSFET 1\n", +"KF=0.25*10^(-3)\n", +"disp('KF = '+string(KF)+' A/V^2') // Scale factor for finding EMOSFET1\n", +"gm=sqrt(4*IDQ*KF)\n", +"disp('gm =sqrt(4*IDQ*KF)= '+string(gm)+' A/V')// calculating transconductance for EMOSFET1 with IDQ = 1 mA\n", +"\n", +"disp('part(iv) ')// part(iv) of this question\n", +"IDQ=0.91*10^(-3)\n", +"disp('IDQ = '+string(IDQ)+' ampere') // drain current for EMOSFET 2\n", +"KF=0.375*10^(-3)\n", +"disp('KF = '+string(KF)+' A/V^2') // Scale factor for finding EMOSFET2\n", +"gm=sqrt(4*IDQ*KF)\n", +"disp('gm =sqrt(4*IDQ*KF)= '+string(gm)+' A/V')// calculating transconductance for EMOSFET2 with IDQ = 0.91 mA\n", +"\n", +"\n", +"\n", +"" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 4.5: Design_potential_divider_biasing_for_JFET.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//Ex4_5\n", +"//Refer fig.4.8\n", +"clc\n", +"IDQmax=5*10^(-3)\n", +"disp('IDQmax = '+string(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", +"disp('IDQmin = '+string(IDQmin)+' ampere') // drain current for JFET for minimum transfer characteristics \n", +"VDD=(20)\n", +"disp('VDD= '+string(VDD)+' volts') // Drain voltage supply\n", +"VDSmin=(6)\n", +"disp('VDSmin= '+string(VDSmin)+' volts') // minimum Drain to source voltage supply\n", +"ID=2.4*10^(-3)\n", +"disp('ID = '+string(ID)+' ampere') // drain current chosen for operation within max and min limits \n", +"VGG=3\n", +"disp('VGG= '+string(VGG)+' volts') // Gate voltage from fig.\n", +"Ri=100*10^(3)\n", +"disp('Ri= '+string(Ri)+ ' ohm') //eqivalent input resistance\n", +"RF=(VGG-0)/(ID-0)\n", +"disp('RF= (VGG-0)/(ID-0)= '+string(RF)+ ' ohm') //calculation for feedback resistance \n", +"R1=VDD*Ri/VGG //using formulae VGG=VDD*Ri/R1\n", +"disp('R1= VDD*Ri/VGG= '+string(R1)+ ' ohm') //calculation for first resistance R1 at input side\n", +"R2=R1*VGG/(VDD-VGG)\n", +"disp('R2= R1*VGG/(VDD-VGG)= '+string(R2)+ ' ohm') //calculation for second resistance R2 at input side\n", +"RL=[((VDD-VDSmin)/IDmax)-RF] // using formulae VDD=IDmax(RL+RF)+VDSmin\n", +"disp('RL=[((VDD-VDSmin)/IDmax)-RF]='+string(RL)+ ' ohm') //Load resistance calculation\n", +"\n", +"\n", +"\n", +"" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 4.6: calculate_feedback_resistance_RF_for_n_channel_JFET.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//Ex4_6\n", +"clc\n", +"IDSS=50*10^(-3)\n", +"disp('IDSS = '+string(IDSS)+' ampere') // maximum drain current JFET \n", +"VP=(-10)\n", +"disp('VP= '+string(VP)+' volts') // pinch off voltage for JFET \n", +"VGSQ=(-5)\n", +"disp('VGSQ= '+string(VGSQ)+' volts') // Gate operating point voltage \n", +"ID=IDSS*(1-VGSQ/VP)^2\n", +"disp('ID =IDSS*(1-VGS/VP)^2= '+string(ID)+' ampere') // drain current JFET \n", +"RF=abs(VGSQ/ID) \n", +"disp('RF= (VGSQ)/(ID)= '+string(RF)+ ' ohm') //calculation for feedback resistance " + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 4.7: Find_drain_current_ID_and_verify_operating_region_is_pinch_off.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//Ex4_7 \n", +"clc\n", +"IDSS=5*10^(-3)\n", +"disp('IDSS = '+string(IDSS)+' ampere') // maximum drain current JFET \n", +"RL=910\n", +"disp('RL= '+string(RL)+ ' ohm') //Load resistance\n", +"RF=2.29*10^(3) \n", +"disp('RF= '+string(RF)+ ' ohm') // feedback resistance \n", +"R1=12*10^(6)\n", +"disp('R1= '+string(R1)+ ' ohm') // first resistance R1 at input side\n", +"R2=8.57*10^(6)\n", +"disp('R2= '+string(R2)+ ' ohm') // second resistance R2 at input side\n", +"VDD=(24)\n", +"disp('VDD= '+string(VDD)+' volts') // Drain voltage supply\n", +"VP=(-2)\n", +"disp('VP= '+string(VP)+' volts') // pinch off voltage for JFET \n", +"VGG=(VDD*R2)/(R1+R2)\n", +"disp('VGG= VDD*R2/(R1+R2)='+string(VGG)+' volts') // Gate voltage for JFET\n", +"disp('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", +"ID=roots(p)*10^(-3)// values of ID converted into Ampere by multiplying by 10^(-3)\n", +"disp('ID = '+string(ID)+' ampere') // drain current JFET \n", +"disp('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", +"disp('IDQ ='+string(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", +"disp('VGSQ = VGG-IDQ*RF = '+string(VGSQ)+' volts') // Gate operating point voltage \n", +"VDSQ=VDD-IDQ*(RL+RF)\n", +"disp('VDSQ= VDD-IDQ*(RL+RF)= '+string(VDSQ)+' volts') // Drain voltage for JFET\n", +"VDGQ=VDSQ-VGSQ\n", +"disp('VDGQ = VDSQ-VGSQ ='+string(VDGQ)+' volts') // Drain-Gate voltage for JFET\n", +"disp('VDGQ >magnitude_VP,Hence FET is in pinch off region')" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 4.8: EX4_8.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//Ex4_8// NOTE :all values of book ans is wrong so give note-INCOMPLETE QUESTION\n", +"clc\n", +"IDSS=15*10^(-3)\n", +"disp('IDSS = '+string(IDSS)+' ampere') // maximum drain current of JFET \n", +"RL=910\n", +"disp('RL= '+string(RL)+ ' ohm') //Load resistance\n", +"RF=2.29*10^(3) \n", +"disp('RF= '+string(RF)+ ' ohm') // feedback resistance \n", +"R1=12*10^(6)\n", +"disp('R1= '+string(R1)+ ' ohm') // first resistance R1 at input side\n", +"R2=8.57*10^(6)\n", +"disp('R2= '+string(R2)+ ' ohm') // second resistance R2 at input side\n", +"VDD=(24)\n", +"disp('VDD= '+string(VDD)+' volts') // Drain voltage supply\n", +"VP=(-6)\n", +"disp('VP= '+string(VP)+' volts') // pinch off voltage for JFET \n", +"VGG=(VDD*R2)/(R1+R2)\n", +"disp('VGG= VDD*R2/(R1+R2)='+string(VGG)+' volts') // Gate voltage for JFET\n", +"disp('Quadratic equation =5.244*ID^(2)-75.68*ID+256=0')// where ID in mA\n", +"p = [5.244 -75.68 256]\n", +"ID=roots(p)*10^(-3)//values of ID converted into Ampere by multiplying by 10^(-3)\n", +"disp('ID = '+string(ID)+' ampere') // drain current JFET \n", +"VDG=VDD-(ID*RL)-VGG\n", +"disp('VDG= '+string(VDG)+' volts') // Drain-gate voltage for JFET\n", +"disp('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", +"disp('IDQ ='+string(IDQ)+' ampere')\n", +"VGSQ=VGG-IDQ*RF\n", +"disp('VGSQ = VGG-IDQ*RF = '+string(VGSQ)+' volts') // Gate operating point voltage \n", +"VDSQ=VDD-IDQ*(RL+RF)\n", +"disp('VDSQ= VDD-IDQ*(RL+RF)= '+string(VDSQ)+' volts') // Drain voltage for JFET\n", +"VDGQ=VDSQ-VGSQ\n", +"disp('VDGQ = VDSQ-VGSQ ='+string(VDGQ)+' volts') // Drain-Gate voltage for JFET\n", +"disp('VDGQ > VP,Hence FET is in pinch off region')\n", +"\n", +"\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: EX4_9.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//Ex4_9\n", +"clc\n", +"RL=12*10^(3)\n", +"disp('RL= '+string(RL)+ ' ohm') //Load resistance\n", +"RF=6*10^(3) \n", +"disp('RF= '+string(RF)+ ' ohm') // feedback resistance \n", +"R1=12*10^(6)\n", +"disp('R1= '+string(R1)+ ' ohm') // first resistance R1 at input side\n", +"R2=8.57*10^(6)\n", +"disp('R2= '+string(R2)+ ' ohm') // second resistance R2 at input side\n", +"VDD=(24)\n", +"disp('VDD= '+string(VDD)+' volts') // Drain voltage supply\n", +"VT=(3)\n", +"disp('VT= '+string(VT)+' volts') // Threshold voltage for n-channel EMOSFET\n", +"KF=0.25*10^(-3)\n", +"disp('KF= '+string(KF)+' A/V^2') // Constant for n-channel EMOSFET \n", +"VGG=(VDD*R2)/(R1+R2)\n", +"disp('VGG= VDD*R2/(R1+R2)='+string(VGG)+' volts') // Gate voltage for n-channel EMOSFET \n", +"disp('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", +"ID=roots(p)*10^(-3)//values of ID converted into Ampere by multiplying by 10^(-3)\n", +"disp('ID = '+string(ID)+' A') // drain current n-channel EMOSFET in Ampere \n", +"VGS=VGG-ID*RF// For ID=1.78 mA and ID=1mA\n", +"disp('VGS = VGG-ID*RF = '+string(VGS)+' volts') // Gate operating point voltage \n", +"disp('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", +"disp('IDQ ='+string(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", +"disp('VGSQ = VGG-IDQ*RF = '+string(VGSQ)+' volts') // Gate operating point voltage \n", +"VDSQ=VDD-IDQ*(RL+RF)\n", +"disp('VDSQ= VDD-IDQ*(RL+RF)= '+string(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" + ] + } +], +"metadata": { + "kernelspec": { + "display_name": "Scilab", + "language": "scilab", + "name": "scilab" + }, + "language_info": { + "file_extension": ".sce", + "help_links": [ + { + "text": "MetaKernel Magics", + "url": "https://github.com/calysto/metakernel/blob/master/metakernel/magics/README.md" + } + ], + "mimetype": "text/x-octave", + "name": "scilab", + "version": "0.7.1" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/Electronics_Circuits_and_Systems_by_Y_N_Bapat/5-Basic_Transistor_Amplifiers.ipynb b/Electronics_Circuits_and_Systems_by_Y_N_Bapat/5-Basic_Transistor_Amplifiers.ipynb new file mode 100644 index 0000000..8394e69 --- /dev/null +++ b/Electronics_Circuits_and_Systems_by_Y_N_Bapat/5-Basic_Transistor_Amplifiers.ipynb @@ -0,0 +1,415 @@ +{ +"cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 5: Basic Transistor Amplifiers" + ] + }, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 5.1: EX5_1.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//Ex5_1\n", +"clc\n", +"RL=5*10^(3)\n", +"disp('RL= '+string(RL)+ ' ohm') //Load resistance\n", +"R1=100*10^(3)\n", +"disp('R1= '+string(R1)+ ' ohm') // resistance\n", +"R2=10*10^(3)\n", +"disp('R2= '+string(R2)+ ' ohm') // resistance\n", +"rc=50*10^(3)\n", +"disp('rc= '+string(rc)+ ' ohm') //collector resistance\n", +"rd=rc // Drain and collector resistance are equal\n", +"rbe=1*10^(3)\n", +"disp('rbe= '+string(rbe)+ ' ohm') //Load resistance\n", +"gm=50*10^(-3)\n", +"disp('gm = '+string(gm)+' A/V')// transconductance for BJT \n", +"Av=(-gm*RL)\n", +"disp('For BJT,Av=(-gm*RL)= '+string(Av)) //Voltage gain for BJT\n", +"AI=gm*rbe\n", +"disp('AI=(gm*rbe)= '+string(AI)) // current gain for BJT\n", +"gm=5*10^(-3)\n", +"disp('gm = '+string(gm)+' A/V')// transconductance for FET \n", +"Av=(-gm*RL)\n", +"disp('For FET,Av=(-gm*RL)= '+string(Av)+ ' ') // gain for FET\n", +"R0=rd\n", +"disp('R0= '+string(R0)+ ' ohm') //output resistance for FET and BJT\n", +"Ri=rbe\n", +"disp('Ri= '+string(Ri)+ ' ohm') //BJT input resistance \n", +"RB=(R1*R2)/(R1+R2)\n", +"disp('RB=(R1*R2)/(R1+R2)= '+string(RB)+ ' ohm') // eqivalent Base resistance for BJT\n", +"Ri=(RB*rbe)/(RB+rbe)\n", +"disp('Ri= (RB*rbe)/(RB+rbe)='+string(Ri)+ ' ohm') //New value of BJT input resistance " + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 5.2: EX5_2.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//Ex5_2\n", +"clc\n", +"RL=5*10^(3)\n", +"disp('RL= '+string(RL)+ ' ohm') //Load resistance\n", +"R1=100*10^(3)\n", +"disp('R1= '+string(R1)+ ' ohm') // resistance\n", +"R2=100*10^(3)\n", +"disp('R2= '+string(R2)+ ' ohm') // resistance\n", +"Rs=5*10^(3)\n", +"disp('Rs= '+string(Rs)+ ' ohm') // Source resistance\n", +"Beta_o=50\n", +"disp('Beta_o = '+string(Beta_o)) //BJT gain\n", +"rbe=1*10^(3)\n", +"disp('rbe= '+string(rbe)+ ' ohm') //Base-emitter resistance\n", +"gm=50*10^(-3)\n", +"disp('gm = '+string(gm)+' A/V')// transconductance for BJT \n", +"rc=50*10^(3)\n", +"disp('rc= '+string(rc)+ ' ohm') //collector resistance\n", +"Av=RL/(RL+1/gm) // Gain formulae\n", +"disp('Av=RL/(RL+1/gm)= '+string(Av)) // voltage gain for BJT\n", +"Avs=RL/[(Rs/Beta_o)+(1/gm)+(RL)]\n", +"disp('Avs=RL/[(Rs/Beta_o)+(1/gm)+(RL)]= '+string(Avs)) // Overall voltage gain for BJT\n", +"AI=-(Beta_o+1)\n", +"disp('AI=-(Beta_o+1)= '+string(AI)) // current gain for BJT\n", +"R0=(Rs+rbe)/Beta_o\n", +"disp('R0= (Rs+rbe)/Beta_o='+string(R0)+ ' ohm') //output resistance for BJT\n", +"Ri=rbe+Beta_o*RL // formulae\n", +"disp('Ri= rbe+Beta_o*RL='+string(Ri)+ ' ohm') // value of BJT input resistance \n", +"RB=(R1*R2)/(R1+R2)\n", +"disp('RB=(R1*R2)/(R1+R2)= '+string(RB)+ ' ohm') // eqivalent Base resistance for BJT\n", +"Rieff=(Ri*RB)/(RB+Ri)\n", +"disp('Rieff= (Ri*RB)/(RB+Ri)='+string(Rieff)+ ' ohm') //Effective value of BJT input resistance \n", +"" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 5.3: EX5_3.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//Ex5_3\n", +"clc\n", +"RL=5*10^(3)\n", +"disp('RL= '+string(RL)+ ' ohm') //Load resistance\n", +"RF=5*10^(3)\n", +"disp('RF= '+string(RF)+ ' ohm') // resistance\n", +"Beta_o=50\n", +"disp('Beta_o = '+string(Beta_o)) //BJT gain\n", +"rbe=1*10^(3)\n", +"disp('rbe= '+string(rbe)+ ' ohm') //Base-emitter resistance\n", +"gm=50*10^(-3)\n", +"disp('gm = '+string(gm)+' A/V')// transconductance for BJT \n", +"rc=50*10^(3)\n", +"disp('rc= '+string(rc)+ ' ohm') //collector resistance\n", +"Ri=rbe+RF*(1+gm*rbe) // formulae\n", +"disp('Ri= rbe+RF*(1+gm*rbe)='+string(Ri)+ ' ohm') // BJT input resistance \n", +"Av=(-gm*RL)/(1+gm*RF)// formulae\n", +"disp('Av=(-gm*RL)/(1+gm*RF)= '+string(Av)) // voltage gain for BJT\n", +"AI=Beta_o\n", +"disp('AI=(Beta_o)= '+string(AI)) // current gain for BJT\n", +"R0=Beta_o*rc\n", +"disp('R0= Beta_o*rc='+string(R0)+ ' ohm') //output resistance for BJT" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 5.4: EX5_4.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//Ex5_4\n", +"clc\n", +"RL=5*10^(3)\n", +"disp('RL= '+string(RL)+ ' ohm') //Load resistance\n", +"RF=2.5*10^(3)\n", +"disp('RF= '+string(RF)+ ' ohm') // resistance\n", +"Rs=50\n", +"disp('Rs= '+string(Rs)+ ' ohm') // resistance\n", +"ro=50*10^(3)\n", +"disp('ro= '+string(ro)+ ' ohm') // output resistance\n", +"rd=ro // drain resistance\n", +"rc=ro// Collector resistance\n", +"disp('rc= '+string(rc)+ ' ohm') // Collector resistance\n", +"rbe=1*10^(3)\n", +"disp('rbe= '+string(rbe)+ ' ohm') //base -emitter resistance\n", +"disp('For CG Amplifier')\n", +"gm=5*10^(-3)\n", +"disp('gm = '+string(gm)+' A/V')// transconductance for FET \n", +"Ri=1/gm // formulae\n", +"disp('Ri= 1/gm='+string(Ri)+ ' ohm') // value of CGA (common gate amplifier)input resistance for FET\n", +"Avs=gm*RL/(1+gm*Rs)\n", +"disp('Avs=gm*RL/(1+gm*Rs)= '+string(Avs)) // Overall voltage gain for FET (CGA)\n", +"Ro=rd*(1+gm*Rs)\n", +"disp('Ro=rd*(1+gm*Rs)='+string(Ro)+ ' ohm') //output resistance for FET (CGA)\n", +"disp('For CB Amplifier')\n", +"gm=50*10^(-3)\n", +"disp('gm = '+string(gm)+' A/V')// transconductance for BJT\n", +"Ri=1/gm // formulae\n", +"disp('Ri= 1/gm='+string(Ri)+ ' ohm') // value of CBA (common base amplifier)input resistance for BJT\n", +"Avs=gm*RL/(1+gm*Rs)\n", +"disp('Avs=gm*RL/(1+gm*Rs)= '+string(Avs)) // Overall voltage gain for BJT (CBA)\n", +"Ro=gm*(rbe*rc)\n", +"disp('Ro=gm*(rbe*rc)='+string(Ro)+ ' ohm') //output resistance for BJT (CBA)\n", +"\n", +"//NOTE: I have calculated first all the parameters for CG amplifier and then for CB amplifier but in book parameters have been calculated alternatingly for CG and CB amplifiers." + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 5.5: Find_high_cut_off_frequency_and_bandwidth_and_unity_gain_bandwidth.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//Ex5_5\n", +"clc\n", +"RL=5*10^(3)\n", +"disp('RL= '+string(RL)+ ' ohm') //Load resistance\n", +"Cc=0.1*10^(-6)\n", +"disp('Cc= '+string(Cc)+ ' farad') //capacitance\n", +"Ri=100*10^(3)\n", +"disp('Ri= '+string(Ri)+ ' ohm') // input resistance for Amplifier\n", +"CSH=100*10^(-12)\n", +"disp('CSH= '+string(CSH)+ ' farad') //shunt load capacitance\n", +"Avm=100\n", +"disp('Avm='+string(Avm)) // Mid-frequency gain \n", +"fL=1/[2*(%pi)*(Ri)*(Cc)]\n", +"disp('fL=1/[2*(%pi)*(Ri)*(Cc)]= '+string(fL)+ 'Hz ') // Lower cutoff-frequency \n", +"fH=1/[2*(%pi)*(RL)*(CSH)]\n", +"disp('fH=1/[2*(%pi)*(RL)*(CSH)]= '+string(fH)+ ' Hz') // Higher cutoff-frequency \n", +"BW=fH-fL\n", +"disp('BW=fH-fL= '+string(BW)+ ' Hz') // Bandwidth\n", +"fT=Avm*fH\n", +"disp('fT=Avm*fH= '+string(fT)+ ' Hz') // Unity gain bandwidth\n", +"// ERROR NOTE: calculated value of lower cutoff frequency, fL= 15.915494 Hz but in book given as 15.0 Hz \n", +" " + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 5.6: Find_percentage_second_harmonic_distortion_in_small_signal_CS_JFET_amplifier.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//Ex5_6\n", +"clc\n", +"IDSS=16*10^(-3)\n", +"disp('IDSS = '+string(IDSS)+' ampere') // maximum drain current JFET \n", +"VP=(-4)\n", +"disp('VP= '+string(VP)+' volts') // pinch off voltage for JFET \n", +"VGSQ=(-2)\n", +"disp('VGSQ= '+string(VGSQ)+' volts') // Gate operating point voltage \n", +"Vsm=(0.2)\n", +"disp('Vsm= '+string(Vsm)+' volts') // sinusoidal input voltage for JFET \n", +"D=[((0.5)*(Vsm)^2)/(4*Vsm)]*100 // derived from ID=IDSS(1-VGS/VP)^2 and putting value of VGS=VGSQ+Vs, where Vs=Vsm sinwt\n", +"disp('D=[((0.5)*(Vsm)^2)/(4*Vsm)]*100 ='+string(D)+'% ') // Percentage second harmonic distortion calculation" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 5.7: Compare_perrformance_of_CE_and_CC_and_CB_configuration_of_BJT.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//Ex5_7 \n", +"clc\n", +"Ic=1*10^(-3)\n", +"disp('Ic = '+string(Ic)+' ampere') // collector current BJT\n", +"rbe=2*10^(3)\n", +"disp('rbe= '+string(rbe)+ ' ohm') //base -emitter resistance\n", +"gm=50*10^(-3)\n", +"disp('gm = '+string(gm)+' A/V')// transconductance for BJT\n", +"Beta_o=100\n", +"disp('Beta_o = '+string(Beta_o)+' ') //BJT gain\n", +"rc=50*10^(3)\n", +"disp('rc= '+string(rc)+ ' ohm') //collector resistance\n", +"Cbe=10*10^(-12)\n", +"disp('Cbe= '+string(Cbe)+ ' farad') //base -emitter capacitance\n", +"Ctc=1*10^(-12)\n", +"disp('Ctc= '+string(Ctc)+ ' farad') //input device capacitance\n", +"disp('part(i)')// part(i)of question\n", +"RL=10*10^(3)\n", +"disp('RL= '+string(RL)+ ' ohm') //Load resistance\n", +"Rs=500\n", +"disp('Rs= '+string(Rs)+ ' ohm') //input source resistance\n", +"Rth=(Rs*rbe)/(Rs+rbe)\n", +"disp('Rth=(Rs*rbe)/(Rs+rbe)='+string(Rth)+ ' ohm') // eqivalent resistance\n", +"Avm=(-gm*RL)\n", +"disp('Avm=(-gm*RL)='+string(Avm)) // Mid-frequency gain for CE amplifier\n", +"CM=Ctc*(1-Avm)\n", +"disp('CM=Ctc*(1-Avm)= '+string(CM)+ ' farad') //calculated capacitance\n", +"Ci=Cbe\n", +"disp('Ci=Cbe= '+string(Ci)+ ' farad') //calculated input capacitance\n", +"fHi=1/[2*(%pi)*(Rth)*(Cbe+CM)]\n", +"disp('fHi=1/[2*(%pi)*(Rth)*(Cbe+CM)]= '+string(fHi)+ ' Hz') // Higher-frequency cutoff for CE amplifier\n", +"Ri=rbe\n", +"disp('Ri=rbe ='+string(Ri)+ ' ohm') //input resistance CE amplifier\n", +"Ro=rc\n", +"disp('R0= rc='+string(Ro)+ ' ohm') //output resistance for CE amplifier\n", +"fB=1/[2*(%pi)*(rbe)*(Cbe)]\n", +"disp('fB=1/[2*(%pi)*(rbe)*(Cbe)]= '+string(fB)+ ' Hz') // base terminal frequency cutoff\n", +"fT=Beta_o*fB\n", +"disp('fT=Beta_o*fB= '+string(fT)+ ' Hz') // Unity gain bandwidth for CE amplifier\n", +"disp('part(ii)')// part(ii)of question\n", +"Rs=50*10^(3)\n", +"disp('Rs= '+string(Rs)+ ' ohm') //input source resistance for CC amplifier\n", +"RL=1*10^(3)\n", +"disp('RL= '+string(RL)+ ' ohm') //Load resistance for CC amplifier\n", +"fhi=1/[2*(%pi)*(Rs)*(Ctc)]\n", +"disp('fhi=1/[2*(%pi)*(Rs)*(Ctc)]= '+string(fhi)+ ' Hz') // Higher-frequency cutoff for CC amplifier\n", +"Avm=(gm*RL)/(1+gm*RL)\n", +"disp('Avm=(gm*RL)/(1+gm*RL)='+string(Avm)) // Mid-frequency gain for CC amplifier\n", +"Ro=1/gm\n", +"disp('Ro= 1/gm='+string(Ro)+ ' ohm') //output resistance for CC amplifier\n", +"Ri=Beta_o*RL\n", +"disp('Ri=Beta_o*RL ='+string(Ri)+ ' ohm') //input resistance CE amplifier\n", +"disp('part(iii)')// part(iii)of question\n", +"RL=10*10^(3)\n", +"disp('RL= '+string(RL)+ ' ohm') //Load resistance for CB amplifier\n", +"Rs=50\n", +"disp('Rs= '+string(Rs)+ ' ohm') //input source resistance for CB amplifier\n", +"fHi=gm/[2*(%pi)*(Cbe)]\n", +"disp('fHi=gm/[2*(%pi)*(Cbe)]= '+string(fHi)+ ' Hz') // Higher-frequency cutoff for CB amplifier\n", +"fHo=1/[2*(%pi)*(Ctc)*(RL)]\n", +"disp('fHo=gm/[2*(%pi)*(Ctc)*(RL)]= '+string(fHo)+ ' Hz') // Higher-frequency cutoff for CB amplifier\n", +"Avs=(gm*RL)/(1+gm*Rs)\n", +"disp('Avs=(gm*RL)/(1+gm*Rs)='+string(Avs)) // Mid-frequency gain for CB amplifier\n", +"Ri=1/gm\n", +"disp('Ri= 1/gm='+string(Ri)+ ' ohm') //output resistance for CB amplifier\n", +"Ro=Beta_o*rc\n", +"disp('Ro=Beta_o*rc ='+string(Ro)+ ' ohm') //input resistance CB amplifier\n", +"//ERROR NOTE:some parameters in the book have been calculated using gm=40 mA/V while given value is gm=50 mA/V. So ,for part(ii) CC amplifier correct value of R0=20 ohm,Ri=100000 ohm,and for part(iii)CB amplifier over all voltage gain Avs=142.85714 ,Ri=20 ohm all calculated for gm=50 mA/V." + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 5.8: Find_load_resistance_RL_and_coupling_capacitor.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//Ex5_8\n", +"clc\n", +"tp=10*10^(-3)\n", +"disp('tp= '+string(tp)+' s') // Time period of pulse\n", +"tr=0.05*10^(-6)\n", +"disp('tr= '+string(tr)+' s') // Rise-Time of pulse\n", +"CSH=50*10^(-12)\n", +"disp('CSH= '+string(CSH)+ ' farad') //output capacitor\n", +"tilt=5\n", +"disp('percentage tilt= '+string(tilt)+ '%') //Sag or percentage tilt of output \n", +"Ri=100*10^(3)\n", +"disp('Ri= '+string(Ri)+ ' ohm') // source resistance\n", +"RL=tr/(2.2*CSH)\n", +"disp('RL=tr/(2.2*CSH)= '+string(RL)+ ' ohm') //Load resistance calculation\n", +"Cc=(tp*100)/(tilt*Ri)\n", +"disp('Cc= (tp*100)/( tilt*Ri)='+string(Cc)+ ' farad') //capacitance\n", +"//ERROR NOTE: calculated value of RL=454.54545 ohm but in book given as 455 ohm " + ] + } +], +"metadata": { + "kernelspec": { + "display_name": "Scilab", + "language": "scilab", + "name": "scilab" + }, + "language_info": { + "file_extension": ".sce", + "help_links": [ + { + "text": "MetaKernel Magics", + "url": "https://github.com/calysto/metakernel/blob/master/metakernel/magics/README.md" + } + ], + "mimetype": "text/x-octave", + "name": "scilab", + "version": "0.7.1" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/Electronics_Circuits_and_Systems_by_Y_N_Bapat/6-Multitransistor_Multistage_Amplifiers.ipynb b/Electronics_Circuits_and_Systems_by_Y_N_Bapat/6-Multitransistor_Multistage_Amplifiers.ipynb new file mode 100644 index 0000000..a4629e0 --- /dev/null +++ b/Electronics_Circuits_and_Systems_by_Y_N_Bapat/6-Multitransistor_Multistage_Amplifiers.ipynb @@ -0,0 +1,332 @@ +{ +"cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 6: Multitransistor Multistage Amplifiers" + ] + }, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 6.1: Express_voltage_gains_in_decibels.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//Ex6_1\n", +"clc\n", +"Av=0.1\n", +"disp('Av= '+string(Av)) //Voltage gain\n", +"AvdB=20*log10(Av)\n", +"disp('Av(dB)=20*log10(Av)= '+string(AvdB)+'dB ') //Voltage gain in decibel\n", +"Av=0.707\n", +"disp('Av= '+string(Av)) //Voltage gain\n", +"AvdB=20*log10(Av)\n", +"disp('Av(dB)=20*log10(Av)= '+string(AvdB)+'dB ') //Voltage gain in decibel\n", +"Av=1\n", +"disp('Av= '+string(Av)) //Voltage gain\n", +"AvdB=20*log10(Av)\n", +"disp('Av(dB)=20*log10(Av)= '+string(AvdB)+'dB ') //Voltage gain in decibel\n", +"Av=10\n", +"disp('Av= '+string(Av)) //Voltage gain\n", +"AvdB=20*log10(Av)\n", +"disp('Av(dB)=20*log10(Av)= '+string(AvdB)+'dB ') //Voltage gain in decibel\n", +"Av=100\n", +"disp('Av= '+string(Av)) //Voltage gain\n", +"AvdB=20*log10(Av)\n", +"disp('Av(dB)=20*log10(Av)= '+string(AvdB)+'dB ') //Voltage gain in decibel\n", +"Av=1000\n", +"disp('Av= '+string(Av)) //Voltage gain\n", +"AvdB=20*log10(Av)\n", +"disp('Av(dB)=20*log10(Av)= '+string(AvdB)+'dB ') //Voltage gain in decibel\n", +"//NOTE:calculated voltage gain in dB for Av=0.707 is -3.0116117dB " + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 6.2: Find_voltage_gain_Av_and_current_gain_Ai_and_power_gain_Ap_for_amplifier.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//Ex6_2\n", +"clc\n", +"Ri=0.5*10^(3)\n", +"disp('Ri= '+string(Ri)+ ' ohm') // Amplifier input resistance\n", +"RL=0.05*10^(3)\n", +"disp('RL= '+string(RL)+ ' ohm') // Load resistance\n", +"Vom=1\n", +"disp('Vom= '+string(Vom)+' volts') // Output voltage \n", +"Vo=Vom/sqrt(2)//RMS value of Output voltage \n", +"Vim=1*10^(-3)\n", +"disp('Vim= '+string(Vim)+' volts') // Peak Input voltage\n", +"Vi=Vim/sqrt(2)//RMS Input voltage \n", +"Av=20*log10(Vo/Vi)\n", +"disp('Av(in dB)=20*log10(Vo/Vi)= '+string(Av)+' dB ') //Voltage gain in decibel\n", +"Iim=Vim/Ri\n", +"disp('Iim= Vim/Ri= '+string(Iim)+' A') // Input peak current\n", +"Ii=Iim/sqrt(2) //RMS value of input current\n", +"Iom=Vom/RL \n", +"disp('Iom= Vom/RL= '+string(Iom)+' A') // Output peak current\n", +"Io=Iom/sqrt(2) //RMS value of Output current\n", +"Ai=20*log10(Io/Ii)\n", +"disp('Ai=20*log10(Io/Ii)= '+string(Ai)+' dB ') //Current gain in decibel\n", +"pi=Vi^2/Ri\n", +"disp('pi= Vi^2/Ri= '+string(pi)+' W') // Input power \n", +"po=Vo^2/RL\n", +"disp('po= Vo^2/RL= '+string(po)+' W') // Output power \n", +"Ap=10*log10(po/pi)\n", +"disp('Ap=10*log10(po/pi)= '+string(Ap)+' dB ') //Power gain in decibel\n", +"\n", +"\n", +"" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 6.3: EX6_3.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//Ex6_3\n", +"clc\n", +"RL=1*10^(3)\n", +"disp('RL= '+string(RL)+ ' ohm') //Load resistance\n", +"RF=500*10^(3)\n", +"disp('RF= '+string(RF)+ ' ohm') //Feedback resistance\n", +"Beta_o=50\n", +"disp('Beta_o = '+string(Beta_o)) //BJT gain\n", +"rbe=1*10^(3)\n", +"disp('rbe= '+string(rbe)+ ' ohm') //Base-emitter resistance\n", +"gm=50*10^(-3)\n", +"disp('gm = '+string(gm)+' A/V')// transconductance for BJT \n", +"rc=50*10^(3)\n", +"disp('rc= '+string(rc)+ ' ohm') //collector resistance\n", +"disp('part(i)')\n", +"Adm1=(-gm*RL)\n", +"disp('Adm1=(-gm*RL)= '+string(Adm1)) // Differential mode gain for BJT for DIDO and SIDO modes\n", +"Adm2=(0.5*gm*RL)\n", +"disp('Adm2=(0.5*gm*RL)= '+string(Adm2)) // Differential mode gain for BJT for DISO and SISO modes\n", +"Rid=2*rbe\n", +"disp('Rid=2*rbe= '+string(Rid)+ ' ohm') //input differential mode resistance\n", +"Acm=(-RL)/(2*RF)\n", +"disp('Acm=(-RL)/(2*RF)= '+string(Acm)) // Common mode gain for BJT for DISO and SISO modes\n", +"Ric=Beta_o*RF\n", +"disp('Ric=Beta_o*RF= '+string(Ric)+ ' ohm') // common mode input resistance\n", +"CMRR=2*gm*RF\n", +"disp('CMRR=2*gm*RF= '+string(CMRR)) // common mode rejection ratio\n", +"disp('part(ii)')\n", +"Vi1=(-0.5)*10^(-3)\n", +"disp('Vi1= '+string(Vi1)+' volts') // input voltage1 \n", +"Vi2=(+0.5)*10^(-3)\n", +"disp('Vi2= '+string(Vi2)+' volts') // input voltage2\n", +"Vcm=(10)*10^(-3)\n", +"disp('Vcm= '+string(Vcm)+' volts') // common mode voltage\n", +"Vd=Vi1-Vi2\n", +"disp('Vd=Vi1-Vi2= '+string(Vd)+' volts') // differential voltage\n", +"Vod=abs(Vd*Adm2)\n", +"disp('Vod=abs(Vd*Adm2)= '+string(Vod)+' volts') // output differential voltage for DISO and SISO modes\n", +"Voc=abs(Vcm*Acm)\n", +"disp('Voc=abs(Vcm*Acm)= '+string(Voc)+' volts') // output common mode voltage\n", +"Error=(Voc/Vod)*100\n", +"disp('percentage error=(Voc/Vod)*100= '+string(Error)+'%')//percentage error due to CM signal\n", +"disp('part(iii)')\n", +"RLeff=(RL*Rid)/(RL+Rid)\n", +"disp('RLeff=(RL*Rid)/(RL+Rid)= '+string(RLeff)+ ' ohm') // Effective load resistance\n", +"Adm=gm*RLeff\n", +"disp('Adm=gm*RLeff= '+string(Adm)) // Modified Differential mode gain for BJT for DIDO and SIDO modes\n", +"Acm=(-RLeff)/(2*RF)\n", +"disp('Acm=(-RLeff)/(2*RF)= '+string(Acm)) // Modified Common mode gain for BJT for DISO and SISO modes\n", +"CMRR=abs(Adm/(Acm))\n", +"disp('CMRR=abs(Adm/(Acm))= '+string(CMRR)) // Modified common mode rejection ratio\n", +"//NOTE: In Book, Formulae used for Acm in part(iii) is written as Acm=(-RL)/(2*RF)but ans is calculated by using RLeff in place of RL.So i have written formulae as Acm=(-RLeff)/(2*RF) in programming.\n", +"// Assigned variable name: in part(i) Adm for DIDO and SIDO modes is represented by Adm1 and Adm for DISO and SISO modes is represented by Adm2 to resist any anamoly in the programming." + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 6.4: EX6_4.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//Ex6_4\n", +"clc\n", +"VCC=(10)\n", +"disp('VCC= '+string(VCC)+' volts') // Collector voltage supply\n", +"VEE=VCC\n", +"disp('VEE=VCC= '+string(VEE)+' volts') // Emitter supply voltage\n", +"IQ=2*10^(-3)\n", +"disp('IQ = '+string(IQ)+' ampere') // operating current for CC class-Aamplifier\n", +"VBE=(0.7)\n", +"disp('VBE= '+string(VBE)+' volts') // Base-emitter voltage \n", +"disp('part(i)')\n", +"RL=VCC/IQ\n", +"disp('RL=VCC/IQ= '+string(RL)+ ' ohm') //Load resistance\n", +"Pomax=VCC^2/(2*RL)\n", +"disp('Pomax=VCC^2/(2*RL)= '+string(Pomax)+' W') // maximum Output power \n", +"PDC=2*VCC*IQ\n", +"disp('PDC=2*VCC*IQ= '+string(PDC)+' W') // Total D.C power supply\n", +"Etta_max=(Pomax/PDC)*100\n", +"disp('Efficiency,Etta_max=(Pomax/PDC)*100= '+string(Etta_max)+'%') //maximum power amplifier conversion efficiency\n", +"PDmax=VCC*IQ\n", +"disp('PDmax=VCC*IQ= '+string(PDmax)+' W') // maximum power dissipation \n", +"disp('part(ii)')\n", +"Vcm=(5)\n", +"disp('Vcm= '+string(Vcm)+' volts') // common mode voltage\n", +"Po=Vcm^2/(2*RL)\n", +"disp('Po=Vcm^2/(2*RL)= '+string(Po)+' W') // Output power \n", +"Etta=(Po/PDC)*100\n", +"disp('Efficiency,Etta=(Po/PDC)*100= '+string(Etta)+' %') // power amplifier conversion efficiency\n", +"PDCavg=PDmax-Po//Using law of conservation of energy\n", +"disp('PDCavg=PDmax-Po= '+string(PDCavg)+' W') // Average power dissipated in BJT" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 6.5: EX6_5.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//Ex6_5 \n", +"// For class-AB BJT amplifier\n", +"clc\n", +"VCC=(10)\n", +"disp('VCC= '+string(VCC)+' volts') // Collector voltage supply\n", +"VEE=VCC\n", +"disp('VEE=VCC= '+string(VEE)+' volts') // Emitter supply voltage\n", +"ICQ_0=10*10^(-3)\n", +"disp('ICQ_0 = '+string(ICQ_0)+' ampere') // Zero signal collector current\n", +"RL=5\n", +"disp('RL= '+string(RL)+ ' ohm') //Load resistance\n", +"disp('part(i)')\n", +"Po=0// Since Output power at Zero signal condition is Zero\n", +"disp('Po='+string(Po)+' W') // Output power at Zero signal condition\n", +"PDC=2*VCC*ICQ_0\n", +"disp('PDC=2*VCC*ICQ_0= '+string(PDC)+' W') // Total D.C power supply for Zero signal condition\n", +"disp('part(ii)')\n", +"Vcm=VCC//For Full output voltage swing Vcm=VCC\n", +"disp('Vcm=VCC =' +string(Vcm)+' volts') // common mode voltage for full swing condition\n", +"Icm=VCC/RL\n", +"disp('Icm = VCC/RL='+string(Icm)+' ampere') // common mode current\n", +"Po=(1/2)*(Icm*Vcm)\n", +"disp('Po=(1/2)*(Icm*Vcm)='+string(Po)+' W') // Output power at full swing condition\n", +"ICavg=(Icm)/(%pi)\n", +"disp('ICavg=(Icm)/(%pi)='+string(ICavg)+' ampere') // Average value of common mode current\n", +"PDC=2*(ICavg*VCC)\n", +"disp('PDC=2*VCC*ICavg= '+string(PDC)+' W') // Total D.C power supply for full swing condition\n", +"Etta=(Po/PDC)*100\n", +"disp('Efficiency,Etta=(Po/PDC)*100= '+string(Etta)+' %') // power amplifier conversion efficiency\n", +"disp('part(iii)')\n", +"Vcm1=(5)//given value\n", +"disp('Vcm1= '+string(Vcm1)+' volts') // common mode voltage for output swing Vcm=5 V\n", +"ICavg1=(Vcm1)/(%pi*RL)\n", +"disp('ICavg1=(Vcm1)/(%pi*RL)='+string(ICavg1)+' ampere') // Average value of common mode current\n", +"Po1=(Vcm1^2)/(2*RL)\n", +"disp('Po1=(Vcm1^2)/(2*RL)='+string(Po1)+' W') // Output power for output swing Vcm=5 V\n", +"PDC1=2*(ICavg1*VCC)\n", +"disp('PDC1=2*VCC*ICavg1= '+string(PDC1)+' W') // Total D.C power supply for output swing Vcm=5 V\n", +"Etta=(Po1/PDC1)*100\n", +"disp('Efficiency,Etta=(Po1/PDC1)*100= '+string(Etta)+' %') // power amplifier conversion efficiency for output swing Vcm=5 V\n", +"// NOTE:Correct value of Efficiency,Etta=(Po1/PDC1)*100= 39.269908 % for part(iii) but book ans is 39.31%(because of approximation used during calculation)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 6.6: Find_maximum_difference_voltage_Vdmax_for_op_amp_without_feedback.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//Ex6_6\n", +"clc\n", +"Av=1*10^(5)\n", +"disp('Av= '+string(Av)) //Voltage gain\n", +"VCC=(10)\n", +"disp('VCC= '+string(VCC)+' volts') // Collector voltage supply\n", +"vo=VCC\n", +"disp('vo= VCC='+string(vo)+' volts') // maximum output voltage\n", +"Vdmax=VCC/Av\n", +"disp('Vdmax= VCC/Av='+string(Vdmax)+' volts') // Difference input voltage at OP-amp terminals\n", +"" + ] + } +], +"metadata": { + "kernelspec": { + "display_name": "Scilab", + "language": "scilab", + "name": "scilab" + }, + "language_info": { + "file_extension": ".sce", + "help_links": [ + { + "text": "MetaKernel Magics", + "url": "https://github.com/calysto/metakernel/blob/master/metakernel/magics/README.md" + } + ], + "mimetype": "text/x-octave", + "name": "scilab", + "version": "0.7.1" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/Electronics_Circuits_and_Systems_by_Y_N_Bapat/7-Feedback_Amplifiers_and_Sinusoidal_oscillators.ipynb b/Electronics_Circuits_and_Systems_by_Y_N_Bapat/7-Feedback_Amplifiers_and_Sinusoidal_oscillators.ipynb new file mode 100644 index 0000000..6777056 --- /dev/null +++ b/Electronics_Circuits_and_Systems_by_Y_N_Bapat/7-Feedback_Amplifiers_and_Sinusoidal_oscillators.ipynb @@ -0,0 +1,462 @@ +{ +"cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 7: Feedback Amplifiers and Sinusoidal oscillators" + ] + }, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 7.10: Find_different_parameters_for_Pierce_oscillator.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//Ex7_10\n", +"clc\n", +"gm=10*10^(-3)\n", +"disp('gm = '+string(gm)+' A/V')// transconductance \n", +"Cgs=5*10^(-12)\n", +"disp('Cgs= '+string(Cgs)+ ' farad') // capacitance between gate-source\n", +"Cds=1*10^(-12)\n", +"disp('Cds= '+string(Cds)+ ' farad') // capacitance between drain-source\n", +"rd=50*10^(3)\n", +"disp('rd= '+string(rd)+ ' ohm') //Drain resistance\n", +"RG=10*10^(6)\n", +"disp('RG= '+string(RG)+ ' ohm') //Gate resistance\n", +"Rse=1*10^(3)\n", +"disp('Rse= '+string(Rse)+ ' ohm') //Gate resistance\n", +"L=0.5\n", +"disp('L= '+string(L)+ ' H') //Inductance\n", +"C2=0.05*10^(-12)\n", +"disp('C2= '+string(C2)+ ' farad') // Crystal parameter \n", +"C1=1*10^(-12)\n", +"disp('C1= '+string(C1)+ ' farad') // Crystal parameter\n", +"disp('part(i)') \n", +"x=C1+[(Cds*Cgs)/(Cds+Cgs)]\n", +"CT=1/[(1/C2)+(1/x)]\n", +"disp('CT= '+string(CT)+ ' farad') // Equivalent series-resonating capacitance\n", +"disp('part(ii)') \n", +"fo=sqrt(2)/[2*%pi*sqrt(L*CT)]\n", +"disp('fo= sqrt(2)/[2*%pi*sqrt(L*CT)]='+string(fo)+' Hz')// frequency of oscillations\n", +"disp('part(iii)')\n", +"z=sqrt((L*C1*C2)/(C1+C2))\n", +"fp=1/[2*%pi*z]\n", +"disp('fp= '+string(fp)+' Hz')// parallel-resonant frequency\n", +"p=sqrt(L*C2)\n", +"fs=1/[2*%pi*p]\n", +"disp('fs= '+string(fs)+' Hz')// series-resonant frequency\n", +"Q=[sqrt(L/C2)]/(Rse)\n", +"disp('Q=[sqrt(L/C2)]/(Rse)= '+string(Q))// Quality factor\n", +"disp('part(iv)')\n", +"AB=gm*rd*(Cds/Cgs)\n", +"disp('AB=gm*rd*(Cds/Cgs)= '+string(AB))//Loop gain\n", +"T_bias=RG*(Cgs+Cds)\n", +"disp('T_bias=RG*(Cgs+Cds)= '+string(T_bias)+'s')//Bias Time-Constant\n", +"T_r = 1/(2*%pi*fo)\n", +"disp('T_r =1/(2*%pi*fo)= '+string(T_r)+'s')//resonant Time-Constant for 'fo'\n", +"disp('for proper operation T_bias >> T_r')\n", +"\n", +"\n", +"// in part (ii)... value calculated for series resonant frequecy 'fo' is wrong in textbook.\n", +"// NOTE: in part(iii)... there is a misprint in the calculated value of Quality factor 'Q' in the textbook.\n", +"//I have used T_r instead of 1/wo (given in the book)\n", +"\n", +"\n", +"\n", +"\n", +"" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 7.1: Calculate_amount_of_negative_feedback_and_feedback_factor.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//Ex7_1\n", +"clc\n", +"A=60000\n", +"disp('A= '+string(A)) //Amplifier gain\n", +"Af=10000\n", +"disp('Af= '+string(Af)) //Feedback gain\n", +"N_dB=20*log10(Af/A)\n", +"disp('N_dB=20*log10(Af/A)= '+string(N_dB)+'dB') //Negative feedback gain\n", +"B=[1/(Af)]-(1/A)// formulae using [Af=A/(1+A*B)]\n", +"disp('B=[1/(Af)]-(1/A)= '+string(B)) //Feedback factor" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 7.2: Find_gain_with_feedback.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//Ex7_2\n", +"clc\n", +"A=10000\n", +"disp('A= '+string(A)) //Amplifier gain\n", +"B=0.01\n", +"disp('B= '+string(B)) //Feedback factor\n", +"Af=[A/(1+A*B)]\n", +"disp('Af= [A/(1+A*B)]='+string(Af)) //Feedback gain\n", +"A1=100000\n", +"disp('A1= '+string(A1)) //New amplifier gain value\n", +"Af1=[A1/(1+A1*B)]\n", +"disp('Af1= [A1/(1+A1*B)]='+string(Af1)) //New feedback gain" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 7.3: calculate_amount_of_feedback_and_gain_Af_and_new_input_voltage.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//Ex7_3\n", +"clc\n", +"Vo=(50)\n", +"disp('Vo= '+string(Vo)+' volts') // output voltage\n", +"Vi=(0.5)\n", +"disp('Vi= '+string(Vi)+' volts') // input voltage\n", +"disp('part(i)') \n", +"A=Vo/Vi\n", +"disp('A= Vo/Vi='+string(A)) //Amplifier gain\n", +"H.D=10\n", +"disp('Harmonic_distortion='+string(H.D)+'%')// Percentage second harmonic distortion\n", +"D=(10*Vo)/100\n", +"disp('D= (10*Vo)/100 = '+string(D)+' volts') // Second Harmonic distortion \n", +"Df=(1*Vo)/100\n", +"disp('Df= (1*Vo)/100 = '+string(Df)+' volts') // Harmonic distortion with Feedback\n", +"B=[D/(Df*A)]-(1/A) //Using formulae Df=[D/(1+A*B)]\n", +"disp('B=[D/(Df*A)]-(1/A) = '+string(B)) //Feedback factor\n", +"disp('part(ii)') \n", +"Af=[A/(1+A*B)]\n", +"disp('Af= [A/(1+A*B)] = '+string(Af)) //Feedback gain\n", +"disp('part(iii)') \n", +"Vif=Vo/Af\n", +"disp('Vif= Vo/Af = '+string(Vif)+' volts') // New input voltage required" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 7.4: find_signal_bandwidth_and_frequency_below_which_midband_gain_will_not_deviate.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//Ex7_4\n", +"clc\n", +"GBW=10^(6)\n", +"disp('GBW= '+string(GBW)+' Hz')// Gain-Bandwidth product\n", +"AMf=100\n", +"disp('AMf='+string(AMf)) // Midband gain with feedback\n", +"fHF=GBW/AMf\n", +"disp('fHF=GBW/AMf= '+string(fHF)+' Hz')//Signal bandwidth\n", +"f_10percent=(10*fHF)/100\n", +"disp('f_10per cent=(10*fHF)/100= '+string(f_10percent)+' Hz')//Frequency below which AMf will not deviate by more than 10 percent" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 7.5: EX7_5.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//Ex7_5\n", +"clc\n", +"AM=50000\n", +"disp('AM='+string(AM)) // Midband gain \n", +"fH=20*10^(3)\n", +"disp('fH= '+string(fH)+' Hz')// Upper cut-off frequency\n", +"fL=30\n", +"disp('fL= '+string(fL)+' Hz')// Lower cut-off frequency\n", +"B=5*10^(-5)\n", +"disp('B= '+string(B)) //Feedback factor\n", +"AMf=AM/(1+B*AM)\n", +"disp('AMf=AM/(1+B*AM)='+string(AMf)) // Midband gain with feedback\n", +"fHf=fH*(1+B*AM)\n", +"disp('fHf=fH*(1+B*AM)= '+string(fHf)+' Hz')//Upper cut-off frequency with feedback\n", +"fLf=fL/(1+B*AM)\n", +"disp('fLf=fL/(1+B*AM)= '+string(fLf)+' Hz')//Lower cut-off frequency with feedback\n", +"//NOTE: calculated value of AMf is AMf=14285.714 and fLF=8.5714286 but in book given as AMf=14286 and fLF=8.58 Hz" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 7.6: calculate_phase_margin_for_different_feedback_gains.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//Ex7_6\n", +"//Refer fig7.4\n", +"clc\n", +"AM=100\n", +"disp('AM='+string(AM)+'dB') // Midband gain \n", +"fc1=1*10^(4)\n", +"disp('fc1= '+string(fc1)+' Hz')// First Critical frequency\n", +"fc2=10^5\n", +"disp('fc2= '+string(fc2)+' Hz')// Second Critical frequency\n", +"fc3=10^6\n", +"disp('fc3= '+string(fc3)+' Hz')// Third Critical frequency\n", +"disp('part(i)')\n", +"Af1=85\n", +"disp('Af1='+string(Af1)+'dB') // gain at 50 kHz and -20dB/decade roll-off\n", +"f=50*10^(3)\n", +"disp('f= '+string(f)+' Hz')// operating frequency\n", +"theta_A=- atand(f/fc1)- atand(f/fc2)- atand(f/fc3)//phase shift in radians\n", +"disp('theta_A='+string(theta_A)+' degree')// Phase shift for feedback gain Af1\n", +"theta_pm=180-abs(theta_A)// formulae phase margin\n", +"disp('theta_pm=180-abs(theta_A)='+string(theta_pm)+' degree')// Phase Margin for feedback gain Af1\n", +"disp('Amplifier stable')// Since phase margin is (+)ive\n", +"disp('part(ii)')\n", +"Af2=50\n", +"disp('Af2='+string(Af2)+' dB') // gain at 500 kHz and -40dB/decade roll-off\n", +"f=500*10^(3)\n", +"disp('f= '+string(f)+' Hz')// frequency\n", +"theta_A=- atand(f/fc1)- atand(f/fc2)- atand(f/fc3)//phase shift in radians\n", +"disp('theta_A= '+string(theta_A)+' degree')// Phase shift for feedback gain Af2\n", +"theta_pm=180-abs(theta_A)// formulae phase margin\n", +"disp('theta_pm=180-abs(theta_A)='+string(theta_pm)+' degree')// Phase Margin for feedback gain Af1\n", +"disp('Amplifier unstable')// Since phase margin is (-)ive\n", +"disp('part(iii)')\n", +"Af3=20\n", +"disp('Af3='+string(Af3)+'dB') // gain at 1100 kHz and -60dB/decade roll-off\n", +"f=1100*10^(3)\n", +"disp('f= '+string(f)+' Hz')// frequency\n", +"theta_A=- atand(f/fc1)- atand(f/fc2)- atand(f/fc3)//phase shift in radians\n", +"disp('theta_A='+string(theta_A)+' degree')// Phase shift for feedback gain Af3\n", +"theta_pm=180-abs(theta_A)// formulae phase margin\n", +"disp('theta_pm=180-abs(theta_A)='+string(theta_pm)+' degree')// Phase Margin for feedback gain Af1\n", +"disp('Amplifier unstable')// Since phase margin is (-)ive\n", +"//NOTE:Correct ans for part(i) phase margin ,theta_pm=71.882476 degree but in book given as 71.86 degree\n", +"// correct ans for part(iii) phase shift, theta_A=-222.01103 degree but in book given as -220.02 degree \n", +"" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 7.7: Find_maximum_allowed_input_voltage_without_causing_output_clipping.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//Ex7_7\n", +"clc\n", +"AV=50000\n", +"disp('AV='+string(AV)) // Voltage gain \n", +"Ri=50*10^(6)\n", +"disp('Ri= '+string(Ri)+ ' ohm') //Input resistance of OP-AMP\n", +"R0=1*10^(3)\n", +"disp('R0= '+string(R0)+ ' ohm') //Output resistance\n", +"AVf=10\n", +"disp('AVf='+string(AVf)) // Overall Voltage gain \n", +"RSf=50*10^(3)\n", +"disp('RSf= '+string(RSf)+ ' ohm') //Source resistance\n", +"R1=RSf\n", +"RF=AVf*(R1)\n", +"disp('RF=AVf*(R1)= '+string(RF)+ ' ohm') //Feedback resistance\n", +"VS=30\n", +"disp('VS= '+string(VS)+' volts') // Peak-peak output swing voltage\n", +"Vomax=0.5*(VS)\n", +"disp('Vomax=0.5*(VS)= -'+string(Vomax)+', +'+string(Vomax)+' volts') // Maximum output voltage swing at negative and positive polarities respectively\n", +"Vsmax=Vomax/AVf\n", +"disp('Vsmax=Vomax/AVf= -'+string(Vsmax)+', +'+string(Vsmax)+' volts') // Maximum output voltage without overload clipping at both polarities\n", +"\n", +"\n", +"//for overall voltage gain author has used two notations 'Avf' and 'Af' ... but I am working with 'Avf' only" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 7.8: find_output_voltage_and_error_for_gain_and_value_of_gain_to_reduce_output_error.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//Ex7_8\n", +"//refer fig. 7.6(b)\n", +"clc\n", +"R1=50*10^(3)\n", +"disp('R1= '+string(R1)+ ' ohm') // resistance at input terminal of OP-AMP\n", +"RF=500*10^(3)\n", +"disp('RF= '+string(RF)+ ' ohm') //Feedback resistance\n", +"VS=1\n", +"disp('VS= '+string(VS)+' volts') // Peak-peak output swing voltage\n", +"disp('part(i)') \n", +"disp('A = infinite')// voltage gain\n", +"Vo1=-(RF/R1) //Output voltage when gain, A=infinite\n", +"disp('Vo1=-(RF/R1)= '+string(Vo1)+' volts')\n", +"disp('part(ii)') \n", +"A=50000\n", +"disp('A='+string(A)) // gain of OP-AMP\n", +"B=R1/(R1+RF)\n", +"disp('B=R1/(R1+RF)= '+string(B)) //Feedback factor\n", +"Vo2=-[(RF)*(B*A)]/(R1*(1+A*B))\n", +"disp('Vo2=-[(RF)*(B*A)]/(R1*(1+A*B))= '+string(Vo2)+' volts')// output voltage for A=50000\n", +"e=-[(Vo2-Vo1)*100]/Vo1\n", +"disp('%Error,e= [(Vo2-Vo1)*100]/Vo1='+string(e)+'% ')// calculation for percentage error in output voltage\n", +"disp('part(iii)') \n", +"e=0.01\n", +"disp('%Error,e='+string(e)+'% ')//Given percentage error in output voltage\n", +"Vo3=-(Vo1-(e*Vo1/100))\n", +"disp('Vo3=Vo1-(e*Vo1/100)= '+string(Vo3)+' volts')// output voltage for error 0.01%\n", +"x=Vo3*(R1/RF)\n", +"A=(x)/[B*(1-x)] //using formulae Vo=-(RF/R1)*[(B*A)/1+A*B)]\n", +"disp('A=(Vo*R1)/[B*RF*(1-(Vo*RF/R1))]='+string(A)) // New Required gain for error less than 0.01%\n", +"\n", +"// while solving the problem I have used 'e' for the error as no varriable is given for the same in textbook by author\n", +"// in textbook author has used 'Vo' for output voltage in all parts.. but to remove any ambiguity in the programe I have used 'Vo1' 'Vo2' 'Vo3' for part i, ii, iii, respectively" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 7.9: EX7_9.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//Ex7_9\n", +"clc\n", +"AV=100000\n", +"disp('AV='+string(AV)) // Voltage gain \n", +"Ri=10*10^(3)\n", +"disp('Ri= '+string(Ri)+ ' ohm') //Input resistance of OP-AMP\n", +"Ro=10\n", +"disp('Ro= '+string(Ro)+ ' ohm') //Output resistance\n", +"Rs=10*10^(6)\n", +"disp('Rs= '+string(Rs)+ ' ohm') //Source resistance\n", +"RL=1*10^(3)\n", +"disp('RL= '+string(RL)+ ' ohm') //Load resistance\n", +"B=(Rs-Ri)/(AV*Ri)\n", +"disp('B=(Rs-Ri)/(AV*Ri)= '+string(B)) //Feedback factor\n", +"AVf=AV/(1+B*AV)\n", +"disp('AVf=AV/(1+B*AV)='+string(AVf)) // Overall Voltage gain with feedback\n", +"Rof=Ro/(1+B*AV)\n", +"disp('Rof=Ro/(1+B*AV) ='+string(Rof)+ ' ohm') //output resistance with feedback\n", +"Rif=Ri*(1+B*AV)\n", +"disp('Rif=Ri/(1+B*AV) ='+string(Rif)+ ' ohm') //Input resistance with feedback\n", +"Ap=(AVf^2)*(Rif/RL)\n", +"disp('Ap=(AVf^2)*(Rif/RL)='+string(Ap)) // Overall Power gain \n", +"AP=10*log10(Ap)\n", +"disp('AP=10*log10(Ap)='+string(AP)+'dB') // Overall Power gain in dB " + ] + } +], +"metadata": { + "kernelspec": { + "display_name": "Scilab", + "language": "scilab", + "name": "scilab" + }, + "language_info": { + "file_extension": ".sce", + "help_links": [ + { + "text": "MetaKernel Magics", + "url": "https://github.com/calysto/metakernel/blob/master/metakernel/magics/README.md" + } + ], + "mimetype": "text/x-octave", + "name": "scilab", + "version": "0.7.1" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/Electronics_Circuits_and_Systems_by_Y_N_Bapat/8-Linear_Op_Amp_Applications.ipynb b/Electronics_Circuits_and_Systems_by_Y_N_Bapat/8-Linear_Op_Amp_Applications.ipynb new file mode 100644 index 0000000..9bad6f5 --- /dev/null +++ b/Electronics_Circuits_and_Systems_by_Y_N_Bapat/8-Linear_Op_Amp_Applications.ipynb @@ -0,0 +1,590 @@ +{ +"cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 8: Linear Op Amp Applications" + ] + }, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 8.10: Design_2nd_order_single_op_amp_band_pass_filter.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//Ex8_10\n", +"clc\n", +"fo=150\n", +"disp('fo= '+string(fo)+' Hz')//Central frequency of band pass filter\n", +"BW=15\n", +"disp('BW= '+string(BW)+' Hz')// Upper cut-off frequency or 3-dB bandwidth\n", +"Q=fo/BW // Quality factor\n", +"disp('Q= '+string(Q))\n", +"C=0.05*10^(-6) // Choosing value of capacitor same as in book\n", +"disp('C='+string(C)+'farad')\n", +"R=sqrt(2)/(2*%pi*fo*C)\n", +"disp('R=sqrt(2)/(2*%pi*fo*C)='+string(R)+ ' ohm') // resistance value for filter design\n", +"Am=5-(sqrt(2)/Q) // formulae\n", +"disp('Am=5-(sqrt(2)/Q)='+string(Am)) // Midband gain \n", +"Abp=Am/(5-Am)\n", +"disp('Abp=Am/(5-Am)='+string(Abp)) // Central frequency gain " + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 8.11: Determine_filter_response_for_state_variable_filter.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//Ex8_11\n", +"clc\n", +"R=10*10^(3)\n", +"disp('R= '+string(R)+ ' ohm') // resistance\n", +"R1=10*10^(3)\n", +"disp('R1= '+string(R1)+ ' ohm') // resistance\n", +"C=0.01*10^(-6) // value of capacitor\n", +"disp('C='+string(C)+' farad')\n", +"R1_ratio_K=2.5*10^(3)\n", +"disp('R1_ratio_K= '+string(R1_ratio_K)+ ' ohm') // resistance\n", +"R2=5*10^(3)\n", +"disp('R= '+string(R)+ ' ohm') // resistance\n", +"alpha_R2=250\n", +"disp('alpha_R2= '+string(alpha_R2)+ ' ohm') // resistance\n", +"alpha=alpha_R2/R2\n", +"disp('alpha=alpha_R2/R2= '+string(alpha)) // Damping factor\n", +"Q=1/alpha\n", +"disp('Q= 1/alpha='+string(Q))// Quality factor\n", +"omega_o=1/(R*C)\n", +"disp('omega_o=1/(R*C)= '+string(omega_o)+' radian')// centre angular frequency\n", +"BW=omega_o/Q\n", +"disp('Bandwidth=omega_o/Q= '+string(BW)+' radian')// Upper cut-off frequency or 3-dB bandwidth\n", +"K=R1/(R1_ratio_K)// Pass band gain for lPF and HPF of state variable filter\n", +"disp('K=R1/(R1_ratio_K)= '+string(K))\n", +"Gm=K/alpha// Pass band gain of state variable filter\n", +"disp('center frequency gain for BPF, K/alpha=K*Q= '+string(Gm)) // Centre frequency gain for BP filter\n", +"" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 8.12: Find_output_offset_voltage_with_and_without_comensation.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//Ex8_12\n", +"clc\n", +"IB=0.5*10^(-6)\n", +"disp('IB = '+string(IB)+' ampere') //Input bias current \n", +"Iio=0.05*10^(-6)\n", +"disp('Iio = '+string(Iio)+' ampere') //Input offset current \n", +"Vio=1*10^(-3)\n", +"disp('Vio= '+string(Vio)+' volts') //Input offset voltage\n", +"R1=10*10^(3)\n", +"disp('R1= '+string(R1)+ ' ohm') // resistance\n", +"RF=500*10^(3)\n", +"disp('RF= '+string(RF)+ ' ohm') //Feedback resistance\n", +"Vos1=Vio*(1+RF/R1)\n", +"disp('Vos1=Vio*(1+RF/R1)='+string(Vos1)+' volts') //output offset voltage due to input offset voltage\n", +"Vos2=IB*RF\n", +"disp('Vos2=IB*RF='+string(Vos2)+' volts') //output offset voltage due to Input bias current \n", +"Vos=Vos1+Vos2\n", +"disp('Vos=Vos1+Vos2='+string(Vos)+' volts') //total output offset voltage \n", +"R2=(R1*RF)/(R1+RF)\n", +"disp('R2=(R1*RF)/(R1+RF)= '+string(R2)+ ' ohm') // resistance to balance IB effect \n", +"Vos2=Iio*RF\n", +"disp('Vos2=Iio*RF='+string(Vos2)+' volts') // Reduced output offset voltage due to Input offset current \n", +"Vos=Vos1+Vos2\n", +"disp('Vos=Vos1+Vos2='+string(Vos)+' volts') // output offset voltage with compensation \n", +" " + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 8.13: EX8_13.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//Ex8_13\n", +"clc\n", +"Iio=0.1*10^(-9)\n", +"disp('Iio = '+string(Iio)+' ampere/degree _celsius') //Input offset current \n", +"Vio=10*10^(-6)\n", +"disp('Vio= '+string(Vio)+' volt/degree _celsius') //Input offset voltage\n", +"Vs=10*10^(-3)\n", +"disp('Vs= '+string(Vs)+' volts') //Input voltage\n", +"R1=10*10^(3)\n", +"disp('R1= '+string(R1)+ ' ohm') // resistance\n", +"RF=100*10^(3)\n", +"disp('RF= '+string(RF)+ ' ohm') //Feedback resistance\n", +"disp('part(i)')\n", +"R2=(R1*RF)/(R1+RF)// R1 in parallel with RF\n", +"disp('R2=(R1*RF)/(R1+RF)= '+string(R2)+ ' ohm') // resistance to balance IB i.e offset effect \n", +"disp('part(ii)')\n", +"delta_T=75-25\n", +"disp('delta_T=75-25 = '+string(delta_T)+' degree_celsius') //Temperature change\n", +"delta_Vo=[(Vio*delta_T)*(1+RF/R1)]+(Iio*delta_T*RF)\n", +"disp('delta_Vo=[(Vio*delta_T)*(1+RF/R1)]+(Iio*delta_T*RF)= '+string(delta_Vo)+' volts') //Output voltage drift\n", +"disp('part(iii)')\n", +"Vo=(-RF/R1)*Vs\n", +"disp('Vo=(-RF/R1)*Vs= '+string(Vo)+' volts') //Inverting OP-AMP output voltage\n", +"e=(delta_Vo/Vo)*100\n", +"disp('Percentage error=(delta_Vo/Vo)*100 =(-)'+string(abs(e))+', (+)'+string(abs(e))+' percent')//percentage error" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 8.14: Find_power_supply_voltage_regulation.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//Ex8_14\n", +"clc\n", +"Iio=0.1*10^(-9)\n", +"disp('Iio = '+string(Iio)+' ampere') //Input offset current\n", +"VCC=15\n", +"disp('VCC= '+string(VCC)+' volts') // voltage supply \n", +"PSRR=150*10^(-6)\n", +"disp('PSRR= '+string(PSRR)+' volts/V')// Power supply rejection ratio\n", +"Vio=10*10^(-6)\n", +"disp('Vio= '+string(Vio)+' volts') //Input offset voltage\n", +"R1=10*10^(3)\n", +"disp('R1= '+string(R1)+ ' ohm') // resistance\n", +"RF=100*10^(3)\n", +"disp('RF= '+string(RF)+ ' ohm') //Feedback resistance\n", +"delta_T=75-25\n", +"disp('delta_T=75-25 = '+string(delta_T)+' celsius') //Temperature change\n", +"delta_Vo=[(Vio*delta_T)*(1+RF/R1)]+(Iio*delta_T*RF)\n", +"disp('delta_Vo=[(Vio*delta_T)*(1+RF/R1)]+(Iio*delta_T*RF)= '+string(delta_Vo)+' volts') //Output voltage drift\n", +"delta_Vio1=(delta_Vo)*(R1/RF)\n", +"disp('delta_Vio1=(delta_Vo)*(R1/RF)= '+string(delta_Vio1)+' volts') // voltage change at Input for voltage drift found\n", +"delta_Vio2=(delta_Vio1)*(1/10)\n", +"disp('delta_Vio2=(delta_Vio1)*(1/10)= '+string(delta_Vio2)+' volts') // change in Vio due to PSRR\n", +"p=[(delta_Vio2)/(VCC*PSRR)]*100\n", +"disp('power supply regulation=[(delta_Vio2)/(VCC*PSRR)]*100 ='+string(p)+ ' percent')// power supply regulation requirement\n", +"\n", +"//delta_Vio1 corresponds to voltage change at Input for voltage drift found \n", +"//delta_Vio2 corresponds voltage change at input due to PSRR\n", +"" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 8.15: calculate_full_power_bandwidth.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//Ex8_15\n", +"clc\n", +"SR=0.65\n", +"disp('SR= '+string(SR)+' volts/microsecond')// Slew rate of OP-AMP\n", +"disp('part(i)')\n", +"Vm=5\n", +"disp('Vm= '+string(Vm)+' volts') // Output peak voltage1\n", +"fsm=SR/[10^(-6)*(2*%pi*Vm)] // using formulae SR=2*pi*fsm*Vm\n", +"disp('fsm=SR/[10^(-6)*(2*%pi*Vm)] = '+string(fsm)+' Hz')// // Full power bandwidth for Output peak voltage Vm=5V\n", +"disp('part(ii)')\n", +"Vm=1\n", +"disp('Vm= '+string(Vm)+' volts') // Output peak voltage2\n", +"fsm=SR/[10^(-6)*(2*%pi*Vm)] // using formulae SR=2*pi*fsm*Vm\n", +"disp('fsm=SR/[10^(-6)*(2*%pi*Vm)] = '+string(fsm)+' Hz')// // Full power bandwidth for Output peak voltage Vm=1V" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 8.1: calculate_feedback_factor_and_variation_in_feedback_gain_Af.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//Ex8_1\n", +"clc\n", +"Amin=8000\n", +"disp('Amin='+string(Amin)) // Minimum gain of OP-AMP\n", +"Amax=64000\n", +"disp('Amax='+string(Amax)) // Maximum gain \n", +"disp('part (i)')\n", +"delta_Af=0.01\n", +"disp('delta_Af='+string(delta_Af)) // Change in overall feedBack gain \n", +"delta_A=(Amax-Amin)/Amin\n", +"disp('delta_A= (Amax-Amin)/Amin = '+string(delta_A)) // Change in open loop gain \n", +"Sg = delta_Af/delta_A\n", +"B = (1/Sg - 1)/Amax\n", +"disp('Sg = delta_Af/delta_A = '+string(Sg))//desensitivity factor\n", +"disp(' B = (1/Sg - 1)/Amax = '+string(B))//feedBack factor\n", +" disp(' part (ii)')\n", +"Af_min = Amin/(1+B*Amin)//minimum change in overall feedBack gain \n", +"Af_max = Amax/(1+B*Amax)///maximum change in overall feedBack gain \n", +"disp('Af_min = Amin/(1+B*Amin) = '+string(Af_min))\n", +"disp('Af_max = Amax/(1+B*Amax) = '+string(Af_max))\n", +"disp('variation in Af = '+string(Af_max/Af_min))//variation in Af with feedBack factor 'B'\n", +"\n", +"\n", +"// for above problem author has divided question in two parts but during solution has written 3 parts. \n", +"// part (i) and part (ii) combinedly equivlent to part (i) \n", +"// part (iii) is equivalent to part (ii)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 8.2: Design_an_inverting_op_amp.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//Ex8_2\n", +"clc\n", +"Avf=-100\n", +"disp('Avf='+string(Avf)) // Voltage gain \n", +"Rif=1\n", +"disp('Rif= '+string(Rif)+ ' ohm') //Input resistance of OP-AMP\n", +"R1=Rif\n", +"RF=-R1*Avf // using formulae Vo=(-RF/R1)*Vi\n", +"disp('RF= -R1*Avf='+string(RF)+ ' ohm') //Feedback resistance of OP-AMP\n", +"// NOTE:Error in value of RF since they have given value of Rif=1ohm but calculated RF by using Rif=1 Kilo ohm\n", +"// So i have calculated using Ri=1ohm and hence RF=100 ohm" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 8.3: Find_resistances_R11_and_R12_and_R13_for_op_amp_adder_and_output_voltage.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//Ex8_3\n", +"clc\n", +"R11=1*10^(3)\n", +"disp('R11= '+string(R11)+ ' ohm') // resistance at input terminal of OP-AMP Adder\n", +"RF=100*10^(3)\n", +"disp('RF= '+string(RF)+ ' ohm') //Feedback resistance\n", +"R12=10*10^(3)\n", +"disp('R12= '+string(R12)+ ' ohm') // resistance at input terminal of OP-AMP Adder\n", +"R13=100*10^(3)\n", +"disp('R13= '+string(R13)+ ' ohm') // resistance at input terminal of OP-AMP Adder\n", +"disp('vo = -('+string(RF/R11)+'vs1 +'+string(RF/R12)+'vs2 +'+string(RF/R13)+'vs3)') // output voltage of opamp adder in terms of input vs1,vs2 vs3\n", +"\n", +"// for average value of input signal\n", +"n = 3// given inputs are '3'\n", +"R11 = n*RF\n", +"R12 = n*RF\n", +"R13 = n*RF\n", +"disp('vo = -('+string(RF/R11)+' vs1 +'+string(RF/R12)+' vs2 +'+string(RF/R13)+ ' vs3)') // output voltage of opamp adder \n", +"\n", +"\n", +"// note : the output voltage of inverting adder is negative \n", +"// but while calculating weighted output voltage in above question ..author has neglected or miss the negative sign" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 8.4: Find_scale_factor_of_photometer.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//Ex8_4\n", +"clc\n", +"Ir=10*10^(-3)\n", +"disp('Ir = '+string(Ir)+' ampere/lumen of radiant energy ') //photodiode Reverse saturation current for constant reverse bias VR\n", +"RF=10*10^(3)\n", +"disp('RF= '+string(RF)+ ' ohm') //Feedback resistance\n", +"E=1*10^(-2)\n", +"disp('E = '+string(E)+' lumens')// radiant energy\n", +"IR=Ir*E\n", +"disp('IR =Ir*E= '+string(IR)+' ampere') // Reverse saturation current\n", +"Vo=IR*RF\n", +"disp('Vo=IR*RF= '+string(Vo)+' volts') // output voltage\n", +"s=E/Vo\n", +"disp('scale factor=E/Vo= '+string(E)+' lumens/V') // Scale factor of photometer\n", +"\n", +"" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 8.5: EX8_5.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//Ex8_5\n", +"clc\n", +"Av=1*10^(5)\n", +"disp('Av= '+string(Av)) //Voltage gain\n", +"RF=100*10^(3)\n", +"disp('RF= '+string(RF)+ ' ohm') //Feedback resistance\n", +"RM=10*10^(3)\n", +"disp('RM= '+string(RM)+ ' ohm') // D.C Ammeter internal resistance\n", +"is=10*10^(-6)\n", +"disp('is = '+string(is)+' ampere') // Source current\n", +"vo=is*RF\n", +"disp('vo=is*RF= '+string(vo)+' volts') // output voltage\n", +"S=vo/is\n", +"disp('S=vo/is= '+string(S)+' V/A') // Sensitivity of Ammeter\n", +"Rif=RF/(1+Av)\n", +"disp('Rif=RF/(1+Av)= '+string(Rif)+ ' ohm') //Input resistance of OP-AMP\n", +"im=100*10^(-6)\n", +"disp('im = '+string(im)+' ampere') // Meter Full-Scale deflection current \n", +"RF=(im*RM)/is\n", +"disp('RF=(im*RM)/is= '+string(RF)+ ' ohm') // New required Feedback resistance for im=100 micro ampere" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 8.6: Find_resistances_R1_and_RF_for_non_inverting_op_amp.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//Ex8_6\n", +"clc\n", +"Av=36\n", +"disp('Av= '+string(Av)+' dB') //Voltage gain\n", +"R1=1*10^(3)// Choosing value of R1\n", +"disp('R1= '+string(R1)+ ' ohm') // Resistor at input side of OP-AMP\n", +"RF=R1*[10^(Av/20)-1] // Using formulae Av=20*log(1+RF/R1)\n", +"disp('RF=R1*[10^(Av/20)-1]= '+string(RF)+ ' ohm') // Calculated Feedback resistance\n", +"//NOTE: Correct value of RF=62095.734 ohm or 62.095 kilo ohm but in book given as 62.24 kilo ohm \n", +" " + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 8.7: EX8_7.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//Ex8_7\n", +"clc\n", +"if=100*10^(-6)\n", +"disp('if = '+string(if)+' ampere') //Full-Scale deflection current\n", +"Av=1*10^(5)\n", +"disp('Av= '+string(Av)) //Voltage gain \n", +"vs=10*10^(-3) \n", +"disp('vs= '+string(vs)+' volts') // Input voltage \n", +"RM=100\n", +"disp('RM= '+string(RM)+ ' ohm') // Moving coil Ammeter internal resistance\n", +"Ri=10*10^(3)\n", +"disp('Ri= '+string(Ri)+ ' ohm') //Input resistance of OP-AMP\n", +"R1=vs/if\n", +"disp('R1=vs/if= '+string(R1)+ ' ohm') // Resistor at input side of OP-AMP in Voltage-to-Current converter \n", +"Avf=1+(RM/R1) // formulae using Avf=1+(RF/R1)=1+(RM/R1)// since RF=RM\n", +"disp('Avf=1+(RM/R1)='+string(Avf)) // Overall Voltage gain\n", +"Rif=Ri*(Av/Avf)\n", +"disp('Rif=Ri*(Av/Avf)='+string(Rif)+ ' ohm') // Equivalent input side resistance of OP-AMP with feedback\n", +"\n", +" " + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 8.8: Find_worst_case_change_in_output_voltage_Vo.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//Ex8_8\n", +"clc\n", +"Ro=0.001\n", +"disp('Ro= '+string(Ro)+ ' ohm') //Output resistance\n", +"Sv=0.01\n", +"disp('Sv= '+string(Sv)+'%') // Input Regulation for IC regulator\n", +"delta_VI=12-9\n", +"disp('change in regulator voltage= '+string(delta_VI)+' volts') // Regulator input voltage variation\n", +"delta_IL=1.25-1\n", +"disp('change in regulator Current= '+string(delta_IL)+' A') // Regulator Current variation\n", +"delta_Vo=[delta_VI*(Sv/100)+delta_IL*Ro]\n", +"disp('change in regulator output voltage= '+string(delta_Vo)+' volts') // Regulator output voltage variation\n", +"" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 8.9: Design_2nd_order_LP_Butterworth_filter.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//Ex8_9\n", +"clc\n", +"alpha=1.414// Damping coefficient for Butterworth LP filter\n", +"disp('alpha='+string(alpha)) \n", +"AM=3-alpha\n", +"disp('AM='+string(AM)) // Midband gain of filter \n", +"fOH=1*10^(3)\n", +"disp('fOH= '+string(fOH)+' Hz')//Cut off frequency\n", +"R1=10*10^(3)// Choosing value of R1 same as in book\n", +"disp('R1= '+string(R1)+ ' ohm') // Resistor at input side of (OP-AMP)filter \n", +"RF=R1*(AM-1)\n", +"disp('RF=R1*(AM-1)='+string(RF)+ ' ohm') //Feedback resistance \n", +"C=0.1*10^(-6) // Choosing value of capacitor same a in book\n", +"disp('C='+string(C)+'farad')\n", +"R=1/(2*%pi*fOH*C)// Using formulae wOH=1/C*R and wOH=(2*%pi*fOH)\n", +"disp('R=1/(omega_OH*C)=1/(2*%pi*fOH*C)='+string(R)+ ' ohm') // resistance value for filter design" + ] + } +], +"metadata": { + "kernelspec": { + "display_name": "Scilab", + "language": "scilab", + "name": "scilab" + }, + "language_info": { + "file_extension": ".sce", + "help_links": [ + { + "text": "MetaKernel Magics", + "url": "https://github.com/calysto/metakernel/blob/master/metakernel/magics/README.md" + } + ], + "mimetype": "text/x-octave", + "name": "scilab", + "version": "0.7.1" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/Electronics_Circuits_and_Systems_by_Y_N_Bapat/9-Digital_Circuits_and_Logic_Families.ipynb b/Electronics_Circuits_and_Systems_by_Y_N_Bapat/9-Digital_Circuits_and_Logic_Families.ipynb new file mode 100644 index 0000000..7dfddf1 --- /dev/null +++ b/Electronics_Circuits_and_Systems_by_Y_N_Bapat/9-Digital_Circuits_and_Logic_Families.ipynb @@ -0,0 +1,459 @@ +{ +"cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 9: Digital Circuits and Logic Families" + ] + }, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 9.10: EX9_10.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//Ex9_10 Refer Fig.9.17(a)\n", +"clc\n", +"V_gamma=0.6\n", +"disp('V_gamma= '+string(V_gamma)+' volts') //Threshold voltage\n", +"VEE=-5.2\n", +"disp('VEE= '+string(VEE)+' volts') // voltage supply \n", +"VBE3=0.7\n", +"VBE4=VBE3\n", +"VBE5=VBE3\n", +"disp('VBE3=VBE4=VBE5 '+string(VBE3)+' volts') //base-emitter voltage\n", +"RE=779\n", +"disp('RE= '+string(RE)+ ' ohm') // Emitter-resistance\n", +"RL2=220\n", +"disp('RL2= '+string(RL2)+ ' ohm') // Load resistance\n", +"RL3=245\n", +"disp('RL3= '+string(RL3)+ ' ohm') // Load resistance\n", +"VREF=-1.29\n", +"disp('VREF= '+string(VREF)+' volts') // Reference- voltage \n", +"V_1=-0.7\n", +"disp('V(1)= '+string(V_1)+' volts') // Acceptable voltage for high logic \n", +"V_0=-1.7\n", +"disp('V(0)= '+string(V_0)+' volts') // Acceptable voltage for low logic \n", +"\n", +"disp('part(i)')// part(i)of question\n", +"VE=VREF-VBE3\n", +"disp('VE=VREF-VBE3= '+string(VE)+' volts') // Emitter- voltage \n", +"IE=(VEE-VE)/RE\n", +"disp('IE=(VEE-VE)/RE= '+string(IE)+' A') //Emitter- Current\n", +"IC3=IE// since IC=IE neglecting IB\n", +"disp('IC3=IE= '+string(IE)+' A') //Collector- Current\n", +"vC3=IC3*RL3\n", +"disp('vC3=IC3*RL3= '+string(vC3)+' volts') // Collector- voltage \n", +"vY=vC3-VBE5\n", +"disp('vY=vC3-VBE5= '+string(vY)+' volts') // Emitter follower output voltage for vB=V(0) \n", +"vC2=0 \n", +"vX=vC2-VBE4\n", +"disp('vX=vC2-VBE4= '+string(vX)+' volts') // Emitter follower output voltage for vB=V(0) \n", +"VBEr=(V_0)-VE\n", +"disp('Base -Emitter reverse voltage,VBEr=V(0)-VE= '+string(VBEr)+' volts')//Base- Emitter junction reverse voltage ,this is sufficient to keep T1 and T2 off since threshold =0.6V\n", +"disp('Transistor T1 and T2 off since VBEr < V_gamma') // Since VBEr < V_gamma hence T1 and T2 off\n", +"\n", +"disp('part(ii)')// part(ii)of question\n", +"IC2=IE\n", +"VBE=0.7 \n", +"vB=V_1\n", +"IC3=0\n", +"VC3=0\n", +"vY=VC3-VBE5\n", +"disp('vY=VC3-VBE= '+string(vY)+' volts')// Emitter follower output voltage for SECOND CASE for vB=V(1) \n", +"VE=vB-VBE\n", +"disp('VE=vB-VBE= '+string(VE)+' volts') // Emitter- voltage \n", +"VBE3=VREF-VE\n", +"disp('VBE3=VREF-VE= '+string(VBE3)+' volts')//Base- Emitter junction voltage\n", +"disp('VBE3 is smaller than V_gamma,hence T3 is off')\n", +"IC2=(VEE-VE)/RE\n", +"disp('IC2=(VEE-VE)/RE= '+string(IC2)+' A') //Collector- Current for T2(transistor)\n", +"vC2=IC2*RL2\n", +"disp('vC2=IC2*RL2= '+string(vC2)+' volts') // Collector- voltage for T2\n", +"vX=vC2-VBE4\n", +"disp('vX=vC2-VBE4= '+string(vX)+' volts') // Emitter follower output voltage for vB=V(1)\n", +"\n", +"disp('part(iii)')// part(iii)of question \n", +"VE3=-1.99\n", +"disp('VE3=VE= '+string(VE3)+' volts') // Transistor T3 Emitter- voltage ,when T3 is conducting \n", +"VB3=VREF\n", +"disp('VB3=VREF= '+string(VB3)+' volts') // Base- voltage when T3 is conducting\n", +"IC3=(VEE-VE3)/RE// Collector current for T3 neglecting IB\n", +"disp('IC3=(VEE-VE3)/RE= '+string(IC3)+' A') //Collector- Current\n", +"VC3=IC3*RL3\n", +"disp('VC3=IC3*RL3= '+string(VC3)+' volts') // Collector- voltage when T3 is conducting \n", +"VCB3=VC3-VB3\n", +"disp('VCB3=VC3-VB3= '+string(VCB3)+' volts') // Base- voltage when T3 is conducting \n", +"//All parameters have appropriate signs for npn BJT hence BJT in active region not in saturation in which VCB will have a (-)value\n", +"disp('All parameters have appropriate signs for npn BJT hence BJT in active region ') \n", +"\n", +"\n", +"// NOTE: Author ha not used any symbol for Base- Emitter junction reverse voltage But I have used 'VBEr' for it.\n", +"// ERROR :sign of IE is given wrong in the book in part(i) and sign of IC2 in part(ii)\n", +"// In part(i) Correct Formulae of vC3 is vC3 =IC3*RL3 but given in book is vC3 =(-)IC3*RL3 because author has included the (-)ive sign or the polarity of IC3 in the formulae \n", +"// IN book in part(ii) mistakenly it is written as vB=V_0 =-0.7 V but Correct expression is vB=V_1=-0.7 V because vB is at high at V_1=-0.7 V\n", +"// In part(ii) Author has used formulae vC2=-IC2*RL2 because he has included the (-)ive sign of the IC2 in the formulae but I have used vC2=IC2*RL2 to remove any ambiguity in program\n", +"\n", +"\n", +"\n", +"" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 9.11: find_low_and_high_level_noise_immunities.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//Ex9_11\n", +"clc\n", +"VIL=-1.475\n", +"disp('VIL= '+string(VIL)+' V') // Minimum input voltage level for which output is maximum\n", +"VIH=-1.105\n", +"disp('VIH= '+string(VIH)+' V') // Maximum input voltage level for which output is minimum\n", +"VOL=-1.63\n", +"disp('VOL= '+string(VOL)+' V') // Minimum output voltage level for maximum input level\n", +"VOH=-0.98\n", +"disp('VOH= '+string(VOH)+' V') // Maximum output voltage level for minimum input level\n", +"NML=VIL-VOL\n", +"disp('NML=VIL-VOL= '+string(NML)+' V') // Low level noise immunities\n", +"NMH=VOH-VIH\n", +"disp('NMH=VOH-VIH= '+string(NMH)+' V') // High level noise immunities\n", +"\n", +"" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 9.1: Find_minimum_gain_for_proper_operation_of_NOT_gate.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//Ex9_1\n", +"clc\n", +"VCC=5\n", +"disp('VCC= '+string(VCC)+' volts') // voltage supply \n", +"RB=10*10^(3)\n", +"disp('RB= '+string(RB)+ ' ohm') // Base-resistance\n", +"RL=1*10^(3)\n", +"disp('RL= '+string(RL)+ ' ohm') // Load resistance\n", +"VCS=0.2\n", +"disp('VCS= '+string(VCS)+' volts') // collector saturated voltage \n", +"VBS=0.8\n", +"disp('VBS= '+string(VBS)+' volts') // Base voltage at saturation \n", +"V_gamma=0.6\n", +"disp('V_gamma= '+string(V_gamma)+' volts') // Threshold or cut-in voltage\n", +"ICS=(VCC-VCS)/RL\n", +"disp('ICS = (VCC-VCS)/RL='+string(ICS)+' ampere') //Saturation collector current of transistor T1\n", +"vi=5\n", +"disp('vi= '+string(vi)+' volts') // Input voltage \n", +"IBS=(vi-VBS)/RB\n", +"disp('IBS=(vi-VBS)/RB='+string(IBS)+' ampere') // Forward base drive required to sustain ICS\n", +"Beta_Fmin=ICS/IBS\n", +"disp('Beta_Fmin=ICS/IBS= '+string(Beta_Fmin)) // Common-emitter current gain\n", +"\n", +"//NOTE: Correct formulae for ICS=(VCC-VCS)/RL\n", +"// but in book it is written wrong as ICS=(VCC-VCS)/RB but had calculated ans (in book) according to correct formulae ICS=(VCC-VCS)/RL" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 9.2: calculate_output_voltage_Vx_for_OR_logic_gate.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//Ex9_2 Refer fig.9.3(e)\n", +"clc\n", +"VD=0.7\n", +"disp('VD= '+string(VD)+' V') // Diode voltage drop in conduction mode\n", +"\n", +"disp('part(i)')// part(i)of question\n", +"vA=0\n", +"disp('vA= '+string(vA)+' V') // Input voltage1 of diode OR logic gate\n", +"vB=0\n", +"disp('vB= '+string(vB)+' V') // Input voltage2 of diode OR logic gate\n", +"vX=0 // Since both input voltages vA=vB=0V\n", +"disp('vX='+string(vX)+' V') // Output voltage of diode OR logic gate for part(i)\n", +"\n", +"disp('part(ii)')// part(ii)of question\n", +"vA=0\n", +"disp('vA= '+string(vA)+' V') // Input voltage1 of diode OR logic gate\n", +"vB=5\n", +"disp('vB= '+string(vB)+' V') // Input voltage2 of diode OR logic gate for SECOND CASE: when vA=0V and vB=5V\n", +"vX=vB-VD\n", +"disp('vX=vB-VD= '+string(vX)+' V') // Output voltage of diode OR logic gate for SECOND CASE\n", +"\n", +"disp('part(iii)')// part(iii)of question\n", +"vA=5\n", +"disp('vA= '+string(vA)+' V') // Input voltage1 of diode OR logic gate for THIRD CASE when vA=5V and vB=0V\n", +"vB=0\n", +"disp('vB= '+string(vB)+' V') // Input voltage2 of diode OR logic gate\n", +"vX=vA-VD\n", +"disp('vX=vA-VD= '+string(vX)+' V') // Output voltage of diode OR logic gate for THIRD CASE\n", +"\n", +"disp('part(iv)')// part(iv)of question\n", +"vA=(+5)\n", +"disp('vA= '+string(vA)+' V') // Input voltage1 of diode OR logic gate\n", +"vB=(+5)\n", +"disp('vB= '+string(vB)+' V') // Input voltage2 of diode OR logic gate\n", +"vX=vA-VD // Since both diodes D1 and D2 are conducting\n", +"vX=vB-VD \n", +"disp('vX=vA-VD=vB-VD= '+string(vX)+' V') // Output voltage of diode OR logic gate for FOURTH CASE: when vA=5V and vB=5V" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 9.3: Calculate_output_voltage_Vx_for_diode_AND_logic_gate.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//Ex9_3 Refer fig.9.4(e)\n", +"// For AND logic gate\n", +"clc\n", +"VD=0.7\n", +"disp('VD= '+string(VD)+' V') // Diode voltage drop in conduction mode\n", +"\n", +"disp('part(i)')\n", +"vA=0\n", +"disp('vA= '+string(vA)+' V') // Input voltage of diode AND logic gate\n", +"vB=0\n", +"disp('vB= '+string(vB)+' V') // Input voltage2 of diode AND logic gate\n", +"\n", +"vX=VD // Since both input voltages vA=vB=0V\n", +"disp('vX=VD='+string(vX)+' V') // Output voltage of diode AND logic gate for FIRST CASE: when vA=0V and vB=0V\n", +"\n", +"disp('part(ii)')\n", +"vA=0\n", +"disp('vA= '+string(vA)+' V') // Input voltage of diode AND logic gate\n", +"vB=5\n", +"disp('vB= '+string(vB)+' V') // Input voltage2 of diode AND logic gate for SECOND CASE: when vA=0V and vB=5V\n", +"vX=VD //due to diode A which is conducting and the Diode B is reverse biased with a voltage VD-VB=0.7-5=-4.3\n", +"disp('vX=VD '+string(vX)+' V')\n", +"//due to diode B which is conducting\n", +"\n", +"\n", +"\n", +"disp('part(iii)')\n", +"vA=5\n", +"disp('vA= '+string(vA)+' V') // Input voltage for THIRD CASE when vA=5V and vB=0V\n", +"vB=0\n", +"disp('vB= '+string(vB)+' V') // Input voltage2 of diode AND logic gate\n", +"vX = VD//due to diode B which is conducting and the Diode A is reverse biased with a voltage VD-VA=0.7-5=-4.3\n", +"disp('vX= '+string(vX)+' V')\n", +"\n", +"disp('part(iv)')\n", +"vA=5\n", +"disp('vA= '+string(vA)+' V') // Input voltage forfourth CASE when vA=5V and vB=5V\n", +"vB=5\n", +"disp('vB= '+string(vB)+' V') // Input voltage2 of diode AND logic gate for CASE: when vA=0V and vB=5V\n", +"vX=vA // Since both diodes D1 and D2 are Non-conducting, so no voltage drop across'R'(resistor)\n", +"disp('vX = vA = vB= '+string(vX)+' V') // Output voltage of diode AND logic gate for FOURTH CASE: when vA=5V and vB=5V" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 9.6: Find_low_and_high_level_noise_immunities.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//Ex9_6 \n", +"clc\n", +"VIL=0.6\n", +"disp('VIL= '+string(VIL)+' V') // Minimum input voltage level for which output is maximum\n", +"VIH=0.75\n", +"disp('VIH= '+string(VIH)+' V') // Maximum input voltage level for which output is minimum\n", +"VOL=0.2\n", +"disp('VOL= '+string(VOL)+' V') // Minimum output voltage level for maximum input level\n", +"VOH=1\n", +"disp('VOH= '+string(VOH)+' V') // Maximum output voltage level for minimum input level\n", +"NML=VIL-VOL\n", +"disp('NML=VIL-VOL= '+string(NML)+' V') // Low level noise immunities\n", +"NMH=VOH-VIH\n", +"disp('NMH=VOH-VIH= '+string(NMH)+' V') // High level noise immunities\n", +"\n", +"\n", +"" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 9.7: Find_fan_out_of_TTL.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//Ex9_7\n", +"clc\n", +"IIL=-1.6*10^(-3)\n", +"disp('IIL= '+string(IIL)+' A') // Input sink Current of TTL driver\n", +"IIH=40*10^(-6)\n", +"disp('IIH= '+string(IIH)+' A') // source (supply) reverse Current of TTL driver\n", +"IOL=16*10^(-3)\n", +"disp('IOL= '+string(IOL)+' A') // Specified Maximum sink Current of TTL driver\n", +"IOH=-400*10^(-6)\n", +"disp('IOH= '+string(IOH)+' A') // Specified Maximum source Current of TTL driver\n", +"Fan_out=abs((IOH/IIH))\n", +"disp('Fan-out=abs((IOH/IIH)=abs((IOL/IIL))= '+string(Fan_out))// Fan-out of TTL" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 9.8: Find_low_and_high_level_noise_immunities.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//Ex9_8 \n", +"clc\n", +"VIL=0.8\n", +"disp('VIL= '+string(VIL)+' V') // Minimum input voltage level for which output is maximum\n", +"VIH=2\n", +"disp('VIH= '+string(VIH)+' V') // Maximum input voltage level for which output is minimum\n", +"VOL=0.4\n", +"disp('VOL= '+string(VOL)+' V') // Minimum output voltage level for maximum input level\n", +"VOH=2.4\n", +"disp('VOH= '+string(VOH)+' V') // Maximum output voltage level for minimum input level\n", +"NML=VIL-VOL\n", +"disp('NML=VIL-VOL= '+string(NML)+' V') // Low level noise immunities\n", +"NMH=VOH-VIH\n", +"disp('NMH=VOH-VIH= '+string(NMH)+' V') // High level noise immunities\n", +"\n", +"" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 9.9: Find_low_and_high_level_noise_immunities.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//Ex9_9\n", +"clc\n", +"VIL=1\n", +"disp('VIL= '+string(VIL)+' V') // Minimum input voltage level for which output is maximum\n", +"VIH=4\n", +"disp('VIH= '+string(VIH)+' V') // Maximum input voltage level for which output is minimum\n", +"VOL=0.5\n", +"disp('VOL= '+string(VOL)+' V') // Minimum output voltage level for maximum input level\n", +"VOH=4.5\n", +"disp('VOH= '+string(VOH)+' V') // Maximum output voltage level for minimum input level\n", +"NML=VIL-VOL\n", +"disp('NML=VIL-VOL= '+string(NML)+' V') // Low level noise immunities\n", +"NMH=VOH-VIH\n", +"disp('NMH=VOH-VIH= '+string(NMH)+' V') // High level noise immunities\n", +"\n", +"\n", +"" + ] + } +], +"metadata": { + "kernelspec": { + "display_name": "Scilab", + "language": "scilab", + "name": "scilab" + }, + "language_info": { + "file_extension": ".sce", + "help_links": [ + { + "text": "MetaKernel Magics", + "url": "https://github.com/calysto/metakernel/blob/master/metakernel/magics/README.md" + } + ], + "mimetype": "text/x-octave", + "name": "scilab", + "version": "0.7.1" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} |