{ "metadata": { "name": "", "signature": "sha256:40f100c8d1fc30e8a6b1192e3ef11450d13550145cfc252cd5b9c5a67296969d" }, "nbformat": 3, "nbformat_minor": 0, "worksheets": [ { "cells": [ { "cell_type": "heading", "level": 1, "metadata": {}, "source": [ "Chapter06:Single-Stage Integrated-\n", "Circuit Amplifiers" ] }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Ex6.1:pg-553" ] }, { "cell_type": "code", "collapsed": false, "input": [ "# Example 6.1: To find the operating point of NMOS transistor\n", "# Consider NMOS transistor\n", "\n", "# 6.1a\n", "I_D=100.0*10**-6; # (A)\n", "K_n=387.0*10**-6*10; # K_n=u_n*C_ox(W/L) (A/V**2) \n", "V_th=0.48; # (V)\n", "V_OV=math.sqrt(2*I_D/K_n);\n", "print round(V_OV,2),\"= V_OV (V)\"\n", "V_GS=V_th+V_OV;\n", "print round(V_GS,2),\"= V_GS (V)\"\n", "\n", "# 6.1b\n", "I_C=100*10**-6; # (A)\n", "I_S=6*10**-18 # (A)\n", "V_T=0.025; # (V)\n", "V_BE=V_T*math.log(I_C/I_S);\n", "print round(V_BE,2),\"= V_BE (V)\"" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "0.23 = V_OV (V)\n", "0.71 = V_GS (V)\n", "0.76 = V_BE (V)\n" ] } ], "prompt_number": 2 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Ex6.2:pg-556" ] }, { "cell_type": "code", "collapsed": false, "input": [ "# Example 6.2 : Comparison between NMOS transistor and npn transistor\n", "\n", "print \"For NMOS transistor\"\n", "I_D=100*10**-6; # (A)\n", "V_a=5; # V'_A=V_a (A)\n", "L=0.4; # (um)\n", "K_n=267*4/0.4*10**-6; # K_n=u_n*C_ox*(W/L) (A/V**2)\n", "V_OV=math.sqrt(2*I_D/K_n);\n", "g_m=math.sqrt(2*K_n*I_D)\n", "print round(g_m*1e3,2),\"= g_m (mA/V)\"\n", "print \"R_in is infinite\"\n", "r_o=V_a*L/I_D;\n", "print r_o/1000,\"= r_o (kohm)\"\n", "A_O=g_m*r_o;\n", "print round(A_O,1),\"= A_O (V/V)\"\n", "print \"For npn transistor\"\n", "I_C=0.1*10**-3; # collector current \n", "B_o=100; # beta value\n", "V_A=35; # (V)\n", "g_m=I_C/V_T;\n", "print round(g_m*1e3),\"= g_m (mA/V)\"\n", "R_in=B_o/g_m;\n", "print R_in/1000,\"= R_in (Kohm)\"\n", "r_o=V_A/I_C;\n", "print r_o/1000,\"= r_o (Kohm)\"\n", "A_O=g_m*r_o;\n", "print A_O,\"= A_O (V/V)\"" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "For NMOS transistor\n", "0.73 = g_m (mA/V)\n", "R_in is infinite\n", "20.0 = r_o (kohm)\n", "14.6 = A_O (V/V)\n", "For npn transistor\n", "4.0 = g_m (mA/V)\n", "25.0 = R_in (Kohm)\n", "350.0 = r_o (Kohm)\n", "1400.0 = A_O (V/V)\n" ] } ], "prompt_number": 8 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Ex6.3:pg-559" ] }, { "cell_type": "code", "collapsed": false, "input": [ "# Example 6.3 : Comparison between NMOS transistor and npn transistor\n", "# For npn transistor\n", "print \"For npn transistor\"\n", "I_C=10.0*10**-6; # (A)\n", "V_T=0.025; # (V)\n", "V_A=35.0; # (V)\n", "C_jeO=5.0*10**-15; # (F)\n", "C_uO=5*10.0**-15; # (F)\n", "C_L=1*10.0**-12; # (F)\n", "print \"The data calculated for I_C=10uA\"\n", "g_m=I_C/V_T;\n", "print round(g_m*1e3,1),\"= g_m (mA/V)\"\n", "r_o=V_A/I_C;\n", "print int(r_o/1000),\"=r_o (Kohm)\"\n", "A_O=V_A/V_T;\n", "print A_O,\"= A_O (V/V)\"\n", "T_F=10*10.0**-12;\n", "C_de=T_F*g_m;\n", "print round(C_de*1e15,2),\"= C_de (fF)\"\n", "C_je=2*C_jeO;\n", "print round(C_je*1e15,2),\"= C_je (fF)\"\n", "C_pi=C_de+C_je;\n", "print round(C_pi*1e15,2),\"= C_pi (fF)\"\n", "C_u=C_uO;\n", "print round(C_u*1e15,2),\"= C_u (fF)\"\n", "f_T=g_m/(2*math.pi*(C_pi+C_u));\n", "print round(f_T/1e9,1),\"= f_T (GHz)\"\n", "f_t=g_m/(2*math.pi*C_L);\n", "print round(f_t/1e6,1),\"= f_t (MHz)\"\n", "print \"The data calculated for I_C=100uA\"\n", "I_C=100.0*10**-6;\n", "g_m=I_C/V_T;\n", "print round(g_m*1e3,1),\"= g_m (mA/V)\"\n", "r_o=V_A/I_C;\n", "print int(r_o/1000),\"=r_o (Kohm)\"\n", "A_O=V_A/V_T;\n", "print A_O,\"= A_O (V/V)\"\n", "T_F=10.0*10**-12;\n", "C_de=T_F*g_m;\n", "print round(C_de*1e15,2),\"= C_de (fF)\"\n", "C_je=2*C_jeO;\n", "print round(C_je*1e15,2),\"= C_je (fF)\"\n", "C_pi=C_de+C_je;\n", "print round(C_pi*1e15,2),\"= C_pi (fF)\"\n", "C_u=C_uO;\n", "print round(C_u*1e15,2),\"= C_u (fF)\"\n", "f_T=g_m/(2*math.pi*(C_pi+C_u));\n", "print round(f_T/1e9,1),\"= f_T (GHz)\"\n", "f_t=g_m/(2*math.pi*C_L);\n", "print round(f_t/1e6,1),\"= f_t (MHz)\"\n", "print \"The data calculated for I_C=1mA\"\n", "I_C=1*10.0**-3;\n", "g_m=I_C/V_T;\n", "print round(g_m*1e3,1),\"= g_m (mA/V)\"\n", "r_o=V_A/I_C;\n", "print int(r_o/1000),\"=r_o (Kohm)\"\n", "A_O=V_A/V_T;\n", "print A_O,\"= A_O (V/V)\"\n", "T_F=10*10**-12;\n", "C_de=T_F*g_m;\n", "print round(C_de*1e6,3),\"= C_de (fF)\"\n", "C_je=2*C_jeO;\n", "print round(C_je*1e15,3),\"= C_je (fF)\"\n", "C_pi=C_de+C_je;\n", "print round(C_pi*1e15,3),\"= C_pi (fF)\"\n", "C_u=C_uO;\n", "print round(C_u*1e15,2),\"= C_u (fF)\"\n", "f_T=g_m/(2*math.pi*(C_pi+C_u));\n", "print round(f_T/1e9,1),\"= f_T (GHz)\"\n", "f_t=g_m/(2*math.pi*C_L);\n", "print round(f_t/1e6,1),\"= f_t (MHz)\"\n", "# For NMOS transistor\n", "L=0.4*10**-6; # (m)\n", "C_L=1*10.0**-12; # (F)\n", "print \"The data calculated for I_D = 10uA\"\n", "I_D=10*10.0**-6; # (A)\n", "WbyL=0.12*I_D; # WbyL=(W/L)\n", "print WbyL*10**6,\"= (W/L)\"\n", "g_m=8*I_D;\n", "print round(g_m*1e3,1),\"= g_m (mA/V)\"\n", "r_o=2/I_D;\n", "print int(r_o/1000),\"=r_o (Kohm)\"\n", "A_O=g_m*r_o;\n", "print A_O,\"= A_O (V/V)\"\n", "C_gs=(2/3.0)*WbyL*0.4*0.4*5.8+0.6*WbyL*0.4;\n", "print round(C_gs*1e6,2),\"= C_gs (fF)\"\n", "C_gd=0.6*WbyL*0.4;\n", "print round(C_gd*1e6,2),\"= C_gd (fF)\"\n", "f_T=g_m/(2*math.pi*(C_gs*10**-15+C_gd*10**-15));\n", "print round(f_T/1e15,1),\"=f_T (GHz)\"\n", "f_t=g_m/(2*math.pi*C_L)\n", "print round(f_t/1e6,1),\"=f_t (MHz)\"\n", "print \"The data calculated for I_D = 100uA\"\n", "I_D=100.0*10**-6; # (A)\n", "WbyL=0.12*I_D; # WbyL=(W/L)\n", "print WbyL*10**6,\"=(W/L)\"\n", "g_m=8*I_D;\n", "print round(g_m*1e3,1),\"= g_m (mA/V)\"\n", "r_o=2/I_D;\n", "print int(r_o/1000),\"=r_o (Kohm)\"\n", "A_O=g_m*r_o;\n", "print A_O,\"=A_O (V/V)\"\n", "C_gs=(2/3.0)*WbyL*0.4*0.4*5.8+0.6*WbyL*0.4;\n", "print round(C_gs*1e6,1),\"=C_gs (fF)\"\n", "C_gd=0.6*WbyL*0.4;\n", "print round(C_gd*1e6,1),\"=C_gd (fF)\"\n", "f_T=g_m/(2*math.pi*(C_gs*10**-15+C_gd*10**-15));\n", "print round(f_T/1e15,1),\"=f_T (GHz)\"\n", "f_t=g_m/(2*math.pi*C_L)\n", "print int(f_t/1e6),\"=f_t (MHz)\"\n", "print \"The data calculated for I_D = 1mA\"\n", "I_D=1*10**-3; # (A)\n", "WbyL=0.12*I_D; # WbyL=(W/L)\n", "print WbyL*10**6,\"=(W/L)\"\n", "g_m=8*I_D;\n", "print round(g_m*1e3,1),\"= g_m (mA/V)\"\n", "r_o=2/I_D;\n", "print int(r_o/1000),\"=r_o (Kohm)\"\n", "A_O=g_m*r_o;\n", "print A_O,\"=A_O (V/V)\"\n", "C_gs=(2/3.0)*WbyL*0.4*0.4*5.8+0.6*WbyL*0.4;\n", "print round(C_gs*1e6,1),\"=C_gs (fF)\"\n", "C_gd=0.6*WbyL*0.4;\n", "print round(C_gd*1e6,1),\"=C_gd (fF)\"\n", "f_T=g_m/(2*math.pi*(C_gs*10**-15+C_gd*10**-15));\n", "print round(f_T/1e15,1),\"=f_T (GHz)\"\n", "f_t=g_m/(2*math.pi*C_L)\n", "print int(f_t/1e6),\"=f_t (MHz)\"\n", " # the answer in the textbook is slightly different due to approximation" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "For npn transistor\n", "The data calculated for I_C=10uA\n", "0.4 = g_m (mA/V)\n", "3500 =r_o (Kohm)\n", "1400.0 = A_O (V/V)\n", "4.0 = C_de (fF)\n", "10.0 = C_je (fF)\n", "14.0 = C_pi (fF)\n", "5.0 = C_u (fF)\n", "3.4 = f_T (GHz)\n", "63.7 = f_t (MHz)\n", "The data calculated for I_C=100uA\n", "4.0 = g_m (mA/V)\n", "350 =r_o (Kohm)\n", "1400.0 = A_O (V/V)\n", "40.0 = C_de (fF)\n", "10.0 = C_je (fF)\n", "50.0 = C_pi (fF)\n", "5.0 = C_u (fF)\n", "11.6 = f_T (GHz)\n", "636.6 = f_t (MHz)\n", "The data calculated for I_C=1mA\n", "40.0 = g_m (mA/V)\n", "35 =r_o (Kohm)\n", "1400.0 = A_O (V/V)\n", "0.0 = C_de (fF)\n", "10.0 = C_je (fF)\n", "410.0 = C_pi (fF)\n", "5.0 = C_u (fF)\n", "15.3 = f_T (GHz)\n", "6366.2 = f_t (MHz)\n", "The data calculated for I_D = 10uA\n", "1.2 = (W/L)\n", "0.1 = g_m (mA/V)\n", "200 =r_o (Kohm)\n", "16.0 = A_O (V/V)\n", "1.03 = C_gs (fF)\n", "0.29 = C_gd (fF)\n", "9.7 =f_T (GHz)\n", "12.7 =f_t (MHz)\n", "The data calculated for I_D = 100uA\n", "12.0 =(W/L)\n", "0.8 = g_m (mA/V)\n", "20 =r_o (Kohm)\n", "16.0 =A_O (V/V)\n", "10.3 =C_gs (fF)\n", "2.9 =C_gd (fF)\n", "9.7 =f_T (GHz)\n", "127 =f_t (MHz)\n", "The data calculated for I_D = 1mA\n", "120.0 =(W/L)\n", "8.0 = g_m (mA/V)\n", "2 =r_o (Kohm)\n", "16.0 =A_O (V/V)\n", "103.0 =C_gs (fF)\n", "28.8 =C_gd (fF)\n", "9.7 =f_T (GHz)\n", "1273 =f_t (MHz)\n" ] } ], "prompt_number": 34 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Ex6.4:pg-565" ] }, { "cell_type": "code", "collapsed": false, "input": [ "# Example 6.4 : Design of the circuit with output current =100uA\n", "\n", "V_DD=3; # (V)\n", "I_REF=100*10**-6; # (A)\n", "I_D1=100*10**-6; # (A)\n", "L=1*10**-6; # (m)\n", "W=10*10**-6; # (m)\n", "V_t=0.7; # (V)\n", "k_n=200*10**-6; # k_n=k'_n (A/V**2)\n", "V_A=20; # V_A=V'_A (V)\n", "V_OV=math.sqrt(I_D1*2*L/(k_n*W));\n", "V_GS=V_t+V_OV;\n", "R=(V_DD-V_GS)/I_REF;\n", "V_Omin=V_OV;\n", "print round(V_Omin,3),\"= V_min (V)\"\n", "r_o2=V_A/I_REF;\n", "print r_o2/1e6,\"= r_o2 (Mohm)\"\n", "V_O=V_GS;\n", "deltaV_O=1; # Change in V_O (V)\n", "deltaI_O=deltaV_O/r_o2; # Corresponding change in I_O (A)\n", "print (deltaI_O*1e6),\"= The correspondng change in I_O (mA)\"" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "0.316 = V_min (V)\n", "0.2 = r_o2 (Mohm)\n", "5.0 = The correspondng change in I_O (mA)\n" ] } ], "prompt_number": 37 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Ex6.5:pg-574" ] }, { "cell_type": "code", "collapsed": false, "input": [ "# Example 6.5 : Determine 3dB frequency \n", "# High frequency response of an amplifier can be characterized by th transfer function\n", "# F_H(s)=(1-s/10**5)/(1+s/10**4)(1+s/4*10**4)\n", "w_H=1/math.sqrt(1/10.0**8+1/(16.0*10**8)-2/10.0**10); # w_H=1/math.sqrt(1/w_P1**2+1/w_P2**2-2/w_Z1**2-2w_Z2**2)\n", "print int(w_H),\"= w_H (rad/s)\"\n", " # the answer in the textbook is slightly different due to approximation" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "9794 = w_H (rad/s)\n" ] } ], "prompt_number": 40 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Ex6.6:pg-576" ] }, { "cell_type": "code", "collapsed": false, "input": [ "# Example 6.6 : To determine midband gain and upper 3dB frequency\n", "R_in=420*10**3; # (ohm)\n", "R_sig=100*10**3; # (ohm)\n", "g_m=4*10**-3; # (mho)\n", "R_L=3.33*10**3; # R_L=R'_L (ohm)\n", "C_gs=1*10**-12; # F\n", "C_gd=C_gs; \n", "A_M=-R_in*g_m*R_L/(R_in+R_sig)\n", "print round(A_M,1),\"= Midband frequency gain A_M (V/V)\"\n", "R_gs=R_in*R_sig/(R_in+R_sig);\n", "R=R_gs; #R=R'\n", "T_gs=C_gs*R_gs; # Oen circuit time constant of C_gs (s)\n", "R_gd=R+R_L+g_m*R_L*R;\n", "T_gd=R_gd*C_gd; # open circuit time constant of C_gd (s)\n", "w_H=1/(T_gs+T_gd); # upper 3dB frequency w_H\n", "f_H=w_H/(2*math.pi);\n", "print round(f_H/1000,1),\"= Upper 3dB frequency f_H (KHz)\"" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "-10.8 = Midband frequency gain A_M (V/V)\n", "128.3 = Upper 3dB frequency f_H (KHz)\n" ] } ], "prompt_number": 44 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Ex6.7:pg-580" ] }, { "cell_type": "code", "collapsed": false, "input": [ "# Example 6.7 : Application of miller's theorem\n", "\n", "# 6.7a\n", "# By miller's theorem\n", "Z=1000.0*10**3; # (ohm)\n", "K=-100.0; # (V/V)\n", "R_sig=10.0*10**3; # (ohm)\n", "Z_1=Z/(1-K);\n", "print round(Z_1/1e3,2),\"= Z_1 (Kohm)\"\n", "Z_2=Z/(1-(1/K));\n", "print round(Z_2/1e6,2),\"= Z_2 (Mohm)\"\n", "VobyVsig=-100*Z_1/(Z_1+R_sig); # VobyVsig=(V_o/V_sig)\n", "print round(VobyVsig,1),\"= (V_o/V_sig) (V/V)\"\n", "\n", "#6.7b\n", "# Applying miller's theorem\n", "f_3dB=1/(2*math.pi*1.01*10**-6);\n", "print round(f_3dB/1000,1),\"= f_3dB (KHz)\"" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "9.9 = Z_1 (Kohm)\n", "0.99 = Z_2 (Mohm)\n", "-49.8 = (V_o/V_sig) (V/V)\n", "157.6 = f_3dB (KHz)\n" ] } ], "prompt_number": 49 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Ex6.8:pg-586" ] }, { "cell_type": "code", "collapsed": false, "input": [ "# Example 6.8 : Analysis of CMOS CS amplifier\n", "k_n=200*10**-6; # (A/V**2)\n", "W=4*10**-6; # (m)\n", "L=0.4*10**-6; # (m)\n", "I_REF=100*10**-6; # (A)\n", "V_An=20; # (A)\n", "I_D1=0.1*10**-3; # (A)\n", "V_Ap=10; # (V)\n", "V_DD=3; # (V)\n", "I_D2=0.1*10**-3; # (A)\n", "V_tp=0.6; # (V)\n", "V_tn=0.6; # (V)\n", "g_m1=math.sqrt(2*k_n*(W/L)*I_REF);\n", "print round(g_m1*1e3,2),\"=g_m1 (mA/V)\"\n", "r_o1=V_An/I_D1;\n", "print r_o1/1000,\"= r_o1 (Kohm)\"\n", "r_o2=V_Ap/I_D2;\n", "print r_o2/1000,\"= r_o2 (Kohm)\"\n", "A_v=-g_m1*r_o1*r_o2/(r_o1+r_o2);\n", "print round(A_v),\"= A_v (v/V)\"\n", "I_D=100*10**-6; # (A)\n", "k_n=65*10**-6; # (A/V**2)\n", "V_OV3=0.53; # (V)\n", "V_SG=V_tp+V_OV3;\n", "print V_SG,\"= V_SG (V)\"\n", "V_OA=V_DD-V_OV3;\n", "print V_OA,\"= V_OA (V)\"\n", "V_IB=0.93; # (V)\n", "V_IA=0.88; # (V)\n", "print V_IA,\"---\",V_IB,\"= Coordinates of the extremities of the amplifier V_IB and V_IA\"\n", "deltavI=V_IB-V_IA; # width of amplifier region\n", "V_OB=0.33; # (V)\n", "deltavO=V_OB-V_OA; # corresponding output range (V)\n", "deltavObydeltavI=-deltavO/deltavI; # Large signal voltage gain (V/V)\n", "print deltavObydeltavI,\"= Large signal voltage gain (V/V)\"" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "0.63 =g_m1 (mA/V)\n", "200.0 = r_o1 (Kohm)\n", "100.0 = r_o2 (Kohm)\n", "-42.0 = A_v (v/V)\n", "1.13 = V_SG (V)\n", "2.47 = V_OA (V)\n", "0.88 --- 0.93 = Coordinates of the extremities of the amplifier V_IB and V_IA\n", "42.8 = Large signal voltage gain (V/V)\n" ] } ], "prompt_number": 54 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Ex6.9:pg-593" ] }, { "cell_type": "code", "collapsed": false, "input": [ "# Example 6.9: Analysis of CMOS CS amplifier\n", "# Consider CMOS open source amplifier\n", "from sympy import roots\n", "from sympy import *\n", "I_D=100.0*10**-6; # (A)\n", "I_REF=I_D; \n", "uC_n=387.0*10**-6; # u_n*C_ox=uC_n (A/V**2)\n", "uC_p=86*10.0**-6; # u_n*C_ox=uC_n (A/V**2)\n", "W=7.2*10**-6; # (m)\n", "L=0.36*10**-6; # (m)\n", "V_An=5*10**-6; # (A)\n", "R_sig=10*10**3; # (ohm)\n", "V_OV=math.sqrt(2*I_D*L/(W*uC_n));\n", "g_m=I_D/(V_OV/2);\n", "print round(g_m*1e3),\"= g_m (mA/V)\"\n", "r_o1=5*0.36/(0.1*10**-3);\n", "print math.ceil(r_o1/1000),\"= r_o1 (ohm)\"\n", "r_o2=6*0.36/(.1*10**-3);\n", "print round(r_o2/1000,1),\"= r_o2 (Kohm)\"\n", "R_L=r_o1*r_o2/(r_o1+r_o2);\n", "print round(R_L/1000,2),\"= R_L (Kohm)\"\n", "A_m=-g_m*R_L;\n", "print round(A_m,1),\"= A_m (V/V)\"\n", "C_gs=20.0*10**-15; # (F)\n", "C_gd=5*10.0**-15; # (F)\n", "C_in=C_gs+C_gd*(1+g_m*R_L); # using miller equivalence\n", "print round(C_in*1e15,1),\"= C_in (fF)\"\n", "f_H=1/(2*math.pi*C_in*R_sig);\n", "print int(f_H/1e6),\"= f_H (MHz)\"\n", "R_gs=10.0*10**3; # (ohm) using open circuit time constants methods\n", "R_L=9.82*10**3; # (ohm)\n", "R_gd=R_sig*(1+g_m*R_L) + R_L;\n", "print round(R_gd/1000),\"= R_gd (Kohm)\"\n", "R_CL=R_L;\n", "T_gs=C_gs*R_gs;\n", "print int(T_gs*1e12),\"= T_gs (ps)\"\n", "T_gd=C_gd*R_gd;\n", "print int(T_gd*1e12),\"= T_gd (ps)\"\n", "C_L=25*10**-15;\n", "T_CL=C_L*R_CL;\n", "print math.ceil(T_CL*1e12),\"= T_CL (ps)\"\n", "T_H=T_gs+T_gd+T_CL;\n", "print int(T_H*1e12),\"= T_H (ps)\"\n", "f_H=1/(2*math.pi*T_H); # 3dB frequency\n", "print int(f_H/1e6),\"= f_H (MHz)\"\n", "f_Z=g_m/(2*math.pi*C_gd); # frequency of the zero\n", "print math.ceil(f_Z/1e9),\"= f_Z (MHz)\"\n", "# Denominator polynomial\n", "#p=poly([1 1.16*10**-9 0.0712*10**-18],'s','coeff')\n", "x = symbols('x')\n", "s=solve(1+(1.16*10**-9)*x+(0.0712*10**-18)*x**2,x)\n", "#print p,\"Denominator polynomial\"\n", "\n", "f_P2=s[1]/(-2*math.pi);\n", "f_P1=s[0]/(-2*math.pi)\n", "print round(f_P2/1e6,1),\" and \",round(f_P1/1e9,1), \"The frequencies f_P1 (MHz) and f_P2 (GHz) are found as the roots of the denominator frequency\"\n", "print round(f_P2/1e6,1),\" = better estimate for f_H (MHz)\"" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "1.0 = g_m (mA/V)\n", "18.0 = r_o1 (ohm)\n", "21.6 = r_o2 (Kohm)\n", "9.82 = R_L (Kohm)\n", "-12.2 = A_m (V/V)\n", "86.1 = C_in (fF)\n", "184 = f_H (MHz)\n", "142.0 = R_gd (Kohm)\n", "200 = T_gs (ps)\n", "709 = T_gd (ps)\n", "246.0 = T_CL (ps)\n", "1155 = T_H (ps)\n", "137 = f_H (MHz)\n", "40.0 = f_Z (MHz)\n", "145.4" ] }, { "output_type": "stream", "stream": "stdout", "text": [ " and 2.4 The frequencies f_P1 (MHz) and f_P2 (GHz) are found as the roots of the denominator frequency\n", "145.4 = better estimate for f_H (MHz)\n" ] } ], "prompt_number": 56 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Ex6.10:pg-599" ] }, { "cell_type": "code", "collapsed": false, "input": [ "# Example 6.10 : To determine A_M, f_t, f_Z, f_3dB\n", "# Consider the CS amplifier\n", "A_M=-12.3;# (V/V) found from Example 6.9\n", "C_L=25.0*10**-15; # (F)\n", "C_gd=5*10.0**-15; # (F)\n", "R_L=9.82*10**3; # (F)\n", "g_m=1.25*10**-3; # (mho)\n", "f_H=1/(2*math.pi*(C_L+C_gd)*R_L); # 3dB frequency\n", "print round(f_H/1e6),\"= f_H (MHz)\"\n", "f_t=-A_M*f_H; # Unity-gain frequency - sign to make gain positive as only magnitude is considered\n", "print round(f_t/1e9,1),\"= f_t (GHz)\"\n", "f_Z=g_m/(2*math.pi*C_gd); # frequency of the zero\n", "print round(f_Z/1e9),\"= f_Z (GHz)\"\n", "I_D=400*10**-6; # I_D must be quadrupled by changing I_REF to 400uF\n", "V_OV=0.32; \n", "g_m=I_D/(V_OV/2);\n", "print round(g_m*1e3,2),\"= g_m (mA/V)\"\n", "r_o1=5*0.36/(0.4*10**-3);\n", "print r_o1/1000,\"= r_o1 (Kohm)\"\n", "r_o2=6*0.36/(0.4*10**-3);\n", "print r_o2/1000,\"= r_o2 (Kohm)\"\n", "R_L=(r_o1*r_o2)/(r_o1+r_o2);\n", "print round(R_L/1000,1),\"= R_L (Kohm)\"\n", "A_M=-g_m*R_L;\n", "print round(A_M,2),\"= A_M (V/V)\"\n", "f_H=1/(2*math.pi*(C_L+C_gd)*R_L);\n", "print round(f_H/1e9,2),\"= f_H (GHz)\"\n", "f_t=f_H*-A_M; # Unity gain frequency\n", "print round(f_t/1e9,1),\"= f_t (GHz)\"\n", " # the answer in the textbook is slightly different due to approximation" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "540.0 = f_H (MHz)\n", "6.6 = f_t (GHz)\n", "40.0 = f_Z (GHz)\n", "2.5 = g_m (mA/V)\n", "4.5 = r_o1 (Kohm)\n", "5.4 = r_o2 (Kohm)\n", "2.5 = R_L (Kohm)\n", "-6.14 = A_M (V/V)\n", "2.16 = f_H (GHz)\n", "13.3 = f_t (GHz)\n" ] } ], "prompt_number": 57 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Ex6.11:pg-609" ] }, { "cell_type": "code", "collapsed": false, "input": [ "# Example 6.11 : Avo Rin Rout Gi Gis Gv fH\n", "# Consider the common gate amplifier\n", "g_m=1.25*10**-3; # (A/V)\n", "r_o=18000; # (ohm)\n", "I_D=100*10**-6; # (A)\n", "X=0.2;\n", "R_S=10*10**3; # (ohm)\n", "R_L=100*10**3; # (ohm)\n", "C_gs=20*10**-15;# (F)\n", "C_gd=5*10**-15;# (F)\n", "C_L=0; # (F)\n", "gmplusgmb=g_m+0.2*g_m; # gmplusgmb=g_m+g_mb\n", "A_vo=1+(gmplusgmb)*r_o;\n", "print A_vo,\"= A_vo (V/V)\"\n", "R_in=(r_o+R_L)/A_vo;\n", "print round(R_in/1000,1),\"= R_in (Kohm)\"\n", "R_out=r_o+A_vo*R_S;\n", "print int(R_out/1000),\"= Kohm\"\n", "G_v=A_vo*R_L/(R_L+R_out);\n", "print round(G_v),\"= G_v (V/V)\"\n", "G_is=A_vo*R_S/R_out;\n", "print round(G_is,2),\"= G_is (A/A)\"\n", "G_i=G_is*R_out/(R_out+R_L)\n", "print round(G_i,1),\"= G_i (A/A)\"\n", "R_gs=R_S*R_in/(R_S+R_in);\n", "R_gd=R_L*R_out/(R_L+R_out);\n", "T_H=C_gs*R_gs+C_gd*R_gd;\n", "f_H=1/(2*math.pi*T_H);\n", "print int(f_H/1e6),\"= f_H (MHz)\"" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "28.0 = A_vo (V/V)\n", "4.2 = R_in (Kohm)\n", "298 = Kohm\n", "7.0 = G_v (V/V)\n", "0.94 = G_is (A/A)\n", "0.7 = G_i (A/A)\n", "366 = f_H (MHz)\n" ] } ], "prompt_number": 14 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Ex6.12:pg-620" ] }, { "cell_type": "code", "collapsed": false, "input": [ "# Example 6.12 : Comparison between Cascode amplifier and CS amplifier\n", "# 6.12a \n", "# CS amplifier\n", "g_m=1.25*10**-3;\n", "r_o=20*10**3;\n", "R_L=r_o*r_o/(r_o+r_o);\n", "C_gs=20*10**-15;\n", "R_sig=10000;\n", "C_gd=5*10**-15;\n", "C_L=5*10**-15;\n", "C_db=5*10**-15;\n", "A_o=g_m*r_o;\n", "print A_o,\"= A_o (V/V)\"\n", "A_v=-A_o/2;\n", "print A_v,\"= A_v (V/V)\"\n", "T_H=C_gs*R_sig+C_gd*((1+g_m*R_L)*R_sig+R_L)+(C_L+C_db)*R_L;\n", "print round(T_H*1e12),\"= T_H (ps)\"\n", "f_H=1/(2*math.pi*T_H);\n", "print round(f_H/1e6,1),\"= f_H (MHz)\"\n", "f_t=-A_v*f_H;\n", "print round(f_t/1e9,2),\"= f_t (GHz)\"\n", "# Cascode amplifier\n", "g_m1=1.25*10**-3;\n", "r_o1=20000;\n", "X=0.2;\n", "r_o2=20000;\n", "R_L=20000;\n", "A_o1=g_m1*r_o1;\n", "print A_o1,\"= A_o1 (V/V)\"\n", "gm2plusgmb2=g_m1+X*g_m;\n", "A_vo2=1+(gm2plusgmb2)*r_o2;\n", "print A_vo2,\"= A_vo2 (V/V)\"\n", "R_out1=r_o1;\n", "R_in2=1/(gm2plusgmb2)+R_L/A_vo2;\n", "print round(R_in2/1000.0,1),\"= R_in2 (kohm)\"\n", "R_d1=R_out1*R_in2/(R_out1+R_in2);\n", "print round(R_d1/1000.0,1),\"= R_d1 (Kohm)\"\n", "R_out=r_o2+A_vo2*r_o1;\n", "print round(R_out/1000.0,1),\"= R_out (Kohm)\"\n", "vo1byvi=-g_m1*R_d1;\n", "print round(vo1byvi,1),\"= (v_o1/v_i) (V/V)\"\n", "A_v=-A_o1*A_vo2*R_L/(R_L+R_out);\n", "print round(A_v,1),\"= A_v (V/V)\"\n", "C_gs1=20*10**-15;\n", "R_sig=10*10**3;\n", "gm1Rd1=1.5;\n", "C_gd1=5*10**-15;\n", "C_gs2=20*10**-15;\n", "C_db2=5*10**-15;\n", "C_gd2=5*10**-15;\n", "C_db1=5*10**-15;\n", "T_H=R_sig*(C_gs1+C_gd1*(1+gm1Rd1))+R_d1*(C_gd1+C_db1+C_gs2)+((R_L*R_out)/(R_L+R_out))*(C_L+C_db2+C_gd2);\n", "f_H=1/(2*math.pi*T_H);\n", "print round(T_H*1e12),\"= T_H (ps)\"\n", "print round(T_H*1e12),\"= T_H (ps)\"\n", "f_t=-A_v*f_H;\n", "print round(T_H*1e12),\"= T_H (ps)\"\n", "# 6.12b \n", "# CS amplifier\n", "A_v=-12.5;\n", "R_L=10*10**3;\n", "print A_v,\"= A_v (V/V)\"\n", "T_H=(C_gd+C_L+C_db)*R_L;\n", "print round(T_H*1e12),\"= T_H (ps)\"\n", "f_H=1/(2*math.pi*T_H);\n", "print round(f_H/1e9,2),\"= f_H (GHz)\"\n", "f_t=-A_v*f_H;\n", "print round(f_t/1e9,1),\"= f_t (GHz)\"\n", "# Cascode amplifier\n", "R_L=640*10**3;\n", "R_out=640*10**3;\n", "R_out1=20*10**3;\n", "A_v=-A_o1*A_vo2*R_L/(R_L+R_out);\n", "print A_v,\"= A_v (V/V)\"\n", "R_in2=1/gm2plusgmb2+R_L/A_vo2;\n", "print round(R_in2/1000.0,1),\"= R_in2 (Kohm)\"\n", "R_d1=R_in2*R_out1/(R_in2+R_out1);\n", "print round(R_d1/1000.0,1),\"= R_d1 (Kohm)\"\n", "T_H=R_d1*(C_gd1+C_db1+C_gs2)+(R_L*R_out/(R_L+R_out))*(C_L+C_gd2+C_db2);\n", "print round(T_H*1e12),\"= T_H (ps)\"\n", "f_H=1/(2*math.pi*T_H);\n", "print round(f_H/1e6,1),\"= f_H (MHz)\"\n", "f_t=-A_v*f_H;\n", "print round(f_t/1e9,1),\"= f_t (GHz)\"" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "25.0 = A_o (V/V)\n", "-12.5 = A_v (V/V)\n", "1025.0 = T_H (ps)\n", "155.3 = f_H (MHz)\n", "1.94 = f_t (GHz)\n", "25.0 = A_o1 (V/V)\n", "31.0 = A_vo2 (V/V)\n", "1.3 = R_in2 (kohm)\n", "1.2 = R_d1 (Kohm)\n", "640.0 = R_out (Kohm)\n", "-1.5 = (v_o1/v_i) (V/V)\n", "-23.5 = A_v (V/V)\n", "653.0 = T_H (ps)\n", "653.0 = T_H (ps)\n", "653.0 = T_H (ps)\n", "-12.5 = A_v (V/V)\n", "150.0 = T_H (ps)\n", "1.06 = f_H (GHz)\n", "13.3 = f_t (GHz)\n", "-387.5 = A_v (V/V)\n", "21.3 = R_in2 (Kohm)\n", "10.3 = R_d1 (Kohm)\n", "5110.0 = T_H (ps)\n", "31.1 = f_H (MHz)\n", "12.1 = f_t (GHz)\n" ] } ], "prompt_number": 25 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Ex6.13:pg-642" ] }, { "cell_type": "code", "collapsed": false, "input": [ "# Example 6.13: Analysis of CC-CE amplifier\n", "# Consider a CC-CE amplifier\n", "# at an emitter bias current of 1mA for Q_1 and Q_2\n", "g_m=40.0*10**-3; # (A/V)\n", "r_e=25.0; # (ohm)\n", "B=100.0; # beta value\n", "C_u=2*10.0**-12; # (F)\n", "f_T=400*10.0**6 # (Hz)\n", "r_pi= B/g_m; \n", "print round(r_pi/1000,1),\"= r_pi (Kohm)\"\n", "C_pi=g_m/(2*math.pi*f_T)-C_u;\n", "print round(C_pi*1e12,1),\"= C_pi (pF)\"\n", "R_in2=2500.0; # (ohm)\n", "r_pi2=2500.0 # (ohm)\n", "r_pi1=2500.0; # (ohm)\n", "r_e1=0.025; # (ohm)\n", "B_1=100.0; # beta value\n", "R_in=(B_1+1)*(r_e1+R_in2);\n", "print round(R_in/1000),\"= R_in (Kohm)\"\n", "R_sig=4*10.0**3; # (ohm)\n", "R_L=4000.0; # (ohm)\n", "Vb1byVsig=R_in/(R_in+R_sig); # (V_b1/V_sig)\n", "print round(Vb1byVsig,2),\"= (V_b1/V_sig) (V/V)\"\n", "Vb2plusVb1=R_in2/(R_in2+r_e1); # (V_b2/V_b1)\n", "print round(Vb2plusVb1,3),\"= (V_b2/V_b1) (V/V)\"\n", "VobyVb2=-g_m*R_L; # (V_o/V_b2)\n", "print round(VobyVb2,2),\"= (V_o/V_b2) (V/V)\"\n", "A_M=VobyVb2*Vb2plusVb1*Vb2plusVb1;\n", "print int(A_M),\"= A_M (V/V)\"\n", "R_u1=R_sig*R_in/(R_sig+R_in);\n", "print round(R_u1/1000,1),\"= R_u1 (Kohm)\"\n", "R_pi1=(R_sig+R_in2)/(1+(R_sig/r_pi1)+(R_in2/r_e1)); # C_pi1 sees a resistance R_pi1\n", "print round(R_pi1*1000,2),\"= R_pi1 (ohm)\"\n", "R_out1=25+4000/101;\n", "R_pi2=R_in2*R_out1/(R_in2+R_out1); # C_pi2 sees a resistance R_pi2\n", "print round(R_pi2,1),\"= R_pi2 (ohm)\"\n", "R_u2=(1+g_m*R_L)*R_pi2+R_L;\n", "print round(R_u2/1000,2),\"= R_u2 (Kohm)\"\n", "C_u1=2*10**-12; # (F)\n", "R_u1=3940; # (ohm)\n", "C_pi1=13.9*10**-12; # (F)\n", "C_u2=2*10**-12; # (F)\n", "C_pi2=13.9*10**-12; # (F)\n", "T_H=C_u1*R_u1+C_pi1*R_pi1+C_u2*R_u2+C_pi2*R_pi2;\n", "print round(T_H*1e9),\"= T_H (ns)\"\n", "f_H=1/(2*math.pi*T_H);\n", "print round(f_H/1e6,1),\"= f_H (MHz)\"\n", "A_M=r_pi*(-g_m*R_L)/(r_pi+R_sig);\n", "print round(A_M,2),\"= A_M (V/V)\"\n", "R_pi=r_pi*R_sig/(r_pi+R_sig); \n", "print round(R_pi/1000,2),\"= R_pi (Kohm)\"\n", "R_u=(1+g_m*R_L)*R_pi +R_L;\n", "print round(R_u/1000,1),\"= R_u (Kohm)\"\n", "T_H=C_pi*R_pi+C_u*R_u;\n", "print round(T_H*1e9,1),\"= T_H (ns)\"\n", "f_H=1/(2*math.pi*T_H);\n", "print int(f_H/1e3),\"= f_H (KHz)\"\n", " # the answer in the textbook is slightly different due to approximation" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "2.5 = r_pi (Kohm)\n", "13.9 = C_pi (pF)\n", "253.0 = R_in (Kohm)\n", "0.98 = (V_b1/V_sig) (V/V)\n", "1.0 = (V_b2/V_b1) (V/V)\n", "-160.0 = (V_o/V_b2) (V/V)\n", "-159 = A_M (V/V)\n", "3.9 = R_u1 (Kohm)\n", "65.0 = R_pi1 (ohm)\n", "62.4 = R_pi2 (ohm)\n", "14.05 = R_u2 (Kohm)\n", "37.0 = T_H (ns)\n", "4.3 = f_H (MHz)\n", "-61.54 = A_M (V/V)\n", "1.54 = R_pi (Kohm)\n", "251.7 = R_u (Kohm)\n", "524.8 = T_H (ns)\n", "303 = f_H (KHz)\n" ] } ], "prompt_number": 49 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Ex6.14:pg-654" ] }, { "cell_type": "code", "collapsed": false, "input": [ "# Example 6.14 : To determine required resistor values\n", "# The circuits generate a constant current I_D=10uA which operate at a supply of 10V\n", "V_BE=0.7; # (V)\n", "V_t=0.025; # (V)\n", "I_REF=10.0*10**-6; # (A)\n", "V_DD=10.0; # (V)\n", "I=1*10.0**-3; # (A)\n", "V_BE1=V_BE+V_t*math.log(I_REF/I); # Voltage drop across Q_1\n", "print round(V_BE1,2),\"= V_BE1 (V)\"\n", "R_1=(V_DD-V_BE1)/(I_REF); # For the Widlar circuit we decide I_REF=1mA and V_BE1=0.7V\n", "print round(R_1/1000,1),\"= R_1 (kohm)\"\n", "R_2=(V_DD-V_BE)/I;\n", "print R_2/1000,\"= R_2 (kohm)\"\n", "R_3=(V_t/I_REF)*math.log(I/I_REF);\n", "print round(R_3/1000,1),\"= R_3 (kohm)\"\n", " # the answer in the textbook is slightly different due to approximation" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "0.58 = V_BE1 (V)\n", "941.5 = R_1 (kohm)\n", "9.3 = R_2 (kohm)\n", "11.5 = R_3 (kohm)\n" ] } ], "prompt_number": 53 } ], "metadata": {} } ] }