summaryrefslogtreecommitdiff
path: root/sample_notebooks/MohdAsif
diff options
context:
space:
mode:
Diffstat (limited to 'sample_notebooks/MohdAsif')
-rw-r--r--sample_notebooks/MohdAsif/Ch2.ipynb1269
1 files changed, 1269 insertions, 0 deletions
diff --git a/sample_notebooks/MohdAsif/Ch2.ipynb b/sample_notebooks/MohdAsif/Ch2.ipynb
new file mode 100644
index 00000000..493ebc40
--- /dev/null
+++ b/sample_notebooks/MohdAsif/Ch2.ipynb
@@ -0,0 +1,1269 @@
+{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:5a4681bcd32ee53961d617cc97d1b729b583a17da43dad40dee1f6a5e0b10f08"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 2 - Junctions & Interfaces"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex 2.6.1 Page 2-21"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from math import log\n",
+ "#Given : \n",
+ "Ge=4.4*10**22 #atoms/cm**3\n",
+ "NA=Ge/10**8 #per cm**3\n",
+ "NA=NA*10**6 #per m**3\n",
+ "ND=NA*10**3 #per m**3\n",
+ "ni=2.5*10**13 #per cm**3\n",
+ "ni=ni*10**6 #per m**3\n",
+ "VT=26 #mV\n",
+ "Vj=VT*log(NA*ND/ni**2) #mV\n",
+ "print \"Junction potential = %0.1f mV\"%Vj"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Junction potential = 328.7 mV\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex 2.6.2 Page 2- 22"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from __future__ import division\n",
+ "#Given : \n",
+ "ni=2.5*10**15 #per cm**3\n",
+ "Ge=4.4*10**22 #atoms/cm**3\n",
+ "NA=Ge/10**8 #per cm**3\n",
+ "NA=NA*10**6 #per m**3\n",
+ "ND=NA*10**3 #per m**3\n",
+ "ni=ni*10**6 #per m**3\n",
+ "T=27+273 #K\n",
+ "VT=T/11600 #V\n",
+ "Vo=VT*log(NA*ND/ni**2) #V\n",
+ "print \"Contact potential = %0.4f V \" %Vo"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Contact potential = 0.0888 V \n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex 2.6.3 Page 2-23"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given : \n",
+ "mu_n=1500*10**-4 #m**2/V-s\n",
+ "mu_p=475*10**-4 #m**2/V-s\n",
+ "ni=1.45*10**10*10**6 #per m**3\n",
+ "q=1.6*10**-19 #Coulomb\n",
+ "rho_p=10 #ohm-cm\n",
+ "rho_p=rho_p*10**-2 #ohm-m\n",
+ "rho_n=3.5 #ohm-cm\n",
+ "rho_n=rho_n*10**-2 #ohm-m\n",
+ "sigma_p=1/rho_p #(ohm-m)**-1\n",
+ "NA=sigma_p/q/mu_p #m**3\n",
+ "sigma_n=1/rho_n #(ohm-m)**-1\n",
+ "ND=sigma_p/q/mu_n #m**3\n",
+ "VT=26*10**-3 #V\n",
+ "Vj=VT*log(NA*ND/ni**2) #V\n",
+ "print \"Height of potential barrier = %0.3f V \"%Vj\n",
+ "#Anser in the book is wrong."
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Height of potential barrier = 0.564 V \n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex 2.6.4 Page 2-24"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given : \n",
+ "rho_p=2 #ohm-cm\n",
+ "rho_p=rho_p*10**-2 #ohm-m\n",
+ "rho_n=1 #ohm-cm\n",
+ "rho_n=rho_n*10**-2 #ohm-m\n",
+ "mu_n=1500*10**-4 #m**2/V-s\n",
+ "mu_p=2100*10**-4 #m**2/V-s\n",
+ "ni=2.5*10**13 #per m**3\n",
+ "q=1.6*10**-19 #Coulomb\n",
+ "sigma_p=1/rho_p #(ohm-m)**-1\n",
+ "NA=sigma_p/q/mu_p #m**3\n",
+ "sigma_n=1/rho_n #(ohm-m)**-1\n",
+ "ND=sigma_p/q/mu_n #m**3\n",
+ "T=27+273 #K\n",
+ "VT=T/11600 #V\n",
+ "Vj=VT*log(NA*ND/ni**2) #V\n",
+ "print \"Height of potential barrier = %0.4f V\"%Vj\n",
+ "#Anser in the book is wrong."
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Height of potential barrier = 0.9347 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex 2.7.1 Page 2-27"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given : \n",
+ "Vgamma=0.6 #Volt\n",
+ "rf=12 #ohm\n",
+ "V=5 #Volts\n",
+ "R=1 #kohm\n",
+ "IF=(V-Vgamma)/(R*1000+rf) #A\n",
+ "print \"Diode current = %0.1f mA\"%(IF*1000)\n",
+ "VF=Vgamma+IF*rf #volts\n",
+ "print \"Diode voltage = %0.2f Volts\"%VF"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Diode current = 4.3 mA\n",
+ "Diode voltage = 0.65 Volts\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex 2.7.2 Page 2-35"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from sympy import symbols, sin, N\n",
+ "#Given : \n",
+ "Vgamma=0.6 #Volt\n",
+ "Rf=10 #ohm\n",
+ "Eta=2 \n",
+ "Vm=0.2 #Volts\n",
+ "Vdc=10 #Volts\n",
+ "RL=1 #kohm\n",
+ "IDQ=(Vdc-Vgamma)/(RL*1000+Rf) #A\n",
+ "VT=25*10**-3 #Volts\n",
+ "rd=Eta*VT/IDQ #ohm\n",
+ "omega,t = symbols('omega t')\n",
+ "Vs = Vm*sin(omega*t)\n",
+ "Vo_ac =(RL*1000)/(RL*1000+rd)*Vs\n",
+ "print \"Alternating component of voltage across RL, Vo(ac) =\",N(Vo_ac,4)\n",
+ "Vo_DC=IDQ*RL*1000 #Volts\n",
+ "Vo_DC_total=Vo_DC+(Vo_ac) #Volts\n",
+ "print \"\\nTotal load voltage =\",N(Vo_DC_total,4)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Alternating component of voltage across RL, Vo(ac) = 0.1989*sin(omega*t)\n",
+ "\n",
+ "Total load voltage = 0.1989*sin(omega*t) + 9.307\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex 2.7.3 Page 2-37"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from math import exp\n",
+ "#Given : \n",
+ "Eta=2 #for Si diode\n",
+ "T=300 #K\n",
+ "VT=T/11600 #V\n",
+ "IbyIo=90/100 \n",
+ "#I=Io*(exp(V/Eta/VT)-1)\n",
+ "V=log(IbyIo+1)*Eta*VT #V\n",
+ "print \"Saturation value of voltage = %0.2f mV\"%(V*1000)\n",
+ "VF=0.5 #Volts\n",
+ "VR=-0.5 #Volts\n",
+ "IFbyIR=(exp(VF/Eta/VT)-1)/(exp(VR/Eta/VT)-1) #ratio\n",
+ "print \"Ratio of forward to reverse current : %0.1f\" %IFbyIR\n",
+ "#Answer in the book is wrong."
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Saturation value of voltage = 33.20 mV\n",
+ "Ratio of forward to reverse current : -15782.7\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex 2.7.4 Page 2-37"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given : \n",
+ "Eta=2 #for Si diode\n",
+ "T=300 #K\n",
+ "VT=T/11600 #V\n",
+ "IbyIo=90/100 \n",
+ "#I=Io*(exp(V/Eta/VT)-1)\n",
+ "V=log(IbyIo+1)*Eta*VT #V\n",
+ "print \"Saturation value of voltage = %0.2f mV\"%(V*1000)\n",
+ "VF=0.2 #Volts\n",
+ "VR=-0.2 #Volts\n",
+ "IFbyIR=(exp(VF/Eta/VT)-1)/(exp(VR/Eta/VT)-1) #ratio\n",
+ "print \"Ratio of forward to reverse current : %0.2f\" %IFbyIR\n",
+ "#Answer in the book is wrong."
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Saturation value of voltage = 33.20 mV\n",
+ "Ratio of forward to reverse current : -47.78\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex 2.9.1 Page 2-61"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given : \n",
+ "IF=10 #mA\n",
+ "VF=0.75 #volts\n",
+ "T=27+273 #K\n",
+ "Eta=2 #for Si diode\n",
+ "VT=T/11600 #V\n",
+ "Io=IF/(exp(VF/Eta/VT)-1) #mA\n",
+ "print \"Reverse saturation current = %0.3f nA\" %(Io*10**6)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Reverse saturation current = 5.043 nA\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex 2.9.2 Page 2-61"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from __future__ import division\n",
+ "#Given : \n",
+ "IF=10 #mA\n",
+ "VF=0.3 #Volts\n",
+ "T=27+273 #K\n",
+ "Eta=1 #for Ge diode\n",
+ "VT=T/11600 #V\n",
+ "Io=IF/(exp(VF/Eta/VT)-1) #mA\n",
+ "print \"Reverse saturation current = %0.2f nA \"%(Io*10**6) \n",
+ "# Answer wrong in the textbook."
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Reverse saturation current = 91.66 nA \n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex 2.9.3 Page 2-61"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given : \n",
+ "Io=1*10**-9 #A\n",
+ "T=27+273 #K\n",
+ "VT=T/11600 #V\n",
+ "VF=0.3 #Volts\n",
+ "Eta=1 #for Ge diode\n",
+ "IF=Io*(exp(VF/Eta/VT)-1) #mA\n",
+ "print \"Forwad current = %0.4f mA \"%(IF*10**3) "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Forwad current = 0.1091 mA \n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex 2.9.4 Page 2-62"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given : \n",
+ "T=27+273 #K\n",
+ "V1=0.4 #V\n",
+ "V2=0.42 #V\n",
+ "I1=10 #mA\n",
+ "I2=20 #mA\n",
+ "VT=T/11600 #V\n",
+ "Eta=1/log(I1/I2)*(V1-V2)/VT\n",
+ "print \"Value of Eta : %0.2f\" %Eta\n",
+ "Io=I1/(exp(V1/Eta/VT)-1)*10**-3 #A\n",
+ "print \"Current, Io = %0.2f nA \"%(Io*10**9) \n",
+ "#Ans in the book is not accurate."
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Value of Eta : 1.12\n",
+ "Current, Io = 9.54 nA \n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex 2.9.5 Page 2-62"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given : \n",
+ "Io1=10**-12 #A\n",
+ "Io2=10**-10 #A\n",
+ "I=2 #mA\n",
+ "Eta=1 #constant\n",
+ "T=27+273 #K\n",
+ "VT=26/1000 #V\n",
+ "#I=I1+I2\n",
+ "V=(log(I*10**-3/(Io1+Io2))+1)*Eta*VT #V\n",
+ "print \"Voltage across the diodes = %.4f V \"%V \n",
+ "#Ans in the book is not accurate."
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Voltage across the diodes = 0.4628 V \n"
+ ]
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex 2.9.6 Page 2-64"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given : \n",
+ "Io1=10*10**-9 #A\n",
+ "Io2=10*10**-9 #A\n",
+ "Eta=1.1 #constant\n",
+ "T=25+273 #K\n",
+ "V=0.2 #V(assumed)\n",
+ "VT=T/11600 #V\n",
+ "I1=Io1*(exp(V/Eta/VT)-1) #A\n",
+ "I2=Io2*(exp(V/Eta/VT)-1) #A\n",
+ "I=I1+I2 #A\n",
+ "print \"Source current = %0.2f micro Ampere \"%(I*10**6) "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Source current = 23.68 micro Ampere \n"
+ ]
+ }
+ ],
+ "prompt_number": 14
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex 2.9.7 Page 2-65"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given : \n",
+ "Io=10**-13 #A\n",
+ "T=27+273 #K\n",
+ "Eta=1 #constant\n",
+ "V=0.6 #V\n",
+ "VT=26/1000 #V\n",
+ "I3=Io*(exp(V/Eta/VT)-1) #A\n",
+ "R=1*1000 #ohm\n",
+ "Ir=V/R #A\n",
+ "Itotal=I3+Ir #A\n",
+ "VD1=log(Itotal/Io)*Eta*VT #V\n",
+ "VD2=VD1 #V\n",
+ "Vin=VD1+VD2+V #V\n",
+ "print \"Voltage Vin = %0.3f V \"%Vin "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Voltage Vin = 1.823 V \n"
+ ]
+ }
+ ],
+ "prompt_number": 15
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex 2.9.8 Page 2-66"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given : \n",
+ "Vs=10 #V\n",
+ "print \"Case(i) : Vb=9.8V\" \n",
+ "Vb=9.8 #V\n",
+ "#D1 forward & D2 reverse biased: Breakdown D2\n",
+ "VD2=Vb #V\n",
+ "VD1=Vs-Vb #V\n",
+ "print \"VD1 = %0.3f V \"%VD1 \n",
+ "print \"VD2 = %0.2f V \"%VD2\n",
+ "print \"Case(ii) : Vb=10.2V\" \n",
+ "Vb=10.2 #V\n",
+ "#D1 forward & D2 reverse biased: none will be breakdown\n",
+ "VD2=Vb #V\n",
+ "#I=I0 so exp(V1/Eta/VT)-1=1\n",
+ "Eta=1 #constant\n",
+ "VT=26/1000 #V\n",
+ "VD1=log(1+1)*Eta*VT #V\n",
+ "VD2=Vs-VD1 #V\n",
+ "print \"VD1 = %0.3f V \"%VD1 \n",
+ "print \"VD2 = %0.3f V \"%VD2"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Case(i) : Vb=9.8V\n",
+ "VD1 = 0.200 V \n",
+ "VD2 = 9.80 V \n",
+ "Case(ii) : Vb=10.2V\n",
+ "VD1 = 0.018 V \n",
+ "VD2 = 9.982 V \n"
+ ]
+ }
+ ],
+ "prompt_number": 16
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex 2.9.9 Page 2-67"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given : \n",
+ "Vs=5 #Volt\n",
+ "Eta=1 #constant\n",
+ "VT=26/1000 #V\n",
+ "#I=I0 so exp(V1/Eta/VT)-1=1\n",
+ "V1=log(1+1)*Eta*VT #Volt\n",
+ "V2=Vs-V1 #Volt\n",
+ "print \"Voltage across diode D1 = %0.3f V \"%V1\n",
+ "print \"Voltage across diode D2 = %0.3f V \"%V2 "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Voltage across diode D1 = 0.018 V \n",
+ "Voltage across diode D2 = 4.982 V \n"
+ ]
+ }
+ ],
+ "prompt_number": 17
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex 2.10.2 Page 2-70"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given : \n",
+ "rho_n=10 #ohm-cm\n",
+ "rho_p=3.5 #ohm-cm\n",
+ "ni=1.5*10**10 #per cm**3\n",
+ "Vj=0.56 #volt\n",
+ "q=1.6*10**-19 #Coulomb\n",
+ "mu_n=1500 #cm**2/V-s\n",
+ "mu_p=500 #cm**2/V-s\n",
+ "sigma_p=1/rho_p #(ohm-cm)**-1\n",
+ "NA=sigma_p/q/mu_p #per cm**3\n",
+ "sigma_n=1/rho_n #(ohm-cm)**-1\n",
+ "ND=sigma_n/q/mu_n #per cm**3\n",
+ "VT=Vj/log(NA*ND/ni**2) #V\n",
+ "T=11600*VT #K\n",
+ "print \"Temperature of junction = %0.2f degree K \" %T\n",
+ "t=T-273 #degree C\n",
+ "print \"Temperature of junction = %0.2f degree C : \" %t"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Temperature of junction = 287.28 degree K \n",
+ "Temperature of junction = 14.28 degree C : \n"
+ ]
+ }
+ ],
+ "prompt_number": 18
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex 2.11.1 Page 2-75"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given : \n",
+ "Io=10 #nA\n",
+ "T1=27+273 #K\n",
+ "T2=87+273 #K\n",
+ "VT=T1/11600 #V\n",
+ "Eta=2 #for Si\n",
+ "m=1.5 #for Si\n",
+ "VGO=-1.21 #volt\n",
+ "K=Io*10**-9/T1**m/exp(VGO/Eta/VT) #constant\n",
+ "VT=T2/11600 #V\n",
+ "Io2=K*T2**m*exp(VGO/Eta/VT) #A\n",
+ "print \"Reverse saturation current at 87 degree C = %0.2f nA \"%(Io2*10**9) "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Reverse saturation current at 87 degree C = 648.69 nA \n"
+ ]
+ }
+ ],
+ "prompt_number": 19
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex 2.11.2 Page 2-76"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given : \n",
+ "V=0.45 #volt\n",
+ "Eta=2 #for Si\n",
+ "T1=27+273 #K\n",
+ "T2=125+273 #K\n",
+ "VT1=T1/11600 #V\n",
+ "VT2=T2/11600 #V\n",
+ "I1BYIo1=exp(V/Eta/VT1) \n",
+ "I2BYIo2=exp(V/Eta/VT2) \n",
+ "m=1.5 #for Si\n",
+ "VGO=1.21 #volt\n",
+ "Io1BYIo2=(T1/T2)**m*exp(-VGO/Eta/VT1+VGO/Eta/VT2) #constant\n",
+ "I2BYI1=I2BYIo2/I1BYIo1/Io1BYIo2 \n",
+ "print \"Factor by which current increases : %0.2f\"%I2BYI1\n",
+ "#Answer is wrong in the textbook."
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Factor by which current increases : 56.94\n"
+ ]
+ }
+ ],
+ "prompt_number": 20
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex 2.11.3 Page 2-78"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given : \n",
+ "Io1=2 #nA\n",
+ "T1=10+273 #K\n",
+ "V=0.4 #volt\n",
+ "VT1=T1/11600 #V\n",
+ "m=1.5 #for Si\n",
+ "Eta=2 #for Si\n",
+ "VGO=-1.21 #volt\n",
+ "K=Io1*10**-9/T1**m/exp(VGO/Eta/VT1) #constant\n",
+ "I1=Io1*10**-9*(exp(V/Eta/VT1)-1) #nA\n",
+ "T2=70+273 #K\n",
+ "VT2=T2/11600 #V\n",
+ "Io2=K*T2**m*(exp(VGO/Eta/VT2)) #A\n",
+ "I2=Io2*(exp(V/Eta/VT2)-1) #nA\n",
+ "change=(I2-I1)/I1*100 #%\n",
+ "print \"%% change in diode current : %0.1f\" %change\n",
+ "#Answer is wrong in the textbook."
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "% change in diode current : 2332.4\n"
+ ]
+ }
+ ],
+ "prompt_number": 21
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex 2.11.4 Page 2-79"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given : \n",
+ "T=300 #K\n",
+ "m_Si=1.5 #for Si\n",
+ "m_Ge=1.5 #for Ge\n",
+ "EGO_Si=1.21 #Volt\n",
+ "EGO_Ge=0.785 #Volt\n",
+ "Eta_Si=2 \n",
+ "Eta_Ge=1 \n",
+ "VT=26/1000 #V\n",
+ "print \"Part(i) : \" \n",
+ "d_logIoBYdt_Ge=m_Ge/T+EGO_Ge/(Eta_Ge*T*VT) #per degree C\n",
+ "print \"d(log(Io))/dt for Ge = %0.2f per degree C \"%d_logIoBYdt_Ge \n",
+ "d_logIoBYdt_Si=m_Si/T+EGO_Si/(Eta_Si*T*VT) #per degree C\n",
+ "print \"d(log(Io))/dt for Si = %0.2f per degree C\"%d_logIoBYdt_Si\n",
+ "print \"\\nPart(ii) : \" \n",
+ "V=0.2 #Volt\n",
+ "dVBYdt_Ge=V/T-Eta_Ge*VT*d_logIoBYdt_Ge \n",
+ "print \"dV/dt for Si = %0.1f mV per degree C\"%(dVBYdt_Ge*1000)\n",
+ "V=0.6 #Volt\n",
+ "dVBYdt_Si=V/T-Eta_Si*VT*d_logIoBYdt_Si\n",
+ "print \"dV/dt for Si = %0.1f mV per degree C\"%(dVBYdt_Si*1000)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Part(i) : \n",
+ "d(log(Io))/dt for Ge = 0.11 per degree C \n",
+ "d(log(Io))/dt for Si = 0.08 per degree C\n",
+ "\n",
+ "Part(ii) : \n",
+ "dV/dt for Si = -2.1 mV per degree C\n",
+ "dV/dt for Si = -2.3 mV per degree C\n"
+ ]
+ }
+ ],
+ "prompt_number": 22
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex 2.12.1 Page 2-85"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from math import sqrt\n",
+ "#Given : \n",
+ "NA=4*10**20 #per m**3\n",
+ "Vj=0.2 #Volt\n",
+ "V1=-1 #Volts\n",
+ "V2=-5 #Volts\n",
+ "epsilon_r=16 #for Ge\n",
+ "epsilon_o=8.85*10**-12 #permitivity\n",
+ "q=1.6*10**-19 #Coulomb\n",
+ "W1=sqrt(2*epsilon_r*epsilon_o*(Vj-V1)/q/NA) #m\n",
+ "print \"Width of depletion region = %0.2f micro meter \"%(W1*10**6) \n",
+ "W2=sqrt(2*epsilon_r*epsilon_o*(Vj-V2)/q/NA) #m\n",
+ "print \"New value of Width of depletion region = %0.2f micro meter \"%(W2*10**6) "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Width of depletion region = 2.30 micro meter \n",
+ "New value of Width of depletion region = 4.80 micro meter \n"
+ ]
+ }
+ ],
+ "prompt_number": 23
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex 2.12.2 Page 2-86"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given : \n",
+ "NA=4*10**20 #per m**3\n",
+ "Vj=0.2 #Volt\n",
+ "V1=-1 #Volts\n",
+ "V2=-5 #Volts\n",
+ "A=0.8*10**-6 #m**2\n",
+ "epsilon_r=16 #for Ge\n",
+ "epsilon_o=8.85*10**-12 #permitivity\n",
+ "q=1.6*10**-19 #Coulomb\n",
+ "W1=sqrt(2*epsilon_r*epsilon_o*(Vj-V1)/q/NA) #m\n",
+ "CT1=epsilon_r*epsilon_o*A/W1 #\n",
+ "print \"Transition capacitance = %0.2f pF\"%(CT1*10**12)\n",
+ "W2=sqrt(2*epsilon_r*epsilon_o*(Vj-V2)/q/NA) #m\n",
+ "CT2=epsilon_r*epsilon_o*A/W2 #\n",
+ "print \"New value of Transition capacitance = %0.1f pF\"%(CT2*10**12)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Transition capacitance = 49.16 pF\n",
+ "New value of Transition capacitance = 23.6 pF\n"
+ ]
+ }
+ ],
+ "prompt_number": 24
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex 2.12.3 Page 2-87"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given : \n",
+ "NA=3*10**20 #per m**3\n",
+ "Vj=0.2 #Volt\n",
+ "V=-10 #Volts\n",
+ "A=1*10**-6 #m**2\n",
+ "epsilon_r=16 #for Ge\n",
+ "epsilon_o=8.854*10**-12 #permitivity\n",
+ "q=1.6*10**-19 #Coulomb\n",
+ "W=sqrt(2*epsilon_r*epsilon_o*(Vj-V)/q/NA) #m\n",
+ "print \"Width of depletion region = %0.2f micro meter\"%(W*10**6)\n",
+ "CT=epsilon_r*epsilon_o*A/W #\n",
+ "print \"Transition capacitance = %0.2f pF\"%(CT*10**12)\n",
+ "#Answer is wrong in the textbook."
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Width of depletion region = 7.76 micro meter\n",
+ "Transition capacitance = 18.26 pF\n"
+ ]
+ }
+ ],
+ "prompt_number": 25
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex 2.12.4 Page 2-88"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given : \n",
+ "W=2*10**-4*10**-2 #m\n",
+ "A=1*10**-6 #m**2\n",
+ "epsilon_r=16 #for Ge\n",
+ "epsilon_o=8.854*10**-12 #permitivity\n",
+ "q=1.6*10**-19 #Coulomb\n",
+ "CT=epsilon_r*epsilon_o*A/W #\n",
+ "print \"Barrier capacitance = %0.1f pF\"%(CT*10**12)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Barrier capacitance = 70.8 pF\n"
+ ]
+ }
+ ],
+ "prompt_number": 26
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex 2.12.5 Page 2-88"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from math import pi\n",
+ "#Given : \n",
+ "Vj=0.5 #Volt\n",
+ "V=-4.5 #Volt\n",
+ "rho_p=5*10**-2 #ohm-m\n",
+ "epsilon_r=12 #for Si\n",
+ "epsilon_o=8.854*10**-12 #permitivity\n",
+ "q=1.6*10**-19 #Coulomb\n",
+ "CT=100*10**-12 #F\n",
+ "mu_p=500*10**-4 #m**2/V-s\n",
+ "sigma_p=1/rho_p #(ohm-m)**-1\n",
+ "NA=sigma_p/q/mu_p #per m**3\n",
+ "W=sqrt(2*epsilon_r*epsilon_o*(Vj-V)/q/NA) #m\n",
+ "A=CT*W/(epsilon_r*epsilon_o) #\n",
+ "r=sqrt(A/pi) #m\n",
+ "D=2*r #m\n",
+ "print \"Diameter = %0.2f micro meter \"%(D*10**6) \n",
+ "#Answer is wrong in the textbook. Sqrt is not taken while calculatng W value and also other mistakes."
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Diameter = 1397.53 micro meter \n"
+ ]
+ }
+ ],
+ "prompt_number": 27
+ },
+ {
+ "cell_type": "heading",
+ "level": 3,
+ "metadata": {},
+ "source": [
+ "Ex 2.12.6 Page 2-90"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#Given : \n",
+ "Eta=2 #for Si\n",
+ "T=300 #K\n",
+ "VT=26/1000 #V\n",
+ "IbyIo=0.9 \n",
+ "#part (i)\n",
+ "V=log(IbyIo+1)*Eta*VT #Volt\n",
+ "print \"Value of reverse voltage = %0.2f mV \" %(V*1000)\n",
+ "#part (ii)\n",
+ "VF=0.2 #Volt\n",
+ "VR=-0.2 #Volt\n",
+ "IFbyIR=(exp(VF/Eta/VT)-1)/(exp(VR/Eta/VT)-1) \n",
+ "print \"Ratio of forward bias current to reverse saturation current : %0.2f\" %IFbyIR\n",
+ "#Answer is wrong in the textbook."
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Value of reverse voltage = 33.38 mV \n",
+ "Ratio of forward bias current to reverse saturation current : -46.81\n"
+ ]
+ }
+ ],
+ "prompt_number": 28
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex 2.12.7 Page 2-91"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import numpy as np\n",
+ "#Given : \n",
+ "Vs=100 #V\n",
+ "Rf1=20 #ohm\n",
+ "Vgamma1=0.2 #Volts\n",
+ "Rf2=15 #ohm\n",
+ "Vgamma2=0.6 #Volts\n",
+ "Vb_Ge=0.2 #Volts\n",
+ "Vb_Si=0.6 #Volts\n",
+ "R1=10*10**3 #ohm\n",
+ "R2=1*10**3 #ohm\n",
+ "#Case(i)\n",
+ "Imax=Vs/R1 #A\n",
+ "#D1 ON & D2 off\n",
+ "V=Vb_Ge+Rf1*Imax #Volt\n",
+ "#D2 off as V<Vb_Si\n",
+ "I2=0 #A\n",
+ "I1=(Vs-V)/(R1+Rf1) #A\n",
+ "print \"For R=10 kohm : \" \n",
+ "print \"I1 = %0.2f mA \"%(I1*1000) \n",
+ "print \"I2 = %0.2f mA \"%I2 \n",
+ "#Case(ii)\n",
+ "R=R2 #ohm#D1 & D2 ON \n",
+ "#V=Vb_Ge+Rf1*I1#V=Vb_Si+Rf2*I2\n",
+ "#/V=Vs-I*R#V=Vs-(I1+I2)*R\n",
+ "#20*I1-15*I2=Vb_Si-Vb_Ge\n",
+ "#1020*I1+1000*I2=99.8\n",
+ "A=np.array([[20, 1020],[ -Rf2, R] ])\n",
+ "B=np.array([Vb_Ge-Vb_Ge ,Vs-Vb_Ge ] )\n",
+ "X=np.linalg.solve(A,B)\n",
+ "I1=X[0]*1000 #mA\n",
+ "I2=X[1]*1000 #mA\n",
+ "print \"\\nFor R=1 kohm : \" \n",
+ "print \"I1 = %0.2f mA \"%I1\n",
+ "print \"I2 = %0.2f mA \"%I2\n",
+ "#Answer for 2nd part is not accurate in the book."
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "For R=10 kohm : \n",
+ "I1 = 9.94 mA \n",
+ "I2 = 0.00 mA \n",
+ "\n",
+ "For R=1 kohm : "
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "I1 = -2883.74 mA \n",
+ "I2 = 56.54 mA \n"
+ ]
+ }
+ ],
+ "prompt_number": 29
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex 2.12.8 Page 2-93"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import numpy as np\n",
+ "#Given : \n",
+ "Rf=10 #ohm\n",
+ "Vgamma=0.5 #Volt\n",
+ "RL=20 #ohm\n",
+ "V=3 #Volt\n",
+ "#Loop 1: 75*I1-50*I=V-Vgamma\n",
+ "#Loop 2: -50*I1+80*I=-Vgamma\n",
+ "A=np.array([[75, -50],[-50, 80]] )\n",
+ "B=np.array([V-Vgamma ,-Vgamma]) \n",
+ "X=np.linalg.solve(A, B)\n",
+ "I1=X[0] #A\n",
+ "I=X[1] #A\n",
+ "Vx=-Vgamma+50*I1 #Volt\n",
+ "print \"DC source = %0.2f Volts \" % Vx\n",
+ "#Answer is wrong in the textbook."
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "DC source = 2.00 Volts \n"
+ ]
+ }
+ ],
+ "prompt_number": 30
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file