{
 "metadata": {
  "name": "",
  "signature": "sha256:cce641bca014659ece25c249d49fc2718ed9c14f783e4ab66dd965cffbe0a1e4"
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "Chatper 14 : INTEGRATED CIRCUITS"
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 14.1  Page No : 456"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#INPUT DATA\n",
      "CMRR = 10**5;\t\t\t#common-mode rejection ratio\n",
      "Ad = 10**5;\t\t\t#differential gain\n",
      "#CALCULATIONS\n",
      "Acm = Ad/(CMRR);\t\t\t#common mode gain\n",
      "print \"common-mode gain is %d\"%(Acm);\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "common-mode gain is 1\n"
       ]
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 14.2  Page No : 458"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#INPUT DATA\n",
      "V0 = 20;\t\t\t#voltage in volts\n",
      "t = 4;\t\t\t#time in microsec\n",
      "#SLEW RATE\n",
      "SR = (V0)/t;\t\t\t#slewrate in V/us\n",
      "print \"slewrate is %d V/us\"%(SR);"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "slewrate is 5 V/us\n"
       ]
      }
     ],
     "prompt_number": 2
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 14.3  Page No : 458"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math \n",
      "\n",
      "#INPUT DATA\n",
      "A = 50;\t\t\t#gain of inverting amplifier\n",
      "Vid = 20*10**-3;\t\t\t#voltage in V\n",
      "SR = 0.5;\t\t\t#slewrate in V/us----->SR = (2*math.pi*f*Vm)/(10**6)\n",
      "#CALCULATIONS\n",
      "Vm = A*(Vid);\t\t\t#maximum output voltage in V\n",
      "fmax = (SR*10**6)/(2*math.pi*Vm);\t\t\t#frequency in hz\n",
      "print \"thus maximum frequency of the input for which undistorted output is obtained is %g hz\"%(fmax);\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "thus maximum frequency of the input for which undistorted output is obtained is 79577.5 hz\n"
       ]
      }
     ],
     "prompt_number": 3
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 14.4  Page No : 458"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math \n",
      "\n",
      "#INPUT DATA\n",
      "A = 10;\t\t\t#gain of inverting amplifier\n",
      "f = 40*10**3;\t\t\t#frequency in hz\n",
      "SR = 0.5;\t\t\t#slewrate in V/us----->SR = (2*math.pi*f*Vm)/(10**6)\n",
      "#CALCULATIONS\n",
      "Vm = (SR*10**6)/(2*math.pi*f);\t\t\t#maximum output voltage in V peak\n",
      "Vm = 2*Vm;\t\t\t#maximum output voltage in V peak to peak\n",
      "Vid = Vm/A;\t\t\t#maximum peak-to-peak input voltage for undistorted output \n",
      "print \"Thus maximum peak-to-peak input voltage for undistorted output is %1.3f V peak-to-peak\"%(Vid);"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Thus maximum peak-to-peak input voltage for undistorted output is 0.398 V peak-to-peak\n"
       ]
      }
     ],
     "prompt_number": 4
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 14.5  Page No : 465"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#INPUT DATA\n",
      "Rf = 10.*10**3;\t\t\t#feedback resistance in ohms\n",
      "R1 = 1*10**3;\t\t\t#resistance in ohms\n",
      "#CALCULATIONS\n",
      "Af = -(Rf/R1);\t\t\t#closed-loop voltage gain for inverting amplifier\n",
      "print \"Thus closed-loop voltage gain is %d\"%(Af);\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Thus closed-loop voltage gain is -10\n"
       ]
      }
     ],
     "prompt_number": 6
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 14.6  Page No : 466"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#INPUT DATA\n",
      "Rf = 10.*10**3;\t\t\t#forward resistance in ohms\n",
      "R1 = 1.*10**3;\t\t\t#resistance in ohms\n",
      "#CALCULATIONS\n",
      "Af = 1+(Rf/R1);\t\t\t#closed-loop voltage gain in non-inverting amplifier\n",
      "b = (R1/(R1+Rf));\t\t\t#feedback factor\n",
      "print \"Thus closed-loop voltage gain and feedback factor are %d and %1.3f respectively\"%(Af,b);\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Thus closed-loop voltage gain and feedback factor are 11 and 0.091 respectively\n"
       ]
      }
     ],
     "prompt_number": 7
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 14.7  Page No : 473"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#INPUT DATA\n",
      "V1 = 2.;\t\t\t#input voltage 1 of summing amplifier in V\n",
      "V2 = 3.;\t\t\t#input voltage 2 of summing amplifier in V\n",
      "V3 = 4.;\t\t\t#input voltage 3 of summing amplifier in V\n",
      "R1 = 1.;\t\t\t#resistance 1 of summing amplifier in kilo ohms\n",
      "R2 = 1.;\t\t\t#resistance 2 of summing amplifier in kilo ohms\n",
      "R3 = 1.;\t\t\t#resistance 3 of summing amplifier in kilo ohms\n",
      "Rf = 1.;\t\t\t#feedback resistance in kilo ohms\n",
      "R = 1.;\t\t\t#resistance in kilo ohms\n",
      "\n",
      "#CALCULATIONS\n",
      "V0 = (-Rf/R)*(V1+V2+V3);\t\t\t#output voltage in volts\n",
      "\n",
      "# result\n",
      "print \"Thus output voltage is %d V\"%(V0);\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Thus output voltage is -9 V\n"
       ]
      }
     ],
     "prompt_number": 8
    }
   ],
   "metadata": {}
  }
 ]
}