{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#  Chapter 12 : Semiconductor Physics"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example number 1, Page number 228"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Resistivity = 0.3846 ohm-m\n"
     ]
    }
   ],
   "source": [
    "#importing modules\n",
    "import math\n",
    "from __future__ import division\n",
    "\n",
    "#Variable declaration\n",
    "ni=2.5*10**19          #intrinsic concentration \n",
    "myun=0.40              #mobility of electrons \n",
    "myup=0.25              #mobility of holes\n",
    "e=1.6*10**-19\n",
    "\n",
    "#Calculations\n",
    "sigmai=ni*e*(myun+myup) #conductivity of intrinsic semiconductor\n",
    "rhoi=1/sigmai\n",
    "\n",
    "#Result\n",
    "print\"Resistivity =\",round(rhoi,4),\"ohm-m\""
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example number 2, Page number 228"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Intrinsic concentration= 5.68*10**18 m**-3\n"
     ]
    }
   ],
   "source": [
    "#importing modules\n",
    "import math\n",
    "from __future__ import division\n",
    "\n",
    "#Variable declaration \n",
    "myun=0.36              #mobility of electrons \n",
    "myup=0.14              #mobility of holes\n",
    "e=1.6*10**-19  \n",
    "rhoi=2.2               #resistivity\n",
    "\n",
    "#Calculations\n",
    "ni=1/(rhoi*e*(myun+myup))/10**18\n",
    "\n",
    "#Result\n",
    "print\"Intrinsic concentration= %1.2f*10**18 m**-3\" %ni"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example number 3, Page number 228"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Conductivity = 2.4 ohm**-1-m**-1\n",
      "resistivity= 0.42 ohm-m\n"
     ]
    }
   ],
   "source": [
    "#importing modules\n",
    "import math\n",
    "from __future__ import division\n",
    "\n",
    "#Variable declaration \n",
    "myun=0.39              #mobility of electrons \n",
    "myup=0.21              #mobility of holes\n",
    "ni=2.5*10**19          #intrinsic concentration \n",
    "e=1.6*10**-19  \n",
    "\n",
    "#Calculations\n",
    "sigmai=ni*e*(myun+myup) #conductivity of intrinsic semiconductor\n",
    "rhoi=1/sigmai\n",
    "\n",
    "#Result\n",
    "print\"Conductivity = %1.1f\" %sigmai,\"ohm**-1-m**-1\"\n",
    "print\"resistivity= %1.2f\" %rhoi,\"ohm-m\"                #the answer provided in the textbook is incorrect"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example number 4, Page number 228"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "concentration of intrinsic charge= 4.83*10**18 /m**3\n"
     ]
    }
   ],
   "source": [
    "#importing modules\n",
    "import math\n",
    "from __future__ import division\n",
    "\n",
    "#Variable declaration \n",
    "Eg=0.8                 #Energy gap width\n",
    "T=300\n",
    "m=9.1*10**-31          #mass of electron\n",
    "k=1.38*10**-23\n",
    "h=6.63*10**-34         \n",
    "\n",
    "#Calculations\n",
    "ni=2*((2*22*m*k*T)/(7*h**2))**(3/2)*math.exp((-Eg*1.6*10**-19)/(2*k*T))/10**18\n",
    "\n",
    "#Result\n",
    "print\"concentration of intrinsic charge= %1.2f*10**18 /m**3\" %ni #the answer provided in the textbook is incorrect"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example number 5, Page number 229"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "hole concentration= 19.4*10**21 m**-3\n",
      "mobility of holes= 0.0358 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.22*10**-4         #Hall coefficient\n",
    "rho=9.0*10**-3\n",
    "e=1.6*10**-19\n",
    "\n",
    "#Calculations\n",
    "p=1/(RH*e)/10**21\n",
    "myup=RH/rho\n",
    "\n",
    "#Result\n",
    "print\"hole concentration= %1.1f*10**21 m**-3\"  %p\n",
    "print\"mobility of holes= %1.4f m**2 V**-1 s**-1\" %myup"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example number 6, Page number 229"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Hall voltage VH= 0.183 V\n"
     ]
    }
   ],
   "source": [
    "#importing modules\n",
    "import math\n",
    "from __future__ import division\n",
    "\n",
    "#Variable declaration \n",
    "RH=3.66*10**-4         #Hall coefficient\n",
    "t=10**-3               #thickness\n",
    "I=1                    #current\n",
    "B=0.5                  #magnetic induction\n",
    "\n",
    "#Calculations\n",
    "VH=(RH*I*B)/t\n",
    "\n",
    "#Result\n",
    "print\"Hall voltage VH= %1.3f\" %VH,\"V\""
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example number 7, Page number 300"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "charge density= 8.33*10**22 /m**3\n",
      "mobility= 0.015 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.5*10**-5         #Hall coefficient\n",
    "sigma=200              #conductivity\n",
    "e=1.6*10**-19          #electron charge\n",
    "\n",
    "#Calculations\n",
    "n=1/(e*RH)/10**22\n",
    "myu=sigma*RH\n",
    "\n",
    "#Result\n",
    "print\"charge density= %1.2f*10**22 /m**3\" %n\n",
    "print\"mobility= %0.3f m**2 V**-1 s**-1\" %myu"
   ]
  }
 ],
 "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.3"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 0
}
