{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#11: Extrinsic Semiconductors"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "##Example number 11.1, Page number 307"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Before adding boron atoms,the semiconductor is an intrinsic semiconductor\n",
      "conductivity before adding boron atoms is 2.016 ohm^-1 m^-1\n",
      "After adding boron atoms,the semiconductor becomes a P-type semiconductor\n",
      "conductivity after adding boron atoms is 1.44 *10**4 ohm^-1 m^-1\n"
     ]
    }
   ],
   "source": [
    "#importing modules\n",
    "import math\n",
    "from __future__ import division\n",
    "\n",
    "#Variable declaration\n",
    "ni=2.1*10**19;   #intrinsic charge carriers(m^-3)\n",
    "me=0.4;   #electron mobility(m^2 V^-1 s^-1)\n",
    "mh=0.2;   #hole mobility(m^2 V^-1 s^-1)\n",
    "d=4.5*10**23;   #density of boron(m^-3)\n",
    "e=1.6*10**-19;   #charge of electron(c)\n",
    "\n",
    "#Calculation\n",
    "C=ni*e*(me+mh);   #conductivity before adding boron atoms(ohm^-1 m^-1)\n",
    "c=d*e*mh;   #conductivity after adding boron atoms(ohm^-1 m^-1)\n",
    "\n",
    "#Result\n",
    "print \"Before adding boron atoms,the semiconductor is an intrinsic semiconductor\"\n",
    "print \"conductivity before adding boron atoms is\",C,\"ohm^-1 m^-1\"\n",
    "print \"After adding boron atoms,the semiconductor becomes a P-type semiconductor\"\n",
    "print \"conductivity after adding boron atoms is\",c/10**4,\"*10**4 ohm^-1 m^-1\""
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "##Example number 11.2, Page number 307"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "DensiTy of electrons in n-type silicon is 1.4423 *10**24 electrons/m^3\n",
      "DensiTy of holes in n-type silicon is 1.56 *10**8 holes/m^3\n",
      "DensiTy of holes in p-type silicon is 3.75e+24 holes/m^3\n",
      "DensiTy of electrons in p-type silicon is 6.0 *10**7 electrons/m^3\n"
     ]
    }
   ],
   "source": [
    "#importing modules\n",
    "import math\n",
    "from __future__ import division\n",
    "\n",
    "#Variable declaration\n",
    "ni=1.5*10**16;   #intrinsic charge carriers(m^-3)\n",
    "me=1300*10**-4;   #electron mobility(m^2 V^-1 s^-1)\n",
    "mh=500*10**-4;    #hole mobility(m^2 V^-1 s^-1)\n",
    "c=3*10**4;     #conductivity of n-tpye silicon(ohm^-1 m^-1)\n",
    "e=1.6*10**-19;   #charge of electron(c)\n",
    "\n",
    "#Calculation\n",
    "ne=c/(e*me);    #DensiTy of electrons in n-type silicon(electrons/m^3)\n",
    "nh=ni**2/ne;   #Density of holes in n-type silicon(holes/m^3)\n",
    "Ne=c/(e*mh);    #Density of holes in p-type silicon(holes/m^3)\n",
    "Nh=ni**2/Ne;   #Density of electrons in p-type silicon(holes/m^3)\n",
    "\n",
    "#Result\n",
    "print \"DensiTy of electrons in n-type silicon is\",round(ne/10**24,4),\"*10**24 electrons/m^3\"\n",
    "print \"DensiTy of holes in n-type silicon is\",nh/10**8,\"*10**8 holes/m^3\"\n",
    "print \"DensiTy of holes in p-type silicon is\",Ne,\"holes/m^3\"\n",
    "print \"DensiTy of electrons in p-type silicon is\",Nh/10**7,\"*10**7 electrons/m^3\""
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "##Example number 11.3, Page number 308"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "The electron concentration is 2.0 *10**9 electrons/m^3\n"
     ]
    }
   ],
   "source": [
    "#importing modules\n",
    "import math\n",
    "from __future__ import division\n",
    "\n",
    "#Variable declaration\n",
    "ni=2*10**16;    #intrinsic charge carriers(m^-3)\n",
    "Na=5*10**23;    #density of acceptor concentration of silicon with arsenic(atoms)\n",
    "Nd=3*10**23;    #density of donor concentration of silicon with arsenic(atoms)\n",
    "\n",
    "#Calculation\n",
    "nh=Na-Nd;   #density of hole(m^-3)\n",
    "ne=ni**2/nh;   #The electron concentration(electrons/m^3)\n",
    "\n",
    "#Result\n",
    "print \"The electron concentration is\",ne/10**9,\"*10**9 electrons/m^3\""
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "##Example number 11.4, Page number 309"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "The position of fermi level is 4.893 *10**-20 J or 0.3058 eV\n"
     ]
    }
   ],
   "source": [
    "#importing modules\n",
    "import math\n",
    "from __future__ import division\n",
    "\n",
    "#Variable declaration\n",
    "d=5*10**28;    #density of silicon atom(atoms/m^3)\n",
    "nd=2.5*10**7;   #donor concentration in 1 atom per si atom\n",
    "T=300;    #Temperature(K)\n",
    "Eg=1.1*1.6*10**-19;   #Eg for silicon(eV)\n",
    "kb=1.38*10**-23;    #Boltzmann's Constant(m^2 Kg s^-2 k^-1)\n",
    "m=9.11*10**-31;   #mass of electon(kg)\n",
    "h=6.625*10**-34;   #plank's constant(m^2 Kg/sec)\n",
    "\n",
    "#Calculation\n",
    "Nd=d/nd;     #The donor concentration(atoms/m^3)\n",
    "Ef=(Eg/2)+(kb*T*(math.log(Nd/(2*((2*math.pi*m*kb*T)/h**2)**(3/2)))));    #The position of fermi level at 300K(J)\n",
    "\n",
    "#Result\n",
    "print \"The position of fermi level is\",round(Ef*10**20,3),\"*10**-20 J or\",round(Ef/(1.6*10**-19),4),\"eV\""
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "##Example number 11.5, Page number 310"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "The density of the intrinsic crystal for p-type is 1.302 *10**21 m^-3\n",
      "The minor carrier concentration for p-type is 1.728e+11 electrons/m^3\n",
      "The density of the intrinsic crystal for n-type is 4.6296 *10**20 m^-3\n",
      "The minor carrier concentration for n-type is 4.86e+11 holes/m^3\n"
     ]
    }
   ],
   "source": [
    "#importing modules\n",
    "import math\n",
    "from __future__ import division\n",
    "\n",
    "#Variable declaration\n",
    "ni=1.5*10**16;   #intrinsic charge carriers(m^-3)\n",
    "r1=10*10**-2;    #resistivity of p-type silicon(ohm m)\n",
    "r2=10*10**-2;    #resistivity of n-type silicon(ohm m)\n",
    "me=1350*10**-4;   #The mobility of the charge carrier(m^2 V^-1 s^-1)\n",
    "mh=480*10**-4;    #The hole charge carrier(m^2 V^-1 s^-1)\n",
    "e=1.6*10**-19;    #charge of electron(c)\n",
    "\n",
    "#Calculation\n",
    "Na=1/(r1*e*mh);    #The density of the intrinsic crystal for p-type(m^-3)\n",
    "ne=ni**2/Na;    #The minor carrier concentration for p-type(electrons/m^3)\n",
    "Nd=1/(r2*e*me);    #The density of the intrinsic crystal for n-type(m^-3)\n",
    "nh=ni**2/Nd;       #The minor carrier concentration for n-type(electrons/m^3)\n",
    "\n",
    "#Result\n",
    "print \"The density of the intrinsic crystal for p-type is\",round(Na/10**21,3),\"*10**21 m^-3\"\n",
    "print \"The minor carrier concentration for p-type is\",ne,\"electrons/m^3\"\n",
    "print \"The density of the intrinsic crystal for n-type is\",round(Nd/10**20,4),\"*10**20 m^-3\"\n",
    "print \"The minor carrier concentration for n-type is\",nh,\"holes/m^3\""
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "##Example number 11.6, Page number 315"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "The electron mobility is 0.14 m^2 V^-1 s^-1\n",
      "The charge carrier density is 5e+21 electrons/m^3\n"
     ]
    }
   ],
   "source": [
    "#importing modules\n",
    "import math\n",
    "from __future__ import division\n",
    "\n",
    "#Variable declaration\n",
    "c=112;   #conductivity of a n-type silicon specimen(ohm^-1 m^-1)\n",
    "RH=1.25*10**-3;   #Hall coefficient of a n-type silicon specimen(m^3 C^-1)\n",
    "e=1.6*10**-19;    #charge of electron(c)\n",
    "\n",
    "#Calculation\n",
    "me=c*RH;     #electron mobility(m^2 V^-1 s^-1)\n",
    "ne=c/(me*e);    #The charge carrier density(electrons/m^3)\n",
    "\n",
    "#Result\n",
    "print \"The electron mobility is\",me,\"m^2 V^-1 s^-1\"\n",
    "print \"The charge carrier density is\",ne,\"electrons/m^3\""
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "##Example number 11.7, Page number 315"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Hall coefficient of semiconductor is 3.7e-06 C^-1 m^3\n",
      "The density of the charge carrier is 1.689 *10**24 electrons/m^3\n"
     ]
    }
   ],
   "source": [
    "#importing modules\n",
    "import math\n",
    "from __future__ import division\n",
    "\n",
    "#Variable declaration\n",
    "l=12*10**-3;    #length of semi conductor crystal(m)\n",
    "b=1*10**-3;     #breadth of semi conductor crystal(m)\n",
    "t=1*10**-3;     #thickness of semi conductor crystal(m)\n",
    "I=20*10**-3;    #current(A)\n",
    "Vh=37*10**-6;    #voltage measured across the width(V)\n",
    "B=0.5;   #magnetic flux density(Wb/m^2)\n",
    "e=1.6*10**-19;    #charge of electron(c)\n",
    "\n",
    "#Calculation\n",
    "RH=Vh*t/(I*B);    #Hall coefficient of semiconductor(C^-1 m^3)\n",
    "ne=1/(RH*e);      #The density of the charge carrier(electrons/m^3)\n",
    "\n",
    "#Result\n",
    "print \"Hall coefficient of semiconductor is\",RH,\"C^-1 m^3\"\n",
    "print \"The density of the charge carrier is\",round(ne/10**24,3),\"*10**24 electrons/m^3\""
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "##Example number 11.8, Page number 315"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Hall coefficient of silicon plate is 3.66 *10**-4 m^3 C^-1\n"
     ]
    }
   ],
   "source": [
    "#importing modules\n",
    "import math\n",
    "from __future__ import division\n",
    "\n",
    "#Variable declaration\n",
    "l=100*10**-3;   #length of silicon plate(m)\n",
    "b=10*10**-3;    #breadth of silicon plate(m)\n",
    "t=1*10**-3;    #thickness of silicon plate(m)\n",
    "I=10**-2;   #current(A)\n",
    "Vh=1.83*10**-3;   #voltage measured across the width(V)\n",
    "B=0.5;    #magnetic flux density(Wb/m^2)\n",
    "\n",
    "#Calculation\n",
    "RH=Vh*t/(I*B);     #Hall coefficient of silicon plate(m^3 C^-1)\n",
    "\n",
    "#Result\n",
    "print \"Hall coefficient of silicon plate is\",RH*10**4,\"*10**-4 m^3 C^-1\""
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "##Example number 11.9, Page number 316"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "The negative sign of the Hall coefficient indicates that the nature of the semiconductor is n-type\n",
      "The density of the charge carrier is 8.503 *10**22 electrons/m^3\n",
      "The mobility of the charge carrier is 14.7 *10**-3 m^2 V^-1 s^-1\n"
     ]
    }
   ],
   "source": [
    "#importing modules\n",
    "import math\n",
    "from __future__ import division\n",
    "\n",
    "#Variable declaration\n",
    "RH=7.35*10**-5;   #Hall coefficient of silicon specimen(m^3 C^-1)\n",
    "rh=-7.35*10**-5;   #Hall coefficient of silicon specimen(m^3 C^-1)\n",
    "c=200;   #conductivity(ohm^-1 m^-1)\n",
    "e=1.6*10**-19;   #charge of electron(c)\n",
    "\n",
    "#Calculation\n",
    "ne=1/(RH*e);    #The density of the charge carrier(electrons/m^3)\n",
    "me=c*RH;      #The mobility of the charge carrier(m^2 V^-1 s^-1)\n",
    "\n",
    "#Result\n",
    "print \"The negative sign of the Hall coefficient indicates that the nature of the semiconductor is n-type\"\n",
    "print \"The density of the charge carrier is\",round(ne/10**22,3),\"*10**22 electrons/m^3\"\n",
    "print \"The mobility of the charge carrier is\",me*10**3,\"*10**-3 m^2 V^-1 s^-1\""
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "##Example number 11.10, Page number 316"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "The density of the charge carrier is 1.7728 *10**22 electrons/m^3\n",
      "The mobility of the charge carrier is 0.06346 m^2 V^-1 s^-1\n",
      "answer given in the book is wrong\n"
     ]
    }
   ],
   "source": [
    "#importing modules\n",
    "import math\n",
    "from __future__ import division\n",
    "\n",
    "#Variable declaration\n",
    "RH=4.16*10**-4;    #Hall coefficient of n-type semiconductor(m^3 C^-1)\n",
    "c=180;    #conductivity(ohm^-1 m^-1)\n",
    "e=1.6*10**-19;   #charge of electron(c)\n",
    "x=1.18;    #correction factor for RH\n",
    "\n",
    "#Calculation\n",
    "ne=x/(RH*e);    #The density of the charge carrier(electrons/m^3)\n",
    "me=c/(ne*e);    #The mobility of the charge carrier(m^2 V^-1 s^-1)\n",
    "\n",
    "#Result\n",
    "print \"The density of the charge carrier is\",round(ne/10**22,4),\"*10**22 electrons/m^3\"\n",
    "print \"The mobility of the charge carrier is\",round(me,5),\"m^2 V^-1 s^-1\"\n",
    "print \"answer given in the book is wrong\""
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "##Example number 11.11, Page number 317"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "The hall coefficient measured by the probes is 1.75 mV\n"
     ]
    }
   ],
   "source": [
    "#importing modules\n",
    "import math\n",
    "from __future__ import division\n",
    "\n",
    "#Variable declaration\n",
    "l=1*10**-3;    #length of rectangular plane sheet of doped silicon(m)\n",
    "b=1*10**-3;    #breadth of semi rectangular plane sheet of doped silicon(m)\n",
    "t=0.5*10**-3;    #thickness of rectangular plane sheet of doped silicon(m)\n",
    "RH=1.25*10**-3;    #Hall coefficient of the material(m^3 C^-1)\n",
    "I=1*10**-3;    #current(A)\n",
    "B=0.7;     #magnetic flux density(Wb/m^2)\n",
    "e=1.6*10**-19;   #charge of electron(c)\n",
    "\n",
    "#Calculation\n",
    "Vh=RH*I*B/t;     #The hall coefficient measured by the probes(mV)\n",
    "\n",
    "#Result\n",
    "print \"The hall coefficient measured by the probes is\",Vh*10**3,\"mV\""
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "##Example number 11.12, Page number 317"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "The density of the charge carrier is 1.70765 *10**22 m^-3\n",
      "The mobility is 0.04099 m^2 V^-1 s^-1\n"
     ]
    }
   ],
   "source": [
    "#importing modules\n",
    "import math\n",
    "from __future__ import division\n",
    "\n",
    "#Variable declaration\n",
    "RH=3.66*10**-4;    #Hall coefficient of a doped silicon(m^3 C^-1)\n",
    "r=8.93*10**-3;     #The resistivity(ohm m)\n",
    "e=1.6*10**-19;    #charge of electron(c)\n",
    "\n",
    "#Calculation\n",
    "n=1/(RH*e);     #The density of the charge carrier(m^-3)\n",
    "me=RH/r;        #The mobility(m^2 V^-1 s^-1)\n",
    "\n",
    "#Result\n",
    "print \"The density of the charge carrier is\",round(n/10**22,5),\"*10**22 m^-3\"\n",
    "print \"The mobility is\",round(me,5),\"m^2 V^-1 s^-1\""
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "##Example number 11.13, Page number 317"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "The current density is 2880.0 A/m^2\n"
     ]
    }
   ],
   "source": [
    "#importing modules\n",
    "import math\n",
    "from __future__ import division\n",
    "\n",
    "#Variable declaration\n",
    "RH=0.0125;    #Hall coefficient of a sample n-type semiconductor(m^3 C^-1)\n",
    "rh=-0.0125;   #Hall coefficient of a sample n-type semiconductor(m^3 C^-1)\n",
    "me=0.36;      #electron mobility(m^2 V^-1 s^-1)\n",
    "EH=100;       #electric field(V/m)\n",
    "e=1.6*10**-19;    #charge of electron(c)\n",
    "\n",
    "#Calculation\n",
    "n=1/(RH*e);    #The density of the charge carrier(m^-3)\n",
    "c=n*e*me;      #conductivity of n-type semiconductor(ohm^-1 m^-1)\n",
    "J=c*EH;        #The current density(A/m^2)\n",
    "\n",
    "#Result\n",
    "print \"The current density is\",J,\"A/m^2\""
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 2",
   "language": "python",
   "name": "python2"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 2
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython2",
   "version": "2.7.9"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 0
}