diff options
Diffstat (limited to 'Electronic_Devices_by_T_L_Floyd/6-BJT_Amplifiers.ipynb')
-rw-r--r-- | Electronic_Devices_by_T_L_Floyd/6-BJT_Amplifiers.ipynb | 439 |
1 files changed, 439 insertions, 0 deletions
diff --git a/Electronic_Devices_by_T_L_Floyd/6-BJT_Amplifiers.ipynb b/Electronic_Devices_by_T_L_Floyd/6-BJT_Amplifiers.ipynb new file mode 100644 index 0000000..0353ff8 --- /dev/null +++ b/Electronic_Devices_by_T_L_Floyd/6-BJT_Amplifiers.ipynb @@ -0,0 +1,439 @@ +{ +"cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 6: BJT Amplifiers" + ] + }, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 6.10: Darlington_emitter_follower.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//ex6.10\n", +"V_CC=12;\n", +"V_BE=0.7;\n", +"R_C=10^3;\n", +"r_e_ce=5; //for common emitter amplifier\n", +"R1=10*10^3;\n", +"R2=22*10^3;\n", +"R_E=22;\n", +"R_L=8;\n", +"B_DC=100;\n", +"B_ac=100;\n", +"V_B=((R2*B_DC^2*R_E/(R2+B_DC^2*R_E))/(R1+(R2*B_DC^2*R_E/(R2+B_DC^2*R_E))))*V_CC;\n", +"V_E=V_B-2*V_BE;\n", +"I_E=V_E/R_E;\n", +"r_e=25*10^-3/I_E; //for darlington emitter-follower\n", +"P_R_E=I_E^2*R_E; //power dissipated by R_E\n", +"P_Q2=(V_CC-V_E)*I_E //power dissipated by transistor Q2\n", +"R_e=R_E*R_L/(R_E+R_L); //ac emitter resistance of darlington emitter follower\n", +"R_in_tot=R1*R2*B_ac^2*(R_e+r_e)/(R1*R2+R1*B_ac^2*(r_e+R_e)+R2*B_ac^2*(r_e+R_e)); //total input resistance of darlington\n", +"R_c=R_C*R_in_tot/(R_C+R_in_tot); //effective ac resistance\n", +"A_v_CE=R_c/r_e_ce;\n", +"disp(A_v_CE,'voltage gain of common emitter amplifier')\n", +"A_v_EF=R_e/(r_e+R_e);\n", +"disp(A_v_EF,'voltage gain of darlington emitter follower')\n", +"A_v=A_v_CE*A_v_EF;\n", +"disp(A_v,'overall voltage gain')" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 6.11: Common_base_amplifier.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//ex6.11\n", +"B_DC=250;\n", +"R_C=2.2*10^3;\n", +"R_E=1*10^3;\n", +"R_L=10*10^3;\n", +"R1=56*10^3;\n", +"R2=12*10^3;\n", +"V_BE=0.7;\n", +"V_CC=10;\n", +"//since B_DC*R_E>>R2\n", +"V_B=(R2/(R1+R2))*V_CC;\n", +"V_E=V_B-V_BE;\n", +"I_E=V_E/R_E;\n", +"r_e=25*10^-3/I_E;\n", +"R_in=r_e; //input resistance\n", +"R_c=R_C*R_L/(R_C+R_L); //ac collector resistance\n", +"A_v=R_c/r_e;\n", +"//current gain is almost 1\n", +"//power gain is approximately equal to voltage gain\n", +"A_p=A_v;\n", +"A_i=1;\n", +"disp(R_in,'input resistance in ohms')\n", +"disp(A_v,'voltage gain')\n", +"disp(A_i,'current gain')\n", +"disp(A_p,'power gain')" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 6.12: Voltage_gain_decibel.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//ex6.12\n", +"A_v1=10;\n", +"A_v2=15;\n", +"A_v3=20;\n", +"A_v=A_v1*A_v2*A_v3; //overall voltage gain\n", +"disp(A_v,'overall voltage gain')\n", +"A_v1_dB=gain_in_decibel_voltage(A_v1);\n", +"A_v2_dB=gain_in_decibel_voltage(A_v2);\n", +"A_v3_dB=gain_in_decibel_voltage(A_v3);\n", +"A_v_dB=A_v1_dB+A_v2_dB+A_v3_dB;\n", +"disp(A_v_dB,'total voltage gain in decibels')" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 6.1: Linear_amplifier.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//ex6.1\n", +"disp('graph question, cannot be solved in scilab')" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 6.2: AC_Emitter_resistance.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//ex6.2\n", +"I_E=2*10^-3;\n", +"r_e=25*10^-3/I_E;\n", +"disp(r_e,'ac emitter resistance in ohms')" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 6.3: Base_voltage.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//ex6.3\n", +"I_E=3.8*10^-3;\n", +"B_ac=160;\n", +"R1=22*10^3;\n", +"R2=6.8*10^3;\n", +"R_s=300;\n", +"V_s=10*10^-3;\n", +"r_e=25*10^-3/I_E;\n", +"R_in_base=B_ac*r_e;\n", +"R_in_tot=(R1*R2*R_in_base)/(R_in_base*R1+R_in_base*R2+R1*R2);\n", +"V_b=(R_in_tot/(R_in_tot+R_s))*V_s;\n", +"disp(V_b,'voltage at the base of the transistor in volts')" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 6.4: Emitter_bypass_capacitor.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//ex6.4\n", +"R_E=560;\n", +"f=2*10^3; //minimum value of frequency in hertz\n", +"X_C=R_E/10; //minimum value of capacitive reactance\n", +"C2=1/(2*%pi*X_C*f);\n", +"disp(C2,'value of bypass capacitor in farads')" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 6.5: Effect_bypass_capacitor.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +" //ex6.5\n", +"r_e=6.58; //from ex6.3\n", +"R_C=1*10^3;\n", +"R_E=560;\n", +"A_v=R_C/(R_E+r_e);\n", +"disp(A_v,'gain without bypass capacitor')\n", +"A_v=R_C/r_e;\n", +"disp(A_v,'gain in the presence of bypass capacitor')" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 6.6: Gain_with_load.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//ex6.6\n", +"R_C=10^3;\n", +"R_L=5*10^3;\n", +"r_e=6.58;\n", +"R_c=(R_C*R_L)/(R_C+R_L);\n", +"disp(R_c,'ac collector resistor in ohms')\n", +"A_v=R_c/r_e;\n", +"disp(A_v,'gain with load')" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 6.7: Gain_swamped_amplifier.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//ex6.7\n", +"R_C=3.3*10^3;\n", +"R_E1=330;\n", +"A_v=R_C/R_E1;\n", +"disp(A_v,'approximate voltage gain as R_E2 is bypassed by C2')" + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 6.8: Common_emitter_amplifier.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//ex6.8\n", +"B_DC=150;\n", +"B_ac=175;\n", +"V_CC=10;\n", +"V_s=10*10^-3;\n", +"R_s=600;\n", +"R1=47*10^3;\n", +"R2=10*10^3;\n", +"R_E1=470;\n", +"R_E2=470;\n", +"R_C=4.7*10^3;\n", +"R_L=47*10^3;\n", +"R_IN_base=B_DC*(R_E1+R_E2);\n", +"//since R_IN_base is ten times more than R2,it can be neglected in DC voltage calculation\n", +"V_B=(R2/(R2+R1))*V_CC;\n", +"V_E=V_B-0.7;\n", +"I_E=V_E/(R_E1+R_E2);\n", +"I_C=I_E;\n", +"V_C=V_CC-I_C*R_C;\n", +"disp(V_C,'dc collector voltage in volts')\n", +"r_e=25*10^-3/I_E;\n", +"//base resistance\n", +"R_in_base=B_ac*(r_e+R_E1);\n", +"//total input resistance\n", +"R_in_tot=(R1*R2*R_in_base)/(R1*R2+R_in_base*R1+R_in_base*R2);\n", +"attenuation=R_in_tot/(R_s+R_in_tot);\n", +"//ac collector resistance\n", +"R_c=R_C*R_L/(R_C+R_L);\n", +"//voltage gain from base to collector\n", +"A_v=R_c/R_E1;\n", +"//overall voltage gain A_V\n", +"A_V=A_v*attenuation;\n", +"//rms voltage at collector V_c\n", +"V_c=A_V*V_s;\n", +"Max_V_c_p=V_C+sqrt(2)*V_c;\n", +"Min_V_c_p=V_C-sqrt(2)*V_c;\n", +"V_out_p=sqrt(2)*V_c;\n", +"//assume frequency to be 1Hz\n", +"f=1;\n", +"t=0:0.0005:4;\n", +"y=V_C+V_c*sin(2*%pi*f.*t);\n", +"clf();\n", +"subplot(121)\n", +"xtitle('Collector Voltage')\n", +"plot(t,y)\n", +"subplot(122)\n", +"xtitle('source and output ac voltage')\n", +"x=-V_s*sin(2*f*%pi.*t);\n", +"z=V_out_p*sin(2*%pi*f.*t);\n", +"plot(t,x,'r')\n", +"plot(t,z,'-.')\n", +"h1=legend(['source voltage';'output voltage'])\n", +" " + ] + } +, +{ + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 6.9: Current_gain.sce" + ] + }, + { +"cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], +"source": [ +"//ex6.9\n", +"R_E=10^3;\n", +"R_L=10^3;\n", +"R1=18*10^3;\n", +"R2=18*10^3;\n", +"B_ac=175;\n", +"V_CC=10;\n", +"V_BE=0.7;\n", +"V_in=1;\n", +"//ac emitter resistance R_e\n", +"R_e=(R_E*R_L)/(R_E+R_L);\n", +"//resistance from base R_in_base\n", +"R_in_base=B_ac*R_e;\n", +"//total input resiatance R_in_tot\n", +"R_in_tot=(R1*R2*R_in_base)/(R1*R2+R1*R_in_base+R2*R_in_base);\n", +"disp(R_in_tot,'total input resistance in ohms')\n", +"V_E=((R2/(R1+R2))*V_CC)-V_BE;\n", +"I_E=V_E/R_E;\n", +"r_e=25*10^-3/I_E;\n", +"A_v=R_e/(r_e+R_e);\n", +"disp(A_v,'voltage gain')\n", +"//ac emitter current I_e\n", +"//V_e=A_v*V_b=1V\n", +"V_e=1;\n", +"I_e=V_e/R_e;\n", +"I_in=V_in/R_in_tot;\n", +"A_i=I_e/I_in; //current gain\n", +"disp(A_i,'current gain')\n", +"A_p=A_i; //power gain\n", +"//since R_L=R_E, one half of the total power is disspated to R_L\n", +"A_p_load=A_p/2;\n", +"disp(A_p_load,'power gain delivered to load')" + ] + } +], +"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 +} |