diff options
Diffstat (limited to 'Electonic_Devices_by_S_Sharma/5-MOSFETs.ipynb')
-rw-r--r-- | Electonic_Devices_by_S_Sharma/5-MOSFETs.ipynb | 1611 |
1 files changed, 1611 insertions, 0 deletions
diff --git a/Electonic_Devices_by_S_Sharma/5-MOSFETs.ipynb b/Electonic_Devices_by_S_Sharma/5-MOSFETs.ipynb new file mode 100644 index 0000000..71c45d5 --- /dev/null +++ b/Electonic_Devices_by_S_Sharma/5-MOSFETs.ipynb @@ -0,0 +1,1611 @@ +{ +"cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 5: MOSFETs" + ] + }, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 5.10: Necessary_value_of_Rs.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Exa 5.10\n", +"format('v',6)\n", +"clc;\n", +"clear;\n", +"close;\n", +"// Given data\n", +"V_GS = 4;// in V\n", +"V_P = 2;// in V\n", +"R2 = 10;// in k ohm\n", +"R1 = 30;// in k ohm\n", +"R_D= 2.5;// in kohm\n", +"I_D= 15;// in mA\n", +"I_D= I_D*10^-3;// in A\n", +"V_DD = 25;// in V\n", +"V_G = (V_DD/R_D)*V_DD/(R1+R2);// in V\n", +"// The necessary value for R_S\n", +"R_S = (V_G-V_GS)/I_D;// in ohm\n", +"disp(R_S,'The value of R_S in ohm is');" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 5.11: ID_and_VDS.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Exa 5.11\n", +"format('v',5)\n", +"clc;\n", +"clear;\n", +"close;\n", +"// Given data\n", +"k= 0.1;// in mA/V^2\n", +"V_T= 1;// in V\n", +"R2= 87*10^3;// in Ω\n", +"R1= 110*10^3;// in Ω\n", +"R_S=2;// in kΩ\n", +"R_D=2;// in kΩ\n", +"//R_D=3*10^3;// in Ω\n", +"V_DD= 6;// in V\n", +"V_SS= 6;// in V\n", +"V_G= (V_DD+V_SS)*R2/(R1+R2);// in V\n", +"// V_S= I_D*R_S-V_SS\n", +"// V_GS= V_G-V_S= V_G+V_SS-(I_D*R_S)\n", +"// I_D= k*[V_GS-V_T]^2 = k*[(V_G+V_SS-V_T)-(I_D*R_S)]^2\n", +"//(I_D*R_S)^2- I_D*(2*R_S*(V_G+V_SS-V_T)+1/k) +(V_G+V_SS-V_T)^2\n", +"A= R_S^2;// assumed\n", +"B= -(2*R_S*(V_G+V_SS-V_T)+1/k);// assumed\n", +"C= (V_G+V_SS-V_T)^2;// assumed\n", +"I_D= [A B C]\n", +"I_D= roots(I_D);// in mA\n", +"I_D= I_D(2);// in mA\n", +"disp(I_D,'The value of I_D in mA is : ')\n", +"// Applying KVL to drain source loop, V_DD+V_SS= I_D*R_D+V_DS+I_D*R_S\n", +"V_DS=V_DD+V_SS-I_D*R_D-I_D*R_S;// in V\n", +"disp(V_DS,'The value of V_DS in volts is : ')\n", +"\n", +"" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 5.12: Designing_of_NMOS_CS_circuit.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Exa 5.12\n", +"format('v',6)\n", +"clc;\n", +"clear;\n", +"close;\n", +"// Given data\n", +"k = 0.16;// in mA/V^2\n", +"V_T = 2;// in V\n", +"I_D = 0.5;// in mA\n", +"V_DD = 6;// in V\n", +"V_SS = -6;// in V\n", +"V_GS = V_T + (sqrt(I_D/k));// in V\n", +"R_S = 2;// in k ohm\n", +"V_S = (I_D*R_S) - V_DD;// in V\n", +"V_G = V_GS+V_S;// in V\n", +"I = 0.1*I_D;// in mA\n", +"R2 = (V_G+V_DD)/I;// in k ohm\n", +"disp(R2,'The value of R2 in k ohm is');\n", +"R1 = (V_DD - V_G)/I;// in k ohm\n", +"disp(R1,'The value of R1 in k ohm is');\n", +"R_D = 10;// in k ohm\n", +"V_DS = (V_DD-V_SS) - (I_D*(R_S+R_D));// in V\n", +"disp(V_DS,'The value of V_DS in V is');\n", +"V_DSsat = V_GS-V_T;// in V\n", +"disp(V_DSsat,'The value of V_DS(sat) in V is');\n", +"if V_DS>V_DSsat then\n", +" disp('The MOSFET is in saturation region')\n", +"end\n", +"\n", +"// Note: The value of R1 is in k ohm but in the book it is wrong." + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 5.13: IDQ_and_VDS.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Exa 5.13\n", +"format('v',5)\n", +"clc;\n", +"clear;\n", +"close;\n", +"// Given data\n", +"V_DD = 6;// in V\n", +"V_D = 3;// in V\n", +"R_D = 10;// in k ohm\n", +"// The value of I_DQ can be find as,\n", +"I_DQ = (V_DD-V_D)/R_D;// in mA\n", +"disp(I_DQ,'The value of I_DQ in mA is');\n", +"V_T = 0.8;// in V\n", +"k = 0.12;// in mA/V^2\n", +"// The value of Ground to Source voltage,\n", +"V_GS = sqrt(I_DQ/k) + V_T;// in V\n", +"V_S = -V_GS;// in V\n", +"// The value of Drain to Source voltage,\n", +"V_DS = V_D-V_S;// in V\n", +"disp(V_DS,'The value of V_DS in V is');" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 5.14: The_region_of_operation.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Exa 5.14\n", +"format('v',5)\n", +"clc;\n", +"clear;\n", +"close;\n", +"// Given data\n", +"I_D = 0.3;// in mA\n", +"k = 0.12;// in mA/V^2\n", +"V_T = 1;// in V\n", +"V_GS = V_T + (sqrt(I_D/k));// in V\n", +"V_S = -V_GS;// in V\n", +"V_DD = 6;// in V\n", +"V_D = 3;// in V\n", +"I_DQ = 0.3;// in mA\n", +"R_D = (V_DD-V_D)/I_DQ;// in k ohm\n", +"disp(R_D,'The value of R_D in k ohm is');\n", +"V_DS = V_D - V_S;// in V\n", +"disp(V_DS,'The value of V_DS in V is');\n", +"V_DSsat = V_GS - V_T;// in V\n", +"disp(V_DSsat,'The value of V_DS(sat) in V is');\n", +"if V_DS>V_DSsat then\n", +" disp('The MOSFET is in saturation region')\n", +"end" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 5.15: VDS_VGS_and_ID.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Exa 5.15\n", +"format('v',6)\n", +"clc;\n", +"clear;\n", +"close;\n", +"// Given data\n", +"k= 0.05;// in mA/V^2\n", +"V_T= 1;// in V\n", +"V_DD= 6;// in V\n", +"R_S= 9.1;//in kΩ\n", +"//V_GS= V_DD-I_D*R_S\n", +"//I_D= k*(V_DD-I_D*R_S)^2\n", +"//I_D^2*R_S^2-I_D*(2*V_DD*R_S+1/k)+V_DD^2\n", +"A= R_S^2;// assumed\n", +"B=-(2*V_DD*R_S+1/k);// assumed\n", +"C= V_DD^2;// assumed\n", +"I_D= [A B C];\n", +"I_D= roots(I_D);// in mA\n", +"I_D= I_D(2);// in mA\n", +"V_GS= V_DD-I_D*R_S;// in V\n", +"V_DS= V_GS;// in V\n", +"disp(I_D,'The value of I_D in mA is : ')\n", +"disp(V_GS,'The value of V_GS in volts is : ')\n", +"disp(V_DS,'The value of V_DS in volts is : ')" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 5.16: All_dc_voltages.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Exa 5.16\n", +"format('v',6)\n", +"clc;\n", +"clear;\n", +"close;\n", +"// Given data\n", +"k1= 0.01;// in mA/V^2\n", +"k2= 0.05;// in mA/V^2\n", +"V_DD= 5;// in V\n", +"V_T1=1;// in V\n", +"V_T2=1;// in V\n", +"// Analysis for Vi= 5V\n", +"Vi= 5;// in V\n", +"//I_D1= k1*(V_GS1-V_T1)^2 and I_D2= k2*(2*(V_GS2-V_T2)*V_DS2-V_DS2^2)\n", +"// But V_GS2= Vi, V_DS2= Vo, V_GS1= V_DS1= V_DD-Vo\n", +"//Vo^2*(k1+k2)-Vo*[2*k1*(V_DD-V_T1)+2*k2*(Vi-V_T2)]+k1*(V_DD-V_T1)^2\n", +"A=(k1+k2);\n", +"B=-[2*k1*(V_DD-V_T1)+2*k2*(Vi-V_T2)];\n", +"C=k1*(V_DD-V_T1)^2;\n", +"Vo= [A B C]\n", +"Vo= roots(Vo);// in V\n", +"Vo= Vo(2);// in V\n", +"V_GS2= Vi;// in V\n", +"V_DS2= Vo;// in V\n", +"V_GS1= V_DD-Vo;// in V\n", +"I_D1= k1*(V_GS1-V_T1)^2;// in mA\n", +"I_D2= I_D1;// in mA\n", +"disp('Part (i) For Vi = 5 V')\n", +"disp(Vo,'The output voltage in volts is : ')\n", +"disp(I_D1,'The value of I_D1 in mA is : ')\n", +"disp(I_D2,'The value of I_D2 in mA is : ')\n", +"// Analysis for Vi= 1.5V\n", +"Vi= 1.5;// in V\n", +"//I_D2= k2*(V_GS2-V_T2)^2 and I_D1= k1*(V_GS1-V_T1)^2\n", +"// But V_GS2= Vi, V_DS2= Vo, V_GS1= V_DS1= V_DD-Vo\n", +"//k2*(Vi-V_T2)^2= k1*(V_DD-Vo-V_T1)^2 or \n", +"Vo= V_DD-V_T1-sqrt(k2/k1)*(Vi-V_T2);// in V\n", +"I_D2= k2*(Vi-V_T2)^2;//in mA\n", +"I_D1= I_D2;// in mA\n", +"disp('Part (ii) For Vi = 1.5 V')\n", +"disp(Vo,'The output voltage in volts is : ')\n", +"disp(I_D1,'The value of I_D1 in mA is : ')\n", +"disp(I_D2,'The value of I_D2 in mA is : ')\n", +"\n", +"\n", +"\n", +"\n", +"\n", +"" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 5.17: ID_and_VDS.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Exa 5.17\n", +"format('v',6)\n", +"clc;\n", +"clear;\n", +"close;\n", +"// Given data\n", +"k = 0.12;// in mA/V^2\n", +"V_T = -2.5;// in V\n", +"V_GS = 0;\n", +"I_D = k*((V_GS-V_T)^2);// in mA\n", +"disp(I_D,'The value of I_D in mA is');\n", +"V_DD = 6;// in V\n", +"R_S = 4.7;// in k ohm \n", +"V_DS = V_DD -(I_D*R_S);// in V\n", +"disp(V_DS,'The value of V_DS in V is '); \n", +"V_S = 0;// in V \n", +"V_DSsat = V_S - V_T;// in V\n", +"disp(V_DSsat,'The value of V_DS(sat) in V is');\n", +"if V_DS<V_DSsat then\n", +" disp('The device is in the non saturation region')\n", +"end" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 5.18: Various_voltage_and_current.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Exa 5.18\n", +"format('v',6)\n", +"clc;\n", +"clear;\n", +"close;\n", +"// Given data\n", +"k4 = 0.125;// in mA/V^2\n", +"k3 = k4;// in mA/V^2\n", +"k2 = k4;// in mA/V^2\n", +"k1 = 0.25;// in mA/V^2\n", +"V_T1 = 0.8;// in V\n", +"V_T2 = V_T1;// in V\n", +"V_T3 = V_T1;// in V\n", +"V_T4 = V_T1;// in V\n", +"V_SS = -5;// in V\n", +"V_DD = 5;// in V\n", +"R_D = 10;// in k ohm\n", +"// Required formula, V_GS3 = ((sqrt(k4/k3) * (-V_SS - V_T4))+V_T3)/(1+sqrt(k4/k3))\n", +"V_GS3 = ((sqrt(k4/k3) * (-V_SS - V_T4))+V_T3)/(1+sqrt(k4/k3));// in V\n", +"// Calculation to evaluate the value of I_Q,\n", +"I_Q = k2*((V_GS3-V_T2)^2);// in mA\n", +"I_D1 = I_Q;// in mA\n", +"// The value of V_GS1,\n", +"V_GS1 = V_T1 + (sqrt(I_D1/k1));// in V\n", +"disp(V_GS1,'The value of V_GS1 in V is');\n", +"// The value of V_DS2,\n", +"V_DS2 = (-V_SS-V_GS1);// in V\n", +"disp(V_DS2,'The value of V_DS2 in V is');\n", +"// The value of V_DS1,\n", +"V_DS1 = V_DD - (I_Q*R_D) - (V_SS + V_DS2);// in V\n", +"disp(V_DS1,'The value of V_DS1 in V is');\n", +"" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 5.19: Q_point.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Exa 5.19\n", +"format('v',6)\n", +"clc;\n", +"clear;\n", +"close;\n", +"// Given data\n", +"R2 = 20;// in k ohm\n", +"R1 = 30;// in k ohm\n", +"R_D = 20;// in k ohm\n", +"R_D=R_D*10^3;// in ohm\n", +"V_DD = 5;// in V\n", +"V_G = (R2/(R1+R2))*V_DD;// in V\n", +"V_S = 0;// in V\n", +"V_GS = V_G;// in V\n", +"k = 100*10^-6;// in A/V^2\n", +"V_T = 1;// in V\n", +"// The value of I_DQ,\n", +"I_DQ = k*((V_GS-V_T)^2);// in A\n", +"I_DQ= I_DQ * 10^6;// in µA\n", +"disp(I_DQ,'The value of I_DQ in µA is');\n", +"I_DQ= I_DQ * 10^-6;// in A\n", +"// The value of V_DSQ,\n", +"V_DSQ = V_DD - (I_DQ*R_D);// in V \n", +"disp(V_DSQ,'The value of V_DSQ in V is');" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 5.1: Current.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Exa 5.1\n", +"format('v',6)\n", +"clc;\n", +"clear;\n", +"close;\n", +"// Given data\n", +"V_TN = 0.7;// in V\n", +"W = 45*10^-4;// in cm\n", +"L = 4;// in µm\n", +"L = L * 10^-4;// in cm\n", +"t_ox = 450;// in Å\n", +"t_ox = t_ox*10^-8;// in cm\n", +"V_GS = 1.4;// in V\n", +"Miu_n = 700;// in cm^2/V-s\n", +"Epsilon_ox = (8.85*10^-14)*(3.9);// in F/cm\n", +"// Conduction parameter can be expressed as,\n", +"k_n = (W*Miu_n*Epsilon_ox)/(2*L*t_ox);// A/V^2\n", +"k_n= k_n*10^3;// in mA/V^2\n", +"disp(k_n,'The value of k_n in mA/V^2 is : ')\n", +"k_n= k_n*10^-3;// in A/V^2\n", +"// The drain current,\n", +"I_D = k_n*((V_GS-V_TN)^2);// in A\n", +"I_D= I_D*10^3;// in mA\n", +"disp(I_D,'The current in mA is ');\n", +"\n", +"// Note: There is a calculation error to find the value of k_n, So the answer in the book is wrong" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 5.20: IDQ_VGSQ_and_VD.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Exa 5.20\n", +"format('v',6)\n", +"clc;\n", +"clear;\n", +"close;\n", +"// Given data\n", +"V_P= -8;// in V\n", +"R_S= 2.4;// in kΩ\n", +"//R_D= 1800;// in Ω\n", +"I_DSS= 8;// in mA\n", +"V_DD= 20;// in V\n", +"R_D= 6.2;// in kΩ\n", +"// V_GS= -I_D*R_S\n", +"// I_D= I_DSS*(1-V_GS/V_P)^2 or I_DSS*(1-(-I_D*R_S)/V_P)^2\n", +"//I_D^2*R_S^2+I_D*(2*R_S*(V_P-V_G)-V_P^2/I_DSS)+(V_P)^2\n", +"A= R_S^2\n", +"B=(2*R_S*(V_P)-V_P^2/I_DSS)\n", +"C=(V_P)^2\n", +"I_D= [A B C]\n", +"// Evaluation fo I_D using by polynomial method\n", +"I_D= roots(I_D);// in mA\n", +"I_D= I_D(2);// in mA\n", +"I_DQ= I_D;// in mA\n", +"disp(I_DQ,'The value of I_DQ in mA is : ')\n", +"// The value of V_GSQ\n", +"V_GSQ= -I_D*R_S;// in V\n", +"disp(V_GSQ,'The value of V_GSQ in volts ')\n", +"// The value of V_D,\n", +"V_D= V_DD-I_D*R_D;// in V\n", +"disp(V_D,'The value of V_D in volts is : ')" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 5.21: ID_VD_VS_and_VG.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Exa 5.21\n", +"format('v',6)\n", +"clc;\n", +"clear;\n", +"close;\n", +"// Given data\n", +"k= 75*10^-3;//in mA/V^2\n", +"Vth= -0.8;// in V\n", +"R2 = 100;// in k ohm\n", +"R1 = 100;// in k ohm\n", +"R_S= 6;// in kΩ\n", +"R_D= 3;// in kΩ\n", +"V_SS = 10;// in V\n", +"V_G = (R2/(R1+R2))*V_SS;// in V\n", +"I_D= poly(0,'I_D');\n", +"V_S= V_SS-I_D*R_S;// in V\n", +"V_GS= V_G-V_S;//in V\n", +"I_D= I_D-k*(V_GS-Vth)^2;\n", +"I_D= roots(I_D);// in mA\n", +"// For I_D(1), the V_DS will be positive, so discarding this\n", +"I_D= I_D(2);// in mA\n", +"V_DS= -V_SS+I_D*(R_D+R_S);// in V\n", +"V_D= I_D*R_D;// in V\n", +"V_S= I_D*R_S;// in V\n", +"disp(I_D,'The value of I_D in mA is : ')\n", +"disp(V_DS,'The value of V_DS in volts is : ')\n", +"disp(V_D,'The value of V_D in volts is : ')\n", +"disp(V_S,'The value of V_S in volts is : ')" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 5.22: Value_of_RD.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Exa 5.22\n", +"format('v',6)\n", +"clc;\n", +"clear;\n", +"close;\n", +"// Given data\n", +"V_T = 1;// in V\n", +"k = 160*10^-6;// in A/V^2\n", +"I_DQ = 160*10^-6;// in A\n", +"V_GS = V_T + sqrt(I_DQ/k);// in V\n", +"V_DD = 5;// in V\n", +"V_DSQ = 3;// in V\n", +"R_D = (V_DD - V_DSQ)/(I_DQ);// in ohm\n", +"R_D = R_D * 10^-3;// in k ohm\n", +"disp(R_D,'The value of R_D in k ohm is');" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 5.23: Q_point.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Exa 5.23\n", +"format('v',6)\n", +"clc;\n", +"clear;\n", +"close;\n", +"// Given data\n", +"V_DD= 12;// in V\n", +"V_T= 2;// in V\n", +"kn= 0.5;// in mA/V^2\n", +"R1 = 2.2;// in M ohm\n", +"R2 = 1.8;// in M ohm\n", +"R_S= 1.5;// in kΩ\n", +"R_D= 3.9;// in kΩ\n", +"V_G = (R2/(R1+R2))*V_DD;// in V\n", +"I_D= poly(0,'I_D')\n", +"V_GS= V_G-I_D*R_S;// V\n", +"// Evaluation the value of I_D by using polynomial method\n", +"I_D= I_D-kn*(V_GS-V_T)^2;// in mA\n", +"I_D= roots(I_D);// in mA\n", +"I_D= I_D(2);// in mA\n", +"I_DQ= I_D;// in mA\n", +"// Evaluation the value of V_DSQ,\n", +"V_DSQ= V_DD-I_D*(R_D+R_S);// in V\n", +"disp(I_DQ,'The value of I_DQ in mA is : ')\n", +"disp(V_DSQ,'The value of V_DSQ in volts is : ')\n", +"V_GS= V_G-I_D*R_S;// V\n", +"V_DSsat= V_GS-V_T;// in V\n", +"disp('The value of V_DS ( '+string(V_DSQ)+' V ) is greater than the value of ')\n", +"disp('V_DSsat ( '+string(V_DSsat)+' V ), So the MOSFET is in saturation region')" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 5.24: IDSQ_VGSQ_and_VDSQ.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Exa 5.24\n", +"format('v',5)\n", +"clc;\n", +"clear;\n", +"close;\n", +"// Given data\n", +"kn= 0.5;// in mA/V^2\n", +"V_T= 1;// in V\n", +"R2 = 40;// in k ohm\n", +"R1 = 60;// in k ohm\n", +"R_S= 1;// in k ohm\n", +"R_D= 2;// in k ohm\n", +"V_DD = 5;// in V\n", +"V_SS = -5;// in V\n", +"V_R2 = (R2/(R2+R1))*(V_DD-V_SS);// in V\n", +"V_G = V_R2 - V_DD;// in V\n", +"I_D= poly(0,'I_D');\n", +"V_S= I_D*R_S+V_SS;// in V\n", +"V_GS= V_G-V_S;// in V\n", +"// Evaluation the value of I_D by using polynomial method,\n", +"I_D=I_D-kn*(V_GS-V_T)^2;// in mA\n", +"I_D= roots(I_D);// in mA\n", +"// Discarding I_D(1), as it will result in a negative V_DS\n", +"I_D= I_D(2);// in mA\n", +"I_DQ= I_D;// in mA\n", +"V_S= I_D*R_S+V_SS;// in V\n", +"V_GS= V_G-V_S;// in V\n", +"// The value of V_DSQ,\n", +"V_DSQ= V_DD-V_SS-I_D*(R_D+R_S);// in V\n", +"disp(I_DQ,'The value of I_DQ in mA is : ')\n", +"disp(V_GS,'The value of V_GS in volts is : ')\n", +"disp(V_DSQ,'The value of V_DSQ in volts is : ')\n", +"" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 5.25: ID_VDS_VGS_and_Av.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Exa 5.25\n", +"format('v',6)\n", +"clc;\n", +"clear;\n", +"close;\n", +"// Given data\n", +"R_S1 = 100*10^-3;// in k ohm\n", +"R_S2 = 100*10^-3;// in k ohm\n", +"R_S = R_S1+R_S2;// in k ohm\n", +"R_D= 1.8;// in k ohm\n", +"I_DSS= 12;// in mA\n", +"Vp= -3.5;// in V\n", +"V_DD= 22;// in V\n", +"rd= 25;// in k ohm\n", +"R_L= 47;// in k ohm\n", +"I_D= poly(0,'I_D');\n", +"V_GS= -I_D*R_S;// in V\n", +"// Evaluation the value of I_D by using polynomial method,\n", +"I_D= I_D-I_DSS*(1-V_GS/Vp)^2;// in mA\n", +"I_D= roots(I_D);// in mA\n", +"// Discarding I_D(1), as it will give a negative result V_DS\n", +"I_D= I_D(2);// in mA\n", +"disp(I_D,'The value of I_D in mA is : ')\n", +"// The value of V_GS,\n", +"V_GS= -I_D*R_S;// in V\n", +"disp(V_GS,'The value of V_GS in volts is : ')\n", +"// The value of V_DS,\n", +"V_DS= V_DD-I_D*(R_D+R_S);// in V\n", +"disp(V_DS,'The value of V_DS in volts is : ')\n", +"gmo= -2*I_DSS/Vp;// in mS\n", +"gm= gmo*(1-V_GS/Vp);// in mS\n", +"miu= gm*rd;\n", +"// The value of Av,\n", +"Av= -miu*R_D*R_L/(R_D+R_L)/(rd+R_D*R_L/(R_D+R_L)+(1+miu)*R_S1);\n", +"disp(Av,'The value of Av is : ')" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 5.26: VGS_ID_and_VDS.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Exa 5.26\n", +"format('v',6)\n", +"clc;\n", +"clear;\n", +"close;\n", +"// Given data\n", +"V_T = 1;// in V\n", +"k = 0.5;// in mA/V^2\n", +"R2 = 40;// in k ohm\n", +"R1 = 60;// in k ohm\n", +"R_S= 1;// in k ohm\n", +"R_D= 2;// in k ohm\n", +"V_DD = 5;// in V\n", +"V_G = (R2/(R2+R1))*V_DD;// in V\n", +"I_D= poly(0,'I_D');\n", +"V_GS= V_G-I_D*R_S;// in V\n", +"// Evaluation the value of I_D by using polynomial method,\n", +"I_D= I_D-k*(V_GS-V_T)^2;\n", +"I_D= roots(I_D);// in mA\n", +"// For I_D(1), V_DS will be negative , so discarding it\n", +"I_D= I_D(2);// in mA\n", +"// The value of V_GS,\n", +"V_GS= V_G-I_D*R_S;// in V\n", +"// The value of V_DS,\n", +"V_DS= V_DD-I_D*(R_D+R_S);// in V\n", +"disp(I_D,'The value of I_D in mA is : ')\n", +"disp(V_GS,'The value of V_GS in volts is : ')\n", +"disp(V_DS,'The value of V_DS in volts is : ')" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 5.27: Drain_current_and_source_to_drain_voltage.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Exa 5.27\n", +"format('v',6)\n", +"clc;\n", +"clear;\n", +"close;\n", +"// Given data\n", +"R_D = 7.5;// in k ohm\n", +"V_T = -0.8;// in V\n", +"k = 0.2;// in mA/V^2\n", +"R2 = 50;// in ohm\n", +"R1 = 50;// in ohm\n", +"V_DD = 5;// in V\n", +"V_S = 5;// in V\n", +"V_G = (R2/(R2+R1))*V_DD;// in V\n", +"V_GS = V_G - V_S;// in V\n", +"I_D = k*((V_GS-V_T)^2);// in mA\n", +"disp(I_D,'Drain current in mA is');\n", +"V_SD = V_DD - (I_D*R_D);// in V\n", +"disp(V_SD,'Source to drain voltage in V is');" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 5.28: IDQ_VGSQ_VD_and_VS.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Exa 5.28\n", +"format('v',6)\n", +"clc;\n", +"clear;\n", +"close;\n", +"// Given data\n", +"I_Don = 5*10^-3;// in A\n", +"V_GSon = 6;// in V\n", +"V_GSth = 3;// in V\n", +"k = I_Don/(V_GSon-V_GSth)^2;// in A/V^2 \n", +"R2 = 6.8;// in M ohm\n", +"R1 = 10;// in M ohm\n", +"R_S= 750;// in ohm\n", +"R_D= 2.2*10^3;// in ohm\n", +"V_DD = 24;// in V\n", +"R_S = 750;// in ohm\n", +"// Applying KVL for input circuit\n", +"V_G= R2*V_DD/(R1+R2);// in V\n", +"I_D= poly(0,'I_D');\n", +"V_GS= V_G-I_D*R_S;// in V\n", +"I_D= I_D-k*(V_GS-V_GSth)^2;\n", +"I_D= roots(I_D);// in A\n", +"I_D= I_D(2);// in A\n", +"I_DQ= I_D;// in A\n", +"V_GS= V_G-I_D*R_S;// in V\n", +"V_GSQ= V_GS;// in V\n", +"V_DSQ= V_DD-I_DQ*(R_D+R_S);// in V\n", +"I_D= I_D*10^3;// in mA\n", +"disp(I_D,'The value of I_D in mA is : ')\n", +"disp(V_GSQ,'The value of V_GSQ in volts is : ')\n", +"disp(V_DSQ,'The value of V_DSQ in volts is : ')\n", +"" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 5.29: VDD_RD_and_VGS.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Exa 5.29\n", +"format('v',6)\n", +"clc;\n", +"clear;\n", +"close;\n", +"// Given data\n", +"I_Don = 4*10^-3;// in A\n", +"V_GSon = 6;// in V\n", +"V_GSth = 3;// in V\n", +"V_DS= 6;// in V\n", +"I_D= I_Don;// in A\n", +"k = I_Don/((V_GSon-V_GSth)^2);// in A/V^2\n", +"V_GS= poly(0,'V_GS')\n", +"// Evaluation the value of V_GS by using polynomial method,\n", +"V_GS= I_D-k*(V_GS-V_GSth)^2;\n", +"V_GS= roots(V_GS);// in V\n", +"V_GS= V_GS(1);// in V\n", +"V_DD= 2*V_DS;// in V\n", +"// V_GS= V_DD-I_D*R_D\n", +"// Drain resistance,\n", +"R_D= (V_DD-V_GS)/I_D;// in ohm\n", +"R_D=R_D*10^-3;// in k ohm\n", +"disp(V_GS,'The value of V_GS in volts is : ')\n", +"disp(V_DD,'The value of V_DD in volts is : ')\n", +"disp(R_D,'The value of R_D in kΩ is : ')" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 5.2: IDQ_and_VDSQ.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Exa 5.2\n", +"format('v',5)\n", +"clc;\n", +"clear;\n", +"close;\n", +"// Given data\n", +"I_Don = 6;// in mA\n", +"I_Don= I_Don*10^-3;// in A\n", +"V_GSon = 8;// in V\n", +"V_GSth = 3;// in V\n", +"V_DD = 12;// in V\n", +"R_D= 2*10^3;// in Ω\n", +"k= I_Don/(V_GSon-V_GSth)^2;// in A/V^2\n", +"// I_D= k*[V_GS-V_GSth]^2 but V_GS= V_DD-I_D*R_D, So\n", +"// I_D= k*(V_DD-I_D*R_D-V_GSth)^2 or\n", +"// I_D^2*R_D^2+I_D*(2*R_D*V_GSth-2*R_D*V_DD-1/k)+(V_DD-V_GSth)^2\n", +"A= R_D^2;// assumed\n", +"B= 2*R_D*V_GSth-2*R_D*V_DD-1/k;// assumed\n", +"C= (V_DD-V_GSth)^2;// assumed\n", +"// Evaluating the value of I_D \n", +"root= [A B C]; \n", +"root= roots(root);// in A\n", +"disp('The value of I_D is : '+string(root(1)*10^3)+' mA or '+string(root(2)*10^3)+' mA')\n", +"I_DQ= root(2);// in A\n", +"disp(I_DQ*10^3,'The value of I_DQ in mA is : ')\n", +"V_DSQ= V_DD-I_DQ*R_D;// in V\n", +"disp(V_DSQ,'The value of V_DSQ in volts is : ')" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 5.30: Value_of_ID.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Exa 5.30\n", +"format('v',6)\n", +"clc;\n", +"clear;\n", +"close;\n", +"// Given data\n", +"I_DD= 20;// in mA\n", +"R2 = 10;// in k ohm\n", +"R1 = 30;// in k ohm\n", +"R_S= 1.2;// in k ohm\n", +"R_D= 500*10^-3;// in k ohm\n", +"V_DD = 12;// in V\n", +"Vp= -6;// in V\n", +"V_G = (R2/(R2+R1))*V_DD;// in V\n", +"I_D= poly(0,'I_D')\n", +"V_GS= V_G-I_D*R_S;// in V\n", +"// Evaluation the value of I_D by using polynomial method,\n", +"I_D=I_D-I_DD*(1-V_GS/Vp)^2;\n", +"I_D= roots(I_D);// in mA\n", +"// For I_D(1), V_DS will be negative, so discarding it\n", +"I_D= I_D(2);// in mA\n", +"// The value of V_DS,\n", +"V_DS= V_DD-I_D*(R_D+R_S);// in V\n", +"// The value of V_D,\n", +"V_D= V_DD-I_D*R_D;// in V\n", +"// The value of V_S,\n", +"V_S= V_D-V_DS;// in V\n", +"disp(I_D,'The value of I_D in mA is : ')\n", +"disp(V_DS,'The value of V_DS in volts is : ')\n", +"disp(V_D,'The value of V_D in volts is : ')\n", +"disp(V_S,'The value of V_S in volts is : ')\n", +"\n", +"" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 5.31: Voltages_at_all_nodes.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Exa 5.31\n", +"format('v',5)\n", +"clc;\n", +"clear;\n", +"close;\n", +"// Given data\n", +"V_DD = 5;// in V\n", +"V_T= 1;// in V\n", +"k= 1;// in mA/V^2\n", +"R1 = 1;// in M ohm\n", +"R2 = 1;// in M ohm\n", +"R_S= 2;// in k ohm\n", +"R_D= 2;// in k ohm\n", +"// Calculation of I1\n", +"I1 = V_DD/(R1+R2);// in A\n", +"disp(I1,'The value of I1 in µA is : ')\n", +"// The value of V_A,\n", +"V_A = (R2/(R2+R1))*V_DD;// in V\n", +"disp(V_A,'The value of V_A and V_G in volts is : ')\n", +"I_D= poly(0,'I_D');\n", +"V_C= I_D*R_S;// in V\n", +"V_GS= V_A-V_C;// in V\n", +"// Evaluation the value of I_D by using polynomial method,\n", +"I_D= I_D-k*(V_GS-V_T)^2;\n", +"I_D= roots(I_D);// in mA\n", +"// For I_D(1), V_DS will be negative, so discarding it\n", +"I_D= I_D(2);// in mA\n", +"disp(I_D,'The value of I_D in mA is : ')\n", +"// The value of V_B,\n", +"V_B= V_DD-I_D*R_D;// in V\n", +"// The value of V_C,\n", +"V_C= I_D*R_S;// in V\n", +"// The value of V_DS,\n", +"V_DS= V_B-V_C;// in V\n", +"disp(V_B,'The value of V_B in volts is : ')\n", +"disp(V_C,'The value of V_C in volts is : ')\n", +"disp(V_DS,'The value of V_DS in volts is : ')\n", +"\n", +"// Note: In the book, the calculated values are not accurate, this is why the answer in the book is wrong." + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 5.32: Av_Ri_Ro_and_Rodesh.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Exa 5.32\n", +"format('v',6)\n", +"clc;\n", +"clear;\n", +"close;\n", +"// Given data\n", +"I_DSS = 12;// in mA\n", +"I_DSS= I_DSS*10^-3;// in A\n", +"V_P = -3;// in V\n", +"r_d = 45;// in k ohm\n", +"r_d= r_d*10^3;// in ohm\n", +"g_m = I_DSS/abs(V_P);// in S\n", +"// Part (i)\n", +"R1 = 91;// in M ohm\n", +"R1=R1*10^6;//in ohm\n", +"R2 = 10;// in M ohm\n", +"R2= R2*10^6;// in ohm\n", +"// Calculation to find the value of Ri\n", +"Ri= R1*R2/(R1+R2);// in ohm\n", +"Ri=Ri*10^-6;// in M ohm\n", +"disp(Ri,'The value of Ri in Mohm is : ')\n", +"// Part (ii)\n", +"R_S = 1.1;// in k ohm\n", +"R_S = R_S * 10^3;// in ohm\n", +"// The value of R_o,\n", +"R_o= (R_S*1/g_m)/(R_S+1/g_m);// in ohm\n", +"disp(R_o,'The value of R_C in ohm is : ')\n", +"// Part (iii)\n", +"// The value of R_desh_o\n", +"R_desh_o= R_o*r_d/(R_o+r_d);// in ohm\n", +"disp(R_desh_o,'The value of R''o in ohm is : ');\n", +"// Part (iv)\n", +"// The voltage gain can be find as,\n", +"Av= g_m*(R_S*r_d/(R_S+r_d))/(1+g_m*(R_S*r_d/(R_S+r_d)));\n", +"disp(Av,'The value of Av is : ')" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 5.34: Current_flow_through_M1_MOSFET.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Exa 5.34\n", +"format('v',6)\n", +"clc;\n", +"clear;\n", +"close;\n", +"// Given data\n", +"V_S2 = -2;// in V\n", +"V_GS2 = -V_S2;// in V\n", +"I_DS2 = (V_GS2-1)^2;// in mA\n", +"I = 2;// in mA\n", +"// The current flow through M1 MOSFET,\n", +"I_DS1 = I-I_DS2;// in mA\n", +"disp(I_DS1,'The current flow through M1 MOSFET in mA is');" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 5.35: Value_of_R_and_VD.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Exa 5.35\n", +"format('v',6)\n", +"clc;\n", +"clear;\n", +"close;\n", +"// Given data\n", +"V_DD= 10;// in V\n", +"I_D= 0.4*10^3;// in A\n", +"W= 100;// in µm\n", +"L= 10;// in µm\n", +"uACox= 20;// in A/V^2\n", +"Vt= 2;// in V\n", +"R= poly(0,'R')\n", +"V_GS= V_DD-I_D*R;// in V\n", +"// Evaluation the value of R by using polynomial method,\n", +"R= I_D-1/2*uACox*W/L*(V_GS-Vt)^2;\n", +"R= roots(R);// in Mohm\n", +"// For R(1), V_DS will be zero, so discarding it\n", +"R= R(2);// in Mohm\n", +"R=R*10^3;// in k ohm\n", +"disp(R,'The value of R in kΩ is : ')\n", +"R=R*10^-3;// in ohm\n", +"// The value of V_D,\n", +"V_D= V_DD-I_D*R;// in V\n", +"disp(V_D,'The value of V_D in volts is : ')" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 5.36: ID_and_VDS.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Exa 5.36\n", +"format('v',5)\n", +"clc;\n", +"clear;\n", +"close;\n", +"// Given data\n", +"V_GSth= 2;// in V\n", +"k= 2*10^-4;// in A/V^2\n", +"V_DD= 12;// in V\n", +"R_D= 5*10^3;// in ohm\n", +"I_D= poly(0,'I_D');\n", +"V_DS= V_DD-I_D*R_D;// in V\n", +"// Evaluation the value of I_D by using polynomial method,\n", +"I_D= I_D-k*(V_DS-V_GSth)^2;\n", +"I_D= roots(I_D);// in A\n", +"// For I_D(1), V_DS will be negative, so discarding it\n", +"I_D= I_D(2);// in A\n", +"// The value of V_DS,\n", +"V_DS= V_DD-I_D*R_D;// in V\n", +"I_D= I_D*10^3;// in mA\n", +"disp(I_D,'The value of I_D in mA is : ')\n", +"disp(V_DS,'The value of V_DS in volts is : ')\n", +"\n", +"" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 5.3: Designing_of_biasing_circuit.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Exa 5.3\n", +"format('v',6)\n", +"clc;\n", +"clear;\n", +"close;\n", +"// Given data\n", +"V_GS = 6;// in V\n", +"I_D = 4;// in mA\n", +"V_GSth = 2;// in V\n", +"V_DS = V_GS;// in V\n", +"// For a good design\n", +"V_DD = 2*V_DS;// in V\n", +"disp(V_DD,'The value of V_DD in V is')\n", +"R_D = (V_DD-V_DS)/I_D;// in k ohm\n", +"disp(R_D,'The value of R_D in k ohm is ');\n", +"disp('The very high value for the gate to drain resistance is : 10 MΩ')" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 5.4: IDQ_VGSQ_and_VDS.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Exa 5.4\n", +"format('v',6)\n", +"clc;\n", +"clear;\n", +"close;\n", +"// Given data\n", +"I_Don = 3*10^-3;\n", +"V_GSon = 10;// in V\n", +"V_GSth= 5;// in V\n", +"R2= 18*10^6;// in Ω\n", +"R1= 22*10^6;// in Ω\n", +"R_S=820;// in Ω\n", +"R_D=3*10^3;// in Ω\n", +"V_DD= 40;// in V\n", +"V_G= V_DD*R2/(R1+R2);// in V\n", +"k= I_Don/(V_GSon-V_GSth)^2;// in A/V^2\n", +"// V_G= V_GS+V_RS= V_GS+I_D*R_S or V_GS= V_G-I_D*R_S\n", +"// I_D= k*[V_GS-V_GSth]^2 or \n", +"// I_D= k*(V_G-I_D*R_D-V_GSth)^2 or\n", +"// I_D^2*R_D^2+I_D*(2*R_D*V_GSth-2*R_D*V_DD-1/k)+(V_DD-V_GSth)^2\n", +"A= R_S^2;// assumed\n", +"B= 2*R_S*V_GSth-2*R_S*V_G-1/k;// assumed\n", +"C= (V_G-V_GSth)^2;// assumed\n", +"// Evaluating the value of I_D \n", +"I_D= [A B C]\n", +"I_D= roots(I_D);// in A\n", +"I_D= I_D(2);// in A\n", +"I_DQ= I_D;// in A\n", +"I_DQ= I_DQ*10^3;// in mA\n", +"disp(I_DQ,'The value of I_DQ in mA is : ')\n", +"I_DQ= I_DQ*10^-3;// in A\n", +"V_GSQ= V_G-I_D*R_S;// in V\n", +"disp(V_GSQ,'The value of V_GSQ in volts is : ')\n", +"V_DSQ= V_DD-I_DQ*(R_D+R_S);// in V\n", +"disp(V_DSQ,'The value of V_DSQ in volts is : ')\n", +"\n", +"" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 5.5: IDSQ_VGSQ_and_VDSQ.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Exa 5.5\n", +"format('v',6)\n", +"clc;\n", +"clear;\n", +"close;\n", +"// Given data\n", +"I_D= '0.3*(V_GS-V_P)^2';// given expression\n", +"V_DD= 30;// in V\n", +"V_P= 4;// in V\n", +"R_GS = 1.2*10^6;// in Ω\n", +"R_G = 1.2*10^6;// in Ω\n", +"Req= R_GS/(R_GS+R_G);// in Ω\n", +"R_D= 15;// in Ω\n", +"// V_DS= V_DD-I_D*R_D (applying KVL to drain circuit)\n", +"// V_GS= Req*V_DS= (V_DD-I_D*R_D)*Req\n", +"// from given expression\n", +"//I_D^2*(R_D*Req)^2 - I_D*(2*R_D*Req*(V_DD*Req-V_P)+1/0.3 + (V_DD*Req-V_P)^2)\n", +"A= (R_D*Req)^2;// assumed\n", +"B= -(2*R_D*Req*(V_DD*Req-V_P)+1/0.3);// assumed\n", +"C= (V_DD*Req-V_P)^2;// assumed\n", +"// Evaluating the value of I_D\n", +"I_D= [A B C]\n", +"I_D= roots(I_D);// in mA\n", +"I_D= I_D(2);// in mA\n", +"I_DSQ= I_D;// in mA\n", +"disp(I_DSQ,'The value of I_DSQ in mA is : ')\n", +"V_GS= (V_DD-I_D*R_D);// in V\n", +"disp(V_GS,'The value of V_GS in volts is : ')\n", +"V_DS= Req*V_GS;// in V\n", +"disp(V_DS,'The value of V_DS in volts is : ')" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 5.6: ID_and_VDS_and_region_of_operation.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Exa 5.6\n", +"format('v',6)\n", +"clc;\n", +"clear;\n", +"close;\n", +"// Given data\n", +"k = 0.1;// in mA/V^2\n", +"V_T = 1;// in V\n", +"R1 = 33;//in k ohm\n", +"R2 = 21;// in k ohm\n", +"V_DD = 6;// in V\n", +"R_D = 18;// in k ohm\n", +"V_G = (R2/(R2+R1))*V_DD;// in V\n", +"V_S = 0;// in V\n", +"V_GS = V_G-V_S;// in V\n", +"I_D = k*((V_GS-V_T)^2);// in mA\n", +"disp(I_D,'The value of I_D in mA is');\n", +"V_DS = V_DD - (I_D*R_D);// in V\n", +"disp(V_DS,'The value of V_DS in V is'); \n", +"V_DSsat = V_GS-V_T;// in V\n", +"disp(V_DSsat,'The value of V_DS(sat) in V is');\n", +"if V_DS>V_DSsat then\n", +" disp('MOSFET is in saturation region')\n", +"end" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 5.7: DC_load_line_and_operating_point.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Exa 5.7\n", +"format('v',6)\n", +"clc;\n", +"clear;\n", +"close;\n", +"// Given data\n", +"V_DD= 6;// in V\n", +"R_D= 18;// in kohm\n", +"// for maximum value of I_D\n", +"V_DS=0;// in V\n", +"I_Dmax= (V_DD-V_DS)/R_D;// in mA\n", +"// for maximum value of V_DS\n", +"I_D=0;// in mA\n", +"V_DSmax=V_DD-I_D*R_D;// in V\n", +"V_DS= 0:0.1:V_DSmax;// in V\n", +"I_D= (V_DD-V_DS)/R_D;// in mA\n", +"plot(V_DS,I_D)\n", +"xlabel('V_DS in volts')\n", +"ylabel('I_D in mA')\n", +"title('DC load line')\n", +"disp('DC load line shown in figure');\n", +"disp('Q-points are : 2.8V, 0.178 mA')" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 5.8: Region_at_which_MOSFET_ia_biased.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Exa 5.8\n", +"format('v',5)\n", +"clc;\n", +"clear;\n", +"close;\n", +"// Given data\n", +"R2 = 18;// in k ohm\n", +"R1 = 33;// in k ohm\n", +"V_DD = 6;// in V\n", +"V_G = (R2/(R1+R2))*V_DD;// in V\n", +"V_S = V_DD;// in V\n", +"V_SG = V_S-V_G;// in V\n", +"disp(V_SG,'The value of V_SG in V is');\n", +"k = 0.1;\n", +"V_T = -1;// in V\n", +"I_D = k*((V_SG+V_T)^2);// in mA\n", +"disp(I_D,'The value of I_D in mA is');\n", +"R_D = 3;// in k ohm\n", +"V_SD = V_DD - (I_D*R_D);// in V\n", +"disp(V_SD,'The value of V_SD in V is');\n", +"V_SDsat = V_SG+V_T;// in V\n", +"disp(V_SDsat,'The value of V_SD(sat) in V is');\n", +"if V_SD>V_SDsat then\n", +" disp('The p MOSFET is indeed biased in the saturation region')\n", +"end" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 5.9: IDQ_and_VDSQ.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Exa 5.9\n", +"format('v',6)\n", +"clc;\n", +"clear;\n", +"close;\n", +"// Given data\n", +"V_G= 1.5;// in V\n", +"V_P= -3;// in V\n", +"R_S= 750;// in Ω\n", +"R_D= 1800;// in Ω\n", +"I_DSS= 6*10^-3;// in A\n", +"V_DD= 18;// in V\n", +"// V_GS= V_G-I_D*R_S\n", +"// I_D= I_DSS*(1-V_GS/V_P)^2 or I_DSS*(1-(V_G-I_D*R_S)/V_P)^2\n", +"//I_D^2*R_S^2+I_D*(2*R_S*(V_P-V_G)-V_P^2/I_DSS)+(V_P-V_G)^2\n", +"A= R_S^2;\n", +"B=(2*R_S*(V_P-V_G)-V_P^2/I_DSS);\n", +"C=(V_P-V_G)^2;\n", +"// Evaluating the value of I_D by using polynomial\n", +"I_D= [A B C]\n", +"I_D= roots(I_D);// in A\n", +"I_D= I_D(2);// in A\n", +"I_DQ= I_D;// in A\n", +"V_DS= V_DD-I_D*(R_D+R_S);// in V\n", +"V_DSQ= V_DS;// in V\n", +"disp(I_DQ*10^3,'The value of I_DQ in mA is : ')\n", +"disp(V_DSQ,'The value of V_DSQ in volts is : ')" + ] + } +], +"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 +} |