{
 "metadata": {
  "name": ""
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "Chapter 19: VLSI Technology and Circuits"
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 1, Page 555"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Variable declaration\n",
      "ID=50*10**-6#ID=drain current in amperes\n",
      "k=25*10**-6#k=ue/D in A/V**2\n",
      "VDS=0.25#VDS=drain-to-source voltage\n",
      "VGS=5#VGS=gate-to-source voltage\n",
      "VTH=1.5#VTH=threshold voltage\n",
      "\n",
      "#Calculations&Results\n",
      "w=ID/(k*(VGS-VTH)*VDS)#w=W/L\n",
      "print \"W/L=%.2f\"%w\n",
      "P=VDS*ID#P=power dissipated by the transistor\n",
      "print \"The dissipated power is=%.1f uW\"%(P*10**6)\n",
      "VDD=5#VDD=drain supply voltage of given NMOS transistor\n",
      "R=(VDD-VDS)/ID#R=load resistor to be connected in series with the drain\n",
      "print \"The load resistance is=%.f k ohm\"%(R/1000)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "W/L=2.29\n",
        "The dissipated power is=12.5 uW\n",
        "The load resistance is=95 k ohm\n"
       ]
      }
     ],
     "prompt_number": 2
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 2, Page 555"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Variable declaration\n",
      "ID=50*10**-6#ID=drain current in amperes\n",
      "k=25*10**-6#k=ue/D in A/V**2\n",
      "VDEP=3\n",
      "\n",
      "#Calculations&Results\n",
      "l=(k*((-VDEP)**2))/(2*ID)#l=(L/W)=aspect ratio of the pull-up\n",
      "print \"Pull-up (L/W)=%.2f\"%l\n",
      "VGS=5#VGS=gate-to-source voltage\n",
      "VTH=1#VTH=threshold voltage\n",
      "VDs=4.75#VDs=the drain source voltage of the depletion mode pull-up in saturation\n",
      "VDD=5#VDD=drain supply voltage of given NMOS inverter\n",
      "#L/W=(k*(VGS-VTH)*VDS)/ID where L/W=pull down aspect ratio\n",
      "l1=(k*(VGS-VTH)*(VDD-VDs))/ID#l1=L/W\n",
      "print \"Pull-down (L/W)=%.1f\"%l1"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Pull-up (L/W)=2.25\n",
        "Pull-down (L/W)=0.5\n"
       ]
      }
     ],
     "prompt_number": 4
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 3, Page 555"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Variable declaration\n",
      "w=10.#w=W/L value of the NMOS transistor in a CMOS inverter\n",
      "un=1350#un=electron mobility for NMOS transistor in cm^2/V s\n",
      "up=540#up=electron mobility for PMOS transistor in cm^2/V s\n",
      "\n",
      "#Calculations\n",
      "#(Wpu/Lpu)*up*(VINV-VDD-VTHP)^2=(Wpd/Lpd)*un*(VINV-VTHN)^2\n",
      "#For a symmetrical inverter VINV=(VDD/2) and VTHN=(-VTHP)\n",
      "#Also for input voltage=VDD/2 both transistors operate in saturation region\n",
      "#Therefore,up*(Wpu/Lpu)=un*(Wpd/Lpd)\n",
      "w1=(un*w)/up#w1=Wpu/Lpu=W/L value of the PMOS for a symmetrical inverter\n",
      "\n",
      "#Result\n",
      "print \"W/L value of the PMOS transistor in a CMOS inverter is = %.f\"%w1"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "W/L value of the PMOS transistor in a CMOS inverter is = 25\n"
       ]
      }
     ],
     "prompt_number": 6
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 4, Page 556"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "\n",
      "#Variable declaration\n",
      "f=2*10**9#f=clock frequency in Hz\n",
      "VDD=3#VDD=drain supply voltage \n",
      "Cl=1*10**-12#C1=load capacitance in Farad\n",
      "P=50.*10**-3#P=maximum power dissipation capability in W/stage\n",
      "\n",
      "#Calculations\n",
      "N=P/(f*Cl*VDD**2)#N=maximum permissible number of fan outs\n",
      "\n",
      "#Results\n",
      "print \"N=%.1f\"%N\n",
      "print \"The maximum permissible number of fan-outs is(integer just below actual value)=%.f\"%math.floor(N)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "N=2.8\n",
        "The maximum permissible number of fan-outs is(integer just below actual value)=2\n"
       ]
      }
     ],
     "prompt_number": 8
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 5, Page 556"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Variable declaration\n",
      "L=3*10**-6#L=length of an NMOS pass transistor in metres\n",
      "VDS=0.5#VDS=drain-source voltage\n",
      "u=1400*10**-4#u=electron mobility in m**2/V s\n",
      "\n",
      "#Calculations\n",
      "t=L**2/(VDS*u)#t=channel transit time\n",
      "\n",
      "#Result\n",
      "print \"The transit time is=%.2f ns\"%(t/10**-9)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The transit time is=0.13 ns\n"
       ]
      }
     ],
     "prompt_number": 10
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 6, Page 556"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Variable declaration\n",
      "y=2#y=length unit in micrometres\n",
      "\n",
      "#Calculations&Results\n",
      "W=3*y#W=mimimum metal linewidth in micrometres\n",
      "print \"W=%.f um\"%W\n",
      "n=80#n=number of driven inverters\n",
      "i=0.07#i=average current ratings in milliamperes\n",
      "I=n*i#I=total currrent drawn by n inverters\n",
      "print \"I=%.1f mA\"%I\n",
      "#1mA per micrometre of aluminium line width is the maximum safe average current an aluminium wire can carry.\n",
      "print \"This needs a line at least width of %.1f um\"%I\n",
      "\n",
      "if (W>I):\n",
      "    print \"Above calculated minimum metal line-width (W) is thus the safe width of the metal line driving 80 inverters.\"\n",
      "\n",
      "f=5#f=number of fanout lines\n",
      "w=f*W#w=required metal line width\n",
      "print \"The metal line-width required to supply a fan-out of 5 lines is= %.f um\"%w"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "W=6 um\n",
        "I=5.6 mA\n",
        "This needs a line at least width of 5.6 um\n",
        "Above calculated minimum metal line-width (W) is thus the safe width of the metal line driving 80 inverters.\n",
        "The metal line-width required to supply a fan-out of 5 lines is= 30 um\n"
       ]
      }
     ],
     "prompt_number": 13
    }
   ],
   "metadata": {}
  }
 ]
}