{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Chapter 3 Semoconductor Devices Fundamentals"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Exa 3.2 page no:35"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "resistivity of the si doped with n−dopant is : \n",
      "0.089 ohm−cm \n"
     ]
    }
   ],
   "source": [
    "def resistivity(u,n): #n:doped concentration =10**17 atoms/cubic cm, u: mobility of electrons =700square cm/v−sec .\n",
    "    q=1.6*10**-19 #q: charge\n",
    "    Res=1/(q*u*n)# since P is neglegible . \n",
    "    print \"resistivity of the si doped with n−dopant is : \"\n",
    "    print \"%0.3f ohm−cm \"%Res \n",
    "resistivity(10**17,700)\n",
    "# after executing calling resitivity ( u=700 and n =10ˆ17)i .e. , resistivity (10ˆ17 ,700) ;"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Exa 3.3 page no:35"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "resistivity of intrinsic Ge is : \n",
      "2595245510.225 ohm−cm \n"
     ]
    }
   ],
   "source": [
    "def resistivity(un,np):    # un: electron concentration , up: hole concentration\n",
    "    q=1.6*10**-19          #in coulumb \n",
    "    ni=2.5*10*13           # concentration in cmˆ−3 \n",
    "    Res=1/(q*ni*un*np)     # since n=p=ni  \n",
    "    print \"resistivity of intrinsic Ge is : \"\n",
    "    print \"%0.3f ohm−cm \"%Res \n",
    "resistivity(3900,1900)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Exa 3.4 page no:37"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "hole concentrartion at 300K is : \n",
      "2250.000000 per cubic cm \n"
     ]
    }
   ],
   "source": [
    "def holeconcentration(ni,Nd): # Nd: donar concentration ; since , Nd>>ni , so Nd=n=10ˆ17 atoms/cmˆ3.\n",
    "    p=ni**2/Nd\n",
    "    print \"hole concentrartion at 300K is : \"\n",
    "    print \"%f per cubic cm \"%p\n",
    "holeconcentration(1.5*10**10,10**17);"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Exa 3.5 page no:39"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "resistivity of the copper is : \n",
      "2.29779411765e-08  ohm−meter\n"
     ]
    }
   ],
   "source": [
    "q=1.6*10**-19;\n",
    "n=8.5*10**28;\n",
    "u=3.2*10**-3;\n",
    "p=1/(n*q*u);\n",
    "print \"resistivity of the copper is : \"\n",
    "print p,\" ohm−meter\"\n",
    "# 2.298D−08 means 2.298∗10ˆ −8"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Exa 3.6 page no:41"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Cu is:  0.0570814666846  pF\n",
      "Ccs is:  0.282102806737 pF\n",
      "gm is : 7.7519379845 mA/V\n",
      "C1 is:  3.32558139535 pF\n",
      "R1 is:  25.8  kilo ohm\n",
      "R0 is  645.0  kilo Ohm \n",
      "Ru is:  1290.0 Mega Ohm \n"
     ]
    }
   ],
   "source": [
    "from math import sqrt\n",
    "\n",
    "Cuo=0.25;        # collector −base depletion region capacitance in pico Farad(pF) for zero bias\n",
    "Ccso=1.5 ;       # collector −substrate junction capacitance in pico Farad(pF) for zero bias\n",
    "q=1.6*10**-19 ;  # electron charge in coulomb\n",
    "Ic=0.2 ;         #collector current in ampere(A)\n",
    "k=8.6*10**-5;    #in eV/K, where 1eV=1.6∗10ˆ−19\n",
    "T=300;           # absolute temperature in kelvin (K)\n",
    "Vcb=10 ;         #forward bias on the junction in volt(v)\n",
    "Vcs=15 ;         # collector −substrate bias in volt (V)\n",
    "Cje=1 ;          #depletion region capacitance in pico Farad(pF)\n",
    "Bo=200;          #small signal current gain\n",
    "Tf=0.3;          #transit time in forward direction in nano seconds (nS)\n",
    "n=2*10**-4;      # proportionality constant for Ro and gm\n",
    "Vo=0.55;         # bias voltage in volt (V)\n",
    "Cu=Cuo/sqrt(1+(Vcb/Vo));# collector −base capacitance\n",
    "print \"Cu is: \",Cu,\" pF\"\n",
    "Ccs=Ccso/sqrt(1+(Vcs/Vo)); # capacitance collector −substrate\n",
    "print \"Ccs is: \",Ccs,\"pF\"\n",
    "gm=q*Ic/(k*T*1.6*10**-19);# since k is in eV so converting it in Coulomb/Kelvin\n",
    "print \"gm is :\",gm,\"mA/V\"# transconductance of the bipolar transistor here\n",
    "Cb=Tf*gm;# diffusion capacitance in pico Farad(pF)\n",
    "C1=Cb+Cje;#small signal capacitance of bipolar transistor\n",
    "print \"C1 is: \",C1,\"pF\"\n",
    "R1=Bo/gm;# small signal input resistance of bipolar transistor\n",
    "print \"R1 is: \",R1,\" kilo ohm\"\n",
    "Ro=1/(n*gm);#small signal output resistance\n",
    "print \"R0 is \",Ro,\" kilo Ohm \"\n",
    "Ru=10*Bo*Ro/10**3;# collector −base resistance\n",
    "print \"Ru is: \",Ru,\"Mega Ohm \""
   ]
  }
 ],
 "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.10"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 0
}