{
 "metadata": {
  "name": "ch_3"
 }, 
 "nbformat": 2, 
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "markdown", 
     "source": [
      "<h1>Chapter 3: Operational Amplifier Characteristics<h1>"
     ]
    }, 
    {
     "cell_type": "markdown", 
     "source": [
      "<h3>Example No. 3.1, Page No: 107<h3>"
     ]
    }, 
    {
     "cell_type": "code", 
     "collapsed": false, 
     "input": [
      "", 
      "#Variable Declaration:", 
      "Vp=15.0                           #Volatge in volt", 
      "Vm=-15.0                          #Voltage in volt", 
      "R5=40.0*10**3                     #Resistance in ohm", 
      "Vbe11=0.7                         #Voltage in volt", 
      "Vbe12=Vbe11                       #Voltage in volt", 
      "", 
      "#Calculations:", 
      "Iref= (Vp-Vbe12-Vbe11-Vm)/R5      #Calculating reference current", 
      "", 
      "Iref=Iref*10**3                   #Calculating reference current", 
      "", 
      "#Results:", 
      "print(\"Iref= %.3f mA\"%Iref)"
     ], 
     "language": "python", 
     "outputs": [
      {
       "output_type": "stream", 
       "stream": "stdout", 
       "text": [
        "Iref= 0.715 mA"
       ]
      }
     ], 
     "prompt_number": 13
    }, 
    {
     "cell_type": "markdown", 
     "source": [
      "<h3>Example No. 3.2, Page No: 107<h3>"
     ]
    }, 
    {
     "cell_type": "code", 
     "collapsed": false, 
     "input": [
      "", 
      "#Variable Declaration:", 
      "Iref= 0.715*10**-3         #reference current in ampere", 
      "Ic13b= 0.75*Iref           #Current in ampere", 
      "Ic17=Ic13b                 #Current in ampere", 
      "Ie17=Ic13b                 #Current in ampere", 
      "Beta=150.0                 #Gain", 
      "Vbe17=0.7                  #Vbe volatge in volt", 
      "R9=50.0*10**3              #Resistance in ohm", 
      "R8=100.0                   #Resistance in ohm", 
      "", 
      "#Calculations:", 
      "Ic16= (Ic17/Beta) + (Ie17*R8 + Vbe17)/R9    #Calculating current", 
      "Ic16=Ic16*1000000.0/1.232                   #Calculating current", 
      "", 
      "#Results:", 
      "print(\"\\nIc16= %.1f uA\"%Ic16)"
     ], 
     "language": "python", 
     "outputs": [
      {
       "output_type": "stream", 
       "stream": "stdout", 
       "text": [
        "", 
        "Ic16= 15.1 uA"
       ]
      }
     ], 
     "prompt_number": 14
    }, 
    {
     "cell_type": "markdown", 
     "source": [
      "<h3>Example No. 3.3, Page No:108<h3>"
     ]
    }, 
    {
     "cell_type": "code", 
     "collapsed": false, 
     "input": [
      "", 
      "#Variable Declaration:", 
      "import math", 
      "Iref=0.000715                #Reference current in ampere", 
      "Vbe19=0.7                    #Vbe voltage in volt", 
      "Is18=10**-14                 #Current in ampere", 
      "Is19=10**-14                 #Current in ampere", 
      "R10=50000.0                  #Resistance in ohm", 
      "", 
      "Is14=2.0*10**-14             #Current in ampere", 
      "Is20=2.0*10**-14             #Current in ampere", 
      "Vbe=0.7                      #Voltge Vbe in volt", 
      "Vbe19=0.612                  #Voltage Vbe in volt", 
      "Beta=200.0                   #Gain", 
      "Vbe18=0.549                  #Volatge vbe in volt", 
      "", 
      "#Calculations:", 
      "Ic13a=0.25*Iref              #Calculating Current          ", 
      "", 
      "Ir10=Vbe19/R10               #Calculating current", 
      "Ic19=Ic13a-Ir10              #Calculating current", 
      "", 
      "Ib19=Ic19/Beta               #Calculating current", 
      "Ic18=Ir10+Ib19               #Calculating current", 
      "         ", 
      "Vbb=Vbe18+Vbe19              #calculating voltage", 
      "", 
      "Ic14=Is20*math.exp(Vbb/2*0.026) #Calculating current", 
      "Ic14=Ic14*10**15/0.2042         #Calculating current", 
      "", 
      "#Results:", 
      "print('Vbb= %.3f V'%Vbb)", 
      "print('\\nIc14= %.2f uA'%Ic14)"
     ], 
     "language": "python", 
     "outputs": [
      {
       "output_type": "stream", 
       "stream": "stdout", 
       "text": [
        "Vbb= 1.161 V", 
        "", 
        "Ic14= 99.43 uA"
       ]
      }
     ], 
     "prompt_number": 15
    }, 
    {
     "cell_type": "markdown", 
     "source": [
      "<h3>Example no. 3.4, Page No: 115<h3>"
     ]
    }, 
    {
     "cell_type": "code", 
     "collapsed": false, 
     "input": [
      "", 
      "#Variable Declaration:", 
      "Ib1=400.0*10**-9         #Current in ampere", 
      "Ib2=300.0*10**-9         #Current in ampere", 
      "", 
      "#Calculations:", 
      "Ib=(Ib1+Ib2)/2.0         #Calculating current", 
      "Ios=Ib1-Ib2              #Calculating current", 
      "Ib=Ib*10**9              #Calculating current", 
      "Ios=Ios*10**9            #Calculating current", 
      "", 
      "#Results:", 
      "print('Ib= %.1f nA'%Ib)", 
      "print('\\nIos= %.1f nA'%Ios)"
     ], 
     "language": "python", 
     "outputs": [
      {
       "output_type": "stream", 
       "stream": "stdout", 
       "text": [
        "Ib= 350.0 nA", 
        "", 
        "Ios= 100.0 nA"
       ]
      }
     ], 
     "prompt_number": 16
    }, 
    {
     "cell_type": "markdown", 
     "source": [
      "<h3>Example No. 3.5, Page No: 115<h3>"
     ]
    }, 
    {
     "cell_type": "code", 
     "collapsed": false, 
     "input": [
      "", 
      "#Variable Declaration:", 
      "Ios=400.0*10**-9         #Current in ampere", 
      "Rf=100.0*10**3           #Resistance in ohm ", 
      "R1=1.0*10**3             #Resistance in ohm", 
      "", 
      "#Calculations:", 
      "Vo=Rf*Ios                #Calculating output voltage", 
      "Vo=Vo*1000.0             #Calculating output voltage  ", 
      "", 
      "#Results:", 
      "print('Vo= %.1f mV'%Vo)"
     ], 
     "language": "python", 
     "outputs": [
      {
       "output_type": "stream", 
       "stream": "stdout", 
       "text": [
        "Vo= 40.0 mV"
       ]
      }
     ], 
     "prompt_number": 17
    }, 
    {
     "cell_type": "markdown", 
     "source": [
      "<h3>Example No. 3.6, Page No: 117<h3>"
     ]
    }, 
    {
     "cell_type": "code", 
     "collapsed": false, 
     "input": [
      "", 
      "#Variable Declaration:", 
      "Rf=10.0*10**3                      #Resistance in ohm", 
      "R1=2.0*10**3                       #Resistance in ohm", 
      "Vos=5.0*10**-3                     #Voltage in volt", 
      "Ios=50.0*10**-9                    #Input offset current in ampere", 
      "Ib=200.0*10**-9                    #Input bias current in ampere", 
      "Ta=25.0                            #Temperature in degree celsius", 
      "#Calculations:", 
      "# without compensating resistor", 
      "Vot=(1+Rf/R1)*Vos + Rf*Ib          #Calculating output offset voltage", 
      "Vot=Vot*1000                       #Calculating output offset voltage", 
      "print('Vot= %.1f mV'%Vot)", 
      "", 
      "", 
      "# with compensating resistor", 
      "Vot=(1+Rf/R1)*Vos + Rf*Ios         #Calculating output offset voltage", 
      "Vot=Vot*1000                       #Calculating output offset voltage", 
      "print('\\nVot= %.1f mV'%Vot)"
     ], 
     "language": "python", 
     "outputs": [
      {
       "output_type": "stream", 
       "stream": "stdout", 
       "text": [
        "Vot= 32.0 mV", 
        "", 
        "Vot= 30.5 mV"
       ]
      }
     ], 
     "prompt_number": 2
    }, 
    {
     "cell_type": "markdown", 
     "source": [
      "<h3>Example No. 3.7, Page No:119<h3>"
     ]
    }, 
    {
     "cell_type": "code", 
     "collapsed": false, 
     "input": [
      "", 
      "#Part A", 
      "#Variable Declaration:", 
      "Vos=1.5*10**-3            #Voltage in volt", 
      "Rf=1.0*10**6              #feedback resistance in ohm", 
      "R1=100.0*10**3            #Resistance in ohm", 
      "", 
      "#Calculations:", 
      "Vo=Vos*(1+Rf/R1)         #Calculating output voltage", 
      "Vo=Vo*1000.0             #Calculating output voltage", 
      "", 
      "#Result:", 
      "print('Vo= %.1f mV'%Vo)", 
      "", 
      "#Part B", 
      "#Variable Declaration:", 
      "Iosch= 10.0*10**-9       #Ios current in ampere", 
      "", 
      "#Calculations:", 
      "Vosch=Iosch*Rf           #Calculating output voltage", 
      "Vosch=Vosch*1000.0       #Calculating output voltage", 
      "", 
      "#Results:", 
      "print('\\nChange in Vo= %.1f mV'%Vosch)", 
      "print('\\n Worst case drift is 26.5 mV or -26.5 mV')"
     ], 
     "language": "python", 
     "outputs": [
      {
       "output_type": "stream", 
       "stream": "stdout", 
       "text": [
        "Vo= 16.5 mV", 
        "", 
        "Change in Vo= 10.0 mV", 
        "", 
        " Worst case drift is 26.5 mV or -26.5 mV"
       ]
      }
     ], 
     "prompt_number": 1
    }, 
    {
     "cell_type": "markdown", 
     "source": [
      "<h3>Example No.3.8, Page No: 125<h3>"
     ]
    }, 
    {
     "cell_type": "code", 
     "collapsed": false, 
     "input": [
      "f=1000.0                 # frequency in hertz", 
      "#from graph", 
      "gain_db=60.0             # Gain in db", 
      "gain=1000.0              #Gain", 
      "", 
      "#Result:", 
      "print('Gain= %d'%gain)"
     ], 
     "language": "python", 
     "outputs": [
      {
       "output_type": "stream", 
       "stream": "stdout", 
       "text": [
        "Gain= 1000"
       ]
      }
     ], 
     "prompt_number": 19
    }, 
    {
     "cell_type": "markdown", 
     "source": [
      "<h3>Example No. 3.9, Page No: 126<h3>"
     ]
    }, 
    {
     "cell_type": "code", 
     "collapsed": false, 
     "input": [
      "", 
      "#Variable Declaration:", 
      "riset=0.7*10**-6               #rise time in microsecond", 
      "", 
      "#Calculations:", 
      "bw=0.35/riset                  #Finding unity gain bandwidth", 
      "bw=bw/1000.0                   #Finding unity gain bandwidth", 
      "", 
      "#Results:", 
      "print('Bandwidth= %d kHz'%bw)"
     ], 
     "language": "python", 
     "outputs": [
      {
       "output_type": "stream", 
       "stream": "stdout", 
       "text": [
        "Bandwidth= 500 kHz"
       ]
      }
     ], 
     "prompt_number": 20
    }, 
    {
     "cell_type": "markdown", 
     "source": [
      "<h3>Page No. 3.10, Page No: 126<h3>"
     ]
    }, 
    {
     "cell_type": "code", 
     "collapsed": false, 
     "input": [
      "", 
      "#Variavle Declaration:", 
      "ugb=1.5*10**6              #Unity gain bandwidth in hertz", 
      "f1=2.0*10**3               #Signal frequency in hertz", 
      "", 
      "#Calculations:", 
      "A0=ugb/f1                  #Calculating open loop DC voltage gain", 
      "", 
      "#Results:", 
      "print('Openloop Dc Voltage gain= %d '%A0)"
     ], 
     "language": "python", 
     "outputs": [
      {
       "output_type": "stream", 
       "stream": "stdout", 
       "text": [
        "Openloop Dc Voltage gain= 750 "
       ]
      }
     ], 
     "prompt_number": 21
    }, 
    {
     "cell_type": "markdown", 
     "source": [
      "<h3>Example No. 3.11, Page No: 134<h3>"
     ]
    }, 
    {
     "cell_type": "code", 
     "collapsed": false, 
     "input": [
      "", 
      "#Variable Declaration:", 
      "Voch=10.0             #Change of voltage in volt", 
      "slew=0.5              #Slew rate in volt per microsecond", 
      "", 
      "#Calculations:", 
      "time=Voch/slew        #Calculating time taken for output to change by 10V ", 
      "", 
      "#Results:", 
      "print('Time= %d us'%time)"
     ], 
     "language": "python", 
     "outputs": [
      {
       "output_type": "stream", 
       "stream": "stdout", 
       "text": [
        "Time= 20 us"
       ]
      }
     ], 
     "prompt_number": 22
    }, 
    {
     "cell_type": "markdown", 
     "source": [
      "<h3>Example No. 3.12, Page No: 135<h3>"
     ]
    }, 
    {
     "cell_type": "code", 
     "collapsed": false, 
     "input": [
      "", 
      "import math", 
      "#Part A", 
      "#Variable Declaration:", 
      "slew=0.5                     #Slew rate in volt per microsecond", 
      "Vm=12.0                      #Voltage in volt", 
      "", 
      "#calculations:", 
      "fmax=slew/(2.0*math.pi*Vm)   #calculating frequency of maximum undistorted wave", 
      "fmax=fmax*1000.0             #Calculating frequency of maximum undistorted wave", 
      "", 
      "#Results:", 
      "print('Fmax= %.1f kHz'%fmax)", 
      "", 
      "# Part B", 
      "#Variable Declarations:", 
      "Vm1=2.0                      #Voltage in volt", 
      "", 
      "#Calculations:", 
      "fmax1=slew/(2.0*math.pi*Vm1) #calculating frequency of maximum undistorted wave", 
      "fmax1=fmax1*1000.0           #calculating frequency of maximum undistorted wave", 
      "", 
      "#Results:", 
      "print('\\nFmax1= %.1f kHz'%fmax1)"
     ], 
     "language": "python", 
     "outputs": [
      {
       "output_type": "stream", 
       "stream": "stdout", 
       "text": [
        "Fmax= 6.6 kHz", 
        "", 
        "Fmax1= 39.8 kHz"
       ]
      }
     ], 
     "prompt_number": 23
    }, 
    {
     "cell_type": "markdown", 
     "source": [
      "<h3>Example No. 3.13, Page No: 135<h3>"
     ]
    }, 
    {
     "cell_type": "code", 
     "collapsed": false, 
     "input": [
      "", 
      "#Variable Declaration:", 
      "import math", 
      "slew=0.5                   #Slew rate in volt per microsecond", 
      "f=10.0*10**3               #frequency in hertz", 
      "", 
      "#Calculations:", 
      "Vmmax=slew/(2*math.pi*f)   #Calculating maximum peak to peak voltage", 
      "Vmmax=Vmmax*10**6          #Calculating maximum peak to peak voltage", 
      "", 
      "#Results:", 
      "print('Vm(max)= %.2f V'%Vmmax)"
     ], 
     "language": "python", 
     "outputs": [
      {
       "output_type": "stream", 
       "stream": "stdout", 
       "text": [
        "Vm(max)= 7.96 V"
       ]
      }
     ], 
     "prompt_number": 1
    }, 
    {
     "cell_type": "markdown", 
     "source": [
      "<h3>Example No. 3.14, Page No: 135<h3>"
     ]
    }, 
    {
     "cell_type": "code", 
     "collapsed": false, 
     "input": [
      "", 
      "#Variable Declaration:", 
      "slew=0.5                  #Slew rate in volt per microsecond", 
      "riset=4.0                 #Rise time in microsecond", 
      "", 
      "print('\\nVo is greater than 1V')", 
      "Vswing=(0.9-0.1)*5.0      #Voltage swing in volt", 
      "", 
      "#Calculations:", 
      "slewreq=Vswing/riset      #Calculating required slew rate", 
      "", 
      "#Results:", 
      "print('\\nSlew Rate Required= %d V/us'%slewreq)"
     ], 
     "language": "python", 
     "outputs": [
      {
       "output_type": "stream", 
       "stream": "stdout", 
       "text": [
        "", 
        "Vo is greater than 1V", 
        "", 
        "Slew Rate Required= 1 V/us"
       ]
      }
     ], 
     "prompt_number": 25
    }, 
    {
     "cell_type": "markdown", 
     "source": [
      "<h3>Example No. 3.15, Page No: 135<h3>"
     ]
    }, 
    {
     "cell_type": "code", 
     "collapsed": false, 
     "input": [
      "", 
      "#Variable Declaration:", 
      "Vch=20.0                #Change in voltage in volt", 
      "time=4.0                #Time in microseconds", 
      "", 
      "#Calculations:", 
      "slew=Vch/time           #Calculating slew rate       ", 
      "", 
      "#Results:", 
      "print('\\nSlew Rate = %d V/us'%slew)"
     ], 
     "language": "python", 
     "outputs": [
      {
       "output_type": "stream", 
       "stream": "stdout", 
       "text": [
        "", 
        "Slew Rate = 5 V/us"
       ]
      }
     ], 
     "prompt_number": 26
    }, 
    {
     "cell_type": "markdown", 
     "source": [
      "<h3>Example No. 3.16, Page No: 136<h3>"
     ]
    }, 
    {
     "cell_type": "code", 
     "collapsed": false, 
     "input": [
      "", 
      "#Variable Declaration:", 
      "import math", 
      "A=50.0                                #Gain", 
      "slew=0.5                              #Slew rate in volt per microsecond", 
      "Vid=20.0*10**-3                       #Voltage difference in volt", 
      " ", 
      "#Calculations:", 
      "Vm=A*Vid                              #Calculating maximum voltage ", 
      "", 
      "fmax=(slew*10**6)/(2*math.pi*Vm)      #calculating frequency of maximum undistorted wave   ", 
      "fmax=fmax/1000.0                      #calculating frequency of maximum undistorted wave", 
      "", 
      "#Results:", 
      "print('Fmax= %.1f kHz'%fmax)"
     ], 
     "language": "python", 
     "outputs": [
      {
       "output_type": "stream", 
       "stream": "stdout", 
       "text": [
        "Fmax= 79.6 kHz"
       ]
      }
     ], 
     "prompt_number": 27
    }, 
    {
     "cell_type": "markdown", 
     "source": [
      "<h3>Example No. 3.17, Page No: 136<h3>"
     ]
    }, 
    {
     "cell_type": "code", 
     "collapsed": false, 
     "input": [
      "", 
      "#Variable Declaration:", 
      "import math", 
      "slew=0.5                      #Slew rate in volt per microsecond", 
      "f=4.0*10**4                   #frequency in hertz", 
      "", 
      "#Calculations:", 
      "Vm=(slew*10**6)/(2*math.pi*f) #Calculating Vm", 
      "Vmpp=2.0*Vm/10.0              #Calculating maximum peak to peak input signal that can be applied", 
      "", 
      "#Results:", 
      "print('Vpeak= %.2f V'%Vm)", 
      "print('\\nVoltage peak-to-peak= %.3f V'%Vmpp)"
     ], 
     "language": "python", 
     "outputs": [
      {
       "output_type": "stream", 
       "stream": "stdout", 
       "text": [
        "Vpeak= 1.99 V", 
        "", 
        "Voltage peak-to-peak= 0.398 V"
       ]
      }
     ], 
     "prompt_number": 28
    }, 
    {
     "cell_type": "markdown", 
     "source": [
      "<h3>Example No. 3.18, Page No: 138<h3>"
     ]
    }, 
    {
     "cell_type": "code", 
     "collapsed": false, 
     "input": [
      "", 
      "#Variable Declaration:", 
      "Rf=10.0*10**3        #Resistance in ohm", 
      "R1=100.0             #Resistance in ohm", 
      "Vni=1*10**-6         #input rms noise voltage in volt", 
      "", 
      "#Calculations: ", 
      "Kn=1+Rf/R1           #Calculating noise gain", 
      "Vno=Vni*(1+Rf/R1)    #Calculating output voltage", 
      "Vno=Vno*10**6        #Calculating output voltage", 
      "", 
      "#Results:", 
      "print('Output noise voltage= %d uV (rms)'%Vno)"
     ], 
     "language": "python", 
     "outputs": [
      {
       "output_type": "stream", 
       "stream": "stdout", 
       "text": [
        "Output noise voltage= 101 uV (rms)"
       ]
      }
     ], 
     "prompt_number": 29
    }, 
    {
     "cell_type": "markdown", 
     "source": [
      "<h3>Example No: 3.19, Page No: 142<h3>"
     ]
    }, 
    {
     "cell_type": "code", 
     "collapsed": false, 
     "input": [
      "", 
      "#Variable Deeclaration:", 
      "Rf=10.0*10**3       #Feedback resistance in ohm", 
      "R1=1.0*10**3        #Resistance in ohm", 
      "", 
      "#Calculations:", 
      "Av=-Rf/R1           #Calculating gain", 
      "", 
      "#Results:", 
      "print('Closed loop voltage gain= %d'%Av)"
     ], 
     "language": "python", 
     "outputs": [
      {
       "output_type": "stream", 
       "stream": "stdout", 
       "text": [
        "Closed loop voltage gain= -10"
       ]
      }
     ], 
     "prompt_number": 30
    }, 
    {
     "cell_type": "markdown", 
     "source": [
      "<h3>Example No. 3.20, Page No: 147<h3>"
     ]
    }, 
    {
     "cell_type": "code", 
     "collapsed": false, 
     "input": [
      "", 
      "#Variable Declaration:", 
      "Rf=10.0*10**3      #Feedback resistance in ohm", 
      "R1=1.0*10**3       #Resistance in ohm", 
      "", 
      "#Calculations:", 
      "Av=1+ Rf/R1        #Calculating gain", 
      "", 
      "Beta=R1/(Rf+R1)    #Calculating feedback factor", 
      "", 
      "#Results:", 
      "print('Closed loop voltage gain= %d'%Av)", 
      "print('\\nFeedback factor= %.3f'%Beta)"
     ], 
     "language": "python", 
     "outputs": [
      {
       "output_type": "stream", 
       "stream": "stdout", 
       "text": [
        "Closed loop voltage gain= 11", 
        "", 
        "Feedback factor= 0.091"
       ]
      }
     ], 
     "prompt_number": 31
    }, 
    {
     "cell_type": "markdown", 
     "source": [
      "<h3>Example No. 3.21, Page No:147<h3>"
     ]
    }, 
    {
     "cell_type": "code", 
     "collapsed": false, 
     "input": [
      "", 
      "#Variable Declaration:", 
      "R1=10.0*10**3        #Resistance in ohm", 
      "R2=1.0*10**3         #Resistance in ohm", 
      "R3=1.0*10**3         #Resistance in ohm", 
      "Rf=50.0*10**3        #Resistance in ohm", 
      "", 
      "#Calculations:", 
      "I=1/(R2+R3)          #Calculating current ", 
      "Vi1=I*R2             #Calculating input voltage", 
      "Vo=Vi1*(1+ Rf/R1)    #Calculating output voltage   ", 
      "", 
      "#Result:", 
      "print('Vout= %d V'%Vo)"
     ], 
     "language": "python", 
     "outputs": [
      {
       "output_type": "stream", 
       "stream": "stdout", 
       "text": [
        "Vout= 3 V"
       ]
      }
     ], 
     "prompt_number": 32
    }, 
    {
     "cell_type": "markdown", 
     "source": [
      "<h3>Example No: 3.22, Page No: 147<h3>"
     ]
    }, 
    {
     "cell_type": "code", 
     "collapsed": false, 
     "input": [
      "", 
      "#Variable Declration:", 
      "Vi=0.6                #volatge in volt ", 
      "Vi1=0.6               #volatge in volt", 
      "Vi2=0.6               #volatge in volt", 
      "R1=10.0*10**3         #Resistance in ohm", 
      "Rf=20.0*10**3         #Resistance in ohm", 
      "RL=2.0*10**3          #Resistance in ohm", 
      "", 
      "#Calculations:", 
      "I1=Vi/R1              #Calculating current", 
      "I1=I1*1000.0          #Calculating current", 
      "Av=1+Rf/R1            #Calculating gain", 
      "Vo=Av*Vi              #Calculating output voltage", 
      "IL=Vo/RL              #Calculating load current", 
      "IL=IL*1000            #Calculating load current", 
      "", 
      "#By Kirchhoff's current law", 
      "Io=I1+IL              #Calculating output current", 
      "", 
      "#Results:", 
      "print('\\nIo=%.2f mA'%Io)", 
      "print('Av=%d'%Av)", 
      "print('\\nVo=%.1f V'%Vo)", 
      "print('\\nI1=%.1f mA'%IL)"
     ], 
     "language": "python", 
     "outputs": [
      {
       "output_type": "stream", 
       "stream": "stdout", 
       "text": [
        "Av=3", 
        "", 
        "Vo=1.8 V", 
        "", 
        "I1=0.9 mA", 
        "", 
        "Io=0.96 mA"
       ]
      }
     ], 
     "prompt_number": 33
    }, 
    {
     "cell_type": "markdown", 
     "source": [
      "<h3>Example No. 3.23,Page No:151 <h3>"
     ]
    }, 
    {
     "cell_type": "code", 
     "collapsed": false, 
     "input": [
      "", 
      "#Variable Declaration:", 
      "import math", 
      "fL=50.0                       #Frequency in hertz", 
      "RL=3.3*10**3                  #Resistance in ohm", 
      "Ibmax=500.0*10**-9            #Current in ampere", 
      "R1max=140.0*10**3             #Resistance in ohm", 
      "", 
      "#Calculations:", 
      "C1=1/(2*math.pi*fL*R1max/10)   #Calculating value of capacitor", 
      "C1=C1*10**6                    #Calculating value of capacitor", 
      "", 
      "C2=1/(2*math.pi*fL*RL)         #Calculating value of capacitor", 
      "C2=C2*10**6                    #Calculating value of capacitor", 
      "", 
      "#Results:", 
      "print('C1=%.3f uF'%C1)", 
      "print('\\nC2=%.2f uF'%C2)"
     ], 
     "language": "python", 
     "outputs": [
      {
       "output_type": "stream", 
       "stream": "stdout", 
       "text": [
        "C1=0.227 uF", 
        "", 
        "C2=0.96 uF"
       ]
      }
     ], 
     "prompt_number": 34
    }, 
    {
     "cell_type": "markdown", 
     "source": [
      "<h3>Example No. 3.24, Page NO: 153<h3>"
     ]
    }, 
    {
     "cell_type": "code", 
     "collapsed": false, 
     "input": [
      "", 
      "#Variable Declaration:", 
      "import math", 
      "", 
      "Vbe=0.6                     #Voltage Vbe in volt", 
      "Ibmax=500.0*10**-9          #Current in ampere", 
      "fL=50.0                     #frequency in hertz", 
      "RL=3.3*10**3                #Resistance in ohm", 
      "Mmin=50000.0", 
      "", 
      "#Calculations:", 
      "R1max=0.1*Vbe/Ibmax         #Calculating maximum value of the resistance R1", 
      "R1=R1max/2.0                #Calculating value of R1", 
      "R2=R1                       #Value of R2 is equal to R1", 
      "", 
      "C3=1/(2*math.pi*fL*RL)      #Calculaing value of capacitance", 
      "C3=C3*10**6                 #Calculaing value of capacitance", 
      "", 
      "C2=1/(2*math.pi*fL*R2/10)   #Calculaing value of capacitance", 
      "C2=C2*10**6                 #Calculaing value of capacitance", 
      "", 
      "", 
      "Zinmin=(1+Mmin)*56.0*10**3  #Calculating minimum input impedance", 
      "Zinmin=Zinmin/10**6         #Calculating minimum input impedance", 
      "", 
      "#Results:", 
      "print('\\nC3=%.2f uF'%C3)", 
      "print('\\nC2=%.2f uF'%C2)", 
      "# answer in textbook is wrong", 
      "print('\\nZin(min)= %d Mohm'%Zinmin)"
     ], 
     "language": "python", 
     "outputs": [
      {
       "output_type": "stream", 
       "stream": "stdout", 
       "text": [
        "", 
        "C3=0.96 uF", 
        "", 
        "C2=0.53 uF", 
        "", 
        "Zin(min)= 2800 Mohm"
       ]
      }
     ], 
     "prompt_number": 2
    }, 
    {
     "cell_type": "markdown", 
     "source": [
      "<h3>Example No. 3.25, Page No: 156<h3>"
     ]
    }, 
    {
     "cell_type": "code", 
     "collapsed": false, 
     "input": [
      "", 
      "#Variable Declaration:", 
      "import math", 
      "Vo=3.0                      #output voltage in volt", 
      "Vi=10.0*10**-3              #Input voltage in volt", 
      "R2=1.0*10**6                #Resistance in ohm", 
      "Av=300.0                    #Gain", 
      "fL=100.0                    #Frequency in hertz", 
      "RL=15.0*10**3               #Resistance in ohm", 
      "", 
      "#Calculations:", 
      "R3=R2/(Av-1)                #Calculating value of resistance ", 
      "", 
      "R1=R2-R3                    #Calculating value of resistance", 
      "C2=1/(2*math.pi*fL*R3)      #Calculatinf value of capacitance", 
      "C2=C2*10**6                 #Calculating value of capacitance", 
      "  ", 
      "C3=1/(2*math.pi*fL*RL/10)   #Calculating value of capacitance", 
      "C3=C3*10**6                 #Calculating value of capacitance", 
      "", 
      "#Results:", 
      "print('\\nC2= %.2f uF'%C2)", 
      "print('\\nC3= %.2f uF'%C3)"
     ], 
     "language": "python", 
     "outputs": [
      {
       "output_type": "stream", 
       "stream": "stdout", 
       "text": [
        "", 
        "C2= 0.48 uF", 
        "", 
        "C3= 1.06 uF"
       ]
      }
     ], 
     "prompt_number": 36
    }, 
    {
     "cell_type": "markdown", 
     "source": [
      "<h3>Example No. 3.26, Page NO: 159<h3>"
     ]
    }, 
    {
     "cell_type": "code", 
     "collapsed": false, 
     "input": [
      "", 
      "#Variable Declaration:", 
      "import math", 
      "fL=20.0                   #frequency in hertz", 
      "fH=2000.0                 #frequency in hertz", 
      "RL=300.0                  #Resistance in ohm", 
      "R1=1.5*10**3              #Resistance in ohm", 
      "R2=56*10**3               #Resistance in ohm", 
      "", 
      "#Calculations:", 
      "C1=1/(2*math.pi*fL*R1/10) #Calculating value of capacitance", 
      "", 
      "C1=C1*10**6               #Calculating value of capacitance", 
      "", 
      "C2=1/(2*math.pi*fL*RL)    #Calculating value of capacitance", 
      "C2=C2*10**6               #Calculating value of capacitance", 
      "", 
      "Cf=1/(2*math.pi*fH*R2)    #Calculating value of capacitance", 
      "Cf=Cf*10**12              #Calculating value of capacitance", 
      "", 
      "", 
      "#Results:", 
      "print('\\nC1= %d uF'%C1)", 
      "print('\\nC2= %.1f uF'%C2)", 
      "print('\\nCf= %d pF'%Cf)"
     ], 
     "language": "python", 
     "outputs": [
      {
       "output_type": "stream", 
       "stream": "stdout", 
       "text": [
        "", 
        "C1= 53 uF", 
        "", 
        "C2= 26.5 uF", 
        "", 
        "Cf= 1421 pF"
       ]
      }
     ], 
     "prompt_number": 37
    }, 
    {
     "cell_type": "markdown", 
     "source": [
      "<h3>Example No. 3.27, Page No: 162<h3>"
     ]
    }, 
    {
     "cell_type": "code", 
     "collapsed": false, 
     "input": [
      "", 
      "#Variable Declaration:", 
      "import math", 
      "Ibmax=500.0*10**-9       #Current in ampere", 
      "Vcc=24.0                 #Volatge Vcc in volt", 
      "I2=50.0*10**-6           #Current in ampere", 
      "Vo=6.0                   #Output voltage in volt", 
      "Av=100.0                 #Gain", 
      "fL=100.0                 #Frequency in hertz", 
      "RL=5.6*10**3             #Resistance in hertz", 
      "", 
      "#Calculations:", 
      "I2=100.0*Ibmax           #Calculating current", 
      "R1=Vcc/(2.0*I2)          #Calculating resistance", 
      "R2=R1                    #value of R2 is equal to R1", 
      "Vi=Vo/Av                 #Calculating input voltage", 
      "", 
      "I4=100.0*Ibmax           #Calculating current", 
      "R4=Vi/I4                 #Calculating  value of resistance", 
      "", 
      "R3=118.8*10**3           #Calculating value of resistance", 
      "R1pR2=(R1+R2)/4.0        #Calculating parellel combination of R1 and R2", 
      "", 
      "C1=1/(2*math.pi*fL*R1pR2/10.0) #Calculating value of capacitance", 
      "C1=C1*10**6                    #Calculating value of capacitance", 
      " ", 
      "C2=1/(2*math.pi*fL*RL/10.0)    #Calculating value of capacitance", 
      "C2=C2*10**6                    #Calculating value of capacitance", 
      "", 
      "C3=1/(2*math.pi*fL*R4)         #Calculating value of capacitance", 
      "C3=C3*10**6                    #Calculating value of capacitance", 
      "", 
      "#Results:", 
      "print('\\nC1= %.3f uF'%C1)", 
      "print('\\nC2= %.3f uF'%C2)", 
      "print('\\nC3= %.3f uF'%C3)"
     ], 
     "language": "python", 
     "outputs": [
      {
       "output_type": "stream", 
       "stream": "stdout", 
       "text": [
        "", 
        "C2= 2.842 uF", 
        "", 
        "C1= 0.133 uF", 
        "", 
        "C3= 1.326 uF"
       ]
      }
     ], 
     "prompt_number": 3
    }, 
    {
     "cell_type": "markdown", 
     "source": [
      "<h3>Example No. 3.28, Page No:166<h3>"
     ]
    }, 
    {
     "cell_type": "code", 
     "collapsed": false, 
     "input": [
      "", 
      "#Variable Declaration:", 
      "cmrr=10**5         #Common mode rejection ratio", 
      "Adm=10**5          #Differential gain", 
      "", 
      "#Calculations:", 
      "Acm=Adm/cmrr       #Calculating common mode gain", 
      "", 
      "#Results:", 
      "print('Common mode gain Acm= %d'%Acm)"
     ], 
     "language": "python", 
     "outputs": [
      {
       "output_type": "stream", 
       "stream": "stdout", 
       "text": [
        "Common mode gain Acm= 1"
       ]
      }
     ], 
     "prompt_number": 39
    }, 
    {
     "cell_type": "markdown", 
     "source": [
      "<h3>Example No: 3.29, Page NO: 168<h3>"
     ]
    }, 
    {
     "cell_type": "code", 
     "collapsed": false, 
     "input": [
      "", 
      "#Variable Declaration:", 
      "R1=560.0            #Resistance value in ohm", 
      "R3=560.0            #Resistance value in ohm", 
      "Rf=5.6*10**3        #Resistance value in ohm", 
      "", 
      "R2=Rf               #Value of R2 is equal to Rf", 
      "Vo1=-2.0            #Volatage in volt  ", 
      "Ri=2.0*10**6        #Resistance value in ohm", 
      "Vo2=-1.0            #Voltage in volt", 
      "", 
      "#Calculations:", 
      "# Part 1", 
      "Ad=1+Rf/R1          #Calculating differential gain", 
      "", 
      "# Part 2", 
      "A=200000.0                      #Gain", 
      "Ri1=Ri*(1+ (A*R2)/(R2+R3))      #Calculating resistance value", 
      "Ri1=Ri1/10**9                   #Calculating resistance value", 
      "", 
      "Ri2=Ri*(1+ (A*R1)/(R1+Rf))      #Calculating resistance value  ", 
      "Ri2=Ri2/10**9                   #Calculating resistance value", 
      " ", 
      "# Part 3", 
      "Vid=Vo2-Vo1                     #Calculating differential voltage", 
      "Vo=(1+Rf/R1)*Vid                #Calculating output voltage", 
      "Vo=Vo", 
      "", 
      "#Results:", 
      "print('\\nAd= %d'%Ad)", 
      "print('\\nRi1=%.1f Gohm'%Ri1)", 
      "print('\\nRi2=%.2f Gohm'%Ri2)", 
      "print('\\nVo=%d V'%Vo)"
     ], 
     "language": "python", 
     "outputs": [
      {
       "output_type": "stream", 
       "stream": "stdout", 
       "text": [
        "", 
        "Ad= 11", 
        "", 
        "Ri1=363.6 Gohm", 
        "", 
        "Ri2=36.37 Gohm", 
        "", 
        "Vo=11 V"
       ]
      }
     ], 
     "prompt_number": 4
    }, 
    {
     "cell_type": "code", 
     "collapsed": true, 
     "input": [], 
     "language": "python", 
     "outputs": []
    }
   ]
  }
 ]
}