diff options
Diffstat (limited to 'Integrated_Circuits_by_S_Sharma/3-Op_Amp_With_Negative_Feedback.ipynb')
-rw-r--r-- | Integrated_Circuits_by_S_Sharma/3-Op_Amp_With_Negative_Feedback.ipynb | 416 |
1 files changed, 416 insertions, 0 deletions
diff --git a/Integrated_Circuits_by_S_Sharma/3-Op_Amp_With_Negative_Feedback.ipynb b/Integrated_Circuits_by_S_Sharma/3-Op_Amp_With_Negative_Feedback.ipynb new file mode 100644 index 0000000..afbcbfe --- /dev/null +++ b/Integrated_Circuits_by_S_Sharma/3-Op_Amp_With_Negative_Feedback.ipynb @@ -0,0 +1,416 @@ +{ +"cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 3: Op Amp With Negative Feedback" + ] + }, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 3.10: Inverting_op_amp.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Exa 3.10\n", +"clc;\n", +"clear;\n", +"close;\n", +"// Given data\n", +"R_F = 1;// in M ohm\n", +"R_F = R_F * 10^6;// in ohm\n", +"Av= -30;\n", +"R1 = R_F/abs(Av);// in ohm\n", +"R1 = R1 * 10^-3;// in k ohm\n", +"disp(R_F*10^-6,'The value of R_F in MΩ is : ')\n", +"disp(R1,'The value of R1 in kΩ is');" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 3.11: Inverting_op_amp.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Exa 3.11\n", +"clc;\n", +"clear;\n", +"close;\n", +"// Given data\n", +"A_v = -8;\n", +"V_in= -1;// in V\n", +"I1 = 15;// in µA\n", +"I1 = I1 * 10^-6;// in A\n", +"R1 = -(V_in)/I1;// in ohm\n", +"R1 = R1 * 10^-3;// in k ohm\n", +"disp(R1,'Minimum value of R1 in kΩ is');\n", +"R_F = -(A_v)*R1;// in k ohm\n", +"disp(R_F,'The minimum value of R_F in kΩ is');\n", +"\n", +"// Note: There is calculation error in the book to find the value of R_F so the answer in the book is wrong." + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 3.1: Closed_loop_voltage_gai.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Exa 3.1\n", +"clc;\n", +"clear;\n", +"close;\n", +"// Given data\n", +"A = 2*10^5;\n", +"R_F = 4.7*10^3;// in ohm\n", +"R1 = 470;// in ohm\n", +"K = R_F/(R1+R_F);\n", +"B = R1/(R1+R_F);\n", +"A_F = -(A*R_F)/(R1+R_F+(R1*A));\n", +"disp(A_F,'The closed loop voltage gain is');\n", +"R_in = 2;// in M ohm\n", +"R_in = R_in * 10^6;// in ohm\n", +"R_inf = R1 + ( (R_F*R_in)/(R_F+R_in + (A*R_in)) );// in ohm\n", +"disp(R_inf,'Input resistance in Ω is');\n", +"R_o = 75;// in ohm\n", +"R_of = R_o/(1+(A*B));// in ohm\n", +"R_of = R_of * 10^3;// in mΩ\n", +"disp(R_of,'Output Resistance in mΩ is');\n", +"f_o = 5;// Hz\n", +"f_f = f_o*(1+(A*B));// in Hz\n", +"f_f = f_f *10^-3;// in kHz\n", +"disp(f_f,'Band width with feedback in kHz is');\n", +"\n", +"// Note: In the book, the unit of output resistant is wrong it will be mΩ (not MΩ)" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 3.2: Inverting_op_amp.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// EXa 3.2\n", +"clc;\n", +"clear;\n", +"close;\n", +"// Given data\n", +"A_F = -30;\n", +"R_F = 1;// in M ohm\n", +"R1 = -(R_F/A_F);// in Mohm\n", +"R_i = R1;// in Mohm\n", +"disp(R_i*10^3,'Input resistance in kΩ is');" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 3.4: Feedback_resistance.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Exa 3.4\n", +"clc;\n", +"clear;\n", +"close;\n", +"// Given data\n", +"A_F = 61;\n", +"R1 = 1;// in k ohm\n", +"R1 = R1 * 10^3;// in ohm\n", +"R_F = (A_F-1)*R1;// in ohm\n", +"R_F = R_F * 10^-3;// k ohm\n", +"disp(R_F,'The value of feedback resistance in kΩ is');" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 3.5: Closed_loop_gain_and_input_resistance.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Exa 3.5\n", +"clc;\n", +"clear;\n", +"close;\n", +"// Given data\n", +"A = 2*10^5;\n", +"R1 = 1;// in k ohm\n", +"R1 = R1 *10^3;// in ohm\n", +"R_F = 10;// in k ohm\n", +"R_F = R_F * 10^3;// in ohm\n", +"B = R1/(R1+R_F);\n", +"R_i = 2;// in M ohm\n", +"R_i = R_i * 10^6;// in ohm\n", +"R_o = 75;// in ohm\n", +"A_F = A/(1+(A*B));\n", +"disp(A_F,'The closed loop gain is');\n", +"R_if = R_i * (1+(A*B));// in ohm\n", +"disp(R_if*10^-9,'Input resistance in GΩ is');\n", +"R_of = R_o/(1+(A*B));// in ohm\n", +"R_of = R_of * 10^3;// in mΩ\n", +"disp(R_of,'The output resistance in mΩis');\n", +"f_o = 5;// in Hz\n", +"f_f = f_o*(1+(A*B));// in Hz\n", +"f_f = f_f * 10^-3;// in kHz ... correction....\n", +"disp(f_f,'Bandwidth with feedback in kHz is');" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 3.6: Voltage_gain_and_input_resistance.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Exa 3.6\n", +"clc;\n", +"clear;\n", +"close;\n", +"// Given data\n", +"A =2*10^5;\n", +"R_i = 2;// in M ohm\n", +"R1 = 1;// in ohm \n", +"R_o= 75;// in ohm\n", +"R_F = 1;// in ohm\n", +"B = R1/(R1+R_F);\n", +"A_F = -1;\n", +"disp(A_F,'The voltage gain is ');\n", +"R_if = 330;// in ohm\n", +"disp(R_if,'Input resistance in Ω is');\n", +"R_of = R_o/(A/2);// in ohm\n", +"disp(R_of,'Output resistance in Ω is');\n", +"f_o = 5;// in Hz\n", +"f_F = (A/2)*f_o;// in Hz\n", +"f_F = f_F * 10^-6;// in MHz\n", +"disp(f_F,'The bandwidth in MHz is');" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 3.7: Value_of_Af_Rif_RoF_and_fF.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Exa 3.7\n", +"clc;\n", +"clear;\n", +"close;\n", +"// Given data\n", +"A = 2*10^5;\n", +"R_i = 2;//in M ohm\n", +"R_i = 2*10^6;// in ohm\n", +"R_o = 75;//in ohm\n", +"f_o = 5;// in Hz\n", +"V_CC = 15;// in V\n", +"V_EE = -15;// in V\n", +"R1 = 1;// in k ohm\n", +"R1 = R1 * 10^3;// in ohm\n", +"R_F = 10;// in k ohm\n", +"R_F = R_F * 10^3;// in ohm\n", +"OVS= 13;// output voltage swing in V in ±\n", +"B = R1/(R1+R_F);\n", +"A_B = A*B;\n", +"A_B1 = 1+(A*B);\n", +"A_F = (1+(R_F/R1));\n", +"disp('Part (i) For non-inverting amplifier')\n", +"disp(A_F,'The value of A_F is');\n", +"R_iF = R_i * (A_B1);// in ohm\n", +"disp(R_iF*10^-9,'The value of R_iF in GΩis');\n", +"R_OF = R_o/(A_B1);// in ohm\n", +"disp(R_OF,'The value of R_OF in ohm is');\n", +"f_F = f_o*A_B1;// in Hz\n", +"f_F =f_F * 10^-3;// in kHz\n", +"disp(f_F,'The value of f_F in kHz is');\n", +"V_ooT= OVS/(1+A*B);// in V\n", +"disp('The value of VooT is ±'+string(V_ooT)+' V or ±'+string(V_ooT*10^3)+' mV')\n", +"\n", +"disp('Part (ii) For inverting amplifier')\n", +"R_F = 4.7;// in k ohm\n", +"R_F = R_F* 10^3;// in ohm\n", +"R_1 = 470;// in ohm\n", +"A_F = -(R_F)/R_1;\n", +"disp(A_F,'The value of A_F is');\n", +"R_iF = R_1// in ohm\n", +"disp(R_iF,'The value of R_iF in Ω is');\n", +"R_OF = R_o/(A_B1);// in ohm\n", +"disp(R_OF,'The value of R_OF in Ω is');\n", +"f_F = f_o*A_B1;// in Hz\n", +"f_F =f_F * 10^-3;// in kHz\n", +"disp(f_F,'The value of f_F in kHz is');\n", +"V_ooT = OVS/A_B1;// in mV\n", +"disp('The value of VooT is ±'+string(V_ooT)+' V or ±'+string(V_ooT*10^3)+' mV')" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 3.8: Voltage_gain_and_input_output_resistance.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// EXA 3.8\n", +"clc;\n", +"clear;\n", +"close;\n", +"// Given data\n", +"R1 = 5;// in k ohm\n", +"R_F = 500;// in k ohm\n", +"V_in = 0.1;// in V\n", +"A_F = -(R_F/R1);\n", +"disp(A_F,'Voltage gain is');\n", +"R_i = R1;// in k ohm\n", +"disp(R_i,'The Input resistance in kΩ is');\n", +"R_o = 0;// in ohm\n", +"disp(R_o,'Output resistance in Ω is');\n", +"V_out = A_F*V_in;// in V\n", +"disp(V_out,'Output voltage in V is');\n", +"I_in = V_in/(R1*10^3);// in A\n", +"I_in = I_in * 10^3;// in mA\n", +"disp(I_in,'Input current in mA is');" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 3.9: Input_impedance_voltage_gain_and_power_gain.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"// Exa 3.9\n", +"clc;\n", +"clear;\n", +"close;\n", +"// Given data\n", +"R_F = 1;// in M ohm\n", +"R_in = 1;// in M ohm\n", +"V_in = 1;// in V (assumed)\n", +"V_out = -(R_F/R_in)*V_in;\n", +"A_v = V_out/V_in;\n", +"disp(A_v,'The value of A_v is');\n", +"I_in = 1;// in A\n", +"I_out = I_in;// in A\n", +"A_in = I_out/I_in;\n", +"disp(A_in,'The value of A_in is');\n", +"A_P = abs(A_v*A_in);\n", +"disp(A_P,'The value of A_P 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 +} |