{
 "metadata": {
  "name": ""
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "Chapter 02 : Semiconductor diodes"
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 2.1, Page No 37"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "#initialisation of variables\n",
      "If=100*10**-3\n",
      "Vf=.75      #given\n",
      "print(\"a)\")\n",
      "print(\"forward resistance\")\n",
      "\n",
      "#Calculations\n",
      "Rf=Vf/If\n",
      "print(\"forward resistnace is %3.1fohm \" %Rf)\n",
      "print(\"b)\")\n",
      "Vr=50\n",
      "Ir=100*10**-9\n",
      "Rr=(Vr/Ir)\n",
      "\n",
      "#Results\n",
      "print(\"reverse resistnace is %.1fohm \" %(Rr/10**6))"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "a)\n",
        "forward resistance\n",
        "forward resistnace is 7.5ohm \n",
        "b)\n",
        "reverse resistnace is 500.0ohm \n"
       ]
      }
     ],
     "prompt_number": 14
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 2.2, Page No 39"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "#initialisation of variables\n",
      "If=70*10**-3\n",
      "\n",
      "#Calculations\n",
      "rd=(26*10**-3)/If\n",
      "print(\"dynamic resistance is %.2fohm \" %rd)\n",
      "If=60*10**-3\n",
      "Vf=.025\n",
      "rd=Vf/If\n",
      "\n",
      "#Results\n",
      "print(\"dynamic resistance is %.2fohm \" %rd)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "dynamic resistance is 0.37ohm \n",
        "dynamic resistance is 0.42ohm \n"
       ]
      }
     ],
     "prompt_number": 15
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 2.3 Page No 40"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "#initialisation of variables\n",
      "R1=4.7*10**3\n",
      "E=15.0\n",
      "Vf=0.7\n",
      "\n",
      "#Calculations\n",
      "print(\"diode current is E=If*R1+Vf\")\n",
      "If=((E-Vf)/R1)*10**3\n",
      "\n",
      "#Results\n",
      "print(\" diode current is %.2fmA \" %If) "
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "diode current is E=If*R1+Vf\n",
        " diode current is 3.04mA \n"
       ]
      }
     ],
     "prompt_number": 16
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 2.5, Page No 41"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "#initialisation of variables\n",
      "E=1.5\n",
      "Vf=0.7\n",
      "R1=10\n",
      "rd=.25\n",
      "\n",
      "#Calculations\n",
      "print(\"a)\")\n",
      "If=(E-Vf)/R1\n",
      "print(\" forward current is %0.1fmA \" %(If*1000))\n",
      "print(\"b)\")\n",
      "If=(E-Vf)/(R1+rd)\n",
      "\n",
      "#Results\n",
      "print(\" forward current is %0.1fmA \" %(If*1000))"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "a)\n",
        " forward current is 80.0mA \n",
        "b)\n",
        " forward current is 78.0mA \n"
       ]
      }
     ],
     "prompt_number": 17
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 2.6 Page No 43"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "#initialisation of variables\n",
      "If=0\n",
      "Vf=5.0\n",
      "R1=100.0\n",
      "\n",
      "#Calculations\n",
      "E=(If*R1)+Vf\n",
      "print(\"B)\")\n",
      "Vf=0\n",
      "E=5.0\n",
      "R1=100.0\n",
      "If=(E/R1)*1000\n",
      "\n",
      "#Results\n",
      "print(\"resistance is %dmA \" %If) "
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "B)\n",
        "resistance is 50mA \n"
       ]
      }
     ],
     "prompt_number": 18
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 2.8 Page No 45"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "#initialisation of variables\n",
      "If=50*10**-3\n",
      "Vf=1.1\n",
      "R1=100.0\n",
      "\n",
      "#Calculations\n",
      "Vf1=If*R1\n",
      "E=Vf1+Vf\n",
      "\n",
      "#Results\n",
      "print(\" new supply voltage is %.2fV \" %E)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " new supply voltage is 6.10V \n"
       ]
      }
     ],
     "prompt_number": 19
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 2.9, Page No 48"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "#initialisation of variables\n",
      "P1=700.0*10**-3\n",
      "Vf=0.7\n",
      "\n",
      "#Calculations\n",
      "If=P1/Vf\n",
      "#at 65C\n",
      "D=5*10**-3\n",
      "T=65-25\n",
      "P2=P1-D*T\n",
      "If=P2/Vf\n",
      "\n",
      "#Results\n",
      "print( \"maximum forward current at 65C is %.1fA \" %(If*1000))"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "maximum forward current at 65C is 714.3A \n"
       ]
      }
     ],
     "prompt_number": 20
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 2.10 Page No 49"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "#initialisation of variables\n",
      "\n",
      "Vf1=0.7\n",
      "Vf=-1.8*10**-3\n",
      "If=26.0*10**-3\n",
      "T=100-25\n",
      "\n",
      "#Calculations\n",
      "Vf2=Vf1+(T*Vf)\n",
      "print(\" voltage at 100C is %.3f V \" %Vf2)\n",
      "print(\"At 25C\")\n",
      "T1=25.0\n",
      "rd=(26*10**-3/If)*((T1+273)/298)\n",
      "print(\" resistance at 25 C is %.2f ohm \" %rd)\n",
      "print(\" At 100C\")\n",
      "T2=100.0\n",
      "rd=(26*10**-3/If)*((T2+273)/298)\n",
      "\n",
      "#Results\n",
      "print(\" resistance at 100 C is %.2fohm \" %rd)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " voltage at 100C is 0.565 V \n",
        "At 25C\n",
        " resistance at 25 C is 1.00 ohm \n",
        " At 100C\n",
        " resistance at 100 C is 1.25ohm \n"
       ]
      }
     ],
     "prompt_number": 21
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 2.11 Page No 51"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "#initialisation of variablesV_s=230\n",
      "If=10*10**-3\n",
      "Vf=0.7\n",
      "\n",
      "#Calculations\n",
      "t=70.0*10**-9\n",
      "Cd=((t*If)/Vf)*10**9\n",
      "\n",
      "#Results\n",
      "print(\" diffusion capacitance is %.2f nF \" %Cd)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " diffusion capacitance is 1.00 nF \n"
       ]
      }
     ],
     "prompt_number": 22
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 2.12 Page No 53"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "#initialisation of variables\n",
      "print(\"A\")\n",
      "trr=10.0*10**-9\n",
      "\n",
      "#Calculations\n",
      "tf=10.0*trr*10**9\n",
      "print(\"minimum fall times is %d ns \" %tf)\n",
      "print(\"B)\")\n",
      "trr=3.0\n",
      "tf=10*trr\n",
      "\n",
      "#Results\n",
      "print(\"minimum fall times is %d ns \" %tf)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "A\n",
        "minimum fall times is 100 ns \n",
        "B)\n",
        "minimum fall times is 30 ns \n"
       ]
      }
     ],
     "prompt_number": 23
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 2.14, Page No 58"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "#initialisation of variables\n",
      "\n",
      "Io=75.0*10**-3\n",
      "#vertical scale of 5mA/cm \n",
      "\n",
      "#Calculations\n",
      "If=Io/5*10**-3\n",
      "R1=15/(75*10**-3)\n",
      "P=((Io)**2)*R1\n",
      "\n",
      "#Results\n",
      "print(\"Pr1 = %1.1f W  \" %P)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Pr1 = 1.1 W  \n"
       ]
      }
     ],
     "prompt_number": 24
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 2.15, Page No 63"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "#initialisation of variables\n",
      "Vz=7.5\n",
      "Pd=400.0*10**-3\n",
      "D=3.2*10**-3\n",
      "\n",
      "#Calculations\n",
      "Izm=Pd/Vz\n",
      "print(\"current at 50C is %.1fA \" %(Izm*1000))\n",
      "print(\"At 100C\")\n",
      "P2=Pd-((100-50)*D)\n",
      "print(\" power at 100C is %.3fW \" %P2)\n",
      "Izm=P2/Vz\n",
      "\n",
      "#Results\n",
      "print(\" current at 100C is %.1fA \" %(Izm*1000))"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "current at 50C is 53.3A \n",
        "At 100C\n",
        " power at 100C is 0.240W \n",
        " current at 100C is 32.0A \n"
       ]
      }
     ],
     "prompt_number": 25
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 2.16, Page No 64"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "#initialisation of variables\n",
      "E=20.0\n",
      "R1=620.0\n",
      "Vz=7.5\n",
      "\n",
      "#Calculations\n",
      "Vr1=E-Vz\n",
      "Iz=Vr1/R1\n",
      "print(\" diode current is %.1f mA \" %(Iz*1000))\n",
      "Pd=Vz*Iz\n",
      "\n",
      "#Results\n",
      "print( \"power dissipation is %.1f mW \" %(Pd*1000))"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " diode current is 20.2 mA \n",
        "power dissipation is 151.2 mW \n"
       ]
      }
     ],
     "prompt_number": 26
    }
   ],
   "metadata": {}
  }
 ]
}