summaryrefslogtreecommitdiff
path: root/Electronic_Circuits_by_P._Raja
diff options
context:
space:
mode:
Diffstat (limited to 'Electronic_Circuits_by_P._Raja')
-rwxr-xr-xElectronic_Circuits_by_P._Raja/Chapter1.ipynb1053
-rwxr-xr-xElectronic_Circuits_by_P._Raja/Chapter2.ipynb1179
-rwxr-xr-xElectronic_Circuits_by_P._Raja/Chapter3.ipynb1812
-rwxr-xr-xElectronic_Circuits_by_P._Raja/Chapter4.ipynb924
-rwxr-xr-xElectronic_Circuits_by_P._Raja/Chapter5.ipynb910
-rwxr-xr-xElectronic_Circuits_by_P._Raja/Chapter6.ipynb519
-rwxr-xr-xElectronic_Circuits_by_P._Raja/Chapter7.ipynb182
-rwxr-xr-xElectronic_Circuits_by_P._Raja/chapter1.ipynb1053
-rwxr-xr-xElectronic_Circuits_by_P._Raja/chapter2.ipynb1179
-rwxr-xr-xElectronic_Circuits_by_P._Raja/chapter3.ipynb1818
-rwxr-xr-xElectronic_Circuits_by_P._Raja/chapter4.ipynb923
-rwxr-xr-xElectronic_Circuits_by_P._Raja/chapter5.ipynb909
-rwxr-xr-xElectronic_Circuits_by_P._Raja/chapter6.ipynb517
-rwxr-xr-xElectronic_Circuits_by_P._Raja/chapter7.ipynb182
14 files changed, 13160 insertions, 0 deletions
diff --git a/Electronic_Circuits_by_P._Raja/Chapter1.ipynb b/Electronic_Circuits_by_P._Raja/Chapter1.ipynb
new file mode 100755
index 00000000..c97fbbe0
--- /dev/null
+++ b/Electronic_Circuits_by_P._Raja/Chapter1.ipynb
@@ -0,0 +1,1053 @@
+{
+ "metadata": {
+ "name": "",
+ "signature": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 1 - Operational Amplifiers"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 1.1 - page 11"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Given data\n",
+ "G= -100 \n",
+ "R1= 2.2 # in kohm\n",
+ "R1=R1*10**3 # in ohm\n",
+ "# Formula G=-Rf/R1\n",
+ "Rf= -G*R1 \n",
+ "print \"The value of Rf = %0.f kohm \" %(Rf*10**-3)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The value of Rf = 220 kohm \n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 1.2 - page 11"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Given data\n",
+ "Rf= 200 # in kohm\n",
+ "R1= 2 # in kohm\n",
+ "vin=2.5 # in mV\n",
+ "vin=vin*10**-3 # in volt\n",
+ "G= -Rf/R1 \n",
+ "vo= G*vin # in V\n",
+ "print \"The output voltage = %0.2f Volt \" %vo"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The output voltage = -0.25 Volt \n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 1.3 - page 12"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Given data\n",
+ "G=-10 \n",
+ "Ri= 100 # in kohm\n",
+ "R1= Ri # in kohm\n",
+ "R1=R1*10**3 # in ohm\n",
+ "# Formula G=-R2/R1\n",
+ "R2= R1*abs(G) # ohm\n",
+ "print \"Value of R1 = %0.f kohm \" %(R1*10**-3)\n",
+ "print \"and value of R2 = %0.f Mohm \" %(R2*10**-6)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Value of R1 = 100 kohm \n",
+ "and value of R2 = 1 Mohm \n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 1.4 - page 37"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Given data\n",
+ "R1= 100 # in kohm\n",
+ "R2= 500 # in kohm\n",
+ "V1= 2 # in volt\n",
+ "Vo= (1+R2/R1)*V1 # in volt\n",
+ "print \"Output voltage for noninverting amplifier = %0.f Volt\" %Vo"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Output voltage for noninverting amplifier = 12 Volt\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 1.5 - page 38"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from __future__ import division\n",
+ "# Given data\n",
+ "Rf= 1 # in Mohm\n",
+ "Rf=Rf*10**6 #in ohm\n",
+ "\n",
+ "# Part(a)\n",
+ "V1=1 #in volt\n",
+ "V2=2 #in volt\n",
+ "V3=3 #in volt\n",
+ "R1= 500 # in kohm\n",
+ "R1=R1*10**3 #in ohm\n",
+ "R2= 1 # in Mohm\n",
+ "R2=R2*10**6 #in ohm\n",
+ "R3= 1 # in Mohm\n",
+ "R3=R3*10**6 #in ohm\n",
+ "Vo= -Rf*(V1/R1+V2/R2+V3/R3) # in volt\n",
+ "print \"(a) Output voltage = %0.f Volt \" %Vo\n",
+ "\n",
+ "# Part(b)\n",
+ "V1=-2 #in volt\n",
+ "V2=3 #in volt\n",
+ "V3=1 #in volt\n",
+ "R1= 200 # in kohm\n",
+ "R1=R1*10**3 #in ohm\n",
+ "R2= 500 # in kohm\n",
+ "R2=R2*10**3 #in ohm\n",
+ "R3= 1 # in Mohm\n",
+ "R3=R3*10**6 #in ohm\n",
+ "Vo= -Rf*(V1/R1+V2/R2+V3/R3) # in volt\n",
+ "print \"(b) Output voltage = %0.f Volt\" %Vo"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a) Output voltage = -7 Volt \n",
+ "(b) Output voltage = 3 Volt\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 1.6 - page 38"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from __future__ import division\n",
+ "# Given data\n",
+ "print \"Minimum closed loop voltage gain for R2=0 and R1= 2 kohm\"\n",
+ "R2=0 \n",
+ "R1=2 # in kohm\n",
+ "R1=R1*10**3 # in ohm\n",
+ "Av_min= (1+R2/R1)\n",
+ "print \"Av(min) =\",Av_min\n",
+ "\n",
+ "print \"Maximum closed loop voltage gain for maximum value of R2=100 kohm and R1= 2 kohm\"\n",
+ "R2=100 # in kohm\n",
+ "R1=2 # in kohm\n",
+ "Av_max= (1+R2/R1)\n",
+ "print \"Av(max) =\",Av_max"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Minimum closed loop voltage gain for R2=0 and R1= 2 kohm\n",
+ "Av(min) = 1.0\n",
+ "Maximum closed loop voltage gain for maximum value of R2=100 kohm and R1= 2 kohm\n",
+ "Av(max) = 51.0\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 1.7 - page 39"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from __future__ import division\n",
+ "# Given data\n",
+ "V1= 745 # in \u00b5V\n",
+ "V2= 740 # in \u00b5V\n",
+ "V1=V1*10**-6 # in volt\n",
+ "V2=V2*10**-6 # in volt\n",
+ "CMRR=80 # in dB\n",
+ "Av=5*10**5 \n",
+ "# (i)\n",
+ "# CMRR in dB= 20*log(Ad/Ac)\n",
+ "Ad=Av \n",
+ "Ac= Ad/10**(CMRR/20) \n",
+ "# (ii)\n",
+ "Vo= Ad*(V1-V2)+Ac*(V1+V2)/2 \n",
+ "print \"Output voltage = %0.2f Volt\" %Vo\n",
+ "\n",
+ "# Note:- In the book, there is calculation error to evaluate the value of Ac,\n",
+ "#so the value of Ac is wrong ans to evaluate the output voltage there is also calculation error "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Output voltage = 2.54 Volt\n"
+ ]
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 1.8 - page 40"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from __future__ import division\n",
+ "# Given data\n",
+ "R1= 1 # in Mohm\n",
+ "Ri=R1 # in Mohm\n",
+ "Rf=1 # in Mohm\n",
+ "A_VF= -Rf/R1 \n",
+ "print \"Voltage gain = %0.f\" %A_VF"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Voltage gain = -1\n"
+ ]
+ }
+ ],
+ "prompt_number": 14
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 1.10 - page 41"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from __future__ import division\n",
+ "# Given data\n",
+ "V1=2 # in V\n",
+ "V2=3 # in V\n",
+ "Rf=3 # in kohm\n",
+ "R1=1 # in kohm\n",
+ "Vo1= (1+Rf/R1)*V1 \n",
+ "print \"Output voltage when only 2V voltage source is acting is %0.f Volt\" %Vo1\n",
+ "Vo2= (1+Rf/R1)*V2 \n",
+ "print \"Output voltage due to 3V voltage source is %0.f Volt\" %Vo2\n",
+ "Vo= Vo1+Vo2 # in volts\n",
+ "print \"Total output voltage is %0.f Volts\" %Vo"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Output voltage when only 2V voltage source is acting is 8 Volt\n",
+ "Output voltage due to 3V voltage source is 12 Volt\n",
+ "Total output voltage is 20 Volts\n"
+ ]
+ }
+ ],
+ "prompt_number": 15
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 1.11 - page 42"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from __future__ import division\n",
+ "# Given data\n",
+ "Rf=500 # in kohm\n",
+ "min_vvs= 0 # minimum value of variable resistor in ohm\n",
+ "max_vvs= 10 # maximum value of variable resistor in ohm\n",
+ "Ri_min= 10+min_vvs # in kohm\n",
+ "Ri_max= 10+max_vvs #in kohm\n",
+ "# Av= Vo/Vi= -Rf/Ri\n",
+ "Av=-Rf/Ri_min \n",
+ "print \"Closed loop voltage gain corresponding to Ri(min) is\",Av\n",
+ "Av=-Rf/Ri_max \n",
+ "print \"and closed loop voltage gain corresponding to Ri(max) is\",Av"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Closed loop voltage gain corresponding to Ri(min) is -50.0\n",
+ "and closed loop voltage gain corresponding to Ri(max) is -25.0\n"
+ ]
+ }
+ ],
+ "prompt_number": 16
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 1.12 - page 43"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Given data\n",
+ "Rf=200 # in kohm\n",
+ "R1= 20 # in kohm\n",
+ "# Av= Vo/Vi= -Rf/Ri\n",
+ "Av= -Rf/R1 \n",
+ "Vi_min= 0.1 # in V\n",
+ "Vi_max= 0.5 # in V\n",
+ "# Vo= Av*Vi\n",
+ "Vo_min= Av*Vi_min # in V\n",
+ "Vo_max= Av*Vi_max # in V\n",
+ "print \"Output voltage ranges from\",Vo_min,\"V to\",Vo_max,\"V\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Output voltage ranges from -1.0 V to -5.0 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 17
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 1.13 - page 43"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from __future__ import division\n",
+ "# Given data\n",
+ "Rf= 250 # in kohm\n",
+ "# Output voltage expression, Vo= -5*Va+3*Vb\n",
+ "# and we know that for a difference amplifier circuit, \n",
+ "# Vo= -Rf/R1*Va + [R2/(R1+R2)]*[1+Rf/R1]*Vb\n",
+ "# Comparing both the expression, we get\n",
+ "# -Rf/R1*Va= -5*Va, or\n",
+ "R1= Rf/5 # in kohm\n",
+ "print \"The value of R1 = %0.2f kohm\" %R1\n",
+ "# and \n",
+ "R2= 3*R1**2/(R1+Rf-3*R1)\n",
+ "print \"The value of R2 = %0.2f kohm\" %R2\n",
+ "\n",
+ "# Note : Answer in the book is wrong"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The value of R1 = 50.00 kohm\n",
+ "The value of R2 = 50.00 kohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 18
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 1.14 - page 44"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Given data\n",
+ "Vi_1= 150 # in \u00b5V\n",
+ "Vi_2= 140 # in \u00b5V\n",
+ "Vd= Vi_1-Vi_2 # in \u00b5V\n",
+ "Vd=Vd*10**-6 # in V\n",
+ "Vc= (Vi_1+Vi_2)/2 # in \u00b5V\n",
+ "Vc=Vc*10**-6 # in V\n",
+ "# Vo= Ad*Vd*(1+Vc/(CMRR*Vd))\n",
+ "\n",
+ "# (i) For Ad=4000 and CMRR= 100\n",
+ "Ad=4000 \n",
+ "CMRR= 100 \n",
+ "Vo= Ad*Vd*(1+Vc/(CMRR*Vd)) # in volt\n",
+ "print \"(a) Output voltage = %.1f mV\" %(Vo*10**3)\n",
+ "\n",
+ "# (ii) For Ad=4000 and CMRR= 10**5\n",
+ "Ad=4000 \n",
+ "CMRR= 10**5 \n",
+ "Vo= Ad*Vd*(1+Vc/(CMRR*Vd)) # in volt\n",
+ "print \"(b) Output voltage = %0.1f mV\" %(Vo*10**3)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a) Output voltage = 45.8 mV\n",
+ "(b) Output voltage = 40.0 mV\n"
+ ]
+ }
+ ],
+ "prompt_number": 19
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 1.15 - page 45"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from __future__ import division\n",
+ "# Given data\n",
+ "Rf=470 # in kohm\n",
+ "R1=4.3 # in kohm\n",
+ "R2=33 # in kohm\n",
+ "R3=33 # in kohm\n",
+ "Vi= 80 # in \u00b5V\n",
+ "Vi=Vi*10**-6 # in volt\n",
+ "A1= 1+Rf/R1 \n",
+ "A2=-Rf/R2 \n",
+ "A3= -Rf/R3 \n",
+ "A=A1*A2*A3 \n",
+ "Vo= A*Vi # in volt\n",
+ "print \"Output voltage = %0.2f Volts\" %Vo"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Output voltage = 1.79 Volts\n"
+ ]
+ }
+ ],
+ "prompt_number": 20
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 1.16 - page 46"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from sympy import symbols, simplify, sin\n",
+ "t = symbols('t')\n",
+ "# Given data\n",
+ "R1= 33 # in k\u03a9\n",
+ "R2= 10 # in k\u03a9\n",
+ "R3= 330 # in k\u03a9\n",
+ "V1 = simplify(50*sin(1000*t)) # in mV\n",
+ "V2 = simplify(10*sin(3000*t)) # in mV\n",
+ "Vo = -(R3/R1*V1+R3/R2*V2)/1000 # in V\n",
+ "print \"Output voltage is\",Vo"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Output voltage is -0.5*sin(1000*t) - 0.33*sin(3000*t)\n"
+ ]
+ }
+ ],
+ "prompt_number": 21
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 1.17 - page 47"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from __future__ import division\n",
+ "# Given data\n",
+ "R1=10 # in kohm\n",
+ "R2=150 # in kohm\n",
+ "R3=10 # in kohm\n",
+ "R4=300 # in kohm\n",
+ "V1= 1 # in V\n",
+ "V2= 2 # in V\n",
+ "Vo= ((1+R4/R2)*(R3*V1/(R1+R3))-(R4/R2)*V2) \n",
+ "print \"Output voltage = %0.2f Volts\" %Vo"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Output voltage = -2.50 Volts\n"
+ ]
+ }
+ ],
+ "prompt_number": 22
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 1.18 - page 47"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from __future__ import division\n",
+ "# Given data\n",
+ "R1=12 # in kohm\n",
+ "Rf=360 # in kohm\n",
+ "V1= -0.3 # in V\n",
+ "Vo= (1+Rf/R1)*V1 # in V\n",
+ "print \"(a) Output voltage result in %0.2f Volts\" %Vo\n",
+ "\n",
+ "# Part(b)\n",
+ "Vo= 2.4 # in V\n",
+ "# We know, Vo= (1+Rf/R1)*V1\n",
+ "V1= Vo/(1+Rf/R1) \n",
+ "print \"(b) To result in an output of 2.4 Volt, Input voltage = %0.2f mV\" %(V1*10**3)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a) Output voltage result in -9.30 Volts\n",
+ "(b) To result in an output of 2.4 Volt, Input voltage = 77.42 mV\n"
+ ]
+ }
+ ],
+ "prompt_number": 23
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 1.19 - page 48"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from __future__ import division\n",
+ "# Given data\n",
+ "Rf=68 # in kohm\n",
+ "R1=33 # in kohm\n",
+ "R2=22 # in kohm\n",
+ "R3=12 # in kohm\n",
+ "V1= 0.2 # in V\n",
+ "V2=-0.5 # in V\n",
+ "V3= 0.8 # in V\n",
+ "Vo= -Rf/R1*V1 + (-Rf/R2)*V2 + (-Rf/R3)*V3 # in volts\n",
+ "print \"Output voltage = %0.3f Volts\" %Vo\n",
+ "#Answer in the textbook is not accurate."
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Output voltage = -3.400 Volts\n"
+ ]
+ }
+ ],
+ "prompt_number": 24
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 1.20 - page 48"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from __future__ import division\n",
+ "# Given data\n",
+ "Rf=100 # in kohm\n",
+ "R1=20 # in kohm\n",
+ "V1= 1.5 # in V\n",
+ "Vo1= V1 \n",
+ "Vo= -Rf/R1*Vo1 # in volts\n",
+ "print \"Output voltage = %0.2f Volts\" %Vo"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Output voltage = -7.50 Volts\n"
+ ]
+ }
+ ],
+ "prompt_number": 25
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 1.22 - page 50"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from __future__ import division\n",
+ "# Given data\n",
+ "vo= -10 # in V\n",
+ "i_f= 1 # in mA\n",
+ "i_f= i_f*10**-3 #in A\n",
+ "# Formula vo= -i_f*Rf\n",
+ "Rf= -vo/i_f # in \u03a9\n",
+ "# The output voltage, vo= -(v1+5*v2) (i)\n",
+ "# vo= -Rf/R1*v1 - Rf/R2*v2 (ii)\n",
+ "# Comparing equations (i) and (2)\n",
+ "R1= Rf/1 # in \u03a9\n",
+ "R2= Rf/5 # in \u03a9\n",
+ "print \"The value of Rf = %0.2f k\u03a9\" %(Rf*10**-3)\n",
+ "print \"The value of R1 = %0.2f k\u03a9\" %(R1*10**-3)\n",
+ "print \"The value of R2 = %0.2f k\u03a9\" %(R2*10**-3)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The value of Rf = 10.00 k\u03a9\n",
+ "The value of R1 = 10.00 k\u03a9\n",
+ "The value of R2 = 2.00 k\u03a9\n"
+ ]
+ }
+ ],
+ "prompt_number": 26
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 1.24 - page 52"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from __future__ import division\n",
+ "from sympy import symbols\n",
+ "v1,v2 = symbols('v1 v2')\n",
+ "# Given data\n",
+ "R1= 9 # in k\u03a9\n",
+ "R2= 1 # in k\u03a9\n",
+ "R3= 2 # in k\u03a9\n",
+ "R4= 3 # in k\u03a9\n",
+ "# for node 1\n",
+ "va = R4/(R4+R3)*v1\n",
+ "vo1 = (1+R1/R2)*va\n",
+ "# for node 2\n",
+ "va=R3/(R3+R4)*v2\n",
+ "vo2 = (1+R1/R2)*va\n",
+ "vo = vo1+vo2\n",
+ "print \"Total voltage is, vo =\",vo"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Total voltage is, vo = 6.0*v1 + 4.0*v2\n"
+ ]
+ }
+ ],
+ "prompt_number": 27
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 1.25 - page 54"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from __future__ import division\n",
+ "from sympy import symbols\n",
+ "v1,v2,v3 = symbols('v1 v2 v3')\n",
+ "# Given data\n",
+ "R1= 9 # in k\u03a9\n",
+ "R2= 1 # in k\u03a9\n",
+ "R3= 2 # in k\u03a9\n",
+ "R4= 3 # in k\u03a9\n",
+ "# Voltage at node 1\n",
+ "va= R4*v1/(R3+R4)\n",
+ "vo1= (1+R1/R2)*va\n",
+ "# Voltage at node 2\n",
+ "va= R3*v2/(R3+R4)\n",
+ "# From (i) and (ii)\n",
+ "vo2= (1+R1/R2)*va\n",
+ "# Voltage at node 3\n",
+ "va= R3*v2/(R3+R4)\n",
+ "vo3= (-R1/R2)*v3\n",
+ "vo = vo1+vo2+vo3\n",
+ "print \"Total voltage is\",vo"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Total voltage is 6.0*v1 + 4.0*v2 - 9.0*v3\n"
+ ]
+ }
+ ],
+ "prompt_number": 28
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 1.26 - page 55"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Given data\n",
+ "import numpy as np\n",
+ "from __future__ import division\n",
+ "# omega_t= Ao*omega_b\n",
+ "# 2*pi*f_t = Ao*2*pi*f_b\n",
+ "# f_t= Ao*f_b\n",
+ "# Part (i)\n",
+ "Ao1= 10**5 \n",
+ "f_b1= 10**2 # in Hz\n",
+ "f_t1= Ao1*f_b1 # in Hz\n",
+ "row1 = np.array([Ao1,f_b1,f_t1])\n",
+ "# Part (ii)\n",
+ "Ao2= 10**6 \n",
+ "f_t2= 10**6 # in Hz\n",
+ "f_b2= f_t2/Ao2 # in Hz\n",
+ "row2 = np.array([Ao2,f_b2,f_t2])\n",
+ "# Part (iii)\n",
+ "f_b3= 10**3 # in Hz\n",
+ "f_t3= 10**8 # in Hz\n",
+ "Ao3= f_t3/f_b3 \n",
+ "row3 = np.array([Ao3,f_b3,f_t3])\n",
+ "# Part (iv)\n",
+ "f_b4= 10**-1 # in Hz\n",
+ "f_t4= 10**6 # in Hz\n",
+ "Ao4= f_t4/f_b4 \n",
+ "row4 = np.array([Ao4,f_b4,f_t4])\n",
+ "# Part (v)\n",
+ "Ao5= 2*10**5 \n",
+ "f_b5= 10 # in Hz\n",
+ "f_t5= Ao5*f_b5 # in Hz\n",
+ "row5 = np.array([Ao5,f_b5,f_t5])\n",
+ "print \"-\"*33\n",
+ "print \"Ao fb(Hz) ft(Hz)\"\n",
+ "print \"-\"*33\n",
+ "print \"%.e %.e %.e\" %(row1[0], row1[1], row1[2])\n",
+ "print \"%.e %.f %.e\" %(row2[0], row5[1], row2[2])\n",
+ "print \"%.e %.e %.e\" %(row3[0], row3[1], row3[2])\n",
+ "print \"%.e %.e %.e\" %(row4[0], row4[1], row4[2])\n",
+ "print \"%.e %.f %.e\" %(row5[0], row5[1], row5[2])\n",
+ "# Answer for f_b2 is wrong in the textbook."
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "---------------------------------\n",
+ "Ao fb(Hz) ft(Hz)\n",
+ "---------------------------------\n",
+ "1e+05 1e+02 1e+07\n",
+ "1e+06 10 1e+06\n",
+ "1e+05 1e+03 1e+08\n",
+ "1e+07 1e-01 1e+06\n",
+ "2e+05 10 2e+06\n"
+ ]
+ }
+ ],
+ "prompt_number": 29
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 1.27 - page 56"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from __future__ import division\n",
+ "from numpy import sqrt\n",
+ "# Given data\n",
+ "Ao= 86 # in dB\n",
+ "A= 40 # in dB\n",
+ "f=100 # in kHz\n",
+ "f=f*10**3 # in Hz\n",
+ "# From 20*log(S) = 20*log(Ao/A), where S, stands for sqrt(1+(f/fb)**2)\n",
+ "S= 10**((Ao-A)/20) \n",
+ "# S= sqrt(1+(f/fb)**2)\n",
+ "fb= f/sqrt(S**2-1) # in Hz\n",
+ "Ao= 10**(Ao/20) \n",
+ "ft= Ao*fb # in Hz\n",
+ "print \"The value of Ao = %0.3e\" %Ao\n",
+ "print \"The value of fb = %0.f Hz\" %fb\n",
+ "print \"The value of ft = %0.f MHz\" %round(ft*10**-6)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The value of Ao = 1.995e+04\n",
+ "The value of fb = 501 Hz\n",
+ "The value of ft = 10 MHz\n"
+ ]
+ }
+ ],
+ "prompt_number": 30
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 1.28 - page 56"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from __future__ import division\n",
+ "from numpy import pi, sqrt\n",
+ "# Given data\n",
+ "Ao= 10**4 # in V/V\n",
+ "f_t= 10**6 # in Hz\n",
+ "R2byR1= 20 \n",
+ "omega_t= 2*pi*f_t \n",
+ "omega_3dB= omega_t/(1+R2byR1) \n",
+ "f3dB= omega_3dB/(2*pi) # in Hz\n",
+ "print \"3-dB frequency of the closed loop amplifier is %0.1f kHz\" %(f3dB*10**-3)\n",
+ "f3dB= 0.1*f3dB # in Hz\n",
+ "voBYvi= -R2byR1/sqrt(1+(2*pi*f3dB/omega_3dB)**2) \n",
+ "voBYvi= abs(voBYvi) # in v/v\n",
+ "print \"Gain = %0.1f v/v\" %(voBYvi)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "3-dB frequency of the closed loop amplifier is 47.6 kHz\n",
+ "Gain = 19.9 v/v\n"
+ ]
+ }
+ ],
+ "prompt_number": 31
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
diff --git a/Electronic_Circuits_by_P._Raja/Chapter2.ipynb b/Electronic_Circuits_by_P._Raja/Chapter2.ipynb
new file mode 100755
index 00000000..3abf271f
--- /dev/null
+++ b/Electronic_Circuits_by_P._Raja/Chapter2.ipynb
@@ -0,0 +1,1179 @@
+{
+ "metadata": {
+ "name": "",
+ "signature": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 2 - Metal oxide semiconductor field effect transistor(MOSFET)"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 2.1 - page 75"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Given data \n",
+ "V_S= 0 # As source is connected to ground\n",
+ "V_G= 1.5 # in V\n",
+ "V_D= 0.5 # in V\n",
+ "Vt= 0.7 # in V\n",
+ "# Part(a) V_D= 0.5 # in V\n",
+ "V_D= 0.5 # in V\n",
+ "V_DS= V_D-V_S # in V\n",
+ "V_GS= V_G-V_S # in V\n",
+ "if V_GS < Vt:\n",
+ " print \"At V_D = 0.5 , the device is in cut off region\"\n",
+ "elif V_DS<= (V_GS-Vt):\n",
+ " print \"At V_D = 0.5 , the device is in triode region\" \n",
+ "else:\n",
+ " print \"At V_D = 0.5 , the device is in saturation region\"\n",
+ "\n",
+ "# Part(b) V_D= 0.9 # in V\n",
+ "V_D= 0.9 # in V\n",
+ "V_DS= V_D-V_S # in V\n",
+ "V_GS= V_G-V_S # in V\n",
+ "if V_GS < Vt:\n",
+ " print \"At V_D = 0.9 , the device is in cut off region\"\n",
+ "elif V_DS<= (V_GS-Vt):\n",
+ " print \"At V_D = 0.9 , the device is in triode region\"\n",
+ "else:\n",
+ " print \"At V_D = 0.9 , the device is in saturation region\" \n",
+ "\n",
+ "\n",
+ "# Part(c) V_D= 3 # in V\n",
+ "V_D= 3 # in V\n",
+ "V_DS= V_D-V_S # in V\n",
+ "V_GS= V_G-V_S # in V\n",
+ "if V_GS < Vt:\n",
+ " print \"At V_D = 3 , the device is in cut off region\"\n",
+ "elif V_DS<= (V_GS-Vt):\n",
+ " print \"At V_D = 3 , the device is in triode region\"\n",
+ "else:\n",
+ " print \"At V_D = 3 , the device is in saturation region\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "At V_D = 0.5 , the device is in triode region\n",
+ "At V_D = 0.9 , the device is in saturation region\n",
+ "At V_D = 3 , the device is in saturation region\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 2.2 - page 77"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Given data \n",
+ "unCox= 100 # in \u00b5A/V**2\n",
+ "unCox= unCox*10**-6 # in A/V**2\n",
+ "L= 1 #in \u00b5m\n",
+ "L= L*10**-6 # in m\n",
+ "W=10 # in \u00b5m\n",
+ "W=W*10**-6 # in m\n",
+ "V_GS= 1.5 # in V\n",
+ "Vt= 0.7 # in V\n",
+ "# For V_DS= 0.5 V\n",
+ "V_DS= 0.5 # in V\n",
+ "if V_DS<= (V_GS-Vt):\n",
+ " I_D= unCox*W/L*((V_GS-Vt)*V_DS-V_DS**2/2)\n",
+ " print \"The device is in triode region. SO the drain current in the triode region = %0.f \u00b5A\" %(I_D*10**6)\n",
+ "else:\n",
+ " I_D= unCox*W/(2*L)*(V_GS-VT)**2\n",
+ " print \"The device is in saturation region. SO the drain current in the saturation region = %0.1f \u00b5A\" %(I_D*10**6)\n",
+ "\n",
+ "# For V_DS= 0.9 V\n",
+ "V_DS= 0.9 # in V\n",
+ "if V_DS<= (V_GS-Vt):\n",
+ " I_D= unCox*W/L*((V_GS-Vt)*V_DS-V_DS**2/2)\n",
+ " print \"The device is in triode region. So the drain current in the triode region = %0.1f \u00b5A\" %(I_D*10**6)\n",
+ "else:\n",
+ " I_D= unCox*W/(2*L)*(V_GS-Vt)**2\n",
+ " print \"The device is in saturation region. So drain current in the saturation region = %0.f \u00b5A\" %(I_D*10**6)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The device is in triode region. SO the drain current in the triode region = 275 \u00b5A\n",
+ "The device is in saturation region. So drain current in the saturation region = 320 \u00b5A\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 2.3 - page 78"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Given data \n",
+ "Vt= 0.7 # in V\n",
+ "ID = 100 # in \u00b5A\n",
+ "V_GS= 1.2 # in V\n",
+ "V_DS= 1.2 # in V\n",
+ "\n",
+ "# Let assume \u00b5n*Cox*W/(2*L) = K\n",
+ "# For triode region\n",
+ "if V_DS<= (V_GS-Vt):\n",
+ " #triode region\n",
+ " K = ID*10**-6/(V_GS-Vt)**2\n",
+ " \n",
+ "else:\n",
+ " # saturation region\n",
+ " K = ID*10**-6/(V_GS-Vt)**2\n",
+ "\n",
+ "V_DS= 3 # inV\n",
+ "V_GS = 1.5 # in V\n",
+ "I_D= K*(V_GS-Vt)**2 # in A\n",
+ "I_D*=10**6 # in \u00b5A\n",
+ "print \"Value of ID = %0.1f \u00b5A\" %I_D\n",
+ "# Drain to source resistance\n",
+ "V_GS = 3.2 # in V\n",
+ "r_DS = 1/(2*K*(V_GS-Vt))\n",
+ "print \"Drain to source resistance, rDS = %0.1f ohm\" %r_DS"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Value of ID = 256.0 \u00b5A\n",
+ "Drain to source resistance, rDS = 500.0 ohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 21
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 2.4 - page 82"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from __future__ import division\n",
+ "from numpy import sqrt\n",
+ "# Given data \n",
+ "I_D= 0.4 # in mA\n",
+ "I_D=I_D*10**-3 # in A\n",
+ "Vt= 0.7 # in V\n",
+ "V_SS= -2.5 # in V\n",
+ "V_DD= 2.5 # in V\n",
+ "unCox= 100 # in \u00b5A/V**2\n",
+ "unCox= unCox*10**-6 # in A/V**2\n",
+ "W= 32 # in m\n",
+ "L= 1 # in m\n",
+ "# V_GS-Vt= V_OV\n",
+ "# I_D= unCox*W/(2*L)*(V_OV)**2\n",
+ "V_OV= sqrt(I_D/(unCox*W/(2*L))) # in V\n",
+ "V_GS= V_OV+Vt # in V\n",
+ "print \"The value of V_GS = %0.1f Volt\" %V_GS\n",
+ "V_G= 0 \n",
+ "# Formula V_GS= V_G-V_S\n",
+ "V_S= V_G-V_GS # in V\n",
+ "R_S= (V_S-V_SS)/I_D# in \u03a9\n",
+ "print \"The value of R_S = %0.2f k\u03a9\" %(R_S*10**-3)\n",
+ "V_D= 0.5 # in V\n",
+ "R_D= (V_DD-V_D)/I_D #in \u03a9\n",
+ "print \"The value of R_D = %0.1f k\u03a9\" %(R_D*10**-3)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The value of V_GS = 1.2 Volt\n",
+ "The value of R_S = 3.25 k\u03a9\n",
+ "The value of R_D = 5.0 k\u03a9\n"
+ ]
+ }
+ ],
+ "prompt_number": 25
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 2.5 - page 83"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from __future__ import division\n",
+ "from numpy import sqrt\n",
+ "# Given data \n",
+ "V_DD= 3 # in V\n",
+ "I_D= 80 # in \u00b5A\n",
+ "I_D=I_D*10**-6 # in A\n",
+ "Vt= 0.6 # in V\n",
+ "unCox= 200 # in \u00b5A/V**2\n",
+ "unCox= unCox*10**-6 # in A/V**2\n",
+ "L= 0.8 #in \u00b5m\n",
+ "L= L*10**-6 # in m\n",
+ "W=4 # in \u00b5m\n",
+ "W=W*10**-6 # in m\n",
+ "# V_GS-Vt= V_OV\n",
+ "# I_D= unCox*W/(2*L)*(V_OV)**2\n",
+ "V_OV= sqrt(I_D/(unCox*W/(2*L))) # in V\n",
+ "V_GS= V_OV+Vt # in V\n",
+ "V_D= 1 # in V\n",
+ "V_G= V_D # in V\n",
+ "R= (V_DD-V_D)/I_D # in \u03a9\n",
+ "print \"The value of R = %0.f k\u03a9\" %(R*10**-3)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The value of R = 25 k\u03a9\n"
+ ]
+ }
+ ],
+ "prompt_number": 29
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 2.6 - page 84"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from __future__ import division\n",
+ "from numpy import sqrt\n",
+ "# Given data \n",
+ "V_DD= 10 # in V\n",
+ "I_D= 0.4 # in mA\n",
+ "I_D=I_D*10**-3 # in A\n",
+ "Vt= 2 # in V\n",
+ "unCox= 20 # in \u00b5A/V**2\n",
+ "unCox= unCox*10**-6 # in A/V**2\n",
+ "L= 10 #in \u00b5m\n",
+ "L= L*10**-6 # in m\n",
+ "W=100 # in \u00b5m\n",
+ "W=W*10**-6 # in m\n",
+ "V_S= 0 # in V as source is connected to ground\n",
+ "# I_D= unCox*W/(2*L)*(V_OV)**2\n",
+ "V_OV= sqrt(I_D/(unCox*W/(2*L))) # in V\n",
+ "V_GS= V_OV+Vt # in V\n",
+ "V_D= V_GS # in V\n",
+ "R= (V_DD-V_D)/I_D # in \u03a9\n",
+ "print \"The value of R = %0.2f k\u03a9\" %(R*10**-3)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The value of R = 15.00 k\u03a9\n"
+ ]
+ }
+ ],
+ "prompt_number": 30
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 2.7 - page 85"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from __future__ import division\n",
+ "# Given data \n",
+ "KnWbyL= 1 # in mA\n",
+ "KnWbyL=KnWbyL*10**-3 # in A\n",
+ "Vt= 1 # in V\n",
+ "V_DS= 0.1 # in V\n",
+ "V_D= V_DS # in V\n",
+ "V_GS= 5 # in V\n",
+ "V_DD= V_GS # in V\n",
+ "# Formula I_D= K'nW/L*[(V_GS-Vt)*V_DS-V_DS**2/2]\n",
+ "I_D= KnWbyL*((V_GS-Vt)*V_DS-V_DS**2/2) # in A\n",
+ "R_D= (V_DD-V_D)/I_D #in \u03a9\n",
+ "print \"The required value of R_D = %0.1f k\u03a9\" %(R_D*10**-3)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The required value of R_D = 12.4 k\u03a9\n"
+ ]
+ }
+ ],
+ "prompt_number": 32
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 2.8 - page 86"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from __future__ import division\n",
+ "# Given data \n",
+ "KnWbyL= 1 # in mA/V**2\n",
+ "KnWbyL=KnWbyL*10**-3 # in A/V**2\n",
+ "Vt= 1 # in V\n",
+ "V_DD= 10 # in V\n",
+ "R_D= 6 # in k\u03a9\n",
+ "R_D= R_D*10**3 # in \u03a9\n",
+ "R_S= 6 # in k\u03a9\n",
+ "R_S= R_S*10**3 # in \u03a9\n",
+ "R_G1= 10 # in M\u03a9\n",
+ "R_G1= R_G1*10**6 # in \u03a9\n",
+ "R_G2= 10 # in M\u03a9\n",
+ "R_G2= R_G2*10**6 # in \u03a9\n",
+ "V_G= V_DD*R_G2/(R_G1+R_G2) # in V\n",
+ "# V_S= R_S*I_D\n",
+ "# V_GS= V_G-V_S= V_G-R_S*I_D\n",
+ "# Formula I_D= K'nW/2*L*(V_GS-Vt)**2, Putting the value of V_GS, We get\n",
+ "# 18*I_D**2 -25*I_D +8= 0\n",
+ "# I_D= 0.89 mA or I_D= 0.5\n",
+ "I_D= 0.5 # in mA\n",
+ "I_D=I_D*10**-3 # in A\n",
+ "V_S= R_S*I_D # in V\n",
+ "V_GS= V_G-V_S # in V\n",
+ "V_D= V_DD-I_D*R_D # in V\n",
+ "print \"The value of I_D = %0.2f mA\" %(I_D*10**3)\n",
+ "print \"The value of V_S = %0.2f Volt\" %(V_S)\n",
+ "print \"The value of V_GS = %0.2f Volt\" %(V_GS)\n",
+ "print \"The value of V_D = %0.2f Volt\" %(V_D)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The value of I_D = 0.50 mA\n",
+ "The value of V_S = 3.00 Volt\n",
+ "The value of V_GS = 2.00 Volt\n",
+ "The value of V_D = 7.00 Volt\n"
+ ]
+ }
+ ],
+ "prompt_number": 33
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 2.9 - page 98"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from __future__ import division\n",
+ "# Given data \n",
+ "R_D= 20 # in k\u03a9\n",
+ "R_D= R_D*10**3 # in \u03a9\n",
+ "R1= 30 # in k\u03a9\n",
+ "R1= R1*10**3 # in \u03a9\n",
+ "R2= 20 # in k\u03a9\n",
+ "R2= R2*10**3 # in \u03a9\n",
+ "V_DD= 5 # in V\n",
+ "Vtn= 1 # in V\n",
+ "Kn= 0.1 # in mA/V**2\n",
+ "Kn=Kn*10**-3 # in A/V**2\n",
+ "V_GS= R2*V_DD/(R1+R2) # in V\n",
+ "# I_D= 1/2*\u00b5nCox*W/L*(V_GS-Vtm)**2 \n",
+ "I_D = Kn*(V_GS-Vtn)**2 # in mA (As Kn= 1/2*\u00b5nCox*W/L)\n",
+ "V_DS= V_DD-I_D*R_D # in V\n",
+ "print \"The value of V_GS = %0.f Volt\" %(V_GS)\n",
+ "print \"The value of I_D = %0.2f mA\" %(I_D*10**3)\n",
+ "print \"The value of V_DS = %0.f Volt\" %(V_DS)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The value of V_GS = 2 Volt\n",
+ "The value of I_D = 0.10 mA\n",
+ "The value of V_DS = 3 Volt\n"
+ ]
+ }
+ ],
+ "prompt_number": 35
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 2.10 - page 99"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from __future__ import division\n",
+ "from numpy import sqrt\n",
+ "# Given data \n",
+ "V_DD= 15 # in V\n",
+ "Vt= 1 # in V\n",
+ "V_D= 10 # in V\n",
+ "V_S= 5 # in V\n",
+ "KnWbyL= 1 # in mA/V**2\n",
+ "KnWbyL=KnWbyL*10**-3 # in A/V**2\n",
+ "R_G1= 8 # in M\u03a9\n",
+ "R_G1= R_G1*10**6 # in \u03a9\n",
+ "I_D= 0.5 # in mA\n",
+ "I_D=I_D*10**-3 #in A\n",
+ "R_D= (V_DD-V_D)/I_D # in \u03a9\n",
+ "R_S= V_S/I_D # in \u03a9\n",
+ "# Formul I_D= 1/2*KnWbyL*(V_OV)**2\n",
+ "V_OV= sqrt(2*I_D/KnWbyL) # in V\n",
+ "# Formula V_OV= V_GS-Vt\n",
+ "V_GS= V_OV+Vt # in V\n",
+ "V_G= V_GS+V_S # in V\n",
+ "# Formul V_G= R_G2*V_DD/(R_G1+R_G2)\n",
+ "R_G2= R_G1*V_G/(V_DD-V_G) #in \u03a9\n",
+ "print \"The value of R_D = %0.1f k\u03a9\" %(R_D*10**-3)\n",
+ "print \"The value of R_S = %0.1f k\u03a9\" %(R_S*10**-3)\n",
+ "print \"The value of V_OV = %0.1f Volt\" %(V_OV)\n",
+ "print \"The value of V_GS = %0.1f Volt\" %V_GS\n",
+ "print \"The value of R_G2 = %0.1f M\u03a9\" %(R_G2*10**-6)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The value of R_D = 10.0 k\u03a9\n",
+ "The value of R_S = 10.0 k\u03a9\n",
+ "The value of V_OV = 1.0 Volt\n",
+ "The value of V_GS = 2.0 Volt\n",
+ "The value of R_G2 = 7.0 M\u03a9\n"
+ ]
+ }
+ ],
+ "prompt_number": 36
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 2.11 - page 110"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from __future__ import division\n",
+ "# Given data \n",
+ "V_DD= 15 # in V\n",
+ "KnWbyL= 0.25 # in mA/V**2\n",
+ "KnWbyL=KnWbyL*10**-3 # in A/V**2\n",
+ "Vt= 1.5 # in V\n",
+ "V_A= 50 # in V\n",
+ "R_D= 10 # in k\u03a9\n",
+ "R_D= R_D*10**3 # in \u03a9\n",
+ "R_L= 10 # in k\u03a9\n",
+ "R_L= R_L*10**3 # in \u03a9\n",
+ "R_G= 10 # in M\u03a9\n",
+ "R_G= R_G*10**6 # in \u03a9\n",
+ "# I_D= 1/2*KnWbyL*(V_D-Vt)**2 , (V_GS= V_D, as dc gate current is zero) (i)\n",
+ "# V_D= V_DD- I_D*R_D (ii)\n",
+ "I_D= 1.06 # in mA\n",
+ "I_D = I_D*10**-3 # in A\n",
+ "V_D= V_DD- I_D*R_D # in V\n",
+ "V_GS=V_D # in V\n",
+ "# The coordinates of operating point \n",
+ "V_GSQ= V_D # in V\n",
+ "I_DQ= I_D*10**3 # in mA\n",
+ "print \"The coordinates of operating point(bias point) are V_GSQ =\",V_GSQ,\"V and I_DQ =\",I_DQ,\"mA\"\n",
+ "gm= KnWbyL*(V_GS-Vt) # in A/V\n",
+ "r_o= V_A/I_D #in \u03a9\n",
+ "# The gain is : Av= vo/vi = -gm*(R_D||R_L||r_o)\n",
+ "Av= -gm*(R_D*R_L*r_o/(R_D*R_L+R_D*r_o+R_L*r_o)) # in V/V\n",
+ "print \"VOltage gain is %0.1f V/V\" %Av\n",
+ "# i_i= (vi-vo)/R_G\n",
+ "# i_i= vi/R_G*(1-vo/vi) and Rin= vi/i_i = R_G/(1-Av)\n",
+ "Rin= R_G/(1-Av) # in \u03a9\n",
+ "print \"The input resistance = %0.2f M\u03a9\" %(Rin*10**-6)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The coordinates of operating point(bias point) are V_GSQ = 4.4 V and I_DQ = 1.06 mA\n",
+ "VOltage gain is -3.3 V/V\n",
+ "The input resistance = 2.34 M\u03a9\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 2.12 - page 143"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from __future__ import division\n",
+ "from numpy import sqrt\n",
+ "# Given data \n",
+ "I_D= 0.5 # in mA\n",
+ "I_D= I_D*10**-3 # in mA\n",
+ "V_D= 3 # in V\n",
+ "Vt= -1 # in V\n",
+ "KpWbyL= 1 # in mA/V**2\n",
+ "KpWbyL=KpWbyL*10**-3 # in A/V**2\n",
+ "# Formul I_D= 1/2*KpWbyL*(V_OV)**2\n",
+ "V_OV= sqrt(2*I_D/KpWbyL) # in V\n",
+ "# For PMOS\n",
+ "V_OV= -V_OV # in V\n",
+ "V_GS= V_OV+Vt # in V\n",
+ "R_D= V_D/I_D # in \u03a9\n",
+ "V_Dmax= V_D+abs(Vt) # in V\n",
+ "R_D= V_Dmax/I_D # in \u03a9 \n",
+ "print \"\"\"The largest value that R_D can have\n",
+ "while maintaining saturation-region operation is %0.2f k\u03a9\"\"\" %(R_D*10**-3)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The largest value that R_D can have\n",
+ "while maintaining saturation-region operation is 8.00 k\u03a9\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 2.14 - page 145"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from __future__ import division\n",
+ "# Given data \n",
+ "V_GS1= 1.5 # in V\n",
+ "Vt= 1 # in V\n",
+ "r_DS1= 1 # in k\u03a9\n",
+ "r_DS1= r_DS1*10**3 # in \u03a9\n",
+ "r_DS2= 200 # in k\u03a9\n",
+ "# r_DS1= 1/(KnWbyL*(V_GS1-Vt)) (i)\n",
+ "# r_DS2= 1/(KnWbyL*(V_GS2-Vt)) (i)\n",
+ "# dividing equation (i) by (ii)\n",
+ "V_GS2= (r_DS1/r_DS2)*(V_GS1-Vt)+Vt # in V\n",
+ "print \"To Optain rDS= 200, The value of V_GS should be %0.2f Volt\" %V_GS2\n",
+ "# For V_GS= 1.5 # V\n",
+ "# W2= 2*W1 \n",
+ "# r_DS1/r_DS2= 2\n",
+ "r_DS2= r_DS1/2 # in \u03a9\n",
+ "print \"For V_GS= 1.5 V , the value of r_DS2 = %0.1f \u03a9 \" %r_DS2\n",
+ "# For V_GS= 3.5 V\n",
+ "r_DS2= 200/2 # in \u03a9\n",
+ "print \"For V_GS= 3.5 V , the value of r_DS2 = %0.1f \u03a9\" %r_DS2"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "To Optain rDS= 200, The value of V_GS should be 3.50 Volt\n",
+ "For V_GS= 1.5 V , the value of r_DS2 = 500.0 \u03a9 \n",
+ "For V_GS= 3.5 V , the value of r_DS2 = 100.0 \u03a9\n"
+ ]
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 2.15 page 146"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from __future__ import division\n",
+ "from numpy import sqrt\n",
+ "# Given data \n",
+ "I_D= 0.2 # in mA\n",
+ "I_D= I_D*10**-3 # in mA\n",
+ "Vt= 1 # in V\n",
+ "KpWbyL= 0.1 # in mA/V**2\n",
+ "KpWbyL=KpWbyL*10**-3 # in A/V**2\n",
+ "# Formul I_D= 1/2*KpWbyL*(V_GS-VT)**2\n",
+ "V_GS= sqrt(2*I_D/KpWbyL)+Vt # in V\n",
+ "V_DSmin= V_GS-Vt # in V\n",
+ "print \"Required V_GS = %0.1f Volt\" %V_GS\n",
+ "print \"The minimum required V_DS = %0.1f Volt\" %V_DSmin\n",
+ "# For I_D= 0.8 mA\n",
+ "I_D = 0.8*10**-3 # in A\n",
+ "V_GS= sqrt(2*I_D/KpWbyL)+Vt # in V\n",
+ "V_DSmin= V_GS-Vt # in V\n",
+ "print \"Required V_GS = %0.1f Volt\" %V_GS\n",
+ "print \"The minimum required V_DS = %0.1f Volt\" %V_DSmin"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Required V_GS = 3.0 Volt\n",
+ "The minimum required V_DS = 2.0 Volt\n",
+ "Required V_GS = 5.0 Volt\n",
+ "The minimum required V_DS = 4.0 Volt\n"
+ ]
+ }
+ ],
+ "prompt_number": 14
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 2.16 - page 147"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from __future__ import division\n",
+ "from numpy import sqrt\n",
+ "# Given data \n",
+ "V_SS= -5 # in V\n",
+ "unCox= 60 # in \u00b5A/V**2\n",
+ "unCox= unCox*10**-6 # in A/V**2\n",
+ "Vt= 1 # in V\n",
+ "W= 100 # in \u00b5m\n",
+ "L= 3 # in \u00b5m\n",
+ "V_G=0 # in V\n",
+ "V_DD= 5 # in V\n",
+ "V_D=0 #in V\n",
+ "I_D= 1*10**-3 # in A\n",
+ "# I_D= (V_DD-V_D)/R_D\n",
+ "R_D= (V_DD-V_D)/I_D # in \u03a9\n",
+ "print \"The value of R_D = %0.f k\u03a9\" %(R_D*10**-3)\n",
+ "# Formul I_D= 1/2*unCox*W/L*(V_GS-Vt)**2\n",
+ "V_GS= sqrt(2*I_D*L/(unCox*W))+Vt # in V\n",
+ "V_S= V_G-V_GS # in V\n",
+ "R_S= (V_S-V_SS)/I_D # in \u03a9\n",
+ "print \"The resistance = %0.f k\u03a9\" %(R_S*10**-3)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The value of R_D = 5 k\u03a9\n",
+ "The resistance = 3 k\u03a9\n"
+ ]
+ }
+ ],
+ "prompt_number": 15
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 2.17 - page 148"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from __future__ import division\n",
+ "from numpy import sqrt\n",
+ "# Given data \n",
+ "V_D= 3.5 # in V\n",
+ "I_D= 115*10**-6 #in A\n",
+ "upCox= 60 # in \u00b5A/V**2\n",
+ "upCox= upCox*10**-6 # in A/V**2\n",
+ "L= 0.8 #in \u00b5m\n",
+ "V_GS= -1.5 # in V\n",
+ "Vt= 0.7 # in V\n",
+ "R= V_D/I_D # in \u03a9\n",
+ "print \"The value required for R = %0.1f k\u03a9\" %(R*10**-3)\n",
+ "# Formul I_D= 1/2*upCox*W/L*(V_GS-Vt)**2\n",
+ "W= 2*I_D*L/(upCox*(V_GS-Vt)**2)\n",
+ "print \"The value required for W = %0.1f \u00b5m\" %(W)\n",
+ "\n",
+ "# Note: Calculation of evaluating the value of W in the book is wrong , so the Answer of the book is wrong "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The value required for R = 30.4 k\u03a9\n",
+ "The value required for W = 0.6 \u00b5m\n"
+ ]
+ }
+ ],
+ "prompt_number": 17
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 2.18 - page 149"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from __future__ import division\n",
+ "from numpy import sqrt\n",
+ "# Given data \n",
+ "Vt= 1 # in V\n",
+ "unCox= 120 # in \u00b5A/V**2\n",
+ "unCox= unCox*10**-6 # in A/V**2\n",
+ "L1=1 # in \u00b5m\n",
+ "L2=L1 # in \u00b5m\n",
+ "I_D= 120 #in \u00b5A\n",
+ "I_D= I_D*10**-6 #in A\n",
+ "V_GS1= 1.5 #in V\n",
+ "V_G2= 3.5 # in V\n",
+ "V_S2= 1.5 # in V\n",
+ "V_DD= 5 # in V\n",
+ "V_D2= 3.5 # in V\n",
+ "# Formul I_D= 1/2*unCox*W/L*(V_GS1-Vt)**2\n",
+ "W1= 2*I_D*L1/(unCox*(V_GS1-Vt)**2) # in \u00b5m\n",
+ "print \"The value of W1 = %0.1f \u00b5m\" %W1\n",
+ "V_GS2= V_G2-V_S2 #in V\n",
+ "# Formul I_D= 1/2*unCox*W/L*(V_GS1-Vt)**2\n",
+ "W2= 2*I_D*L2/(unCox*(V_GS2-Vt)**2) # in \u00b5m\n",
+ "print \"The value of W2 = %0.1f \u00b5m\" %W2\n",
+ "R= (V_DD-V_D2)/I_D # in \u03a9\n",
+ "print \"Resistance = %0.1f k\u03a9\" %(R*10**-3) "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The value of W1 = 8.0 \u00b5m\n",
+ "The value of W2 = 2.0 \u00b5m\n",
+ "Resistance = 12.5 k\u03a9\n"
+ ]
+ }
+ ],
+ "prompt_number": 18
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 2.19 - page 150"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from __future__ import division\n",
+ "from numpy import sqrt\n",
+ "# Given data \n",
+ "Vt= 2 # in V\n",
+ "K1WbyL= 1 # in mA/V**2\n",
+ "K1WbyL= K1WbyL*10**-3 #in mA/V**2\n",
+ "I_D= 10 #in \u00b5A\n",
+ "I_D= I_D*10**-6 #in A\n",
+ "V_DD= 10 # in V\n",
+ "R_D= 4 # in k\u03a9\n",
+ "R_D= R_D*10**3 # in \u03a9\n",
+ "\n",
+ "# Formul I_D= 1/2*K1WbyL*(V_GS-Vt)**2\n",
+ "V_GS= sqrt(2*I_D/K1WbyL)+Vt # in V\n",
+ "V1= -V_GS # in V\n",
+ "# Part (b)\n",
+ "I_D= 2 # in mA\n",
+ "I_D= I_D*10**-3 # in A\n",
+ "V2= V_DD-I_D*R_D #in V\n",
+ "# Formul I_D= 1/2*K1WbyL*(V_GS-Vt)**2\n",
+ "V_GS= sqrt(2*I_D/K1WbyL)+Vt # in V\n",
+ "V3= -V_GS # in V\n",
+ "# Part (c)\n",
+ "I_D= 1 # in mA\n",
+ "I_D= I_D*10**-3 # in A\n",
+ "# Formul I_D= 1/2*K1WbyL*(V_GS-Vt)**2\n",
+ "V_GS= sqrt(2*I_D/K1WbyL)+Vt # in V\n",
+ "V4= V_GS # in V\n",
+ "# Part (d)\n",
+ "I_D= 2 # in mA\n",
+ "R_D= 2.5 # in k\u03a9\n",
+ "R_D= R_D*10**3 # in \u03a9\n",
+ "V_SS= 10 # in V\n",
+ "I_D= I_D*10**-3 # in A\n",
+ "V_GS= sqrt(2*I_D/K1WbyL)+Vt # in V\n",
+ "V5= -V_SS+I_D*R_D # in V\n",
+ "print \"The value of V1 = %0.2f Volt\" %V1\n",
+ "print \"The value of V2 = %0.f Volt\" %V2\n",
+ "print \"The value of V3 = %0.f Volt\" %V3\n",
+ "print \"The value of V4 = %0.2f Volt\" %V4\n",
+ "print \"The value of V5 = %0.f Volt\" %V5"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The value of V1 = -2.14 Volt\n",
+ "The value of V2 = 2 Volt\n",
+ "The value of V3 = -4 Volt\n",
+ "The value of V4 = 3.41 Volt\n",
+ "The value of V5 = -5 Volt\n"
+ ]
+ }
+ ],
+ "prompt_number": 23
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 2.20 - page 152"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from __future__ import division\n",
+ "# Given data \n",
+ "unCox= 20*10**-6 #in A/V**2\n",
+ "upCox= unCox/2.5 # in A/V**2\n",
+ "V_DD= 3 #in V\n",
+ "Vt= 1 # in V\n",
+ "W= 30 # in \u00b5m\n",
+ "L= 10 # in \u00b5m\n",
+ "\n",
+ "# V_GS1= V_GS2\n",
+ "# Formula V_DD= V_GS1+V_GS2\n",
+ "V_GS1= V_DD/2 #in V\n",
+ "V_GS2= V_GS1 # in V\n",
+ "V2= V_GS1 # inV\n",
+ "I1= 1/2*unCox*W/L*(V_GS1-Vt)**2 # in A\n",
+ "# Both transistor have V_D = V_G and therefore they are operating in saturation \n",
+ "#1/2*unCox*W/L*(V4-Vt)**2 = 1/2*upCox*W/L*(V_DD-V4-Vt)\n",
+ "V4= (V_DD-Vt+sqrt(unCox/upCox))/(1+sqrt(unCox/upCox)) \n",
+ "I3= 1/2*unCox*W/L*(1.39-Vt)**2 \n",
+ "print \"The value of V2 = %0.1f Volt\" %V2\n",
+ "print \"The value of I1 = %0.1f \u00b5A\" %(I1*10**6,)\n",
+ "print \"The value of V4 = %0.1f Volt \" %V4\n",
+ "print \"The value of I3 = %0.1f \u00b5A\" %(I3*10**6)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The value of V2 = 1.5 Volt\n",
+ "The value of I1 = 7.5 \u00b5A\n",
+ "The value of V4 = 1.4 Volt \n",
+ "The value of I3 = 4.6 \u00b5A\n"
+ ]
+ }
+ ],
+ "prompt_number": 24
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 2.22 - page 155"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from __future__ import division\n",
+ "from numpy import sqrt\n",
+ "# Given data \n",
+ "Vt= 0.9 # in V\n",
+ "V_A= 50 # in V\n",
+ "V_D= 2 # in V\n",
+ "R_L= 10 # in M\u03a9\n",
+ "R_L= R_L*10**3 # in \u03a9\n",
+ "R_G= 10 # in M\u03a9\n",
+ "R_G= R_G*10**6 # in \u03a9\n",
+ "I_D= 500 # in \u00b5A\n",
+ "I_D= I_D*10**-6 # in A\n",
+ "V_GS= V_D # in V\n",
+ "ro= V_A/I_D # in \u03a9\n",
+ "gm= 2*I_D/(V_GS-Vt) # in A/V\n",
+ "# vo= -gm*vi*(ro || R_L)\n",
+ "vo_by_vi = -gm*(ro*R_L/(ro+R_L)) # in V/V\n",
+ "print \"The voltage gain = %0.1f V/V\" %(vo_by_vi )\n",
+ "# For I= 1 mA or twice the current \n",
+ "I_D1= I_D # in A\n",
+ "I_D2= 2*I_D1 # in A\n",
+ "gm1= gm # in A/V\n",
+ "# Effect on V_D\n",
+ "# I_D1/I_D2 = (V_GS1-Vt)**2/(V_GS2-Vt)**2\n",
+ "V_GS1= V_GS \n",
+ "V_GS2= Vt+sqrt(2)*(V_GS1-Vt) # in V\n",
+ "print \"The new value of V_GS = %0.1f Volt\" %(V_GS2)\n",
+ "# Effect on gm\n",
+ "# gm1/gm2= sqrt(I_D1/I_D2)\n",
+ "gm2= sqrt(I_D2/I_D1)*gm1 # in A/V\n",
+ "print \"The new value of gm2 = %0.1f mA/V\" %(gm2*10**3)\n",
+ "# Effect on ro\n",
+ "# ro1/ro2= I_D2/I_D1\n",
+ "ro1= ro # in \u03a9\n",
+ "ro2= I_D1*ro1/I_D2 # in \u03a9\n",
+ "print \"The new value of ro = %0.1f k\u03a9/V\" %(ro2*10**-3)\n",
+ "# Effect on gain\n",
+ "# Av= -gm*(ro2 || R_L)\n",
+ "Av= -gm*(ro2*R_L/(ro2+R_L)) # in V/V\n",
+ "print \"The new value of voltage gain = %0.1f V/V\" %(Av)\n",
+ "#Answer wrong in the textbook because of calculation accuracy."
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The voltage gain = -8.3 V/V\n",
+ "The new value of V_GS = 2.5 Volt\n",
+ "The new value of gm2 = 1.3 mA/V\n",
+ "The new value of ro = 50.0 k\u03a9/V\n",
+ "The new value of voltage gain = -7.6 V/V\n"
+ ]
+ }
+ ],
+ "prompt_number": 26
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 2.23 - page 157"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from __future__ import division\n",
+ "from numpy import pi\n",
+ "# Given data \n",
+ "I_D= 1 # in mA\n",
+ "I_D= I_D*10**-3 # in A\n",
+ "gm= 1 #in mA/V\n",
+ "gm= gm*10**-3 #in A/V\n",
+ "f_L= 10 # in Hz\n",
+ "R_S= 6 # in k\u03a9\n",
+ "R_S= R_S*10**3 # in \u03a9\n",
+ "R_D= 10 # in k\u03a9\n",
+ "R_D= R_D*10**3 # in \u03a9\n",
+ "vo_by_vi= -gm*R_D/(1+gm*R_S) # in V/V\n",
+ "print \"Mid band gain = %0.2f V/V \" %(vo_by_vi)\n",
+ "# Formula f_L= 1/(2*pi*(1/gm || R_S)) * CS\n",
+ "CS= 1/(2*pi*(1/gm*R_S/(1/gm+R_S))*f_L) #in F\n",
+ "print \"The value of Cs = %0.2f \u00b5F\" %(CS*10**6)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Mid band gain = -1.43 V/V \n",
+ "The value of Cs = 18.57 \u00b5F\n"
+ ]
+ }
+ ],
+ "prompt_number": 29
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 2.24 - page 159"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from __future__ import division\n",
+ "from numpy import pi\n",
+ "# Given data \n",
+ "Rsig= 100 # in k\u03a9\n",
+ "Rsig= Rsig*10**3 # in \u03a9\n",
+ "R_G= 4.7 # in M\u03a9\n",
+ "R_G= R_G*10**6 # in \u03a9\n",
+ "R_D= 15 # in k\u03a9\n",
+ "R_D= R_D*10**3 # in \u03a9\n",
+ "R_L= R_D # in \u03a9\n",
+ "gm= 1 #in mA/V\n",
+ "gm= gm*10**-3 #in A/V\n",
+ "ro=150 # in k\u03a9\n",
+ "ro=ro*10**3 # in \u03a9\n",
+ "Cgs= 1 # in pF\n",
+ "Cgs=Cgs*10**-12 #in F\n",
+ "Cgd= 0.4 # in pF\n",
+ "Cgd=Cgd*10**-12 #in F\n",
+ "vgsBYvsig= R_G/(Rsig+R_G) \n",
+ "Rdesh_L= R_D*R_L/(R_D+R_L) # in \u03a9\n",
+ "voBYvgs= -gm*Rdesh_L \n",
+ "Av= voBYvgs/vgsBYvsig # in V/V\n",
+ "print \"The Mid-band gain = %0.2f V/V\" %(Av)\n",
+ "CM= Cgd*(1+gm*Rdesh_L) # in F\n",
+ "# f_H= 1/(2*pi*(Rsig || R_G)*(Cgs*CM))\n",
+ "f_H= 1/(2*pi*(Rsig * R_G/(Rsig + R_G))*(Cgs+CM)) # in Hz\n",
+ "print \"Frequency = %0.1f kHz\" %(f_H*10**-3)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The Mid-band gain = -7.66 V/V\n",
+ "Frequency = 369.4 kHz\n"
+ ]
+ }
+ ],
+ "prompt_number": 32
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
diff --git a/Electronic_Circuits_by_P._Raja/Chapter3.ipynb b/Electronic_Circuits_by_P._Raja/Chapter3.ipynb
new file mode 100755
index 00000000..23be2dad
--- /dev/null
+++ b/Electronic_Circuits_by_P._Raja/Chapter3.ipynb
@@ -0,0 +1,1812 @@
+{
+ "metadata": {
+ "name": "",
+ "signature": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter3 - Bipolar Junction Transistors(BJTs)"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 3.1 - page 182"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from __future__ import division\n",
+ "# Given data \n",
+ "V_E= -0.7 # in V\n",
+ "Bita=50 \n",
+ "RC= 5 # in k\u03a9\n",
+ "RE= 10 # in k\u03a9\n",
+ "RE= RE*10**3 # in \u03a9\n",
+ "RC= RC*10**3 # in \u03a9\n",
+ "V_CC= 10 # in V\n",
+ "V_BE= -10 # in volt\n",
+ "I_E= (V_E-V_BE)/RE # in A\n",
+ "print \"Emitter current = %0.2f mA\" %(I_E*10**3)\n",
+ "# I_E= I_B+I_C and I_C= Bita*I_B, so\n",
+ "I_B= I_E/(1+Bita) # in A\n",
+ "print \"Base current = %0.1f \u00b5A\" %(I_B*10**6)\n",
+ "I_C= I_E-I_B #in A\n",
+ "print \"Collector current = %0.2f mA\" %(I_C*10**3)\n",
+ "V_C= V_CC-I_C*RC # in V\n",
+ "print \"The value of V_C = %0.2f Volt\" %(V_C)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Emitter current = 0.93 mA\n",
+ "Base current = 18.2 \u00b5A\n",
+ "Collector current = 0.91 mA\n",
+ "The value of V_C = 5.44 Volt\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 3.2 - page 183"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from __future__ import division\n",
+ "# Given data \n",
+ "V_E= 1.7 # in V\n",
+ "V_B= 1 # in V\n",
+ "RC= 5 # in k\u03a9\n",
+ "RE= 5 # in k\u03a9\n",
+ "RE= RE*10**3 # in \u03a9\n",
+ "RC= RC*10**3 # in \u03a9\n",
+ "RB= 100 #in k\u03a9\\\n",
+ "RB= RB*10**3 # in \u03a9\n",
+ "V_CC= 10 # in V\n",
+ "V_BE= -10 # in volt\n",
+ "I_E= (V_CC-V_E)/RE # in A\n",
+ "I_B= V_B/RB # in V\n",
+ "# Formula I_B= (1-alpha)*I_E\n",
+ "alpha= 1-I_B/I_E \n",
+ "print \"Value of alpha = %0.3f \" %(alpha)\n",
+ "beta= alpha/(1-alpha) \n",
+ "print \"Value of beta = %.01f \" %beta\n",
+ "V_C= (I_E-I_B)*RC-V_CC # in volt\n",
+ "print \"Collector voltage = %0.2f Volt\" %V_C\n",
+ "# Answer in the textbook is not accurate."
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Value of alpha = 0.994 \n",
+ "Value of beta = 165.0 \n",
+ "Collector voltage = -1.75 Volt\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 3.3 - page 187"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from __future__ import division# Given data \n",
+ "from numpy import log\n",
+ "# Given data\n",
+ "V_CC= 10 # in V\n",
+ "V_CE= 3.2 # in V\n",
+ "RC= 6.8 # in k\u03a9\n",
+ "RC= RC*10**3 # in \u03a9\n",
+ "I_S= 1*10**-15 # in A\n",
+ "V_T= 25*10**-3 # in V\n",
+ "I_C1= (V_CC-V_CE)/RC # in A\n",
+ "print \"Part(a) : \"\n",
+ "# Formula I_C= I_S*%e**(V_BE1/V_T)\n",
+ "V_BE1= V_T*log(I_C1/I_S) # in volt\n",
+ "print \"Collector current = %0.1f mA\" %(I_C1*10**3)\n",
+ "print \"Value of V_BE = %0.1f Volt\" %(V_BE1)\n",
+ "\n",
+ "print \"Part(b) : \"\n",
+ "v_in= 5*10**-3 # in V\n",
+ "Av= -(V_CC-V_CE)/V_T # in V/V\n",
+ "print \"Voltage gain = %0.1f V/V\" %(Av)\n",
+ "v_o= abs(Av )*v_in # in V\n",
+ "print \"Change in output voltage = %0.2f Volt\" %v_o\n",
+ "\n",
+ "print \"Part(c) : \"\n",
+ "#for V_CE= 0.3 V\n",
+ "V_CE= 0.3 # in V\n",
+ "I_C2= (V_CC-V_CE)/RC # in A\n",
+ "# I_C1= I_S*%e**(V_BE1/V_T) (i)\n",
+ "# I_C2= I_S*%e**(V_BE2/V_T) (ii)\n",
+ "# divide the equation (ii) by (i)\n",
+ "delta_V_BE= V_T*log(I_C2/I_C1) # in volt ( where delta_V_BE = V_BE2-V_BE1 )\n",
+ "print \"The positive increament in V_BE = %0.1f mV\" %(delta_V_BE*10**3)\n",
+ "\n",
+ "print \"Part(d) : \"\n",
+ "v_o= 0.99*V_CC # in V\n",
+ "I_C3= (V_CC-v_o)/RC # in A\n",
+ "delta_V_BE= V_T*log(I_C3/I_C1) # in V\n",
+ "print \"The negative increament in V_BE = %0.1f mV\" %(delta_V_BE*10**3 )"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Part(a) : \n",
+ "Collector current = 1.0 mA\n",
+ "Value of V_BE = 0.7 Volt\n",
+ "Part(b) : \n",
+ "Voltage gain = -272.0 V/V\n",
+ "Change in output voltage = 1.36 Volt\n",
+ "Part(c) : \n",
+ "The positive increament in V_BE = 8.9 mV\n",
+ "Part(d) : \n",
+ "The negative increament in V_BE = -105.5 mV\n"
+ ]
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 3.4 - page 197"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from __future__ import division\n",
+ "# Given data \n",
+ "V_CC= 10 # in V\n",
+ "V_CE= 5 # in V\n",
+ "V_BE= 0.7 # in V\n",
+ "I_C= 5*10**-3 # in mA\n",
+ "bita= 100 \n",
+ "R_C= (V_CC-V_CE)/I_C # in \u03a9\n",
+ "I_B= I_C/bita # in A\n",
+ "R_B= (V_CC-V_BE)/I_B # in \u03a9\n",
+ "print \"The value of R_C = %0.1f k\u03a9\" %(R_C*10**-3)\n",
+ "print \"The value of I_B = %0.1f \u00b5A\" %(I_B*10**6)\n",
+ "print \"The value of R_B = %.01f k\u03a9\" %(R_B*10**-3)\n",
+ "\n",
+ "# Note: The value of base current in the book is wrong"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The value of R_C = 1.0 k\u03a9\n",
+ "The value of I_B = 50.0 \u00b5A\n",
+ "The value of R_B = 186.0 k\u03a9\n"
+ ]
+ }
+ ],
+ "prompt_number": 14
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 3.5 - page 197"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "%matplotlib inline\n",
+ "from matplotlib.pyplot import plot, text, xlabel, ylabel, show, axes, title, gca\n",
+ "from __future__ import division\n",
+ "from numpy import arange, nditer\n",
+ "# Given data \n",
+ "V_CC= 6 # in V\n",
+ "bita= 100 \n",
+ "R_C= 2 # in k\u03a9\n",
+ "R_C= R_C*10**3 # in \u03a9\n",
+ "R_B= 530 # in k\u03a9\n",
+ "R_B= R_B*10**3 # in \u03a9\n",
+ "# when I_C=0\n",
+ "I_C=0 \n",
+ "V_CE= V_CC-I_C*R_C # in volt\n",
+ "V_CE= arange(0,7,0.1) # in Volt\n",
+ "# defining function to get the collector current\n",
+ "def current(V):\n",
+ " it = nditer([V, None])\n",
+ " for v_ce,i in it:\n",
+ " i[...] = (V_CC-v_ce)/R_C*1000 \n",
+ " return it.operands[1]\n",
+ "I_C=current(V_CE) # in mA\n",
+ "x=arange(-1,4,0.1)\n",
+ "y=arange(-0.5,1.02,0.1)\n",
+ "plot(V_CE,I_C) \n",
+ "plot(4*(y/y),y,'--')\n",
+ "plot(x,1*(x/x),'--')\n",
+ "text(4,1.02,'Operating Point')\n",
+ "title(\"DC load line\")\n",
+ "xlabel(\"V_CE in volts\")\n",
+ "ylabel(\"I_C in mA\")\n",
+ "# Setting axes\n",
+ "axes = gca()\n",
+ "axes.set_xlim([0,6])\n",
+ "axes.set_ylim([0,3])\n",
+ "show()\n",
+ "print \"DC load line shown in figure\"\n",
+ "# When V_CE= 0\n",
+ "I_C= V_CC/R_C #in A\n",
+ "# Operating point for silicon transistor \n",
+ "V_BE= 0.7 # in V\n",
+ "I_B= (V_CC-V_BE)/R_B #in A\n",
+ "I_CQ= bita*I_B # in A\n",
+ "V_CEQ= V_CC-I_CQ*R_C # in volt\n",
+ "print \"Operating point is \",V_CEQ,\" V and \",I_CQ*10**3,\" mA\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "metadata": {},
+ "output_type": "display_data",
+ "png": "iVBORw0KGgoAAAANSUhEUgAAAYIAAAEaCAYAAAAcz1CnAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3X28lWWd7/HPV7eOKSiC5aSh5igeFHkQ1J2mbHXCp3wY\nNctzKtEj0iSTOdYpdE7gTDKjvo6S9coHGhWdxITsQVObEraFhRqCAlKGKT4l04iJHnCOyO/8cd9r\nu1isvfba7Pve6+n7fr3Wq/VwrX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\n",
+ "Operating point is 4.0 V and 1.0 mA\n"
+ ]
+ }
+ ],
+ "prompt_number": 15
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 3.6 - page 203"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from __future__ import division\n",
+ "# Given data \n",
+ "V_CC= 12 # in V\n",
+ "V_BE= 0.7 # in V\n",
+ "bita= 100 \n",
+ "R_C= 10 # in k\u03a9\n",
+ "R_C= R_C*10**3 # in \u03a9\n",
+ "R_B= 100 # in k\u03a9\n",
+ "R_B= R_B*10**3 # in \u03a9\n",
+ "I_BQ= (V_CC-V_BE)/((1+bita)*R_C+R_B) # in A\n",
+ "I_CQ= bita*I_BQ # in A\n",
+ "V_CEQ= V_CC-(I_CQ+I_BQ)*R_C # in volt\n",
+ "# For dc load line\n",
+ "# When\n",
+ "I_C=0 \n",
+ "V_CE= V_CC-(I_C+I_BQ)*R_C # in volt\n",
+ "# When\n",
+ "V_CE= 0 \n",
+ "I_C= (V_CC-I_BQ*R_C)/R_C #in A\n",
+ "print \"Q- point values for circuit is\",round(V_CEQ,2),\"V and\",round(I_CQ*10**3),\"mA\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Q- point values for circuit is 1.72 V and 1.0 mA\n"
+ ]
+ }
+ ],
+ "prompt_number": 16
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 3.7 - page 204"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from __future__ import division\n",
+ "# Given data \n",
+ "V_CC= 15 # in V\n",
+ "V_BE= 0.7 # in V\n",
+ "V_CE= 5 # in V\n",
+ "I_C= 5 # in mA\n",
+ "I_C=I_C*10**-3 # in A\n",
+ "bita= 100 \n",
+ "I_B= I_C/bita # in A\n",
+ "print \"Base current = %0.f \u00b5A\" %(I_B*10**6)\n",
+ "#Apply KVL to collector circuit , V_CC= (I_C+I_B)*R_C+V_CE\n",
+ "R_C= (V_CC-V_CE)/(I_C+I_B) # in \u03a9\n",
+ "print \"The value of R_C = %0.2f k\u03a9\" %(R_C*10**-3)\n",
+ "#Apply KVL to base or input circuit, V_CC= (I_C+I_B)*R_C+V_CE + I_B*R_B\n",
+ "R_B= (V_CC-V_BE-(I_C+I_B)*R_C)/I_B # in ohm\n",
+ "print \"The value of R_B = %0.f k\u03a9 \" %(R_B*10**-3)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Base current = 50 \u00b5A\n",
+ "The value of R_C = 1.98 k\u03a9\n",
+ "The value of R_B = 86 k\u03a9 \n"
+ ]
+ }
+ ],
+ "prompt_number": 17
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 3.8 - page 205"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from __future__ import division\n",
+ "# Given data \n",
+ "V_BE= 0.7 # in V\n",
+ "V_CE= 3 # in V\n",
+ "I_C= 1 # in mA\n",
+ "I_C=I_C*10**-3 # in A\n",
+ "bita= 100 \n",
+ "I_B= I_C/bita # in A\n",
+ "# V_CE= V_BE+V_CB and V_CB= I_B*R_B\n",
+ "R_B= (V_CE-V_BE)/I_B # in \u03a9\n",
+ "print \"The value of R_B = %0.f k\u03a9\" %(R_B*10**-3)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The value of R_B = 230 k\u03a9\n"
+ ]
+ }
+ ],
+ "prompt_number": 18
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 3.9 - page 208"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "%matplotlib inline\n",
+ "# Exa 3.9\n",
+ "from numpy import nditer, arange\n",
+ "from matplotlib.pyplot import plot, text, xlabel, ylabel, show, axes, title, gca\n",
+ "# Given data \n",
+ "R1= 10;# in k\u03a9\n",
+ "R1=R1*10**3;# in \u03a9\n",
+ "R2= 5;# in k\u03a9\n",
+ "R2=R2*10**3;# in \u03a9\n",
+ "RC= 1;# in k\u03a9\n",
+ "RC=RC*10**3;# in \u03a9\n",
+ "RE= 2;# in k\u03a9\n",
+ "RE=RE*10**3;# in \u03a9\n",
+ "V_CC= 15;# in V\n",
+ "V_BE= 0.7;# in V\n",
+ "# When\n",
+ "I_C=0;\n",
+ "V_CE= V_CC-I_C*(RC+RE);# in V\n",
+ "# When V_CE= 0\n",
+ "I_C= V_CC/(RC+RE);# in A\n",
+ "V_B= V_CC*R2/(R1+R2);# in V\n",
+ "I_E= (V_B-V_BE)/RE;# in A\n",
+ "I_C= I_E;# in A (approx)\n",
+ "I_CQ= I_C;# in A\n",
+ "V_CE= V_CC-I_C*(RC+RE);# in V\n",
+ "V_CEQ= V_CE;# in V\n",
+ "#############\n",
+ "V_CE= arange(0,16,0.1);# in Volt\n",
+ "def current(v):\n",
+ " it = nditer([v, None])\n",
+ " for x,y in it:\n",
+ " y[...]= (V_CC-x)/(RC+RE)*1000\n",
+ " return it.operands[1]\n",
+ "I_C = current(V_CE)\n",
+ "\n",
+ "#I_C= (V_CC-V_CE)/(RC+RE)*1000;# in mA\n",
+ "plot(V_CE,I_C);\n",
+ "title(\"DC load line\")\n",
+ "xlabel(\"V_CE in volts\")\n",
+ "ylabel(\"I_C in mA\")\n",
+ "text(8.55,2.15,'Q(8.55V,2.15mA)')\n",
+ "x1=arange(0,8.55,0.01)\n",
+ "y1=arange(0,2.15,0.01)\n",
+ "a=arange(0,8.55,0.01)\n",
+ "yd=2.15*(a/a)\n",
+ "plot(a,yd,'b--')\n",
+ "b=arange(-1,2.15,0.005)\n",
+ "xd=8.55*(b/b)\n",
+ "plot(xd,b,'b--')\n",
+ "show()\n",
+ "print \"DC load line shown in figure\"\n",
+ "print 'Operating point is ',V_CEQ,\" V and \",I_CQ*10**3,\" mA\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "metadata": {},
+ "output_type": "display_data",
+ "png": "iVBORw0KGgoAAAANSUhEUgAAAYMAAAEaCAYAAADzDTuZAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3XuYFPWV//H3QYKiKAoBQRRBBQUGBlCIGiKDkpUgovy8\nBVZEdLNR4y2oiWjyDF7iJeqKiJE1xusvIkYjRkHBC6MoIiCICILRyAqCYsBwEV25nP2jasaeoWem\nZ6a7q7r783qefuyprq46INOnv+db9T3m7oiISGFrFHUAIiISPSUDERFRMhARESUDERFByUBERFAy\nEBERlAxEMLNzzWx2ho6908wOqea1MjM7P3z+72Y2IxMxiKRCyUByipmtNLOtZrbJzL40szfM7Odm\nZlX262tm08N91pvZW2Z2bkRhV8fDB+7+Z3c/MeJ4pIApGUiucWCIu+8DtAduAX4N/Kl8BzM7BngZ\nmAUc6u4tgQuBQdkPVyQ3KBlIznL3ze7+LHAWMMrMuoYv3QY85O63ufuGcN+F7v7TVI5rZsea2Xwz\n+5eZzQuTS/lro81sWTgy+cjM/rPKe68yszVmttrMzkv1z1K1VBWWl35uZh+Eo5uJVfY/L4xjg5m9\nYGbtUz2XSDJKBpLz3H0+sBr4kZntCRwNPFmfY5lZC2AaMB5oAfwXMC3cDvA5cFI4MhkN3GlmvcL3\nDgKuAAYCncP/NsRJwFFAD+BMMzsxPM8pwFhgGPB9YDYwuYHnkgKnZCD5Yg3Bh/d+BP+u19bzOCcB\nK8Ia/k53fxxYDpwM4O7T3f3j8PlrwEzgR+F7zwQecPdl7r4VKK33nyZwi7tvcvdVBCWv4nD7BcDN\n7r7C3XcCNwM9zeygBp5PCpiSgeSLA4EN4WMn0LaexzkA+KTKtv8Jt2NmPzGzueGk9JfAY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vnlbAsvXVqyZAnnnXceAP/85z8ZNGgQ\nPXv2pKioiIceeijp8c4991wOOeQQevXqRa9evXj33XcBKCsro3nz5hXbb7zxRgAGDBjAzJkzKx1j\n/PjxXHTRRZW2rVq1igEDBtCtWzeKioqYMGFC0vMvX76cY445hj322IM77rij0msdOnSgR48e9OrV\ni759+9btLyo0depUGjVqxIoVKyq2ff755wwePLhex5MauHutD2AmsFcq+6b7EYQoEi+rV7sPH+7e\nvr37E0+479xZ+3t27tzpffr08Yceesjd3Xfs2OHnn3++X3XVVe7uPnLkSJ83b567u5eWlvrVV1/t\n7u5ffPGFt2jRwrdt27bLMc8991x/6qmndtk+a9YsP/nkk3fZft999/no0aMrbTv66KN99uzZlbat\nXbvWFy1a5O7umzdv9s6dO/uyZct2Od66det8/vz5fu211/rtt99e6bUOHTr4+vXrk/9lpOjMM8/0\nk08+2UtLSyttHzFihL/99tsNOna+Cz87U/6sTXVkcDXwppn9t5ndHT6Sf1UQKQDt2gV3Lz/yCNxw\nAwwcGEw41+SVV16hadOmjBo1CoBGjRpx55138sADD7Bp0ybmzp1Lnz59AGjbti2bNm0CYNOmTbRs\n2ZLGjRsnPa5XU0ZNtv20005j2rRpbN++HYCVK1eyZs0a+vXrV2m/Nm3a0LNnTwCaNWtGly5dWLNm\nzS7Ha9WqFUcddRTf+973Uo6hpKSEMWPG0KdPH7p06cL8+fMZNmwYnTt35re//W3Fflu2bOGtt95i\n4sSJTJkypdIxhg4dyuTJk5OeU+on1WRwH/ASMBdYALwdPkQKWl16JyxdupQjjzyy0ra9996b9u3b\n8+6773L44YdXbP/Zz37G0qVLOeCAAyguLuauu+6qNoaxY8dSXFzMmDFj+Pbb4J5QM2POnDkUFxcz\nePBgloWZqkWLFvTt25fp06cD8Pjjj3PWWWfV+GdcuXIlixYt4gc/+EGtfx+JzIyBAwdy1FFH8cc/\n/rHS9t1335358+dz4YUXcsoppzBp0iTee+89HnroIb788ksAnnnmGQYNGkT79u1p1aoVCxcurDhG\n3759ee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KSw9kkfqYTLC8xsyEbWcRLGmw\nCzPbA3iOoAfFtHBbf6AVwd2kr7n7yTWd0N1PSkPcNZ6C7+5svQx4FPg6w+cU0chActpTwElhT4Hy\nZcQPcPfXq9l/BMECc9PKN7j7q+6+lBRXnzSzlWHnsA5hF6n7wk5SM8Jkk7hvczNbmfDzXmb2iQUd\n53qGywuXd/Xat/Jb7RKCFVFnmdnLZtYoHDUsMbN3zezyVOIVSZWSgeSssK/APIJVLiEYJUyp4S3d\ngLdreP1HVcpEHZOdNuH5YcDEsJPUv4DTqsS3EXjHzErCTUOAF9x9B8HaRleFXb2WUHlZZHf3uwl6\nJZS4+wkEvTIOcPfu7t6DoLuVSNooGUiuKy8VQVAimlzL/jWNAGa7e6+Ex8e1HOvjhCYnbxMsb1zV\nlDAuwjinhB3dmocdqiDoPnZcLef6iGDhsQlmdiJBtzWRtFEykFz3N+AEM+sF7Bk28KnOUuDINJ77\nfxOe7yD5HNyzwCAz24+gN8MrSfaptUTl7v8iWMW1DLiAoH2pSNooGUhOCzvLzSIom9TWGesx4Fgz\nKy8rYWbHmVm3DMc3H5gAPOuBjcCXZtYv3G0kwYd8VZuBfcI4WwKN3f2vwG+JZ9MfyWG6mkjywWSC\nrk5n1rSTu38TtgAdb2bjCZraLyZoYfl9wjmDhLfcEH74VjpMNc+T/VxuCkHbwZKEbaOASWErxY+A\nqmvlQ9Aj4QUz+xT4JfCgmZV/gYtdO1DJbepnICIiKhOJiIjKRJKHzKw7waWbib5x92OiiEckF6hM\nJCIiKhOJiIiSgYiIoGQgIiIoGYiICEoGIiIC/B9eQEZhSVTJsAAAAABJRU5ErkJggg==\n",
+ "text": [
+ "<matplotlib.figure.Figure at 0x7f861bd2dcd0>"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "DC load line shown in figure\n",
+ "Operating point is 8.55 V and 2.15 mA\n"
+ ]
+ }
+ ],
+ "prompt_number": 19
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 3.10 page 220"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from __future__ import division\n",
+ "# Given data \n",
+ "V_CC= 10 # in V\n",
+ "V_BB= 3 # in V\n",
+ "V_BE= 0.7 # in V\n",
+ "V_T= 25*10**-3 # in V\n",
+ "bita=100 \n",
+ "RC= 3 # in k\u03a9\n",
+ "RC=RC*10**3 # in \u03a9\n",
+ "RB= 100 # in k\u03a9\n",
+ "RB=RB*10**3 # in \u03a9\n",
+ "I_B= (V_BB-V_BE)/RB # in V\n",
+ "I_C= bita*I_B # in A\n",
+ "V_C= V_CC-I_C*RC # in V\n",
+ "gm= I_C/V_T # in A/V\n",
+ "r_pi= bita/gm # in \u03a9\n",
+ "# v_be= r_pi/(RB+r_pi)*v_i\n",
+ "v_be_by_v_i= r_pi/(RB+r_pi) \n",
+ "# v_o= -gm*v_be*RC\n",
+ "v_o_by_v_i= -gm*v_be_by_v_i*RC # in V/V\n",
+ "Av= v_o_by_v_i # in V/V\n",
+ "print \"Voltage gain = %0.2f V/V \" % (round(Av))\n",
+ "# Answer in the book is not accurate."
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Voltage gain = -3.00 V/V \n"
+ ]
+ }
+ ],
+ "prompt_number": 20
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 3.11 - page 253"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from __future__ import division\n",
+ "# Given data \n",
+ "V_B= 4 # in V\n",
+ "V_BE= 0.7 # in V\n",
+ "V_CC= 10 # in V\n",
+ "V_E= V_B-V_BE # in V\n",
+ "R_E= 3.3 # in k\u03a9\n",
+ "R_E=R_E*10**3 # in \u03a9\n",
+ "RC= 4.7 # in k\u03a9\n",
+ "RC=RC*10**3 # in \u03a9\n",
+ "I_E= V_E/R_E # in A\n",
+ "bita=100 \n",
+ "alpha= bita/(1+bita) \n",
+ "I_C= alpha*I_E #in A\n",
+ "print \"The value of I_C = %0.2f mA\" %(I_C*10**3)\n",
+ "V_C= V_CC-I_C*RC # in V\n",
+ "print \"The value of V_C = %0.1f Volts\" %(V_C)\n",
+ "I_B= I_E/(1+bita) # in A\n",
+ "print \"The value of I_B = %0.2f mA\" %(I_B*10**3)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The value of I_C = 0.99 mA\n",
+ "The value of V_C = 5.3 Volts\n",
+ "The value of I_B = 0.01 mA\n"
+ ]
+ }
+ ],
+ "prompt_number": 21
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 3.12 - page 254"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from __future__ import division\n",
+ "# Given data \n",
+ "V_B= 5 # in V\n",
+ "V_BE= 0.7 # in V\n",
+ "V_CC= 10 # in V\n",
+ "bita=100 \n",
+ "R_B= 100 # in k\u03a9\n",
+ "R_C= 2 # in k\u03a9\n",
+ "R_B=R_B*10**3 # in \u03a9\n",
+ "R_C=R_C*10**3 # in \u03a9\n",
+ "I_B= (V_B-V_BE)/R_B # in A\n",
+ "I_C= bita*I_B #in A\n",
+ "V_C= V_CC-I_C*R_C # in V\n",
+ "I_E= I_C # in A (approx)\n",
+ "print \"The value of I_B = %0.3f mA\" %(I_B*10**3)\n",
+ "print \"The value of I_C = %0.1f mA \" %(I_C*10**3)\n",
+ "print \"The value of V_C = %0.1f Volts\" %(V_C)\n",
+ "print \"The value of I_E = %0.1f mA\" %(I_E*10**3)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The value of I_B = 0.043 mA\n",
+ "The value of I_C = 4.3 mA \n",
+ "The value of V_C = 1.4 Volts\n",
+ "The value of I_E = 4.3 mA\n"
+ ]
+ }
+ ],
+ "prompt_number": 22
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 3.13 - page 255"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from __future__ import division\n",
+ "from sympy import symbols, solve\n",
+ "V_B = symbols('V_B')\n",
+ "# Given data \n",
+ "V_EB= 0.7 # in V\n",
+ "V_E = 0.7 # in V\n",
+ "bita=100 \n",
+ "V_EC= 0.2 # in V\n",
+ "V_E= V_EB+V_B # in V\n",
+ "V_CC= 5 # in V\n",
+ "R_E= 1 # in k\u03a9\n",
+ "R_E=R_E*10**3 # in \u03a9\n",
+ "R_C= 10 # in k\u03a9\n",
+ "R_C=R_C*10**3 # in \u03a9\n",
+ "R_B= 10 # in k\u03a9\n",
+ "R_B= R_B*10**3 # in \u03a9\n",
+ "V_E= V_B+V_EB # (i)\n",
+ "V_C= V_E-V_EC # (ii)\n",
+ "I_E= (V_CC-V_E)/(R_E)*1000 # mA (iii)\n",
+ "I_B= V_B/R_B # (iv)\n",
+ "I_C= (V_C+V_CC)/R_C # (v)\n",
+ "# By using relationship, I_E= I_B+I_C\n",
+ "expr = I_E*1000-(I_B*1000+I_C*1000)\n",
+ "V_B = solve(expr,V_B)\n",
+ "V_B= (9*V_CC-11*V_EB+V_EC)/12 # in V\n",
+ "V_E= V_B+V_EB # in V\n",
+ "V_C= V_B+V_EB-V_EC # in V\n",
+ "I_E= (V_CC-V_E)/R_E# in amp\n",
+ "I_C= (V_B+V_EB-V_EC+V_CC)/R_B # in amp\n",
+ "I_B= V_B/R_B # in amp\n",
+ "print \"The value of V_B = %0.2f Volts\" %V_B\n",
+ "print \"The value of V_E = %0.2f Volts\" %V_E\n",
+ "print \"The value of V_C = %0.2f Volts\" %V_C\n",
+ "print \"The value of I_E = %0.2f mA\" %(I_E*10**3)\n",
+ "print \"The value of I_C = %0.2f mA\" %(I_C*10**3)\n",
+ "print \"The value of I_B = %0.2f mA\" %(I_B*10**3)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The value of V_B = 3.12 Volts\n",
+ "The value of V_E = 3.83 Volts\n",
+ "The value of V_C = 3.62 Volts\n",
+ "The value of I_E = 1.17 mA\n",
+ "The value of I_C = 0.86 mA\n",
+ "The value of I_B = 0.31 mA\n"
+ ]
+ }
+ ],
+ "prompt_number": 23
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 3.14 - page 257"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Given data \n",
+ "bita=100 \n",
+ "hFE= 100 \n",
+ "VCEsat= 0.2 # in V\n",
+ "VBEsat= 0.8 # in V\n",
+ "VBEactive= 0.7 # in V\n",
+ "VBB= 5 # in V\n",
+ "VCC= 10 # in V\n",
+ "R_C= 3 # in k\u03a9\n",
+ "R_C=R_C*10**3 # in \u03a9\n",
+ "R_B= 50 # in k\u03a9\n",
+ "R_B=R_B*10**3 # in \u03a9\n",
+ "# Formula VCC= ICsat*R_C+VCEsat\n",
+ "ICsat= (VCC-VCEsat)/R_C #A\n",
+ "print \"The value of IC(sat) = %0.2f mA\" %(ICsat*10**3)\n",
+ "IBmin= ICsat/bita # in A\n",
+ "# Apply KVL to input circuit, VBB= IB*R_B+VBEsat\n",
+ "IB= (VBB-VBEsat)/R_B # in A\n",
+ "print \"Actual base current = %0.f \u00b5A\" %(IB*10**6)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The value of IC(sat) = 3.27 mA\n",
+ "Actual base current = 84 \u00b5A\n"
+ ]
+ }
+ ],
+ "prompt_number": 24
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 3.16 - page 259"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Given data \n",
+ "# beta= alpha/(1-alpha)\n",
+ "# At alpha= 0.5\n",
+ "alpha= 0.5 \n",
+ "beta= alpha/(1-alpha) \n",
+ "print \"At alpha=0.5, the value of beta = %0.f \" %beta\n",
+ "# At alpha= 0.9\n",
+ "alpha= 0.9 \n",
+ "beta = alpha/(1-alpha) \n",
+ "print \"At alpha=0.9, the value of beta is %0.f \" %beta\n",
+ "# At alpha= 0.5\n",
+ "alpha= 0.999 \n",
+ "beta= alpha/(1-alpha) \n",
+ "print \"At alpha=0.999, the value of beta is %0.f \" %beta"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "At alpha=0.5, the value of beta = 1 \n",
+ "At alpha=0.9, the value of beta is 9 \n",
+ "At alpha=0.999, the value of beta is 999 \n"
+ ]
+ }
+ ],
+ "prompt_number": 25
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 3.17 - page 259"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from __future__ import division\n",
+ "# Given data \n",
+ "# alpha= beta/(1-beta)\n",
+ "# At beta= 1\n",
+ "beta=1 \n",
+ "alpha= beta/(1+beta) \n",
+ "print \"At beta=1, the value of alpha is %0.2f \" %alpha\n",
+ "# At beta= 2\n",
+ "beta=2 \n",
+ "alpha= beta/(1+beta) \n",
+ "print \"At beta=2, the value of alpha is %0.2f \" %alpha\n",
+ "# At beta= 100\n",
+ "beta=100 \n",
+ "alpha= beta/(1+beta) \n",
+ "print \"At beta=100, the value of alpha is %0.2f \" %alpha\n",
+ "# At beta= 200\n",
+ "beta=200 \n",
+ "alpha= beta/(1+beta) \n",
+ "print \"At beta=200, the value of alpha is %0.3f \"%alpha"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "At beta=1, the value of alpha is 0.50 \n",
+ "At beta=2, the value of alpha is 0.67 \n",
+ "At beta=100, the value of alpha is 0.99 \n",
+ "At beta=200, the value of alpha is 0.995 \n"
+ ]
+ }
+ ],
+ "prompt_number": 26
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 3.18 - page 260"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from numpy import exp, log\n",
+ "# Given data \n",
+ "VBE= 0.76 # in V\n",
+ "VT= 0.025 # in V\n",
+ "I_C= 10*10**-3 # in A\n",
+ "# Formula I_C= I_S*exp(VBE/VT)\n",
+ "I_S= I_C/(exp(VBE/VT)) # in A\n",
+ "print \"The value of I_S = %0.3e A\" %I_S\n",
+ "# Part(a) for VBE = 0.7 V\n",
+ "VBE= 0.7 # in V\n",
+ "I_C= I_S*exp(VBE/VT)\n",
+ "print \"For VBE = 0.7 V , The value of I_C = %0.3f mA\" %(I_C*10**3)\n",
+ "\n",
+ "# Part (b) for I_C= 10 \u00b5A\n",
+ "I_C= 10*10**-6 # in A\n",
+ "# Formula I_C= I_S*exp(VBE/VT)\n",
+ "VBE= VT*log(I_C/I_S) \n",
+ "print \"For I_C = 10 \u00b5A, The value of VBE = %0.3f V\" %VBE"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The value of I_S = 6.273e-16 A\n",
+ "For VBE = 0.7 V , The value of I_C = 0.907 mA\n",
+ "For I_C = 10 \u00b5A, The value of VBE = 0.587 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 27
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 3.19 - page 260"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from __future__ import division\n",
+ "# Given data \n",
+ "VBE= 0.7 # in V\n",
+ "VT= 0.025 # in V\n",
+ "I_B= 100 # in \u00b5A\n",
+ "I_B=I_B*10**-6 # in A\n",
+ "I_C= 10*10**-3 # in A\n",
+ "# Formula I_C= I_S*exp(VBE/VT)\n",
+ "I_S= I_C/(exp(VBE/VT)) # in A\n",
+ "alpha= I_C/(I_C+I_B) \n",
+ "beta= I_C/I_B \n",
+ "IS_by_alpha= I_S/alpha # in A\n",
+ "IS_by_beta= I_S/beta # in A\n",
+ "print \"The value of alpha is %0.2f \" %alpha\n",
+ "print \"The value of beta is %0.2f \" %beta \n",
+ "print \"The value of Is/alpha = %0.2e A\" %IS_by_alpha\n",
+ "print \"The value of Is/beta = %0.2e A\" %IS_by_beta"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The value of alpha is 0.99 \n",
+ "The value of beta is 100.00 \n",
+ "The value of Is/alpha = 6.98e-15 A\n",
+ "The value of Is/beta = 6.91e-17 A\n"
+ ]
+ }
+ ],
+ "prompt_number": 28
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 3.20 - page 261"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Given data \n",
+ "VBE= 0.7 # in V\n",
+ "VCC= 10.7 # in V\n",
+ "R_C= 10 #in k\u03a9\n",
+ "R_C=R_C*10**3 # in \u03a9\n",
+ "R_B= 10 #in k\u03a9\n",
+ "R_B=R_B*10**3 # in \u03a9\n",
+ "I1= (VCC-VBE)/R_C # in A\n",
+ "print \"The value of I1 = %0.f mA\" %(I1*10**3)\n",
+ "# Part (b)\n",
+ "VC= -4 #in V\n",
+ "VB= -10 # in V\n",
+ "R_C= 5.6 #in k\u03a9\n",
+ "R_C=R_C*10**3 # in \u03a9\n",
+ "R_B= 2.4 #in k\u03a9\n",
+ "R_B=R_B*10**3 # in \u03a9\n",
+ "VCC=12 # V\n",
+ "I_C= (VC-VB)/R_B # in A\n",
+ "V2= VCC- (R_C*I_C) \n",
+ "print \"The value of V2 = %0.f Volt\" %V2\n",
+ "# Part (c)\n",
+ "VCC= 0 \n",
+ "VCE= -10 # in V\n",
+ "R_C= 10 #in k\u03a9\n",
+ "R_C=R_C*10**3 # in \u03a9\n",
+ "I_C= (VCC-VCE)/R_C # in A\n",
+ "V4= 1 # in V\n",
+ "I3= I_C # in A (approx)\n",
+ "print \"The value of V4 = %0.f Volt\" %V4\n",
+ "print \"The value of I3 = %0.f mA\" %(I3*10**3)\n",
+ "# Part (d)\n",
+ "VBE= -10 # in V\n",
+ "VCC= 10 # in V\n",
+ "R_B= 5 #in k\u03a9\n",
+ "R_B=R_B*10**3 # in \u03a9\n",
+ "R_C= 15 #in k\u03a9\n",
+ "R_C=R_C*10**3 # in \u03a9\n",
+ "# I5= I_C and \n",
+ "# I5= (V6-0.7-VBE)/R_B and I_C= (VCC-V6)/R_C\n",
+ "V6= (VCC*R_B+R_C*(0.7+VBE))/(R_C+R_B) \n",
+ "print \"The value of V6 = %0.3f Volt\" %(V6)\n",
+ "I5= (V6-0.7-VBE)/R_B # in A\n",
+ "print \"The value of I5 = %0.3f mA\" %(I5*10**3)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The value of I1 = 1 mA\n",
+ "The value of V2 = -2 Volt\n",
+ "The value of V4 = 1 Volt\n",
+ "The value of I3 = 1 mA\n",
+ "The value of V6 = -4.475 Volt\n",
+ "The value of I5 = 0.965 mA\n"
+ ]
+ }
+ ],
+ "prompt_number": 29
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 3.21 -page 264"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Given data \n",
+ "# Part (a)\n",
+ "V_C= 2 # in V\n",
+ "R_C= 1 # in k\u03a9\n",
+ "R_C=R_C*10**3 # in \u03a9\n",
+ "V_B= 4.3 # in V\n",
+ "R_B= 200 # in k\u03a9\n",
+ "R_B=R_B*10**3 # in \u03a9\n",
+ "I_C= V_C/R_C # in A\n",
+ "I_B= V_B/R_B # in A\n",
+ "beta= I_C/I_B \n",
+ "print \"Part (a)\"\n",
+ "print \"Collector current = %0.f mA\" %(I_C*10**3)\n",
+ "print \"Base current = %0.1f \u00b5A\" %(I_B*10**6)\n",
+ "print \"The value of beta is %0.f \"%beta\n",
+ "\n",
+ "# Part (b)\n",
+ "V_C= 2.3 # in V\n",
+ "R_C= 230 # in k\u03a9\n",
+ "R_C=R_C*10**3 # in \u03a9\n",
+ "V_B= 4.3 # in V\n",
+ "R_B= 20 # in k\u03a9\n",
+ "R_B=R_B*10**3 # in \u03a9\n",
+ "I= V_C/R_C # current through 230\u03a9 resistro i.e. I_C + I_B in A\n",
+ "I_B= (V_B-V_C)/R_B # in A\n",
+ "I_C= I-I_B # in A\n",
+ "bita= abs(I_C/I_B) \n",
+ "print \"Part (b)\"\n",
+ "print \"Collector current = %0.2f mA\" %(I_C*10**3)\n",
+ "print \"Base current = %0.2f mA\" %(I_B*10**3)\n",
+ "print \"The value of beta is %0.2f \"%beta\n",
+ "\n",
+ "# Part (c)\n",
+ "V_E= 10 # in V\n",
+ "R_E= 1 # in k\u03a9\n",
+ "R_E=R_E*10**3 # in \u03a9\n",
+ "V_1= 7 # in V\n",
+ "R_C= 1 # in k\u03a9\n",
+ "R_C=R_C*10**3 # in \u03a9\n",
+ "V_B= 6.3 # in V\n",
+ "R_B= 100 # in k\u03a9\n",
+ "R_B=R_B*10**3 # in \u03a9\n",
+ "I_E= (V_E-V_1)/R_C #in A\n",
+ "I_C=I_E # in A (approx)\n",
+ "V_C= I_C*R_C # in V\n",
+ "I_B= (V_B-V_C)/R_B # in A\n",
+ "beta= I_E/I_B-1 \n",
+ "print \"Part (c)\"\n",
+ "print \"Emitter current = %0.2f mA\" %(I_E*10**3)\n",
+ "print \"Base current = %0.2f \u00b5A\" %(I_B*10**6)\n",
+ "print \"Collector voltage = %0.2f Volts\" %(V_C)\n",
+ "print \"The value of beta is %0.2f \"%(beta)\n",
+ "\n",
+ "# Note : In the book the value of base current in the first part is wrong due to calculation error.\n",
+ "#In the part (b) the values of collector current and beta are wrong due to calculation error in the first line of part (b)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Part (a)\n",
+ "Collector current = 2 mA\n",
+ "Base current = 21.5 \u00b5A\n",
+ "The value of beta is 93 \n",
+ "Part (b)\n",
+ "Collector current = -0.09 mA\n",
+ "Base current = 0.10 mA\n",
+ "The value of beta is 93.02 \n",
+ "Part (c)\n",
+ "Emitter current = 3.00 mA\n",
+ "Base current = 33.00 \u00b5A\n",
+ "Collector voltage = 3.00 Volts\n",
+ "The value of beta is 89.91 \n"
+ ]
+ }
+ ],
+ "prompt_number": 30
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 3.22 - page 266"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Given data \n",
+ "# Part (a)\n",
+ "beta= 30 \n",
+ "R_C= 2.2 # in k\u03a9\n",
+ "R_C=R_C*10**3 # in \u03a9\n",
+ "R_B= 2.2 # in k\u03a9\n",
+ "R_B=R_B*10**3 # in \u03a9\n",
+ "VCC= 3 # in V\n",
+ "VCE= -3 # in V\n",
+ "VBE= 0.7 # in V\n",
+ "V_B= 0 # in V\n",
+ "V_E= V_B-VBE # in V\n",
+ "I_E= (V_E-VCE)/R_B # in A\n",
+ "I_C= I_E # in A\n",
+ "V_C= VCC-I_E*R_C # in V\n",
+ "I_B= I_C/beta # in A\n",
+ "print \"Part (a)\"\n",
+ "print \"The value of V_B = %0.2f V \" %V_B\n",
+ "print \"The value of V_E = %0.2f V\" %V_E\n",
+ "print \"The value of I_E = %0.2f mA\" %(I_E*10**3)\n",
+ "print \"The value of V_C = %0.3f V\" %(V_C)\n",
+ "print \"The value of I_B = %0.2f mA\" %(I_B*10**3)\n",
+ "# Part (b)\n",
+ "R_C= 560 # in \u03a9\n",
+ "R_B= 1.1 # in k\u03a9\n",
+ "R_B=R_B*10**3 # in \u03a9\n",
+ "VCC= 9 # in V\n",
+ "VCE= 3 # in V\n",
+ "V_B= 3 # in V\n",
+ "V_E= V_B+VBE # in V\n",
+ "I_E= (VCC-V_E)/R_B # in A\n",
+ "alpha= beta/(1+beta) \n",
+ "I_C= I_E*alpha # in A\n",
+ "V_C= I_C*R_C # in V\n",
+ "I_B= I_C/beta # in A\n",
+ "print \"Part (b)\"\n",
+ "print \"The value of V_B = %0.2f V \" %V_B\n",
+ "print \"The value of V_E = %0.2f V\" %V_E\n",
+ "print \"The value of I_E = %0.2f mA\" %(I_C*10**3)\n",
+ "print \"The value of V_C = %0.2f V\" %(V_C)\n",
+ "print \"The value of I_B = %0.3f mA\" %(I_B*10**3)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Part (a)\n",
+ "The value of V_B = 0.00 V \n",
+ "The value of V_E = -0.70 V\n",
+ "The value of I_E = 1.05 mA\n",
+ "The value of V_C = 0.700 V\n",
+ "The value of I_B = 0.03 mA\n",
+ "Part (b)\n",
+ "The value of V_B = 3.00 V \n",
+ "The value of V_E = 3.70 V\n",
+ "The value of I_E = 4.66 mA\n",
+ "The value of V_C = 2.61 V\n",
+ "The value of I_B = 0.155 mA\n"
+ ]
+ }
+ ],
+ "prompt_number": 31
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 3.23 - page 268"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from numpy import inf\n",
+ "# Given data \n",
+ "VBE= 0.7 # in V\n",
+ "VCC= 9 # in V\n",
+ "VCE= -9 # in V\n",
+ "V_B= -1.5 # in V\n",
+ "R_C= 10 # in k\u03a9\n",
+ "R_C=R_C*10**3 # in \u03a9\n",
+ "R_B= 10 # in k\u03a9\n",
+ "R_B=R_B*10**3 # in \u03a9\n",
+ "I_B= abs(V_B)/R_B # in A\n",
+ "V_E= V_B-VBE # in V\n",
+ "print \"The value of V_E = %0.2f Volt\" %V_E\n",
+ "I_E= (V_E-VCE)/R_B # in A\n",
+ "beta= I_E/I_B-1 \n",
+ "alpha= beta/(1+beta) \n",
+ "print \"The value of alpha = %0.2f Volt\" %alpha\n",
+ "print \"The value of beta = %0.2f Volt\" %beta\n",
+ "V_C= VCC-I_E*alpha*R_C # in V\n",
+ "print \"The value of V_C = %0.2f Volt\" %V_C\n",
+ "beta = inf\n",
+ "alpha= beta/(1+beta)\n",
+ "I_B= 0 \n",
+ "V_B=0 \n",
+ "V_C= VCC-I_E*R_C # in volt\n",
+ "print \"The value of V_B = %0.2f V \" %V_B\n",
+ "print \"The value of V_E = %0.2f V\" %V_E\n",
+ "print \"The value of V_C = %0.2f V\" %(V_C)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The value of V_E = -2.20 Volt\n",
+ "The value of alpha = 0.78 Volt\n",
+ "The value of beta = 3.53 Volt\n",
+ "The value of V_C = 3.70 Volt\n",
+ "The value of V_B = 0.00 V \n",
+ "The value of V_E = -2.20 V\n",
+ "The value of V_C = 2.20 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 32
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 3.24 - page 269"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Given data \n",
+ "VBE_1= 0.7 # in V\n",
+ "VBE_2= 0.5 # in V\n",
+ "V_T= 0.025 # in V\n",
+ "I_C1= 10 # in mV\n",
+ "I_C1= I_C1*10**-3 # in A\n",
+ "# I_C1= I_S*%e**(VBE_1/V_T) (i)\n",
+ "# I_C2= I_S*%e**(VBE_2/V_T) (ii)\n",
+ "# Devide equation (ii) by (i)\n",
+ "I_C2= I_C1*exp((VBE_2-VBE_1)/V_T) # in A\n",
+ "print \"The value of I_C2 = %0.2f \u00b5A\" %(I_C2*10**6)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The value of I_C2 = 3.35 \u00b5A\n"
+ ]
+ }
+ ],
+ "prompt_number": 33
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 3.25 - page 270"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Given data \n",
+ "R1= 10 # in k\u03a9\n",
+ "R1=R1*10**3 # in \u03a9\n",
+ "R2= 10 # in k\u03a9\n",
+ "R2=R2*10**3 # in \u03a9\n",
+ "I_C=.5 # mA\n",
+ "V_T= 0.025 #in V\n",
+ "I_C= I_C*10**-3 # in A\n",
+ "V= 10 # in V\n",
+ "Vth= V*R1/(R1+R2) # in V\n",
+ "Rth= R1*R2/(R1+R2) #in \u03a9\n",
+ "vo= I_C*Rth # in V\n",
+ "vi=V_T # in V\n",
+ "vo_by_vi= vo/vi #in V/V\n",
+ "print \"The value of vo/vi = %0.f V/V \" %vo_by_vi"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The value of vo/vi = 100 V/V \n"
+ ]
+ }
+ ],
+ "prompt_number": 34
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 3.27 - page 272"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Given data \n",
+ "V_B= 2 # in V\n",
+ "V_CC=5 # in V\n",
+ "V_BE= 0.7 # in V\n",
+ "R_E= 1*10**3 # in \u03a9\n",
+ "R_C= 1*10**3 # in \u03a9\n",
+ "V_E= V_B-V_BE # in V\n",
+ "I_E= V_E/R_E # in A\n",
+ "I_C= I_E # in A\n",
+ "V_C= V_CC-I_C*R_C #in V\n",
+ "print \"At V_B= +2 V\"\n",
+ "print \"The value of V_E = %0.2f Volts\" %V_E\n",
+ "print \"The value of V_C = %0.2f Volts\" %V_C\n",
+ "\n",
+ "# Part (b)\n",
+ "V_B= 0 #in V\n",
+ "V_E= 0 # in V\n",
+ "I_E= 0 # in A\n",
+ "V_C= 5 # in V\n",
+ "print \"At V_B= 0 V\"\n",
+ "print \"The value of V_E = %0.2f Volts\" %V_E\n",
+ "print \"The value of V_C = %0.2f Volts\" %V_C"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "At V_B= +2 V\n",
+ "The value of V_E = 1.30 Volts\n",
+ "The value of V_C = 3.70 Volts\n",
+ "At V_B= 0 V\n",
+ "The value of V_E = 0.00 Volts\n",
+ "The value of V_C = 5.00 Volts\n"
+ ]
+ }
+ ],
+ "prompt_number": 35
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 3.28 - page 273"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Given data \n",
+ "V_B= 0 # in V\n",
+ "R_E=1*10**3 #in \u03a9\n",
+ "R_C=1*10**3 #in \u03a9\n",
+ "V_CC=5 # in V\n",
+ "V_BE= 0.7 # in V\n",
+ "V_E= V_B-V_BE # in V\n",
+ "I_E= (1+V_E)/R_E # in A\n",
+ "I_C= I_E # (approx) in A\n",
+ "V_C= V_CC-I_C*R_C #in V\n",
+ "print \"Part (a)\"\n",
+ "print \"The value of V_E = %0.2f Volts\" %V_E\n",
+ "print \"The value of V_C = %0.2f Volts\" %V_C\n",
+ "# For saturation \n",
+ "V_CE=0.2 # V\n",
+ "V_CB= -0.5 # in V\n",
+ "# I_C= 5-V_C/R_C and V_C= V_E-VCE, So\n",
+ "# I_C= (5.2-V_E)/R_C\n",
+ "# I_E= (V_E+1)/R_E and at the edge of saturation I_C=I_E,\n",
+ "V_E= 4.2/2 #/ in V\n",
+ "V_B= V_E+0.7 # in V\n",
+ "V_C= V_E+0.2 # in V\n",
+ "print \"Part (b) \"\n",
+ "print \"The value of V_E = %0.2f Volts\" %V_E\n",
+ "print \"The value of V_B = %0.2f Volts\" %V_B\n",
+ "print \"The value of V_C = %0.2f Volts\" %V_C\n",
+ "\n",
+ "# Note: In the book , there is a miss print in the last line of this question \n",
+ "#because V_E+0.2= 2.1+0.2 = 2.3 (not 2.8) , so answer in the book is wrong "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Part (a)\n",
+ "The value of V_E = -0.70 Volts\n",
+ "The value of V_C = 4.70 Volts\n",
+ "Part (b) \n",
+ "The value of V_E = 2.10 Volts\n",
+ "The value of V_B = 2.80 Volts\n",
+ "The value of V_C = 2.30 Volts\n"
+ ]
+ }
+ ],
+ "prompt_number": 36
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 3.29 - page 275"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Given data \n",
+ "V_CC=5 # in V\n",
+ "V_E= 1 # in V\n",
+ "V_BE= 0.7 # in V\n",
+ "R_E=5*10**3 #in \u03a9\n",
+ "R_C=5*10**3 #in \u03a9\n",
+ "R_B= 20*10**3 # in \u03a9\n",
+ "I_E= (V_CC-V_E)/R_E # in A\n",
+ "# For pnp transistor V_BE= V_E-V_B\n",
+ "V_B= V_E-V_BE # in V\n",
+ "I_B= V_B/R_B # in A\n",
+ "I_C= I_E-I_B # in A\n",
+ "V_C= I_C*R_C-V_CC # in V\n",
+ "beta= I_C/I_B \n",
+ "alpha= I_C/I_E \n",
+ "print \"The value of V_B = %0.1f Volts\" %V_B\n",
+ "print \"The value of I_B = %0.3f mA\" %(I_B*10**3)\n",
+ "print \"The value of I_E = %0.1f mA\" %(I_E*10**3)\n",
+ "print \"The value of I_C = %0.3f mA\" %(I_C*10**3)\n",
+ "print \"The value of V_C = %0.3f Volts\" %V_C \n",
+ "print \"The value of beta is %0.1f \"%beta \n",
+ "print \"The value of alpha is %0.2f \"%alpha"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The value of V_B = 0.3 Volts\n",
+ "The value of I_B = 0.015 mA\n",
+ "The value of I_E = 0.8 mA\n",
+ "The value of I_C = 0.785 mA\n",
+ "The value of V_C = -1.075 Volts\n",
+ "The value of beta is 52.3 \n",
+ "The value of alpha is 0.98 \n"
+ ]
+ }
+ ],
+ "prompt_number": 37
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 3.30 - page 276"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Given data\n",
+ "V_CC=5 # in V\n",
+ "V_T= 0.025 # in V\n",
+ "R_C=7.5*10**3 #in \u03a9\n",
+ "I_C= 0.5 # in mA\n",
+ "I_C= I_C*10**-3 # in A\n",
+ "I_E=I_C # (approx) in A\n",
+ "V_C= V_CC-I_C*R_C # in V\n",
+ "print \"dc voltage at the collector = %0.2f Volt\" %V_C\n",
+ "gm= I_C/V_T # in A/V\n",
+ "print \"The value of gm = %0.f mA/V\" %(gm*10**3)\n",
+ "# v_be= -v_i\n",
+ "# v_c= -gm*v_be*R_C\n",
+ "vcbyvi= gm*R_C # in V/V\n",
+ "print \"The value of vc/vi = %0.f V/V\" %(vcbyvi)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "dc voltage at the collector = 1.25 Volt\n",
+ "The value of gm = 20 mA/V\n",
+ "The value of vc/vi = 150 V/V\n"
+ ]
+ }
+ ],
+ "prompt_number": 38
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 3.31 - page 277"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Given data\n",
+ "V_T= 0.025 # in V\n",
+ "I_E= 0.5 # in mA\n",
+ "I_E= I_E*10**-3 # in mA\n",
+ "Rsig= 50 # in \u03a9\n",
+ "R_C= 5*10**3 # in \u03a9\n",
+ "re= V_T/I_E # in ohm\n",
+ "Rin= Rsig+re # in ohm\n",
+ "print \"Input resistance = %0.f \u03a9\" %Rin\n",
+ "# Part(b)\n",
+ "# vo= -0.99*ie*R_C and ie= -v_sig/Rin\n",
+ "vo_by_v_sig= 0.99*R_C/Rin # in V/V\n",
+ "print \"The value of vo/vsig = %0.1f V/V\" %(vo_by_v_sig)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Input resistance = 100 \u03a9\n",
+ "The value of vo/vsig = 49.5 V/V\n"
+ ]
+ }
+ ],
+ "prompt_number": 39
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 3.32 - page 278"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Given data\n",
+ "beta= 200 \n",
+ "alpha= beta/(1+beta) \n",
+ "R_C= 100 # in \u03a9\n",
+ "R_B= 10 # in k\u03a9\n",
+ "Rsig= 1 # in k\u03a9\n",
+ "Rsig= Rsig*10**3 # in \u03a9\n",
+ "R_B= R_B*10**3 # in \u03a9\n",
+ "V_T= 25*10**-3 \n",
+ "V=1.5 # in V\n",
+ "I_E= 10 # in mA\n",
+ "I_E= I_E*10**-3 # in A\n",
+ "I_C= alpha*I_E # in A\n",
+ "V_C= I_C*R_C # in V\n",
+ "I_B= I_C/beta # in A\n",
+ "V_B= V-(R_B*I_B)\n",
+ "gm= I_C/V_T # in A/V\n",
+ "rpi= beta/gm # in \u03a9\n",
+ "Rib= rpi # in \u03a9\n",
+ "print \"The value of Rib = %0.2f \u03a9 \" %Rib\n",
+ "Rin= R_B*rpi/(R_B+rpi) # in \u03a9\n",
+ "print \"The value of Rin = %0.2f \u03a9\" %Rin\n",
+ "# vbe= v_sig*Rin/(Rsig+Rin) \n",
+ "vbe_by_vsig= Rin/(Rsig+Rin) \n",
+ "# vo= -gm*vbe*R_C and = -gm*v_sig*Rin/(Rsig+Rin)\n",
+ "vo_by_vsig= -gm*R_C*vbe_by_vsig # in V/V\n",
+ "print \"Overall voltage gain = %0.2f V/V\" %vo_by_vsig\n",
+ "# if \n",
+ "vo= 0.4 #(\u00b1) in V\n",
+ "vs= vo/abs(vo_by_vsig) # in V\n",
+ "vbe= vbe_by_vsig*vs # in V\n",
+ "print \"The value of v_sig = %0.2f mV\" %(vs*10**3)\n",
+ "print \"The value of v_be = %0.2f mV\" %(vbe*10**3)\n",
+ "\n",
+ "# Note: There is some difference between in this coding and book solution. But Coding is correct."
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The value of Rib = 502.50 \u03a9 \n",
+ "The value of Rin = 478.46 \u03a9\n",
+ "Overall voltage gain = -12.88 V/V\n",
+ "The value of v_sig = 31.06 mV\n",
+ "The value of v_be = 10.05 mV\n"
+ ]
+ }
+ ],
+ "prompt_number": 40
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 3.33 - page 280"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Given data\n",
+ "V_T= 0.025 # in V\n",
+ "# Part(a)\n",
+ "print \"Part (a) : \"\n",
+ "V_BE= 690 # in mV\n",
+ "V_BE=V_BE*10**-3 # in V\n",
+ "I_C= 1 # in mA\n",
+ "I_B= 50 # in \u00b5A\n",
+ "I_C=I_C*10**-3 # in A\n",
+ "I_B=I_B*10**-6 # in A\n",
+ "beta= I_C/I_B \n",
+ "alpha= beta/(1+beta) \n",
+ "I_E= I_C/alpha # in A\n",
+ "# I_C= I_S*exp(V_BE/V_T)\n",
+ "I_S= I_C/(exp(V_BE/V_T)) \n",
+ "print \"The value of beta is %0.1f \" %beta\n",
+ "print \"The value of alpha is %0.4f \"%alpha\n",
+ "print \"The value of I_E = %0.2f mA\" %(I_E*10**3)\n",
+ "print \"The value of I_S = %0.2e A\" %I_S\n",
+ "\n",
+ "# Part(b)\n",
+ "print \"Part (b) : \"\n",
+ "V_BE= 690 # in mV\n",
+ "V_BE=V_BE*10**-3 # in V\n",
+ "I_C= 1 # in mA\n",
+ "I_C=I_C*10**-3 # in A\n",
+ "I_E= 1.070 # in mA\n",
+ "I_E=I_E*10**-3 # in A\n",
+ "beta= I_C/I_B \n",
+ "alpha= I_C/I_E \n",
+ "beta= alpha/(1-alpha) \n",
+ "I_B= I_C/beta # in A\n",
+ "# I_C= I_S*exp(V_BE/V_T)\n",
+ "I_S= I_C/(exp(V_BE/V_T)) \n",
+ "print \"The value of beta is %0.3f \" %beta\n",
+ "print \"The value of alpha is %0.4f \"%alpha\n",
+ "print \"The value of I_B = %0.2f \u00b5A\" %(I_B*10**6)\n",
+ "print \"The value of I_S = %0.2e A\" %I_S\n",
+ "\n",
+ "# Part(c)\n",
+ "print \"Part (C) : \"\n",
+ "V_BE= 580 # in mV\n",
+ "V_BE=V_BE*10**-3 # in V\n",
+ "I_E= 0.137 # in mA\n",
+ "I_B= 7 # in \u00b5A\n",
+ "I_E=I_E*10**-3 # in A\n",
+ "I_B=I_B*10**-6 # in A\n",
+ "# I_C= alpha*I_E = bita*I_B\n",
+ "beta= I_E/I_B-1 \n",
+ "alpha= beta/(1+beta) \n",
+ "I_C= beta*I_B # in A\n",
+ "# I_C= I_S*exp(V_BE/V_T)\n",
+ "I_S= I_C/(exp(V_BE/V_T)) \n",
+ "print \"The value of beta is %0.3f \" %beta\n",
+ "print \"The value of alpha is %0.4f \"%alpha\n",
+ "print \"The value of I_C = %0.3f mA\" %(I_C*10**3)\n",
+ "print \"The value of I_S = %0.3e A\" %I_S\n",
+ "\n",
+ "# Part(d)\n",
+ "print \"Part (d) : \"\n",
+ "V_BE= 780 # in mV\n",
+ "V_BE=V_BE*10**-3 # in V\n",
+ "I_C= 10.10 # in mA\n",
+ "I_B= 120 # in \u00b5A\n",
+ "I_C=I_C*10**-3 # in A\n",
+ "I_B=I_B*10**-6 # in A\n",
+ "beta= I_C/I_B \n",
+ "alpha= beta/(1+beta) \n",
+ "I_E= I_C/alpha # in A\n",
+ "# I_C= I_S*%e**(V_BE/V_T)\n",
+ "I_S= I_C/(exp(V_BE/V_T)) \n",
+ "print \"The value of beta is %0.3f \" %beta\n",
+ "print \"The value of alpha is %0.4f \"%alpha\n",
+ "print \"The value of I_E = %0.2f mA\" %(I_E*10**3)\n",
+ "print \"The value of I_S = %0.4e A\" %I_S\n",
+ "\n",
+ "# Part(e)\n",
+ "print \"Part (e) : \"\n",
+ "V_BE= 820 # in mV\n",
+ "V_BE=V_BE*10**-3 # in V\n",
+ "I_E= 75 # in mA\n",
+ "I_B= 1050 # in \u00b5A\n",
+ "I_E=I_E*10**-3 # in A\n",
+ "I_B=I_B*10**-6 # in A\n",
+ "# I_C= alpha*I_E = bita*I_B\n",
+ "beta= I_E/I_B-1 \n",
+ "alpha= beta/(1+beta) \n",
+ "I_C= beta*I_B # in A\n",
+ "# I_C= I_S*exp(V_BE/V_T)\n",
+ "I_S= I_C/(exp(V_BE/V_T)) \n",
+ "print \"The value of beta is %0.3f \" %beta\n",
+ "print \"The value of alpha is %0.3f \"%alpha\n",
+ "print \"The value of I_C = %0.2f mA\" %(I_C*10**3)\n",
+ "print \"The value of I_S = %0.3e A\" %I_S"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Part (a) : \n",
+ "The value of beta is 20.0 \n",
+ "The value of alpha is 0.9524 \n",
+ "The value of I_E = 1.05 mA\n",
+ "The value of I_S = 1.03e-15 A\n",
+ "Part (b) : \n",
+ "The value of beta is 14.286 \n",
+ "The value of alpha is 0.9346 \n",
+ "The value of I_B = 70.00 \u00b5A\n",
+ "The value of I_S = 1.03e-15 A\n",
+ "Part (C) : \n",
+ "The value of beta is 18.571 \n",
+ "The value of alpha is 0.9489 \n",
+ "The value of I_C = 0.130 mA\n",
+ "The value of I_S = 1.092e-14 A\n",
+ "Part (d) : \n",
+ "The value of beta is 84.167 \n",
+ "The value of alpha is 0.9883 \n",
+ "The value of I_E = 10.22 mA\n",
+ "The value of I_S = 2.8466e-16 A\n",
+ "Part (e) : \n",
+ "The value of beta is 70.429 \n",
+ "The value of alpha is 0.986 \n",
+ "The value of I_C = 73.95 mA\n",
+ "The value of I_S = 4.208e-16 A\n"
+ ]
+ }
+ ],
+ "prompt_number": 41
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
diff --git a/Electronic_Circuits_by_P._Raja/Chapter4.ipynb b/Electronic_Circuits_by_P._Raja/Chapter4.ipynb
new file mode 100755
index 00000000..38d22a7c
--- /dev/null
+++ b/Electronic_Circuits_by_P._Raja/Chapter4.ipynb
@@ -0,0 +1,924 @@
+{
+ "metadata": {
+ "name": "",
+ "signature": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 4 - Differential amplifiers"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 4.1 - page 317"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Given data\n",
+ "V_CC= 10 # in volt\n",
+ "V_EE= -10 # in volt\n",
+ "I= 1 # in mA\n",
+ "I=I*10**-3 # in A\n",
+ "R_C= 10 # in kohm\n",
+ "R_C=R_C*10**3 # in kohm\n",
+ "V_BE=0.7 # in volt\n",
+ "\n",
+ "i_C1= I/2 # in A\n",
+ "i_C2= i_C1 # in A\n",
+ "print \"Value of i_C1 = %0.2f mA\" %(i_C1*10**3)\n",
+ "\n",
+ "V_C1= V_CC-i_C1*R_C # in V\n",
+ "# For V_cm=0 volt\n",
+ "V_E= -0.7 # in volt\n",
+ "V_CE1= V_C1-V_E # in volt\n",
+ "print \"For V_cm =0, The value of V_CE1 = %0.2f Volt\" %(V_CE1)\n",
+ "\n",
+ "# For V_cm= -5 volt\n",
+ "V_cm= -5 # in V\n",
+ "V_B= V_cm # in V\n",
+ "# From V_BE= V_B-V_E\n",
+ "V_E= V_B-V_BE # in volt\n",
+ "V_CE1= V_C1-V_E # in volt\n",
+ "print \"For V_cm =-5V, The value of V_CE1 = %0.2f Volt\" %V_CE1\n",
+ "\n",
+ "# For V_cm= 5 volt\n",
+ "V_cm= 5 # in V\n",
+ "V_B= V_cm # in V\n",
+ "V_E= V_B-V_BE # in volt\n",
+ "V_CE1= V_C1-V_E # in volt\n",
+ "print \"For V_cm =5V, The value of V_CE1 = %0.2f Volt\" %V_CE1"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Value of i_C1 = 0.50 mA\n",
+ "For V_cm =0, The value of V_CE1 = 5.70 Volt\n",
+ "For V_cm =-5V, The value of V_CE1 = 10.70 Volt\n",
+ "For V_cm =5V, The value of V_CE1 = 0.70 Volt\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 4.2 - page 338"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from numpy import sqrt\n",
+ "# Given data\n",
+ "V_DD= 1.5 # in V\n",
+ "V_SS= V_DD # in V\n",
+ "KnWL= 4 # in mA/V**2\n",
+ "KnWL=KnWL*10**-3 # in A/V**2\n",
+ "Vt= 0.5 # in V\n",
+ "I=0.4 # in mA\n",
+ "I=I*10**-3 #in A\n",
+ "R_D= 2.5 # in k\u03a9\n",
+ "R_D= R_D*10**3 # in \u03a9\n",
+ "\n",
+ "# Part (a)\n",
+ "print \"Part (a)\"\n",
+ "V_OV= sqrt(I/KnWL) # in V\n",
+ "V_GS= V_OV+Vt # in V\n",
+ "print \"Value of V_OV = %0.2f Volt\" %V_OV\n",
+ "print \"Value of V_GS = %0.2f Volt\" %V_GS\n",
+ "\n",
+ "# Part (b)\n",
+ "print \"Part (b)\"\n",
+ "V_CM= 0 # in volt\n",
+ "V_S= -V_GS # in volt\n",
+ "print \"Value of V_S = %0.2f Volt\" %V_S\n",
+ "I=0.4 # in mw\n",
+ "i_D1= I/2 # in mA\n",
+ "print \"Value of i_D1 = %0.2f mA\" %i_D1\n",
+ "i_D1=i_D1*10**-3 # in A\n",
+ "V_D1= V_DD-i_D1*R_D # in V\n",
+ "V_D2=V_D1 # in V\n",
+ "print \"Value of V_D1 = %0.2f Volt\" %V_D1\n",
+ "print \"Value of V_D2 = %0.2f Volt\" %V_D2\n",
+ "\n",
+ "\n",
+ "# Part (c)\n",
+ "print \"Part (c)\"\n",
+ "V_CM=1 # in V\n",
+ "V_GS= 0.82 # in V\n",
+ "V_G= 1 # in V\n",
+ "V_S= V_G-V_GS # in V\n",
+ "print \"Value of V_S = %0.2f Volt\" %V_S\n",
+ "i_D1= I/2 # in mA\n",
+ "print \"Value of i_D1 = %0.2f mA\" %i_D1\n",
+ "i_D1=i_D1*10**-3 # in A\n",
+ "V_D1= V_DD-i_D1*R_D # in V\n",
+ "V_D2=V_D1 # in V\n",
+ "print \"Value of V_D1 = %0.2f Volt\" %V_D1\n",
+ "print \"Value of V_D2 = %0.2f Volt\" %V_D2\n",
+ "\n",
+ "# Part (d)\n",
+ "print \"Part (d)\"\n",
+ "V_CM_max= Vt+V_DD-i_D1*R_D\n",
+ "print \"Highest value of V_CM = %0.2f Volt\" %V_CM_max\n",
+ "\n",
+ "# Part (e)\n",
+ "V_S= 0.4 # in V\n",
+ "print \"Part (e)\"\n",
+ "V_CM_min= -V_SS+V_S+Vt+V_OV # in V\n",
+ "print \"Lowest value of V_CM = %0.2f Volt \" %V_CM_min\n",
+ "V_Smin= V_CM_min-V_GS # in volt\n",
+ "print \"Lowest value of V_S = %0.2f Volt\" %V_Smin"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Part (a)\n",
+ "Value of V_OV = 0.32 Volt\n",
+ "Value of V_GS = 0.82 Volt\n",
+ "Part (b)\n",
+ "Value of V_S = -0.82 Volt\n",
+ "Value of i_D1 = 0.20 mA\n",
+ "Value of V_D1 = 1.00 Volt\n",
+ "Value of V_D2 = 1.00 Volt\n",
+ "Part (c)\n",
+ "Value of V_S = 0.18 Volt\n",
+ "Value of i_D1 = 0.20 mA\n",
+ "Value of V_D1 = 1.00 Volt\n",
+ "Value of V_D2 = 1.00 Volt\n",
+ "Part (d)\n",
+ "Highest value of V_CM = 1.50 Volt\n",
+ "Part (e)\n",
+ "Lowest value of V_CM = -0.28 Volt \n",
+ "Lowest value of V_S = -1.10 Volt\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 4.3 - page 341"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Given data\n",
+ "I= 0.4 # in mA\n",
+ "unCox= 0.2 # in mA/V**2\n",
+ "i_D= I/2 # in mA\n",
+ "V_OV1= 0.2 # in V\n",
+ "V_OV2= 0.3 # in V\n",
+ "V_OV3= 0.4 # in V\n",
+ "WbyL1= 2*i_D/(unCox*V_OV1**2) \n",
+ "gm1= I/V_OV1 # in mA/V\n",
+ "WbyL2= 2*i_D/(unCox*V_OV2**2) \n",
+ "gm2= I/V_OV2 # in mA/V\n",
+ "WbyL3= 2*i_D/(unCox*V_OV3**2) \n",
+ "gm3= I/V_OV3 # in mA/V\n",
+ "print \"Vov (in V) \",V_OV1,\" \",V_OV2,\" \",V_OV3\n",
+ "print \"W/L \",WbyL1,\" \",round(WbyL2,1),\" \",WbyL3\n",
+ "print \"gm(in mA/V) \",gm1,\" \",round(gm2,2),\" \",gm3"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Vov (in V) 0.2 0.3 0.4\n",
+ "W/L 50.0 22.2 12.5\n",
+ "gm(in mA/V) 2.0 1.33 1.0\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 4.4 - page 341"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Given data\n",
+ "V_A= 20 # in V\n",
+ "R_D= 5 # in k\u03a9\n",
+ "R_D= R_D*10**3 # in \u03a9\n",
+ "I= 0.8 # in mA\n",
+ "I=I*10**-3 # in A\n",
+ "i_D= I/2 # in A\n",
+ "unCox= 0.2 # mA/V**2\n",
+ "unCox= unCox*10**-3 # in A/V**2\n",
+ "WbyL= 100 \n",
+ "# Formula i_D= 1/2*unCox*WbyL*V_OV**2\n",
+ "V_OV= sqrt(2*i_D/(unCox*WbyL)) # in V\n",
+ "print \"The value of V_OV = %0.2f Volts\" %V_OV\n",
+ "gm= I/V_OV # in A/V \n",
+ "print \"The value of gm = %0.f mA/V\" %(gm*10**3)\n",
+ "r_o= V_A/i_D # in \u03a9\n",
+ "print \"The value of r_o = %0.f k\u03a9\" %(r_o*10**-3)\n",
+ "# Ad= v_o/v_id = gm*(R_D || r_o)\n",
+ "Ad= gm*(R_D*r_o/(R_D+r_o)) # in V/V\n",
+ "print \"Differential gain = %0.1f V/V \" %Ad"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The value of V_OV = 0.20 Volts\n",
+ "The value of gm = 4 mA/V\n",
+ "The value of r_o = 50 k\u03a9\n",
+ "Differential gain = 18.2 V/V \n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 4.5 - page 342"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from __future__ import division\n",
+ "from numpy import log10\n",
+ "# Given data\n",
+ "R_D= 5 # in k\u03a9\n",
+ "R_D= R_D*10**3 # in \u03a9\n",
+ "R_SS= 25 # in k\u03a9\n",
+ "R_SS= R_SS*10**3 # in \u03a9\n",
+ "I= 0.8 # in mA\n",
+ "I=I*10**-3 # in A\n",
+ "i_D= I/2 # in A\n",
+ "unCox= 0.2 # mA/V**2\n",
+ "unCox= unCox*10**-3 # in A/V**2\n",
+ "WbyL= 100 \n",
+ "# Formula i_D= 1/2*unCox*WbyL*V_OV**2\n",
+ "V_OV= sqrt(2*i_D/(unCox*WbyL)) # in V\n",
+ "gm= i_D/V_OV # in A/V \n",
+ "\n",
+ "# Part (a)\n",
+ "Ad= 1/2*gm*R_D # in V/V\n",
+ "print \"Differential gain = %0.f V/V\" %(Ad)\n",
+ "Acm= -R_D/(2*R_SS) # in V/V\n",
+ "print \"Common mode gain = %0.1f V/V\" %Acm\n",
+ "CMRR= abs(Ad)/abs(Acm) \n",
+ "CMRRindB= round(20*log10(CMRR)) # in dB\n",
+ "print \"Common mode rejection ratio = %0.f dB\" %CMRRindB\n",
+ "\n",
+ "\n",
+ "# Part (b)\n",
+ "print \"Part (b) when output is taken differentially\"\n",
+ "Ad= gm*R_D # in V/V\n",
+ "print \"Differential gain = %0.f V/V\" %Ad\n",
+ "Acm= 0 \n",
+ "print \"Common mode gain = %0.1f V/V \"%Acm\n",
+ "CMRRindB= 20*log10(Ad/Acm) # in dB\n",
+ "print \"Common mode rejection ratio = %0.f dB\" %CMRRindB\n",
+ "\n",
+ "\n",
+ "# Part (c)\n",
+ "print \"Part (c) when output is taken differentially but the drain resistance have a 1% mismatch.\"\n",
+ "Ad= gm*R_D # in V/V\n",
+ "print \"Differential gain = %0.f V/V\" %Ad\n",
+ "# delta_R_D= 1% of R_D\n",
+ "delta_R_D= R_D*1.0/100 # in \u03a9 \n",
+ "Acm= R_D/(2*R_SS)*delta_R_D/R_D # in V/V\n",
+ "print \"Common mode gain = %0.3f V/V\" %Acm\n",
+ "CMRRindB= 20*log10(abs(Ad)/abs(Acm)) # in dB\n",
+ "print \"Common mode rejection ratio = %0.1f dB\" %CMRRindB\n",
+ "\n",
+ "# Note: In the book, there is putting wrong value of Ad (20 at place of 10)\n",
+ "#to evaluate the value of CMRR in dB in part(c) , So the answer of CMRR in dB of Part (c) is wrong"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Differential gain = 5 V/V\n",
+ "Common mode gain = -0.1 V/V\n",
+ "Common mode rejection ratio = 34 dB\n",
+ "Part (b) when output is taken differentially\n",
+ "Differential gain = 10 V/V\n",
+ "Common mode gain = 0.0 V/V \n",
+ "Common mode rejection ratio = inf dB\n",
+ "Part (c) when output is taken differentially but the drain resistance have a 1% mismatch.\n",
+ "Differential gain = 10 V/V\n",
+ "Common mode gain = 0.001 V/V\n",
+ "Common mode rejection ratio = 80.0 dB\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 4.6 - page 343"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Given data (From Exa 4.4)\n",
+ "R_D= 5 # in k\u03a9\n",
+ "R_D= R_D*10**3 # in \u03a9\n",
+ "R_SS= 25 # in k\u03a9\n",
+ "R_SS= R_SS*10**3 # in \u03a9\n",
+ "I= 0.8 # in mA\n",
+ "I=I*10**-3 # in A\n",
+ "i_D= I/2 # in A\n",
+ "unCox= 0.2 # mA/V**2\n",
+ "unCox= unCox*10**-3 # in A/V**2\n",
+ "WbyL= 100 \n",
+ "# Formula i_D= 1/2*unCox*WbyL*V_OV**2\n",
+ "V_OV= sqrt(2*i_D/(unCox*WbyL)) # in V\n",
+ "gm= i_D/V_OV # in A/V \n",
+ "# gm mismatch have a negligible effect on Ad\n",
+ "Ad= gm*R_D # in V/V(approx) \n",
+ "# delta_gm= 1% of gm\n",
+ "delta_gm = gm*1/100 # in A/V\n",
+ "Acm= R_D/(2*R_SS)*delta_gm/gm \n",
+ "CMRRindB= 20*log10(Ad/Acm) \n",
+ "print \"CMRR is %0.f dB\"%CMRRindB"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "CMRR is 80 dB\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 4.7 - page 344"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Given data \n",
+ "V_CM= 0 \n",
+ "V_BE= -0.7 # in volt\n",
+ "v_E= V_CM-V_BE # in volt\n",
+ "print \"Value of v_E = %0.1f Volts\" %v_E\n",
+ "\n",
+ "I_E= (5-0.7)/10**3 # in A\n",
+ "v_B1= 0.5 # in V\n",
+ "v_B2= 0 # in V\n",
+ "# Due to Q1 is off therefore\n",
+ "v_C1= -5 # in V\n",
+ "v_C2= I_E*10**3-5 # in V\n",
+ "print \"Value of v_C1 = %0.1f Volts\" %v_C1\n",
+ "print \"Value of v_C2 = %0.1f Volts\" %v_C2"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Value of v_E = 0.7 Volts\n",
+ "Value of v_C1 = -5.0 Volts\n",
+ "Value of v_C2 = -0.7 Volts\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 4.8 - page 345"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from numpy import log\n",
+ "# Given data \n",
+ "iE1_by_I= 0.99 # as it is given that iE1= 0.99 *I\n",
+ "VT= 0.025 # in volt\n",
+ "# Formula iE1= I/(1+%e**(-vid/VT))\n",
+ "# %e**(-vid/VT)= 1/iE1_by_I-1\n",
+ "vid= log( 1/iE1_by_I-1)*(-VT) # in volt\n",
+ "print \"Input differential signal = %0.1f mV\" %round(vid*10**3)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Input differential signal = 115.0 mV\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 4.9 - page 345"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Given data \n",
+ "Beta= 100 \n",
+ "\n",
+ "# Part (a)\n",
+ "RE= 150 # in \u03a9\n",
+ "VT= 25 # in mV\n",
+ "VT= VT*10**-3 # in V\n",
+ "IE= 0.5 # in mA\n",
+ "IE=IE*10**-3 # in A\n",
+ "re1= VT/IE #in \u03a9\n",
+ "R_id= 2*(Beta+1)*(re1+RE) # in \u03a9\n",
+ "R_id= round(R_id*10**-3) # in k\u03a9\n",
+ "print \"(a) The input differential resistance = %0.1f k\u03a9\" %R_id\n",
+ "\n",
+ "# Part (b)\n",
+ "RC=10 #in k\u03a9\n",
+ "RC=RC*10**3 #in \u03a9\n",
+ "Rsig= 5+5 # in k\u03a9\n",
+ "VoltageGain1= R_id/(Rsig+R_id) #voltage gain from the signal source to the base of Q1 and Q2 in V/V\n",
+ "VoltageGain2= 2*RC/(2*(re1+RE)) # voltage gain from the bases to the output in V/V\n",
+ "Ad= VoltageGain1*VoltageGain2 #in V/V\n",
+ "print \"(b) The overall differential voltage gain = %0.1f V/V\" %Ad\n",
+ "\n",
+ "# Part (c)\n",
+ "delta_RC= 0.02*RC \n",
+ "R_EE= 200 #in k\u03a9\n",
+ "R_EE=R_EE*10**3 #in \u03a9\n",
+ "Acm= RC/(2*R_EE)*delta_RC/RC #in V/V\n",
+ "print \"(c) Common mode gain = %0.e V/V\" %Acm\n",
+ "\n",
+ "# Part (d)\n",
+ "CMRRindB= 20*log10(Ad/Acm) # in dB\n",
+ "print \"(d) CMRR = %.f dB\" %CMRRindB\n",
+ "\n",
+ "# Part (e)\n",
+ "V_A= 100 # in V\n",
+ "r_o= V_A/(IE) # in \u03a9\n",
+ "# Ricm= (Beta+1)*(R_EE || r_o/2)\n",
+ "Ricm= (Beta+1)*(R_EE*(r_o/2)/(R_EE+(r_o/2))) \n",
+ "print \"(e) Input common mode resistance = %0.1f M\u03a9\" %(Ricm*10**-6)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a) The input differential resistance = 40.0 k\u03a9\n",
+ "(b) The overall differential voltage gain = 40.0 V/V\n",
+ "(c) Common mode gain = 5e-04 V/V\n",
+ "(d) CMRR = 98 dB\n",
+ "(e) Input common mode resistance = 6.7 M\u03a9\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 4.10 - page 347"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Given data \n",
+ "delta_RDbyRD= 2/100 \n",
+ "delta_WLbyWL= 2/100 \n",
+ "delta_Vt= 2 #in mV\n",
+ "delta_Vt= delta_Vt*10**-3 # in V\n",
+ "#(From Exa 4.4)\n",
+ "V_A= 20 # in V\n",
+ "R_D= 5 # in k\u03a9\n",
+ "R_D= R_D*10**3 # in \u03a9\n",
+ "I= 0.8 # in mA\n",
+ "I=I*10**-3 # in A\n",
+ "i_D= I/2 # in A\n",
+ "unCox= 0.2 # mA/V**2\n",
+ "unCox= unCox*10**-3 # in A/V**2\n",
+ "WbyL= 100 \n",
+ "# Formula i_D= 1/2*unCox*WbyL*V_OV**2\n",
+ "V_OV= sqrt(2*i_D/(unCox*WbyL)) # in V\n",
+ "V_OS1= V_OV/2*delta_RDbyRD # in V\n",
+ "\n",
+ "# V_OS due to W/L ratio\n",
+ "V_OS2= V_OV/2*delta_WLbyWL # in V\n",
+ "\n",
+ "# V_OS due to threshold voltage\n",
+ "V_OS3= delta_Vt # in V\n",
+ "# Total offset voltage\n",
+ "V_OS= sqrt(V_OS1**2+V_OS2**2+V_OS3**2) # in V\n",
+ "V_OS= V_OS*10**3 # in mV\n",
+ "print \"Total offset voltage = %0.1f mV\" %V_OS"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Total offset voltage = 3.5 mV\n"
+ ]
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 4.11 - page 348"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Given data \n",
+ "WLn= 100 \n",
+ "WLp= 200 \n",
+ "unCox= 0.2 # mA/V**2\n",
+ "unCox=unCox*10**-3 #in A/V**2\n",
+ "RSS= 25 # in k\u03a9\n",
+ "RSS= RSS*10**3 # in \u03a9\n",
+ "I=0.8 # in mA\n",
+ "I=I*10**-3 #in A\n",
+ "V_A= 20 # in V\n",
+ "i_D= I/2 # in A\n",
+ "# Formula i_D= 1/2*unCox*WLn*V_OV**2\n",
+ "V_OV= sqrt(2*i_D/(unCox*WLn)) # in V\n",
+ "gm= I/V_OV # in A/V\n",
+ "print \"Value of Gm = %0.1f mA/V\" %(gm*10**3)\n",
+ "ro2= V_A/(I/2) # in ohm\n",
+ "ro4= ro2 # in ohm\n",
+ "Ro= ro2*ro4/(ro2+ro4) # in ohm\n",
+ "print \"Value of Ro = %0.1f k\u03a9\" %(Ro*10**-3)\n",
+ "Ad= gm*Ro # in V/V\n",
+ "print \"Value of Ad = %0.1f V/V\" %Ad\n",
+ "# Finding the value of gm3\n",
+ "upCox= 0.1 # mA/V**2\n",
+ "upCox=upCox*10**-3 #in A/V**2\n",
+ "# Formula i_D= 1/2*upCox*WLp*V_OV**2\n",
+ "V_OV= sqrt(2*i_D/(upCox*WLp)) # in V\n",
+ "gm3= I/V_OV # in A/V\n",
+ "Acm= 1/(2*gm3*RSS) #in V/V\n",
+ "print \"Value of |Acm| = %0.3f V/V\" %(abs(Acm))\n",
+ "CMRRindB= 20*log10(abs(Ad)/abs(Acm)) #in dB\n",
+ "print \"CMRR = %0.f dB\" %(round(CMRRindB))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Value of Gm = 4.0 mA/V\n",
+ "Value of Ro = 25.0 k\u03a9\n",
+ "Value of Ad = 100.0 V/V\n",
+ "Value of |Acm| = 0.005 V/V\n",
+ "CMRR = 86 dB\n"
+ ]
+ }
+ ],
+ "prompt_number": 14
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 4.12 - page 349"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Given data \n",
+ "I=0.8 # in mA\n",
+ "I=I*10**-3 #in A\n",
+ "V_A= 100 # in V\n",
+ "Beta=160 \n",
+ "VT=25 # in mV\n",
+ "VT= VT*10**-3 #in V\n",
+ "gm= (I/2)/VT # in A/V\n",
+ "Gm= gm # Short circuit trnsconductance in mA/V\n",
+ "print \"The value of Gm = %0.1f mA/V\" %(Gm*10**3)\n",
+ "ro2= V_A/(I/2) # in ohm\n",
+ "ro4= ro2 # in ohm\n",
+ "Ro= ro2*ro4/(ro2+ro4) # in ohm\n",
+ "print \"The value of Ro = %0.1f k\u03a9\" %(Ro*10**-3)\n",
+ "Ad= Gm*Ro # in V/V\n",
+ "print \"Value of Ad = %0.1f V/V\" %Ad\n",
+ "r_pi= Beta/gm #in \u03a9\n",
+ "Rid= 2*r_pi # in \u03a9\n",
+ "print \"The value of Rid = %0.1f k\u03a9\" %(Rid*10**-3)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The value of Gm = 16.0 mA/V\n",
+ "The value of Ro = 125.0 k\u03a9\n",
+ "Value of Ad = 2000.0 V/V\n",
+ "The value of Rid = 20.0 k\u03a9\n"
+ ]
+ }
+ ],
+ "prompt_number": 15
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 4.13 - page 349"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Given data \n",
+ "Vtp= -0.8 # in V\n",
+ "KpWL= 3.5 # in mA/V**2\n",
+ "I=0.7 # in mA\n",
+ "I=I*10**-3 # in A\n",
+ "R_D= 2 # in k\u03a9\n",
+ "R_D=R_D*10**3 # in \u03a9\n",
+ "KpWL=KpWL*10**-3 #in A/V**2\n",
+ "v_G1= 0 # in V\n",
+ "v_G2=v_G1 # in V\n",
+ "VSS= 2.5 # in V\n",
+ "VDD=VSS # in V\n",
+ "VCS= 0.5 # in V\n",
+ "print \"Part (a)\"\n",
+ "V_OV= -sqrt(I/KpWL) # in V\n",
+ "print \"The value of V_OV = %0.2f Volts\" %V_OV\n",
+ "V_GS= V_OV+Vtp # in V\n",
+ "print \"The value of V_GS = %0.2f Volts\" %V_GS\n",
+ "V_G= 0 # as gate is connected ground\n",
+ "v_S1= V_G-V_GS # in V\n",
+ "v_S2= v_S1 # in V\n",
+ "print \"The value of v_S1 = %0.2f Volts\" %v_S1\n",
+ "v_D1= I/2*R_D-VDD # in V\n",
+ "v_D2=v_D1 # in V\n",
+ "print \"The value of v_D1 = %0.1f Volts\" %v_D1\n",
+ "print \"The value of v_D2 = %0.1f Volts\" %v_D2\n",
+ "\n",
+ "print \"Part (b)\"\n",
+ "V_CMmin= I*R_D/2-VDD+Vtp # in V\n",
+ "V_CMmax= VSS-VCS+Vtp+V_OV # in V\n",
+ "print \"The value of V_CMmin = %0.1f Volts\" %V_CMmin\n",
+ "print \"The value of V_CMmax = %0.2f Volts\" %V_CMmax"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Part (a)\n",
+ "The value of V_OV = -0.45 Volts\n",
+ "The value of V_GS = -1.25 Volts\n",
+ "The value of v_S1 = 1.25 Volts\n",
+ "The value of v_D1 = -1.8 Volts\n",
+ "The value of v_D2 = -1.8 Volts\n",
+ "Part (b)\n",
+ "The value of V_CMmin = -2.6 Volts\n",
+ "The value of V_CMmax = 0.75 Volts\n"
+ ]
+ }
+ ],
+ "prompt_number": 16
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 4.14 - page 351"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Given data \n",
+ "V_OV= 0.2 # in V\n",
+ "gm=1 # in mA/V\n",
+ "gm=gm*10**-3 # in A/V\n",
+ "Vt=0.8 # in V\n",
+ "unCox= 90 # in \u00b5A/V**2\n",
+ "unCox=unCox*10**-6 # in A/V**2\n",
+ "# gm= I/V_OV\n",
+ "I= gm*V_OV # in A\n",
+ "print \"Bias current = %0.1f mA\" %(I*10**3)\n",
+ "I_D= I/2 # in A\n",
+ "# Formula I_D= 1/2*unCox*WLn*V_OV**2\n",
+ "WbyL= 2*I_D/(unCox*V_OV**2) \n",
+ "print \"W/L ratio is %0.1f \"%WbyL"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Bias current = 0.2 mA\n",
+ "W/L ratio is 55.6 \n"
+ ]
+ }
+ ],
+ "prompt_number": 17
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 4.15 - page 351"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Given data \n",
+ "I=0.5 # in mA\n",
+ "I=I*10**-3 # in A\n",
+ "WbyL= 50 \n",
+ "unCox= 250 # in \u00b5A/V**2\n",
+ "unCox=unCox*10**-6 # in A/V**2\n",
+ "V_A= 10 # in V\n",
+ "R_D= 4 #in k\u03a9\n",
+ "R_D= R_D*10**3 #in \u03a9\n",
+ "V_OV= sqrt(I/(WbyL*unCox)) #in V\n",
+ "print \"The value of V_OV = %0.2f V \" %V_OV\n",
+ "gm= I/V_OV # in A/V\n",
+ "print \"The value of gm = %0.2f mA/V\" %(gm*10**3)\n",
+ "I_D=I/2 # in A\n",
+ "ro= V_A/I_D # in \u03a9\n",
+ "print \"The value of ro = %0.2f k\u03a9\" %(ro*10**-3)\n",
+ "Ad= gm*(R_D*ro/(R_D+ro)) # in V/V\n",
+ "print \"The value of Ad = %0.2f V/V \" %Ad"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The value of V_OV = 0.20 V \n",
+ "The value of gm = 2.50 mA/V\n",
+ "The value of ro = 40.00 k\u03a9\n",
+ "The value of Ad = 9.09 V/V \n"
+ ]
+ }
+ ],
+ "prompt_number": 18
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 4.16 - page 352"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Given data \n",
+ "I=1 # in mA\n",
+ "I=I*10**-3 # in A\n",
+ "i_C=1 # in mA\n",
+ "i_C=i_C*10**-3 # in A\n",
+ "V_CC= 5 # in V\n",
+ "V_CM= -2 # in V\n",
+ "V_BE= 0.7 # in V\n",
+ "R_C= 3 # in k\u03a9\n",
+ "R_C= R_C*10**3 # in \u03a9\n",
+ "Alpha=1 \n",
+ "Beta=100 \n",
+ "V_B= 1 # in V\n",
+ "i_C1= Alpha*I # in A\n",
+ "i_C2=0 # A\n",
+ "v_E= V_B-V_BE # in V\n",
+ "print \"Emitters voltage = %0.2f Volt\" %v_E,\n",
+ "v_C1= V_CC-i_C1*R_C # in V\n",
+ "v_C2= V_CC-i_C2*R_C # in V\n",
+ "print \"Output voltage is\",v_C1,\"V &\",v_C2,\"V\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Emitters voltage = 0.30 Volt Output voltage is 2.0 V & 5 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 19
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
diff --git a/Electronic_Circuits_by_P._Raja/Chapter5.ipynb b/Electronic_Circuits_by_P._Raja/Chapter5.ipynb
new file mode 100755
index 00000000..26c74103
--- /dev/null
+++ b/Electronic_Circuits_by_P._Raja/Chapter5.ipynb
@@ -0,0 +1,910 @@
+{
+ "metadata": {
+ "name": "",
+ "signature": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter5 - Feedback amplifiers"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 5.1 - page 383"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from __future__ import division\n",
+ "# Given data\n",
+ "A= 800 # unit less\n",
+ "Af= 50 # unit less\n",
+ "# Formula Af= A/(1+Bita*A)\n",
+ "Beta= 1/Af-1/A \n",
+ "print \"Percentage of output which is feedback to the input = %0.3f %%\" %(Beta*100)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Percentage of output which is feedback to the input = 1.875 %\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 5.2 - page 384"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Given data\n",
+ "Af= 100 # unit less\n",
+ "Vi= 50 # in mV\n",
+ "Vi= Vi*10**-3 # in V\n",
+ "Vs= 0.5 # in V\n",
+ "# Formula Af= Vo/Vs\n",
+ "Vo= Af*Vs # in V\n",
+ "A= Vo/Vi \n",
+ "print \"Value of A is %0.f \"%A\n",
+ "# Formula Af= A/(1+B*A)\n",
+ "B= 1/Af-1/A \n",
+ "B=B*100 # in %\n",
+ "print \"Value of B is %0.1f %%\" %B"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Value of A is 1000 \n",
+ "Value of B is 0.9 %\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 5.3 - page 385"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Given data\n",
+ "Beta= 5/100 \n",
+ "f_H= 50 # in kHz\n",
+ "f_H= f_H*10**3 # in Hz\n",
+ "f_L= 50 # in kHz\n",
+ "Amid= 1000 \n",
+ "f_LF= f_L/(1+Beta*Amid) # in Hz\n",
+ "f_HF= f_H*(1+Beta*Amid) # in Hz\n",
+ "print \"Value of f_LF = %0.2f Hz\" %f_LF\n",
+ "print \"Value of f_HF = %0.2f MHz\" %(f_HF*10**-6)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Value of f_LF = 0.98 Hz\n",
+ "Value of f_HF = 2.55 MHz\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 5.4 - page 385"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Given data\n",
+ "dAf_by_Af= 0.2/100 \n",
+ "dA_by_A= 150/2000 \n",
+ "A=2000 \n",
+ "# Formula dAf_by_Af = 1/(1+Bita*A) * dA_by_A\n",
+ "Beta= dA_by_A/(A*dAf_by_Af )-1/A \n",
+ "Af= A/(1+Beta*A) \n",
+ "print \"Value of Beta = %0.3f %%\" %(Beta*100)\n",
+ "print \"Value of Af is %0.2f \" %Af"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Value of Beta = 1.825 %\n",
+ "Value of Af is 53.33 \n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 5.5 - page 386"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Given data\n",
+ "Av= 140 \n",
+ "Avf= 17.5 \n",
+ "# Formula Avf= Av/(1+Av*Beta)\n",
+ "Beta= 1/Avf-1/Av \n",
+ "print \"Fraction of the output is %0.2f \"%Beta"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Fraction of the output is 0.05 \n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 5.6 - page 386"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Given data\n",
+ "Av= 100 \n",
+ "Avf= 50 \n",
+ "# Formula Avf= Av/(1+Av*Beta)\n",
+ "Beta= 1/Avf-1/Av \n",
+ "print \"The vlaue of beta is %0.2f\" %Beta\n",
+ "\n",
+ "# Part(ii)\n",
+ "Avf= 75 \n",
+ "# Formula Avf= Av/(1+Av*Beta)\n",
+ "Av= Avf/(1-Beta*Avf)\n",
+ "print \"Value of amplifier gain is %0.f \"%Av"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The vlaue of beta is 0.01\n",
+ "Value of amplifier gain is 300 \n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 5.7 - page 387"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Given data\n",
+ "Av= 50 \n",
+ "Avf= 25 \n",
+ "# Formula Avf= Av/(1+Av*Beta)\n",
+ "Beta= 1/Avf-1/Av \n",
+ "# Part(i)\n",
+ "Av=50 \n",
+ "Avf= 40 \n",
+ "Perc_reduction= (Av-Avf)/Av*100 # Percentage of reduction in stage gain in %\n",
+ "print \"Without feedback, percentage of reduction in stage gain = %0.f %%\" %(Perc_reduction)\n",
+ "\n",
+ "# Part(ii)\n",
+ "Av= 40 \n",
+ "Avf= 25 \n",
+ "gain_with_neg_feed= Av/(1+Beta*Av) \n",
+ "Perc_reduction= (Avf-gain_with_neg_feed)/Avf*100 # in %\n",
+ "print \"With feedback, percentage reduction in stage gain = %0.1f %%\" %Perc_reduction"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Without feedback, percentage of reduction in stage gain = 20 %\n",
+ "With feedback, percentage reduction in stage gain = 11.1 %\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 5.8 - page 387"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from numpy import pi\n",
+ "# Given data\n",
+ "Ao= 10**4 \n",
+ "Afo= 50 \n",
+ "omega_H= 2*pi*100 # in rad/s\n",
+ "# Formula Afo= Ao/(1+Ao*Beta)\n",
+ "Beta= 1/Afo-1/Ao \n",
+ "omega_f_H= omega_H*(1+Ao*Beta) \n",
+ "print \"Closed loop bandwidth in rad/s is\",omega_f_H,\"or 2*pi*20*10**3\" "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Closed loop bandwidth in rad/s is 125663.706144 or 2*pi*20*10**3\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 5.10 - page 399"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from numpy import inf\n",
+ "# Given data\n",
+ "gm=50 \n",
+ "R_E= 100 # in ohm\n",
+ "R_S= 1 # in kohm\n",
+ "R_S=R_S*10**3 # in ohm\n",
+ "r_pi= 1100 # in ohm\n",
+ "h_ie= r_pi \n",
+ "# Formula Av= Vo/Vs, But Vo= gm*vpi*R_E and Vs= Ib*(Ri+rpi), so\n",
+ "Av= gm*R_E/(R_S+h_ie)\n",
+ "# As Vo=Vf, so\n",
+ "Beta=1 \n",
+ "D= 1+Beta*Av \n",
+ "Avf= Av/D \n",
+ "Ri= R_S+r_pi # in ohm\n",
+ "Ri= Ri*10**-3 # in kohm\n",
+ "R_if= Ri*D # in kohm\n",
+ "Ro= inf # ohm\n",
+ "Rof= Ro*D # ohm\n",
+ "print \"Value of Av = %0.2f \" %Av\n",
+ "print \"Value of Beta = %0.f\" %Beta\n",
+ "print \"Value of Avf = %0.2f\" %Avf\n",
+ "print \"Value of Ri = %0.2f kohm\" %Ri\n",
+ "print \"Value of R_if = %0.2f kohm\" % R_if\n",
+ "print \"Value of R_of = %0.2f \" % Rof\n",
+ "# Answer slightly mismatch because of calculation accuracy in the textbook."
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Value of Av = 2.38 \n",
+ "Value of Beta = 1\n",
+ "Value of Avf = 0.70\n",
+ "Value of Ri = 2.10 kohm\n",
+ "Value of R_if = 7.10 kohm\n",
+ "Value of R_of = inf \n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 5.11 - page 400"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Given data\n",
+ "gm=2 # in mA/V\n",
+ "gm=gm*10**-3 # in A/V\n",
+ "r_d= 40 # in kohm\n",
+ "r_d= r_d*10**3 # in ohm\n",
+ "Rs= 3 # in kohm\n",
+ "Rs= Rs*10**3 # in ohm\n",
+ "miu= gm*r_d \n",
+ "Bita=1 \n",
+ "Av= miu*Rs/(r_d+Rs) \n",
+ "D= 1+Bita*Av \n",
+ "Avf= Av/D \n",
+ "Ri=inf # ohm\n",
+ "R_if = Ri*D # ohm\n",
+ "Rof= r_d/D # in ohm\n",
+ "print \"Value of Av = %0.2f \" %Av\n",
+ "print \"Value of D = %0.2f \" %D\n",
+ "print \"Value of Avf = %0.3f \" %Avf\n",
+ "print \"Value of R_if = %0.2f \" % R_if\n",
+ "print \"Value of R_of = %0.2e \" % Rof"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Value of Av = 5.58 \n",
+ "Value of D = 6.58 \n",
+ "Value of Avf = 0.848 \n",
+ "Value of R_if = inf \n",
+ "Value of R_of = 6.08e+03 \n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 5.12 - page 406"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Given data\n",
+ "gm=75 # in A/V\n",
+ "Rs= 1 # in kohm\n",
+ "Rs= Rs*10**3 # in ohm\n",
+ "R_E= 1 # in kohm\n",
+ "R_E= R_E*10**3 # in ohm\n",
+ "rpi= 1 # in kohm\n",
+ "rpi= rpi*10**3 # in ohm\n",
+ "hie=rpi \n",
+ "\n",
+ "Io= -gm \n",
+ "Vi= Rs+R_E+rpi \n",
+ "Gm= Io/Vi \n",
+ "print \"Value of Gm = %0.3f \" %Gm\n",
+ "Beta=-R_E \n",
+ "print \"Value of Beta = %0.f \" %Beta\n",
+ "D= 1+Beta*Gm \n",
+ "print \"Value of D = %0.f \" %D\n",
+ "Gmf= -Gm/D \n",
+ "print \"Value of Gmf = %0.1e\" %Gmf\n",
+ "Ri= Rs+R_E+hie # in ohm\n",
+ "Rif= Ri*D # in ohm\n",
+ "Rif=Rif*10**-3 # in kohm\n",
+ "print \"Value of Rif = %0.f kohm\" %Rif\n",
+ "Ro=inf \n",
+ "R_of = Ro*D # ohm\n",
+ "print \"Value of R_of = %0.2f \" %R_of"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Value of Gm = -0.025 \n",
+ "Value of Beta = -1000 \n",
+ "Value of D = 26 \n",
+ "Value of Gmf = 9.6e-04\n",
+ "Value of Rif = 78 kohm\n",
+ "Value of R_of = inf \n"
+ ]
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 5.19 - page 417"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Given data\n",
+ "A= 10**5 \n",
+ "Af= 100 \n",
+ "# Formula Af= A/(1+A*Bita)\n",
+ "Bita= 1/Af-1/A \n",
+ "\n",
+ "\n",
+ "#when A= 10**3\n",
+ "A=10**3 \n",
+ "Af_desh= A/(1+A*Bita) \n",
+ "\n",
+ "delta_Af= Af_desh-Af \n",
+ "Perc_Change_inAf= delta_Af/Af*100 # in %\n",
+ "print \"Percentage change in Af = %0.f %% \" %Perc_Change_inAf"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Percentage change in Af = -9 % \n"
+ ]
+ }
+ ],
+ "prompt_number": 14
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 5.20 - page 417"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from numpy import log10\n",
+ "# Given data\n",
+ "A= 100 \n",
+ "Vs=1 # in volt\n",
+ "Beta=1 # as in the voltage follower, the output voltage is same as input\n",
+ "Af= A/(1+Beta*A) \n",
+ "CLG= 1+A*Beta # closed loop gain\n",
+ "print \"Closed loop gain = %0.f\" %CLG\n",
+ "CLG_dB= 20*log10(CLG) \n",
+ "print \"Closed loop gain = %0.1f dB\" %CLG_dB\n",
+ "Vo= Af*Vs # in V\n",
+ "print \"Value of Vo = %0.2f Volt\" %Vo\n",
+ "Vi= Vs-Vo # in V\n",
+ "print \"Value of Vi = %0.2f mV\" %round(Vi*10**3)\n",
+ "# If A decrease 10%,i.e.\n",
+ "A=90 \n",
+ "Af_desh= A/(1+Beta*A) \n",
+ "Per_gain_reduction= (Af_desh-Af)/Af*100 # in %\n",
+ "print \"Percentage of gain reduction = %0.1f %%\" %Per_gain_reduction"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Closed loop gain = 101\n",
+ "Closed loop gain = 40.1 dB\n",
+ "Value of Vo = 0.99 Volt\n",
+ "Value of Vi = 10.00 mV\n",
+ "Percentage of gain reduction = -0.1 %\n"
+ ]
+ }
+ ],
+ "prompt_number": 15
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 5.21 - page 418"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Given data\n",
+ "# Part (a)\n",
+ "PerError= 1 # in %\n",
+ "A= 10**5 # (Assumed value)\n",
+ "ABita= 1/PerError*100 \n",
+ "Bita= 1/(PerError*A) \n",
+ "print \"% error A A\u00df 1+A\u00df\"\n",
+ "print PerError,\" %.e\"%A,\" \",ABita,\" \",1+ABita\n",
+ "# Part (b)\n",
+ "PerError= 5 # in %\n",
+ "ABita= 1/PerError*100 \n",
+ "Bita= 1/(PerError*A) \n",
+ "print PerError,\" %.e\"%A,\" \",ABita,\" \",1+ABita\n",
+ "# Part (c)\n",
+ "PerError= 50 # in %\n",
+ "ABita= 1/PerError*100 \n",
+ "Bita= 1/(PerError*A) \n",
+ "print PerError,\" %.e\"%A,\" \",ABita,\" \",1+ABita"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "% error A A\u00df 1+A\u00df\n",
+ "1 1e+05 100.0 101.0\n",
+ "5 1e+05 20.0 21.0\n",
+ "50 1e+05 2.0 3.0\n"
+ ]
+ }
+ ],
+ "prompt_number": 16
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 5.22 - page 419"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Given data\n",
+ "S= -20 # sensitivity of closed to open loop gain in dB\n",
+ "# sensitivity of closed to open loop gain = 1/(1+AB) = S\n",
+ "# or (1+AB) = -S\n",
+ "AB= 10**(-S/20) - 1 \n",
+ "print \"The loop gain AB = %0.2f, \\nfor which the sensitivity of closed loop gain to open loop gain is -20 dB\" %AB\n",
+ "\n",
+ "# Part (b) when \n",
+ "S= 1/2 # sensitivity of closed to open loop gain in dB\n",
+ "#S= 1/(1+AB)\n",
+ "AB= 1/S-1 \n",
+ "print \"The loop gain AB = %0.2f, \\nfor which the sensitivity of closed loop gain to open loop gain is 1/2 \" %AB"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The loop gain AB = 9.00, \n",
+ "for which the sensitivity of closed loop gain to open loop gain is -20 dB\n",
+ "The loop gain AB = 1.00, \n",
+ "for which the sensitivity of closed loop gain to open loop gain is 1/2 \n"
+ ]
+ }
+ ],
+ "prompt_number": 17
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 5.23 - page 419"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from __future__ import division\n",
+ "#Given Data\n",
+ "A = 1e5\n",
+ "Af = 1e3\n",
+ "Beta = 0.99*1e-3 \n",
+ "GDF = 1+A*Beta\n",
+ "print \"Gain density factor %0.2f\" %GDF\n",
+ "# part (a)\n",
+ "A_dash = A*90/100\n",
+ "Af_dash = A_dash/(1+A_dash*Beta)\n",
+ "cp = (Af-Af_dash)/Af*100 # Corresponding %\n",
+ "print \"(a) Corresponding % =\",round(cp,2),\"%\"\n",
+ "# part (a)\n",
+ "A_dash = A*70/100\n",
+ "Af_dash = A_dash/(1+A_dash*Beta)\n",
+ "cp = (Af-Af_dash)/Af*100 # Corresponding %\n",
+ "print \"(b) Corresponding % =\",round(cp,2),\"%\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Gain density factor 100.00\n",
+ "(a) Corresponding % = 0.11 %\n",
+ "(b) Corresponding % = 0.43 %\n"
+ ]
+ }
+ ],
+ "prompt_number": 18
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 5.24 - page 420"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Given data\n",
+ "A=100 \n",
+ "Af= 10 \n",
+ "f_L= 100 # in Hz\n",
+ "f_H= 10 # in kHz\n",
+ "# Af= A/(1+A*Bita)\n",
+ "Bita= 1/Af-1/A \n",
+ "f_desh_L= f_L/(1+A*Bita) # in Hz\n",
+ "f_desh_H= f_H/(1+A*Bita) # in kHz\n",
+ "print \"Low frequency = %0.2f Hz\" %f_desh_L\n",
+ "print \"High frequency = %0.2f kHz\" %f_desh_H\n",
+ "\n",
+ "# Note: In the book Calculation to find the value of high frequency i.e. f_desh_H is wrong so the answer in the book is wrong "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Low frequency = 10.00 Hz\n",
+ "High frequency = 1.00 kHz\n"
+ ]
+ }
+ ],
+ "prompt_number": 19
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 5.25 - page 420"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Given data\n",
+ "Vs= 100 # in mV\n",
+ "Vf= 95 # in mV\n",
+ "Vs= Vs*10**-3 # in V\n",
+ "Vf= Vf*10**-3 # in V\n",
+ "Vo=10 # in V\n",
+ "Vi= Vs-Vf # in V\n",
+ "Av= Vo/Vi # in V/V\n",
+ "print \"Value of Av = %0.e V/V\" %Av\n",
+ "Beta= Vf/Vo # in V/V\n",
+ "print \"Value of Bita = %0.1e V/V\" %Beta\n",
+ "\n",
+ "# Note: In the book Calculation to find the value of Beta is wrong so the asnwer in the book is wrong"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Value of Av = 2e+03 V/V\n",
+ "Value of Bita = 9.5e-03 V/V\n"
+ ]
+ }
+ ],
+ "prompt_number": 20
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 5.26 - page 420"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Given data\n",
+ "Is= 100 # in \u00b5A\n",
+ "Is= Is*10**-6 # in A\n",
+ "If= 95 # in \u00b5A\n",
+ "Io= 10 # in mA\n",
+ "A= Io*1e-3/((Is-If)*1e-6) # n A/A\n",
+ "Beta= If/Io # A/A\n",
+ "print \"Value of Av = %0.e V/V\" %Av\n",
+ "print \"Value of Beta = %0.1f \u00b5A/mA\" %Beta\n",
+ "# Note: In the book , to evaluating the value of Beta, they putted wrong value of If (90 at place of 95)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Value of Av = 2e+03 V/V\n",
+ "Value of Beta = 9.5 \u00b5A/mA\n"
+ ]
+ }
+ ],
+ "prompt_number": 21
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 5.28 - page 422"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Given data\n",
+ "A=2000 #V/V\n",
+ "Beta= 0.1 # inV/V\n",
+ "Ri= 1 # in kohm\n",
+ "Ri= Ri*10**3 # in ohm\n",
+ "Ro= 1 # in kohm\n",
+ "Ro= Ro*10**3 # in ohm\n",
+ "Af= A/(1+A*Bita) \n",
+ "print \"The gain Af = %0.2f \"%Af\n",
+ "Rif= Ri*(1+A*Beta) # in ohm\n",
+ "print \"The input resistance = %0.f kohm\" %(Rif*10**-3)\n",
+ "Rof= Ro*1e3/(1+A*Beta) # in ohm\n",
+ "print \"The output resistance = %0.3f kohm\" %(Rof*10**-3)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The gain Af = 11.05 \n",
+ "The input resistance = 201 kohm\n",
+ "The output resistance = 4.975 kohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 22
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 5.29 - page 423"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from __future__ import division\n",
+ "# Given data\n",
+ "\n",
+ "# Part (b)\n",
+ "Af= 10 \n",
+ "A= 10**4 \n",
+ "# Af= A/(1+A*Beta) \n",
+ "Beta= 1/Af-1/A \n",
+ "# Beta= R1/(R1+R2)\n",
+ "R2_by_R1= 1/Beta-1 \n",
+ "print \"(b) Value of R2/R1 = %0.2f\" %R2_by_R1\n",
+ "\n",
+ "# Part (c)\n",
+ "Vs= 1 # in V\n",
+ "Vo= (1+R2_by_R1)*Vs \n",
+ "print \"(c) Value of Vo = %0.2f Volt\" %Vo\n",
+ "Vf= Vo/(1+R2_by_R1)\n",
+ "print \"Value of Vf = %0.2f Volt\" %Vf"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(b) Value of R2/R1 = 9.01\n",
+ "(c) Value of Vo = 10.01 Volt\n",
+ "Value of Vf = 1.00 Volt\n"
+ ]
+ }
+ ],
+ "prompt_number": 23
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
diff --git a/Electronic_Circuits_by_P._Raja/Chapter6.ipynb b/Electronic_Circuits_by_P._Raja/Chapter6.ipynb
new file mode 100755
index 00000000..59db3bd3
--- /dev/null
+++ b/Electronic_Circuits_by_P._Raja/Chapter6.ipynb
@@ -0,0 +1,519 @@
+{
+ "metadata": {
+ "name": "",
+ "signature": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter6 - Oscillators"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 6.1 - page 438"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Given data\n",
+ "Vf= 0.0125 # in volt\n",
+ "Vo= 0.5 # in volt\n",
+ "Beta= Vf/Vo \n",
+ "# For oscillator A*Beta= 1\n",
+ "A= 1/Beta \n",
+ "print \"Amplifier Should have a minimum gain of\",A,\"to provide oscillation\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Amplifier Should have a minimum gain of 40.0 to provide oscillation\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 6.2 - page 439"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from numpy import pi, sqrt\n",
+ "# Given data\n",
+ "R1= 50 # in kohm\n",
+ "R1=R1*10**3 # in ohm\n",
+ "R2=R1 # in ohm\n",
+ "R3=R2 # in ohm\n",
+ "C1= 60 # in pF\n",
+ "C1= C1*10**-12 # in F\n",
+ "C2=C1 # in F\n",
+ "C3=C2 # in F\n",
+ "f= 1/(2*pi*R1*C1*sqrt(6)) \n",
+ "print \"Frequency of oscilltions = %0.2f kHz\" %( f*10**-3)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Frequency of oscilltions = 21.66 kHz\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 6.3 - page 445"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from numpy import pi\n",
+ "# Given data\n",
+ "f=2 # in kHz\n",
+ "f=f*10**3 # in Hz\n",
+ "# Let\n",
+ "R= 10 # in kohm (As R should be greater than 1 kohm)\n",
+ "R=R*10**3 # in ohm\n",
+ "# Formula f= 1/(2*pi*R*C)\n",
+ "C= 1/(2*pi*f*R) # in F\n",
+ "C= C*10**9 # in nF\n",
+ "# For Bita to be 1/3, Choose\n",
+ "R4= R # in ohm\n",
+ "R3= 2*R4 # in ohm\n",
+ "print \"Value of C = %0.2f nF\" %C\n",
+ "print \"Value of R3 = %0.f kohm\" %(R3*10**-3)\n",
+ "print \"Value of R4 = %0.f kohm\" %(R4*10**-3)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Value of C = 7.96 nF\n",
+ "Value of R3 = 20 kohm\n",
+ "Value of R4 = 10 kohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 6.4 - page 445"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Given data\n",
+ "R1= 200 # in kohm\n",
+ "R1=R1*10**3 # in ohm\n",
+ "R2=R1 # in ohm\n",
+ "C1= 200 # in pF\n",
+ "C1= C1*10**-12 # in F\n",
+ "C2=C1 # in F\n",
+ "f= 1/(2*pi*R1*C1) # in Hz\n",
+ "print \"Frequency of oscilltions = %0.2f kHz\" %(f*10**-3)\n",
+ "\n",
+ "# Note: Calculation to find the value of f in the book is wrong, so answer in the book is wrong"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Frequency of oscilltions = 3.98 kHz\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 6.5 - page 460"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Given data\n",
+ "L= 100 # in \u00b5H\n",
+ "L= L*10**-6 # in H\n",
+ "C1= .001 # in \u00b5F\n",
+ "C1= C1*10**-6 # in F\n",
+ "C2= .01 # in \u00b5F\n",
+ "C2= C2*10**-6 # in F\n",
+ "C= C1*C2/(C1+C2) # in F\n",
+ "# (i)\n",
+ "f= 1/(2*pi*sqrt(L*C)) # in Hz\n",
+ "print \"Operating frequency = %0.f kHz\" %(round(f*10**-3))\n",
+ "# (ii)\n",
+ "Beta= C1/C2 \n",
+ "print \"Feedback fraction = %0.1f \" %Beta\n",
+ "# (iii)\n",
+ "# A*Bita >=1, so Amin*Bita= 1\n",
+ "Amin= 1/Beta \n",
+ "print \"Minimum gain to substain oscillations is\",Amin"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Operating frequency = 528 kHz\n",
+ "Feedback fraction = 0.1 \n",
+ "Minimum gain to substain oscillations is 10.0\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 6.6 - page 460"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Given data\n",
+ "L= 15 # in \u00b5H\n",
+ "L= L*10**-6 # in H\n",
+ "C1= .004 # in \u00b5F\n",
+ "C1= C1*10**-6 # in F\n",
+ "C2= .04 # in \u00b5F\n",
+ "C2= C2*10**-6 # in F\n",
+ "C= C1*C2/(C1+C2) # in F\n",
+ "f= 1/(2*pi*sqrt(L*C)) # in Hz\n",
+ "print \"Frequency of oscilltions = %0.1f kHz\" %(f*10**-3)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Frequency of oscilltions = 681.5 kHz\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 6.7 - page 461"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Given data\n",
+ "L= 0.01 # in H\n",
+ "C= 10 # in pF\n",
+ "C= C*10**-12 # in F\n",
+ "f= 1/(2*pi*sqrt(L*C)) # in Hz\n",
+ "print \"Frequency of oscilltions = %0.2f kHz\" %(f*10**-3)\n",
+ "# Note: Calculation to find the value of f in the book is wrong, so answer in the book is wrong"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Frequency of oscilltions = 503.29 kHz\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 6.8 - page 463"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Given data\n",
+ "L= 0.8 # in H\n",
+ "\n",
+ "C= .08 # in pF\n",
+ "C= C*10**-12 # in F\n",
+ "C_M= 1.9 # in pF\n",
+ "C_M= C_M*10**-12 # in F\n",
+ "C_T= C*C_M/(C+C_M) # in F\n",
+ "R=5 # in kohm\n",
+ "f_s= 1/(2*pi*sqrt(L*C)) # in Hz\n",
+ "print \"Series resonant frequency = %0.f kHz\" %(f_s*10**-3)\n",
+ "# (ii)\n",
+ "f_p= 1/(2*pi*sqrt(L*C_T)) # in Hz\n",
+ "print \"Parallel resonant frequency = %0.f kHz\" %(f_p*10**-3)\n",
+ "# Note: Calculation to find the value of parallel resonant frequency in the book is wrong, so answer in the book is wrong"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Series resonant frequency = 629 kHz\n",
+ "Parallel resonant frequency = 642 kHz\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 6.10 - page 466"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Given data\n",
+ "R1= 220 # in kohm\n",
+ "R1=R1*10**3 # in ohm\n",
+ "R2=R1 # in ohm\n",
+ "C1= 250 # in pF\n",
+ "C1= C1*10**-12 # in F\n",
+ "C2=C1 # in F\n",
+ "f= 1/(2*pi*R1*C1) \n",
+ "print \"Frequency of oscilltions = %0.2f Hz\" %f"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Frequency of oscilltions = 2893.73 Hz\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 6.11 - page 467"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from math import tan\n",
+ "# Given data\n",
+ "R= 10 # in kohm\n",
+ "R=R*10**3 # in ohm\n",
+ "f=1000 \n",
+ "fie= 60 # in \u00b0\n",
+ "# The impedence of given circuit , Z= R+j*1/(omega*C)\n",
+ "# the phase shift, tan(fie)= imaginary part/ Real part\n",
+ "# tand(fie) = 1/(omega*R*C)\n",
+ "C= 1/(2*pi*R*tan(fie*pi/180)) \n",
+ "print \"The value of C = %0.2f pF\" %(C*10**12)\n",
+ "# Note : There is an calculation error to evaluate the value of C, So the answer in the book is wrong"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The value of C = 9188814.92 pF\n"
+ ]
+ }
+ ],
+ "prompt_number": 16
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Given data\n",
+ "R= 10 # in kohm\n",
+ "R=R*10**3 # in ohm\n",
+ "f=1000 \n",
+ "fie= 60 # in \u00b0\n",
+ "# The impedence of given circuit , Z= R+j*1/(omega*C)\n",
+ "# the phase shift, tan(fie)= imaginary part/ Real part\n",
+ "# tand(fie) = 1/(omega*R*C)\n",
+ "C= 1/(2*pi*R*tan(fie*pi/180)) \n",
+ "print \"The value of C = %0.2f \u00b5F\" %(C*10**6)\n",
+ "# Note : There is an calculation error to evaluate the value of C, So the answer in the book is wrong"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The value of C = 9.19 \u00b5F\n"
+ ]
+ }
+ ],
+ "prompt_number": 17
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 6.12 - page 467"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Given data\n",
+ "L= 50 # in \u00b5H\n",
+ "L= L*10**-6 # in H\n",
+ "C1= 300 # in pF\n",
+ "C1= C1*10**-12 # in F\n",
+ "C2= 100 # in pF\n",
+ "C2= C2*10**-12 # in F\n",
+ "C_eq= C1*C2/(C1+C2) # in F\n",
+ "f= 1/(2*pi*sqrt(L*C_eq)) # in Hz\n",
+ "print \"Frequency of oscillations = %0.1f MHz\" %(f*10**-6)\n",
+ "Beta= C2/C1 \n",
+ "# (iii)\n",
+ "# A*Beta >=1, so A*Bita= 1 (for sustained oscillations)\n",
+ "Amin= 1/Beta \n",
+ "print \"Minimum gain to substain oscillations is\",Amin"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Frequency of oscillations = 2.6 MHz\n",
+ "Minimum gain to substain oscillations is 3.0\n"
+ ]
+ }
+ ],
+ "prompt_number": 18
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 6.14 - page 469"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Given data\n",
+ "L1= 2 # in mH\n",
+ "L1= L1*10**-3 # in H\n",
+ "L2= 1.5 # in mH\n",
+ "L2= L2*10**-3 # in H\n",
+ "# Formula f= 1/(2*pi*sqrt((L1+L2)*C)\n",
+ "# For f= 1000 kHz, C will be maximum\n",
+ "f=1000 # in kHz\n",
+ "f=f*10**3 # in Hz\n",
+ "Cmax= 1/((2*pi*f)**2*(L1+L2)) # in F\n",
+ "# For f= 2000 kHz, C will be maximum\n",
+ "f=2000 # in kHz\n",
+ "f=f*10**3 # in Hz\n",
+ "Cmin= 1/((2*pi*f)**2*(L1+L2)) # in F\n",
+ "print \"Maximum Capacitance = %0.1f pF\" %(Cmax*10**12)\n",
+ "print \"Minimum Capacitance = %0.1f pF\" %(Cmin*10**12)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Maximum Capacitance = 7.2 pF\n",
+ "Minimum Capacitance = 1.8 pF\n"
+ ]
+ }
+ ],
+ "prompt_number": 19
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
diff --git a/Electronic_Circuits_by_P._Raja/Chapter7.ipynb b/Electronic_Circuits_by_P._Raja/Chapter7.ipynb
new file mode 100755
index 00000000..78dc3860
--- /dev/null
+++ b/Electronic_Circuits_by_P._Raja/Chapter7.ipynb
@@ -0,0 +1,182 @@
+{
+ "metadata": {
+ "name": "",
+ "signature": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Solved Examination Paper"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 1.b - page 476"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Given data\n",
+ "R1= 10 # in k\u03a9\n",
+ "R2= 10 # in k\u03a9\n",
+ "Rf= 50 # in k\u03a9\n",
+ "V= 2 # in V\n",
+ "V1= V*R1/(R1+R2) # in V\n",
+ "V01= -Rf/R1*V1 # in V\n",
+ "print \"The value of V1 = %0.f Volts\" %(V1)\n",
+ "print \"The value of V01 = %0.f Volts\" %(V01)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The value of V1 = 1 Volts\n",
+ "The value of V01 = -5 Volts\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 2.a - page 479"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Given data\n",
+ "V_P= -4 # in V\n",
+ "I_DSS= 10 # in mA\n",
+ "V_GS= 0 # in V\n",
+ "R_D= 1.8 # in k\u03a9\n",
+ "V_DD= 20 # in V\n",
+ "I_D= I_DSS*(1-V_GS/V_P)**2 # in mA\n",
+ "# Applying KVL to the circuit, we get V_DD= I_D*R_D+V_D\n",
+ "V_D= V_DD-I_D*R_D # in V\n",
+ "print \"The value of I_D = %0.f mA\" %(I_D)\n",
+ "print \"The value of V_D = %0.f Volts\" %V_D"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The value of I_D = 10 mA\n",
+ "The value of V_D = 2 Volts\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 2.c - page 480"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Given data\n",
+ "V_GS= 3 # in V\n",
+ "Vth= 1 # in V\n",
+ "unCox= 25 # in mA/V**2\n",
+ "unCox= unCox*10**-3 # in A/V**2\n",
+ "W=3 # in \u00b5m\n",
+ "L=1 # in \u00b5m\n",
+ "r_DS= 1/(unCox*W/L*(V_GS-Vth)) # in \u03a9\n",
+ "print \"The value of r_DS = %0.2f \u03a9 \" %r_DS"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The value of r_DS = 6.67 \u03a9 \n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 3.b - page 481"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Given data\n",
+ "I_CQ= 10 # in mA\n",
+ "I_CQ= I_CQ*10**-3 # in A\n",
+ "V_CQ= 5 # in V\n",
+ "V_CC= 10 # in V\n",
+ "R_C= 0.4 # in k\u03a9\n",
+ "R_C= R_C*10**3 # in \u03a9\n",
+ "V_BE= 0.075 # in V\n",
+ "V_BB= 0.175 # in V\n",
+ "beta=100 \n",
+ "beta_max=120 \n",
+ "beta_min= 40 \n",
+ "# Applying KVL we get, V_CQ= V_CC-I_C*(R_C+R_E)\n",
+ "R_E= (V_CC-V_CQ)/I_CQ-R_C # in \u03a9\n",
+ "print \"The value of R_E = %0.f \u03a9\" %( R_E)\n",
+ "I_B= I_CQ/beta # in A\n",
+ "R_B= (V_BB-V_BE)/I_B # in \u03a9\n",
+ "print \"The value of R_B = %0.f k\u03a9\" %(R_B*10**-3)\n",
+ "I_Cmax= beta_max*I_B # in A\n",
+ "I_Cmin= beta_min*I_B # in A\n",
+ "delta_I_CQ= I_Cmax-I_Cmin # in A\n",
+ "print \"The value of delta_I_C = %0.f mA\" %(delta_I_CQ*10**3)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The value of R_E = 100 \u03a9\n",
+ "The value of R_B = 1 k\u03a9\n",
+ "The value of delta_I_C = 8 mA\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
diff --git a/Electronic_Circuits_by_P._Raja/chapter1.ipynb b/Electronic_Circuits_by_P._Raja/chapter1.ipynb
new file mode 100755
index 00000000..6297ee97
--- /dev/null
+++ b/Electronic_Circuits_by_P._Raja/chapter1.ipynb
@@ -0,0 +1,1053 @@
+{
+ "metadata": {
+ "name": "",
+ "signature": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 1 - Operational Amplifiers"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 1.1 - page 11"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Given data\n",
+ "G= -100 \n",
+ "R1= 2.2 # in kohm\n",
+ "R1=R1*10**3 # in ohm\n",
+ "# Formula G=-Rf/R1\n",
+ "Rf= -G*R1 \n",
+ "print \"The value of Rf = %0.f kohm \" %(Rf*10**-3)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The value of Rf = 220 kohm \n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 1.2 - page 11"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Given data\n",
+ "Rf= 200 # in kohm\n",
+ "R1= 2 # in kohm\n",
+ "vin=2.5 # in mV\n",
+ "vin=vin*10**-3 # in volt\n",
+ "G= -Rf/R1 \n",
+ "vo= G*vin # in V\n",
+ "print \"The output voltage = %0.2f Volt \" %vo"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The output voltage = -0.25 Volt \n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 1.3 - page 12"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Given data\n",
+ "G=-10 \n",
+ "Ri= 100 # in kohm\n",
+ "R1= Ri # in kohm\n",
+ "R1=R1*10**3 # in ohm\n",
+ "# Formula G=-R2/R1\n",
+ "R2= R1*abs(G) # ohm\n",
+ "print \"Value of R1 = %0.f kohm \" %(R1*10**-3)\n",
+ "print \"and value of R2 = %0.f Mohm \" %(R2*10**-6)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Value of R1 = 100 kohm \n",
+ "and value of R2 = 1 Mohm \n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 1.4 - page 37"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Given data\n",
+ "R1= 100 # in kohm\n",
+ "R2= 500 # in kohm\n",
+ "V1= 2 # in volt\n",
+ "Vo= (1+R2/R1)*V1 # in volt\n",
+ "print \"Output voltage for noninverting amplifier = %0.f Volt\" %Vo"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Output voltage for noninverting amplifier = 12 Volt\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 1.5 - page 38"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from __future__ import division\n",
+ "# Given data\n",
+ "Rf= 1 # in Mohm\n",
+ "Rf=Rf*10**6 #in ohm\n",
+ "\n",
+ "# Part(a)\n",
+ "V1=1 #in volt\n",
+ "V2=2 #in volt\n",
+ "V3=3 #in volt\n",
+ "R1= 500 # in kohm\n",
+ "R1=R1*10**3 #in ohm\n",
+ "R2= 1 # in Mohm\n",
+ "R2=R2*10**6 #in ohm\n",
+ "R3= 1 # in Mohm\n",
+ "R3=R3*10**6 #in ohm\n",
+ "Vo= -Rf*(V1/R1+V2/R2+V3/R3) # in volt\n",
+ "print \"(a) Output voltage = %0.f Volt \" %Vo\n",
+ "\n",
+ "# Part(b)\n",
+ "V1=-2 #in volt\n",
+ "V2=3 #in volt\n",
+ "V3=1 #in volt\n",
+ "R1= 200 # in kohm\n",
+ "R1=R1*10**3 #in ohm\n",
+ "R2= 500 # in kohm\n",
+ "R2=R2*10**3 #in ohm\n",
+ "R3= 1 # in Mohm\n",
+ "R3=R3*10**6 #in ohm\n",
+ "Vo= -Rf*(V1/R1+V2/R2+V3/R3) # in volt\n",
+ "print \"(b) Output voltage = %0.f Volt\" %Vo"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a) Output voltage = -7 Volt \n",
+ "(b) Output voltage = 3 Volt\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 1.6 - page 38"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from __future__ import division\n",
+ "# Given data\n",
+ "print \"Minimum closed loop voltage gain for R2=0 and R1= 2 kohm\"\n",
+ "R2=0 \n",
+ "R1=2 # in kohm\n",
+ "R1=R1*10**3 # in ohm\n",
+ "Av_min= (1+R2/R1)\n",
+ "print \"Av(min) =\",Av_min\n",
+ "\n",
+ "print \"Maximum closed loop voltage gain for maximum value of R2=100 kohm and R1= 2 kohm\"\n",
+ "R2=100 # in kohm\n",
+ "R1=2 # in kohm\n",
+ "Av_max= (1+R2/R1)\n",
+ "print \"Av(max) =\",Av_max"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Minimum closed loop voltage gain for R2=0 and R1= 2 kohm\n",
+ "Av(min) = 1.0\n",
+ "Maximum closed loop voltage gain for maximum value of R2=100 kohm and R1= 2 kohm\n",
+ "Av(max) = 51.0\n"
+ ]
+ }
+ ],
+ "prompt_number": 14
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 1.7 - page 39"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from __future__ import division\n",
+ "# Given data\n",
+ "V1= 745 # in \u00b5V\n",
+ "V2= 740 # in \u00b5V\n",
+ "V1=V1*10**-6 # in volt\n",
+ "V2=V2*10**-6 # in volt\n",
+ "CMRR=80 # in dB\n",
+ "Av=5*10**5 \n",
+ "# (i)\n",
+ "# CMRR in dB= 20*log(Ad/Ac)\n",
+ "Ad=Av \n",
+ "Ac= Ad/10**(CMRR/20) \n",
+ "# (ii)\n",
+ "Vo= Ad*(V1-V2)+Ac*(V1+V2)/2 \n",
+ "print \"Output voltage = %0.2f Volt\" %Vo\n",
+ "\n",
+ "# Note:- In the book, there is calculation error to evaluate the value of Ac,\n",
+ "#so the value of Ac is wrong ans to evaluate the output voltage there is also calculation error "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Output voltage = 2.54 Volt\n"
+ ]
+ }
+ ],
+ "prompt_number": 15
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 1.8 - page 40"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from __future__ import division\n",
+ "# Given data\n",
+ "R1= 1 # in Mohm\n",
+ "Ri=R1 # in Mohm\n",
+ "Rf=1 # in Mohm\n",
+ "A_VF= -Rf/R1 \n",
+ "print \"Voltage gain = %0.f\" %A_VF"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Voltage gain = -1\n"
+ ]
+ }
+ ],
+ "prompt_number": 16
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 1.10 - page 41"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from __future__ import division\n",
+ "# Given data\n",
+ "V1=2 # in V\n",
+ "V2=3 # in V\n",
+ "Rf=3 # in kohm\n",
+ "R1=1 # in kohm\n",
+ "Vo1= (1+Rf/R1)*V1 \n",
+ "print \"Output voltage when only 2V voltage source is acting is %0.f Volt\" %Vo1\n",
+ "Vo2= (1+Rf/R1)*V2 \n",
+ "print \"Output voltage due to 3V voltage source is %0.f Volt\" %Vo2\n",
+ "Vo= Vo1+Vo2 # in volts\n",
+ "print \"Total output voltage is %0.f Volts\" %Vo"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Output voltage when only 2V voltage source is acting is 8 Volt\n",
+ "Output voltage due to 3V voltage source is 12 Volt\n",
+ "Total output voltage is 20 Volts\n"
+ ]
+ }
+ ],
+ "prompt_number": 18
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 1.11 - page 42"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from __future__ import division\n",
+ "# Given data\n",
+ "Rf=500 # in kohm\n",
+ "min_vvs= 0 # minimum value of variable resistor in ohm\n",
+ "max_vvs= 10 # maximum value of variable resistor in ohm\n",
+ "Ri_min= 10+min_vvs # in kohm\n",
+ "Ri_max= 10+max_vvs #in kohm\n",
+ "# Av= Vo/Vi= -Rf/Ri\n",
+ "Av=-Rf/Ri_min \n",
+ "print \"Closed loop voltage gain corresponding to Ri(min) is\",Av\n",
+ "Av=-Rf/Ri_max \n",
+ "print \"and closed loop voltage gain corresponding to Ri(max) is\",Av"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Closed loop voltage gain corresponding to Ri(min) is -50.0\n",
+ "and closed loop voltage gain corresponding to Ri(max) is -25.0\n"
+ ]
+ }
+ ],
+ "prompt_number": 21
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 1.12 - page 43"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Given data\n",
+ "Rf=200 # in kohm\n",
+ "R1= 20 # in kohm\n",
+ "# Av= Vo/Vi= -Rf/Ri\n",
+ "Av= -Rf/R1 \n",
+ "Vi_min= 0.1 # in V\n",
+ "Vi_max= 0.5 # in V\n",
+ "# Vo= Av*Vi\n",
+ "Vo_min= Av*Vi_min # in V\n",
+ "Vo_max= Av*Vi_max # in V\n",
+ "print \"Output voltage ranges from\",Vo_min,\"V to\",Vo_max,\"V\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Output voltage ranges from -1.0 V to -5.0 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 23
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 1.13 - page 43"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from __future__ import division\n",
+ "# Given data\n",
+ "Rf= 250 # in kohm\n",
+ "# Output voltage expression, Vo= -5*Va+3*Vb\n",
+ "# and we know that for a difference amplifier circuit, \n",
+ "# Vo= -Rf/R1*Va + [R2/(R1+R2)]*[1+Rf/R1]*Vb\n",
+ "# Comparing both the expression, we get\n",
+ "# -Rf/R1*Va= -5*Va, or\n",
+ "R1= Rf/5 # in kohm\n",
+ "print \"The value of R1 = %0.2f kohm\" %R1\n",
+ "# and \n",
+ "R2= 3*R1**2/(R1+Rf-3*R1)\n",
+ "print \"The value of R2 = %0.2f kohm\" %R2\n",
+ "\n",
+ "# Note : Answer in the book is wrong"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The value of R1 = 50.00 kohm\n",
+ "The value of R2 = 50.00 kohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 24
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 1.14 - page 44"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Given data\n",
+ "Vi_1= 150 # in \u00b5V\n",
+ "Vi_2= 140 # in \u00b5V\n",
+ "Vd= Vi_1-Vi_2 # in \u00b5V\n",
+ "Vd=Vd*10**-6 # in V\n",
+ "Vc= (Vi_1+Vi_2)/2 # in \u00b5V\n",
+ "Vc=Vc*10**-6 # in V\n",
+ "# Vo= Ad*Vd*(1+Vc/(CMRR*Vd))\n",
+ "\n",
+ "# (i) For Ad=4000 and CMRR= 100\n",
+ "Ad=4000 \n",
+ "CMRR= 100 \n",
+ "Vo= Ad*Vd*(1+Vc/(CMRR*Vd)) # in volt\n",
+ "print \"(a) Output voltage = %.1f mV\" %(Vo*10**3)\n",
+ "\n",
+ "# (ii) For Ad=4000 and CMRR= 10**5\n",
+ "Ad=4000 \n",
+ "CMRR= 10**5 \n",
+ "Vo= Ad*Vd*(1+Vc/(CMRR*Vd)) # in volt\n",
+ "print \"(b) Output voltage = %0.1f mV\" %(Vo*10**3)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a) Output voltage = 45.8 mV\n",
+ "(b) Output voltage = 40.0 mV\n"
+ ]
+ }
+ ],
+ "prompt_number": 31
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 1.15 - page 45"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from __future__ import division\n",
+ "# Given data\n",
+ "Rf=470 # in kohm\n",
+ "R1=4.3 # in kohm\n",
+ "R2=33 # in kohm\n",
+ "R3=33 # in kohm\n",
+ "Vi= 80 # in \u00b5V\n",
+ "Vi=Vi*10**-6 # in volt\n",
+ "A1= 1+Rf/R1 \n",
+ "A2=-Rf/R2 \n",
+ "A3= -Rf/R3 \n",
+ "A=A1*A2*A3 \n",
+ "Vo= A*Vi # in volt\n",
+ "print \"Output voltage = %0.2f Volts\" %Vo"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Output voltage = 1.79 Volts\n"
+ ]
+ }
+ ],
+ "prompt_number": 33
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 1.16 - page 46"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from sympy import *\n",
+ "t = symbols('t')\n",
+ "# Given data\n",
+ "R1= 33 # in k\u03a9\n",
+ "R2= 10 # in k\u03a9\n",
+ "R3= 330 # in k\u03a9\n",
+ "V1 = simplify(50*sin(1000*t)) # in mV\n",
+ "V2 = simplify(10*sin(3000*t)) # in mV\n",
+ "Vo = -(R3/R1*V1+R3/R2*V2)/1000 # in V\n",
+ "print \"Output voltage is\",Vo"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Output voltage is -0.5*sin(1000*t) - 0.33*sin(3000*t)\n"
+ ]
+ }
+ ],
+ "prompt_number": 37
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 1.17 - page 47"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from __future__ import division\n",
+ "# Given data\n",
+ "R1=10 # in kohm\n",
+ "R2=150 # in kohm\n",
+ "R3=10 # in kohm\n",
+ "R4=300 # in kohm\n",
+ "V1= 1 # in V\n",
+ "V2= 2 # in V\n",
+ "Vo= ((1+R4/R2)*(R3*V1/(R1+R3))-(R4/R2)*V2) \n",
+ "print \"Output voltage = %0.2f Volts\" %Vo"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Output voltage = -2.50 Volts\n"
+ ]
+ }
+ ],
+ "prompt_number": 39
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 1.18 - page 47"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from __future__ import division\n",
+ "# Given data\n",
+ "R1=12 # in kohm\n",
+ "Rf=360 # in kohm\n",
+ "V1= -0.3 # in V\n",
+ "Vo= (1+Rf/R1)*V1 # in V\n",
+ "print \"(a) Output voltage result in %0.2f Volts\" %Vo\n",
+ "\n",
+ "# Part(b)\n",
+ "Vo= 2.4 # in V\n",
+ "# We know, Vo= (1+Rf/R1)*V1\n",
+ "V1= Vo/(1+Rf/R1) \n",
+ "print \"(b) To result in an output of 2.4 Volt, Input voltage = %0.2f mV\" %(V1*10**3)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a) Output voltage result in -9.30 Volts\n",
+ "(b) To result in an output of 2.4 Volt, Input voltage = 77.42 mV\n"
+ ]
+ }
+ ],
+ "prompt_number": 41
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 1.19 - page 48"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from __future__ import division\n",
+ "# Given data\n",
+ "Rf=68 # in kohm\n",
+ "R1=33 # in kohm\n",
+ "R2=22 # in kohm\n",
+ "R3=12 # in kohm\n",
+ "V1= 0.2 # in V\n",
+ "V2=-0.5 # in V\n",
+ "V3= 0.8 # in V\n",
+ "Vo= -Rf/R1*V1 + (-Rf/R2)*V2 + (-Rf/R3)*V3 # in volts\n",
+ "print \"Output voltage = %0.3f Volts\" %Vo\n",
+ "#Answer in the textbook is not accurate."
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Output voltage = -3.400 Volts\n"
+ ]
+ }
+ ],
+ "prompt_number": 44
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 1.20 - page 48"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from __future__ import division\n",
+ "# Given data\n",
+ "Rf=100 # in kohm\n",
+ "R1=20 # in kohm\n",
+ "V1= 1.5 # in V\n",
+ "Vo1= V1 \n",
+ "Vo= -Rf/R1*Vo1 # in volts\n",
+ "print \"Output voltage = %0.2f Volts\" %Vo"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Output voltage = -7.50 Volts\n"
+ ]
+ }
+ ],
+ "prompt_number": 45
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 1.22 - page 50"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from __future__ import division\n",
+ "# Given data\n",
+ "vo= -10 # in V\n",
+ "i_f= 1 # in mA\n",
+ "i_f= i_f*10**-3 #in A\n",
+ "# Formula vo= -i_f*Rf\n",
+ "Rf= -vo/i_f # in \u03a9\n",
+ "# The output voltage, vo= -(v1+5*v2) (i)\n",
+ "# vo= -Rf/R1*v1 - Rf/R2*v2 (ii)\n",
+ "# Comparing equations (i) and (2)\n",
+ "R1= Rf/1 # in \u03a9\n",
+ "R2= Rf/5 # in \u03a9\n",
+ "print \"The value of Rf = %0.2f k\u03a9\" %(Rf*10**-3)\n",
+ "print \"The value of R1 = %0.2f k\u03a9\" %(R1*10**-3)\n",
+ "print \"The value of R2 = %0.2f k\u03a9\" %(R2*10**-3)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The value of Rf = 10.00 k\u03a9\n",
+ "The value of R1 = 10.00 k\u03a9\n",
+ "The value of R2 = 2.00 k\u03a9\n"
+ ]
+ }
+ ],
+ "prompt_number": 46
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 1.24 - page 52"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from __future__ import division\n",
+ "from sympy import *\n",
+ "v1,v2 = symbols('v1 v2')\n",
+ "# Given data\n",
+ "R1= 9 # in k\u03a9\n",
+ "R2= 1 # in k\u03a9\n",
+ "R3= 2 # in k\u03a9\n",
+ "R4= 3 # in k\u03a9\n",
+ "# for node 1\n",
+ "va = R4/(R4+R3)*v1\n",
+ "vo1 = (1+R1/R2)*va\n",
+ "# for node 2\n",
+ "va=R3/(R3+R4)*v2\n",
+ "vo2 = (1+R1/R2)*va\n",
+ "vo = vo1+vo2\n",
+ "print \"Total voltage is, vo =\",vo"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Total voltage is, vo = 6.0*v1 + 4.0*v2\n"
+ ]
+ }
+ ],
+ "prompt_number": 60
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 1.25 - page 54"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from __future__ import division\n",
+ "from sympy import *\n",
+ "v1,v2,v3 = symbols('v1 v2 v3')\n",
+ "# Given data\n",
+ "R1= 9 # in k\u03a9\n",
+ "R2= 1 # in k\u03a9\n",
+ "R3= 2 # in k\u03a9\n",
+ "R4= 3 # in k\u03a9\n",
+ "# Voltage at node 1\n",
+ "va= R4*v1/(R3+R4)\n",
+ "vo1= (1+R1/R2)*va\n",
+ "# Voltage at node 2\n",
+ "va= R3*v2/(R3+R4)\n",
+ "# From (i) and (ii)\n",
+ "vo2= (1+R1/R2)*va\n",
+ "# Voltage at node 3\n",
+ "va= R3*v2/(R3+R4)\n",
+ "vo3= (-R1/R2)*v3\n",
+ "vo = vo1+vo2+vo3\n",
+ "print \"Total voltage is\",vo"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Total voltage is 6.0*v1 + 4.0*v2 - 9.0*v3\n"
+ ]
+ }
+ ],
+ "prompt_number": 67
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 1.26 - page 55"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Given data\n",
+ "import numpy as np\n",
+ "from __future__ import division\n",
+ "# omega_t= Ao*omega_b\n",
+ "# 2*pi*f_t = Ao*2*pi*f_b\n",
+ "# f_t= Ao*f_b\n",
+ "# Part (i)\n",
+ "Ao1= 10**5 \n",
+ "f_b1= 10**2 # in Hz\n",
+ "f_t1= Ao1*f_b1 # in Hz\n",
+ "row1 = np.array([Ao1,f_b1,f_t1])\n",
+ "# Part (ii)\n",
+ "Ao2= 10**6 \n",
+ "f_t2= 10**6 # in Hz\n",
+ "f_b2= f_t2/Ao2 # in Hz\n",
+ "row2 = np.array([Ao2,f_b2,f_t2])\n",
+ "# Part (iii)\n",
+ "f_b3= 10**3 # in Hz\n",
+ "f_t3= 10**8 # in Hz\n",
+ "Ao3= f_t3/f_b3 \n",
+ "row3 = np.array([Ao3,f_b3,f_t3])\n",
+ "# Part (iv)\n",
+ "f_b4= 10**-1 # in Hz\n",
+ "f_t4= 10**6 # in Hz\n",
+ "Ao4= f_t4/f_b4 \n",
+ "row4 = np.array([Ao4,f_b4,f_t4])\n",
+ "# Part (v)\n",
+ "Ao5= 2*10**5 \n",
+ "f_b5= 10 # in Hz\n",
+ "f_t5= Ao5*f_b5 # in Hz\n",
+ "row5 = np.array([Ao5,f_b5,f_t5])\n",
+ "print \"-\"*33\n",
+ "print \"Ao fb(Hz) ft(Hz)\"\n",
+ "print \"-\"*33\n",
+ "print \"%.e %.e %.e\" %(row1[0], row1[1], row1[2])\n",
+ "print \"%.e %.f %.e\" %(row2[0], row5[1], row2[2])\n",
+ "print \"%.e %.e %.e\" %(row3[0], row3[1], row3[2])\n",
+ "print \"%.e %.e %.e\" %(row4[0], row4[1], row4[2])\n",
+ "print \"%.e %.f %.e\" %(row5[0], row5[1], row5[2])\n",
+ "# Answer for f_b2 is wrong in the textbook."
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "---------------------------------\n",
+ "Ao fb(Hz) ft(Hz)\n",
+ "---------------------------------\n",
+ "1e+05 1e+02 1e+07\n",
+ "1e+06 10 1e+06\n",
+ "1e+05 1e+03 1e+08\n",
+ "1e+07 1e-01 1e+06\n",
+ "2e+05 10 2e+06\n"
+ ]
+ }
+ ],
+ "prompt_number": 37
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 1.27 - page 56"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from __future__ import division\n",
+ "from numpy import sqrt\n",
+ "# Given data\n",
+ "Ao= 86 # in dB\n",
+ "A= 40 # in dB\n",
+ "f=100 # in kHz\n",
+ "f=f*10**3 # in Hz\n",
+ "# From 20*log(S) = 20*log(Ao/A), where S, stands for sqrt(1+(f/fb)**2)\n",
+ "S= 10**((Ao-A)/20) \n",
+ "# S= sqrt(1+(f/fb)**2)\n",
+ "fb= f/sqrt(S**2-1) # in Hz\n",
+ "Ao= 10**(Ao/20) \n",
+ "ft= Ao*fb # in Hz\n",
+ "print \"The value of Ao = %0.3e\" %Ao\n",
+ "print \"The value of fb = %0.f Hz\" %fb\n",
+ "print \"The value of ft = %0.f MHz\" %round(ft*10**-6)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The value of Ao = 1.995e+04\n",
+ "The value of fb = 501 Hz\n",
+ "The value of ft = 10 MHz\n"
+ ]
+ }
+ ],
+ "prompt_number": 43
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 1.28 - page 56"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from __future__ import division\n",
+ "from numpy import pi, sqrt\n",
+ "# Given data\n",
+ "Ao= 10**4 # in V/V\n",
+ "f_t= 10**6 # in Hz\n",
+ "R2byR1= 20 \n",
+ "omega_t= 2*pi*f_t \n",
+ "omega_3dB= omega_t/(1+R2byR1) \n",
+ "f3dB= omega_3dB/(2*pi) # in Hz\n",
+ "print \"3-dB frequency of the closed loop amplifier is %0.1f kHz\" %(f3dB*10**-3)\n",
+ "f3dB= 0.1*f3dB # in Hz\n",
+ "voBYvi= -R2byR1/sqrt(1+(2*pi*f3dB/omega_3dB)**2) \n",
+ "voBYvi= abs(voBYvi) # in v/v\n",
+ "print \"Gain = %0.1f v/v\" %(voBYvi)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "3-dB frequency of the closed loop amplifier is 47.6 kHz\n",
+ "Gain = 19.9 v/v\n"
+ ]
+ }
+ ],
+ "prompt_number": 48
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
diff --git a/Electronic_Circuits_by_P._Raja/chapter2.ipynb b/Electronic_Circuits_by_P._Raja/chapter2.ipynb
new file mode 100755
index 00000000..3abf271f
--- /dev/null
+++ b/Electronic_Circuits_by_P._Raja/chapter2.ipynb
@@ -0,0 +1,1179 @@
+{
+ "metadata": {
+ "name": "",
+ "signature": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 2 - Metal oxide semiconductor field effect transistor(MOSFET)"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 2.1 - page 75"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Given data \n",
+ "V_S= 0 # As source is connected to ground\n",
+ "V_G= 1.5 # in V\n",
+ "V_D= 0.5 # in V\n",
+ "Vt= 0.7 # in V\n",
+ "# Part(a) V_D= 0.5 # in V\n",
+ "V_D= 0.5 # in V\n",
+ "V_DS= V_D-V_S # in V\n",
+ "V_GS= V_G-V_S # in V\n",
+ "if V_GS < Vt:\n",
+ " print \"At V_D = 0.5 , the device is in cut off region\"\n",
+ "elif V_DS<= (V_GS-Vt):\n",
+ " print \"At V_D = 0.5 , the device is in triode region\" \n",
+ "else:\n",
+ " print \"At V_D = 0.5 , the device is in saturation region\"\n",
+ "\n",
+ "# Part(b) V_D= 0.9 # in V\n",
+ "V_D= 0.9 # in V\n",
+ "V_DS= V_D-V_S # in V\n",
+ "V_GS= V_G-V_S # in V\n",
+ "if V_GS < Vt:\n",
+ " print \"At V_D = 0.9 , the device is in cut off region\"\n",
+ "elif V_DS<= (V_GS-Vt):\n",
+ " print \"At V_D = 0.9 , the device is in triode region\"\n",
+ "else:\n",
+ " print \"At V_D = 0.9 , the device is in saturation region\" \n",
+ "\n",
+ "\n",
+ "# Part(c) V_D= 3 # in V\n",
+ "V_D= 3 # in V\n",
+ "V_DS= V_D-V_S # in V\n",
+ "V_GS= V_G-V_S # in V\n",
+ "if V_GS < Vt:\n",
+ " print \"At V_D = 3 , the device is in cut off region\"\n",
+ "elif V_DS<= (V_GS-Vt):\n",
+ " print \"At V_D = 3 , the device is in triode region\"\n",
+ "else:\n",
+ " print \"At V_D = 3 , the device is in saturation region\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "At V_D = 0.5 , the device is in triode region\n",
+ "At V_D = 0.9 , the device is in saturation region\n",
+ "At V_D = 3 , the device is in saturation region\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 2.2 - page 77"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Given data \n",
+ "unCox= 100 # in \u00b5A/V**2\n",
+ "unCox= unCox*10**-6 # in A/V**2\n",
+ "L= 1 #in \u00b5m\n",
+ "L= L*10**-6 # in m\n",
+ "W=10 # in \u00b5m\n",
+ "W=W*10**-6 # in m\n",
+ "V_GS= 1.5 # in V\n",
+ "Vt= 0.7 # in V\n",
+ "# For V_DS= 0.5 V\n",
+ "V_DS= 0.5 # in V\n",
+ "if V_DS<= (V_GS-Vt):\n",
+ " I_D= unCox*W/L*((V_GS-Vt)*V_DS-V_DS**2/2)\n",
+ " print \"The device is in triode region. SO the drain current in the triode region = %0.f \u00b5A\" %(I_D*10**6)\n",
+ "else:\n",
+ " I_D= unCox*W/(2*L)*(V_GS-VT)**2\n",
+ " print \"The device is in saturation region. SO the drain current in the saturation region = %0.1f \u00b5A\" %(I_D*10**6)\n",
+ "\n",
+ "# For V_DS= 0.9 V\n",
+ "V_DS= 0.9 # in V\n",
+ "if V_DS<= (V_GS-Vt):\n",
+ " I_D= unCox*W/L*((V_GS-Vt)*V_DS-V_DS**2/2)\n",
+ " print \"The device is in triode region. So the drain current in the triode region = %0.1f \u00b5A\" %(I_D*10**6)\n",
+ "else:\n",
+ " I_D= unCox*W/(2*L)*(V_GS-Vt)**2\n",
+ " print \"The device is in saturation region. So drain current in the saturation region = %0.f \u00b5A\" %(I_D*10**6)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The device is in triode region. SO the drain current in the triode region = 275 \u00b5A\n",
+ "The device is in saturation region. So drain current in the saturation region = 320 \u00b5A\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 2.3 - page 78"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Given data \n",
+ "Vt= 0.7 # in V\n",
+ "ID = 100 # in \u00b5A\n",
+ "V_GS= 1.2 # in V\n",
+ "V_DS= 1.2 # in V\n",
+ "\n",
+ "# Let assume \u00b5n*Cox*W/(2*L) = K\n",
+ "# For triode region\n",
+ "if V_DS<= (V_GS-Vt):\n",
+ " #triode region\n",
+ " K = ID*10**-6/(V_GS-Vt)**2\n",
+ " \n",
+ "else:\n",
+ " # saturation region\n",
+ " K = ID*10**-6/(V_GS-Vt)**2\n",
+ "\n",
+ "V_DS= 3 # inV\n",
+ "V_GS = 1.5 # in V\n",
+ "I_D= K*(V_GS-Vt)**2 # in A\n",
+ "I_D*=10**6 # in \u00b5A\n",
+ "print \"Value of ID = %0.1f \u00b5A\" %I_D\n",
+ "# Drain to source resistance\n",
+ "V_GS = 3.2 # in V\n",
+ "r_DS = 1/(2*K*(V_GS-Vt))\n",
+ "print \"Drain to source resistance, rDS = %0.1f ohm\" %r_DS"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Value of ID = 256.0 \u00b5A\n",
+ "Drain to source resistance, rDS = 500.0 ohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 21
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 2.4 - page 82"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from __future__ import division\n",
+ "from numpy import sqrt\n",
+ "# Given data \n",
+ "I_D= 0.4 # in mA\n",
+ "I_D=I_D*10**-3 # in A\n",
+ "Vt= 0.7 # in V\n",
+ "V_SS= -2.5 # in V\n",
+ "V_DD= 2.5 # in V\n",
+ "unCox= 100 # in \u00b5A/V**2\n",
+ "unCox= unCox*10**-6 # in A/V**2\n",
+ "W= 32 # in m\n",
+ "L= 1 # in m\n",
+ "# V_GS-Vt= V_OV\n",
+ "# I_D= unCox*W/(2*L)*(V_OV)**2\n",
+ "V_OV= sqrt(I_D/(unCox*W/(2*L))) # in V\n",
+ "V_GS= V_OV+Vt # in V\n",
+ "print \"The value of V_GS = %0.1f Volt\" %V_GS\n",
+ "V_G= 0 \n",
+ "# Formula V_GS= V_G-V_S\n",
+ "V_S= V_G-V_GS # in V\n",
+ "R_S= (V_S-V_SS)/I_D# in \u03a9\n",
+ "print \"The value of R_S = %0.2f k\u03a9\" %(R_S*10**-3)\n",
+ "V_D= 0.5 # in V\n",
+ "R_D= (V_DD-V_D)/I_D #in \u03a9\n",
+ "print \"The value of R_D = %0.1f k\u03a9\" %(R_D*10**-3)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The value of V_GS = 1.2 Volt\n",
+ "The value of R_S = 3.25 k\u03a9\n",
+ "The value of R_D = 5.0 k\u03a9\n"
+ ]
+ }
+ ],
+ "prompt_number": 25
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 2.5 - page 83"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from __future__ import division\n",
+ "from numpy import sqrt\n",
+ "# Given data \n",
+ "V_DD= 3 # in V\n",
+ "I_D= 80 # in \u00b5A\n",
+ "I_D=I_D*10**-6 # in A\n",
+ "Vt= 0.6 # in V\n",
+ "unCox= 200 # in \u00b5A/V**2\n",
+ "unCox= unCox*10**-6 # in A/V**2\n",
+ "L= 0.8 #in \u00b5m\n",
+ "L= L*10**-6 # in m\n",
+ "W=4 # in \u00b5m\n",
+ "W=W*10**-6 # in m\n",
+ "# V_GS-Vt= V_OV\n",
+ "# I_D= unCox*W/(2*L)*(V_OV)**2\n",
+ "V_OV= sqrt(I_D/(unCox*W/(2*L))) # in V\n",
+ "V_GS= V_OV+Vt # in V\n",
+ "V_D= 1 # in V\n",
+ "V_G= V_D # in V\n",
+ "R= (V_DD-V_D)/I_D # in \u03a9\n",
+ "print \"The value of R = %0.f k\u03a9\" %(R*10**-3)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The value of R = 25 k\u03a9\n"
+ ]
+ }
+ ],
+ "prompt_number": 29
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 2.6 - page 84"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from __future__ import division\n",
+ "from numpy import sqrt\n",
+ "# Given data \n",
+ "V_DD= 10 # in V\n",
+ "I_D= 0.4 # in mA\n",
+ "I_D=I_D*10**-3 # in A\n",
+ "Vt= 2 # in V\n",
+ "unCox= 20 # in \u00b5A/V**2\n",
+ "unCox= unCox*10**-6 # in A/V**2\n",
+ "L= 10 #in \u00b5m\n",
+ "L= L*10**-6 # in m\n",
+ "W=100 # in \u00b5m\n",
+ "W=W*10**-6 # in m\n",
+ "V_S= 0 # in V as source is connected to ground\n",
+ "# I_D= unCox*W/(2*L)*(V_OV)**2\n",
+ "V_OV= sqrt(I_D/(unCox*W/(2*L))) # in V\n",
+ "V_GS= V_OV+Vt # in V\n",
+ "V_D= V_GS # in V\n",
+ "R= (V_DD-V_D)/I_D # in \u03a9\n",
+ "print \"The value of R = %0.2f k\u03a9\" %(R*10**-3)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The value of R = 15.00 k\u03a9\n"
+ ]
+ }
+ ],
+ "prompt_number": 30
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 2.7 - page 85"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from __future__ import division\n",
+ "# Given data \n",
+ "KnWbyL= 1 # in mA\n",
+ "KnWbyL=KnWbyL*10**-3 # in A\n",
+ "Vt= 1 # in V\n",
+ "V_DS= 0.1 # in V\n",
+ "V_D= V_DS # in V\n",
+ "V_GS= 5 # in V\n",
+ "V_DD= V_GS # in V\n",
+ "# Formula I_D= K'nW/L*[(V_GS-Vt)*V_DS-V_DS**2/2]\n",
+ "I_D= KnWbyL*((V_GS-Vt)*V_DS-V_DS**2/2) # in A\n",
+ "R_D= (V_DD-V_D)/I_D #in \u03a9\n",
+ "print \"The required value of R_D = %0.1f k\u03a9\" %(R_D*10**-3)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The required value of R_D = 12.4 k\u03a9\n"
+ ]
+ }
+ ],
+ "prompt_number": 32
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 2.8 - page 86"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from __future__ import division\n",
+ "# Given data \n",
+ "KnWbyL= 1 # in mA/V**2\n",
+ "KnWbyL=KnWbyL*10**-3 # in A/V**2\n",
+ "Vt= 1 # in V\n",
+ "V_DD= 10 # in V\n",
+ "R_D= 6 # in k\u03a9\n",
+ "R_D= R_D*10**3 # in \u03a9\n",
+ "R_S= 6 # in k\u03a9\n",
+ "R_S= R_S*10**3 # in \u03a9\n",
+ "R_G1= 10 # in M\u03a9\n",
+ "R_G1= R_G1*10**6 # in \u03a9\n",
+ "R_G2= 10 # in M\u03a9\n",
+ "R_G2= R_G2*10**6 # in \u03a9\n",
+ "V_G= V_DD*R_G2/(R_G1+R_G2) # in V\n",
+ "# V_S= R_S*I_D\n",
+ "# V_GS= V_G-V_S= V_G-R_S*I_D\n",
+ "# Formula I_D= K'nW/2*L*(V_GS-Vt)**2, Putting the value of V_GS, We get\n",
+ "# 18*I_D**2 -25*I_D +8= 0\n",
+ "# I_D= 0.89 mA or I_D= 0.5\n",
+ "I_D= 0.5 # in mA\n",
+ "I_D=I_D*10**-3 # in A\n",
+ "V_S= R_S*I_D # in V\n",
+ "V_GS= V_G-V_S # in V\n",
+ "V_D= V_DD-I_D*R_D # in V\n",
+ "print \"The value of I_D = %0.2f mA\" %(I_D*10**3)\n",
+ "print \"The value of V_S = %0.2f Volt\" %(V_S)\n",
+ "print \"The value of V_GS = %0.2f Volt\" %(V_GS)\n",
+ "print \"The value of V_D = %0.2f Volt\" %(V_D)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The value of I_D = 0.50 mA\n",
+ "The value of V_S = 3.00 Volt\n",
+ "The value of V_GS = 2.00 Volt\n",
+ "The value of V_D = 7.00 Volt\n"
+ ]
+ }
+ ],
+ "prompt_number": 33
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 2.9 - page 98"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from __future__ import division\n",
+ "# Given data \n",
+ "R_D= 20 # in k\u03a9\n",
+ "R_D= R_D*10**3 # in \u03a9\n",
+ "R1= 30 # in k\u03a9\n",
+ "R1= R1*10**3 # in \u03a9\n",
+ "R2= 20 # in k\u03a9\n",
+ "R2= R2*10**3 # in \u03a9\n",
+ "V_DD= 5 # in V\n",
+ "Vtn= 1 # in V\n",
+ "Kn= 0.1 # in mA/V**2\n",
+ "Kn=Kn*10**-3 # in A/V**2\n",
+ "V_GS= R2*V_DD/(R1+R2) # in V\n",
+ "# I_D= 1/2*\u00b5nCox*W/L*(V_GS-Vtm)**2 \n",
+ "I_D = Kn*(V_GS-Vtn)**2 # in mA (As Kn= 1/2*\u00b5nCox*W/L)\n",
+ "V_DS= V_DD-I_D*R_D # in V\n",
+ "print \"The value of V_GS = %0.f Volt\" %(V_GS)\n",
+ "print \"The value of I_D = %0.2f mA\" %(I_D*10**3)\n",
+ "print \"The value of V_DS = %0.f Volt\" %(V_DS)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The value of V_GS = 2 Volt\n",
+ "The value of I_D = 0.10 mA\n",
+ "The value of V_DS = 3 Volt\n"
+ ]
+ }
+ ],
+ "prompt_number": 35
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 2.10 - page 99"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from __future__ import division\n",
+ "from numpy import sqrt\n",
+ "# Given data \n",
+ "V_DD= 15 # in V\n",
+ "Vt= 1 # in V\n",
+ "V_D= 10 # in V\n",
+ "V_S= 5 # in V\n",
+ "KnWbyL= 1 # in mA/V**2\n",
+ "KnWbyL=KnWbyL*10**-3 # in A/V**2\n",
+ "R_G1= 8 # in M\u03a9\n",
+ "R_G1= R_G1*10**6 # in \u03a9\n",
+ "I_D= 0.5 # in mA\n",
+ "I_D=I_D*10**-3 #in A\n",
+ "R_D= (V_DD-V_D)/I_D # in \u03a9\n",
+ "R_S= V_S/I_D # in \u03a9\n",
+ "# Formul I_D= 1/2*KnWbyL*(V_OV)**2\n",
+ "V_OV= sqrt(2*I_D/KnWbyL) # in V\n",
+ "# Formula V_OV= V_GS-Vt\n",
+ "V_GS= V_OV+Vt # in V\n",
+ "V_G= V_GS+V_S # in V\n",
+ "# Formul V_G= R_G2*V_DD/(R_G1+R_G2)\n",
+ "R_G2= R_G1*V_G/(V_DD-V_G) #in \u03a9\n",
+ "print \"The value of R_D = %0.1f k\u03a9\" %(R_D*10**-3)\n",
+ "print \"The value of R_S = %0.1f k\u03a9\" %(R_S*10**-3)\n",
+ "print \"The value of V_OV = %0.1f Volt\" %(V_OV)\n",
+ "print \"The value of V_GS = %0.1f Volt\" %V_GS\n",
+ "print \"The value of R_G2 = %0.1f M\u03a9\" %(R_G2*10**-6)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The value of R_D = 10.0 k\u03a9\n",
+ "The value of R_S = 10.0 k\u03a9\n",
+ "The value of V_OV = 1.0 Volt\n",
+ "The value of V_GS = 2.0 Volt\n",
+ "The value of R_G2 = 7.0 M\u03a9\n"
+ ]
+ }
+ ],
+ "prompt_number": 36
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 2.11 - page 110"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from __future__ import division\n",
+ "# Given data \n",
+ "V_DD= 15 # in V\n",
+ "KnWbyL= 0.25 # in mA/V**2\n",
+ "KnWbyL=KnWbyL*10**-3 # in A/V**2\n",
+ "Vt= 1.5 # in V\n",
+ "V_A= 50 # in V\n",
+ "R_D= 10 # in k\u03a9\n",
+ "R_D= R_D*10**3 # in \u03a9\n",
+ "R_L= 10 # in k\u03a9\n",
+ "R_L= R_L*10**3 # in \u03a9\n",
+ "R_G= 10 # in M\u03a9\n",
+ "R_G= R_G*10**6 # in \u03a9\n",
+ "# I_D= 1/2*KnWbyL*(V_D-Vt)**2 , (V_GS= V_D, as dc gate current is zero) (i)\n",
+ "# V_D= V_DD- I_D*R_D (ii)\n",
+ "I_D= 1.06 # in mA\n",
+ "I_D = I_D*10**-3 # in A\n",
+ "V_D= V_DD- I_D*R_D # in V\n",
+ "V_GS=V_D # in V\n",
+ "# The coordinates of operating point \n",
+ "V_GSQ= V_D # in V\n",
+ "I_DQ= I_D*10**3 # in mA\n",
+ "print \"The coordinates of operating point(bias point) are V_GSQ =\",V_GSQ,\"V and I_DQ =\",I_DQ,\"mA\"\n",
+ "gm= KnWbyL*(V_GS-Vt) # in A/V\n",
+ "r_o= V_A/I_D #in \u03a9\n",
+ "# The gain is : Av= vo/vi = -gm*(R_D||R_L||r_o)\n",
+ "Av= -gm*(R_D*R_L*r_o/(R_D*R_L+R_D*r_o+R_L*r_o)) # in V/V\n",
+ "print \"VOltage gain is %0.1f V/V\" %Av\n",
+ "# i_i= (vi-vo)/R_G\n",
+ "# i_i= vi/R_G*(1-vo/vi) and Rin= vi/i_i = R_G/(1-Av)\n",
+ "Rin= R_G/(1-Av) # in \u03a9\n",
+ "print \"The input resistance = %0.2f M\u03a9\" %(Rin*10**-6)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The coordinates of operating point(bias point) are V_GSQ = 4.4 V and I_DQ = 1.06 mA\n",
+ "VOltage gain is -3.3 V/V\n",
+ "The input resistance = 2.34 M\u03a9\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 2.12 - page 143"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from __future__ import division\n",
+ "from numpy import sqrt\n",
+ "# Given data \n",
+ "I_D= 0.5 # in mA\n",
+ "I_D= I_D*10**-3 # in mA\n",
+ "V_D= 3 # in V\n",
+ "Vt= -1 # in V\n",
+ "KpWbyL= 1 # in mA/V**2\n",
+ "KpWbyL=KpWbyL*10**-3 # in A/V**2\n",
+ "# Formul I_D= 1/2*KpWbyL*(V_OV)**2\n",
+ "V_OV= sqrt(2*I_D/KpWbyL) # in V\n",
+ "# For PMOS\n",
+ "V_OV= -V_OV # in V\n",
+ "V_GS= V_OV+Vt # in V\n",
+ "R_D= V_D/I_D # in \u03a9\n",
+ "V_Dmax= V_D+abs(Vt) # in V\n",
+ "R_D= V_Dmax/I_D # in \u03a9 \n",
+ "print \"\"\"The largest value that R_D can have\n",
+ "while maintaining saturation-region operation is %0.2f k\u03a9\"\"\" %(R_D*10**-3)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The largest value that R_D can have\n",
+ "while maintaining saturation-region operation is 8.00 k\u03a9\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 2.14 - page 145"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from __future__ import division\n",
+ "# Given data \n",
+ "V_GS1= 1.5 # in V\n",
+ "Vt= 1 # in V\n",
+ "r_DS1= 1 # in k\u03a9\n",
+ "r_DS1= r_DS1*10**3 # in \u03a9\n",
+ "r_DS2= 200 # in k\u03a9\n",
+ "# r_DS1= 1/(KnWbyL*(V_GS1-Vt)) (i)\n",
+ "# r_DS2= 1/(KnWbyL*(V_GS2-Vt)) (i)\n",
+ "# dividing equation (i) by (ii)\n",
+ "V_GS2= (r_DS1/r_DS2)*(V_GS1-Vt)+Vt # in V\n",
+ "print \"To Optain rDS= 200, The value of V_GS should be %0.2f Volt\" %V_GS2\n",
+ "# For V_GS= 1.5 # V\n",
+ "# W2= 2*W1 \n",
+ "# r_DS1/r_DS2= 2\n",
+ "r_DS2= r_DS1/2 # in \u03a9\n",
+ "print \"For V_GS= 1.5 V , the value of r_DS2 = %0.1f \u03a9 \" %r_DS2\n",
+ "# For V_GS= 3.5 V\n",
+ "r_DS2= 200/2 # in \u03a9\n",
+ "print \"For V_GS= 3.5 V , the value of r_DS2 = %0.1f \u03a9\" %r_DS2"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "To Optain rDS= 200, The value of V_GS should be 3.50 Volt\n",
+ "For V_GS= 1.5 V , the value of r_DS2 = 500.0 \u03a9 \n",
+ "For V_GS= 3.5 V , the value of r_DS2 = 100.0 \u03a9\n"
+ ]
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 2.15 page 146"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from __future__ import division\n",
+ "from numpy import sqrt\n",
+ "# Given data \n",
+ "I_D= 0.2 # in mA\n",
+ "I_D= I_D*10**-3 # in mA\n",
+ "Vt= 1 # in V\n",
+ "KpWbyL= 0.1 # in mA/V**2\n",
+ "KpWbyL=KpWbyL*10**-3 # in A/V**2\n",
+ "# Formul I_D= 1/2*KpWbyL*(V_GS-VT)**2\n",
+ "V_GS= sqrt(2*I_D/KpWbyL)+Vt # in V\n",
+ "V_DSmin= V_GS-Vt # in V\n",
+ "print \"Required V_GS = %0.1f Volt\" %V_GS\n",
+ "print \"The minimum required V_DS = %0.1f Volt\" %V_DSmin\n",
+ "# For I_D= 0.8 mA\n",
+ "I_D = 0.8*10**-3 # in A\n",
+ "V_GS= sqrt(2*I_D/KpWbyL)+Vt # in V\n",
+ "V_DSmin= V_GS-Vt # in V\n",
+ "print \"Required V_GS = %0.1f Volt\" %V_GS\n",
+ "print \"The minimum required V_DS = %0.1f Volt\" %V_DSmin"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Required V_GS = 3.0 Volt\n",
+ "The minimum required V_DS = 2.0 Volt\n",
+ "Required V_GS = 5.0 Volt\n",
+ "The minimum required V_DS = 4.0 Volt\n"
+ ]
+ }
+ ],
+ "prompt_number": 14
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 2.16 - page 147"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from __future__ import division\n",
+ "from numpy import sqrt\n",
+ "# Given data \n",
+ "V_SS= -5 # in V\n",
+ "unCox= 60 # in \u00b5A/V**2\n",
+ "unCox= unCox*10**-6 # in A/V**2\n",
+ "Vt= 1 # in V\n",
+ "W= 100 # in \u00b5m\n",
+ "L= 3 # in \u00b5m\n",
+ "V_G=0 # in V\n",
+ "V_DD= 5 # in V\n",
+ "V_D=0 #in V\n",
+ "I_D= 1*10**-3 # in A\n",
+ "# I_D= (V_DD-V_D)/R_D\n",
+ "R_D= (V_DD-V_D)/I_D # in \u03a9\n",
+ "print \"The value of R_D = %0.f k\u03a9\" %(R_D*10**-3)\n",
+ "# Formul I_D= 1/2*unCox*W/L*(V_GS-Vt)**2\n",
+ "V_GS= sqrt(2*I_D*L/(unCox*W))+Vt # in V\n",
+ "V_S= V_G-V_GS # in V\n",
+ "R_S= (V_S-V_SS)/I_D # in \u03a9\n",
+ "print \"The resistance = %0.f k\u03a9\" %(R_S*10**-3)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The value of R_D = 5 k\u03a9\n",
+ "The resistance = 3 k\u03a9\n"
+ ]
+ }
+ ],
+ "prompt_number": 15
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 2.17 - page 148"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from __future__ import division\n",
+ "from numpy import sqrt\n",
+ "# Given data \n",
+ "V_D= 3.5 # in V\n",
+ "I_D= 115*10**-6 #in A\n",
+ "upCox= 60 # in \u00b5A/V**2\n",
+ "upCox= upCox*10**-6 # in A/V**2\n",
+ "L= 0.8 #in \u00b5m\n",
+ "V_GS= -1.5 # in V\n",
+ "Vt= 0.7 # in V\n",
+ "R= V_D/I_D # in \u03a9\n",
+ "print \"The value required for R = %0.1f k\u03a9\" %(R*10**-3)\n",
+ "# Formul I_D= 1/2*upCox*W/L*(V_GS-Vt)**2\n",
+ "W= 2*I_D*L/(upCox*(V_GS-Vt)**2)\n",
+ "print \"The value required for W = %0.1f \u00b5m\" %(W)\n",
+ "\n",
+ "# Note: Calculation of evaluating the value of W in the book is wrong , so the Answer of the book is wrong "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The value required for R = 30.4 k\u03a9\n",
+ "The value required for W = 0.6 \u00b5m\n"
+ ]
+ }
+ ],
+ "prompt_number": 17
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 2.18 - page 149"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from __future__ import division\n",
+ "from numpy import sqrt\n",
+ "# Given data \n",
+ "Vt= 1 # in V\n",
+ "unCox= 120 # in \u00b5A/V**2\n",
+ "unCox= unCox*10**-6 # in A/V**2\n",
+ "L1=1 # in \u00b5m\n",
+ "L2=L1 # in \u00b5m\n",
+ "I_D= 120 #in \u00b5A\n",
+ "I_D= I_D*10**-6 #in A\n",
+ "V_GS1= 1.5 #in V\n",
+ "V_G2= 3.5 # in V\n",
+ "V_S2= 1.5 # in V\n",
+ "V_DD= 5 # in V\n",
+ "V_D2= 3.5 # in V\n",
+ "# Formul I_D= 1/2*unCox*W/L*(V_GS1-Vt)**2\n",
+ "W1= 2*I_D*L1/(unCox*(V_GS1-Vt)**2) # in \u00b5m\n",
+ "print \"The value of W1 = %0.1f \u00b5m\" %W1\n",
+ "V_GS2= V_G2-V_S2 #in V\n",
+ "# Formul I_D= 1/2*unCox*W/L*(V_GS1-Vt)**2\n",
+ "W2= 2*I_D*L2/(unCox*(V_GS2-Vt)**2) # in \u00b5m\n",
+ "print \"The value of W2 = %0.1f \u00b5m\" %W2\n",
+ "R= (V_DD-V_D2)/I_D # in \u03a9\n",
+ "print \"Resistance = %0.1f k\u03a9\" %(R*10**-3) "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The value of W1 = 8.0 \u00b5m\n",
+ "The value of W2 = 2.0 \u00b5m\n",
+ "Resistance = 12.5 k\u03a9\n"
+ ]
+ }
+ ],
+ "prompt_number": 18
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 2.19 - page 150"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from __future__ import division\n",
+ "from numpy import sqrt\n",
+ "# Given data \n",
+ "Vt= 2 # in V\n",
+ "K1WbyL= 1 # in mA/V**2\n",
+ "K1WbyL= K1WbyL*10**-3 #in mA/V**2\n",
+ "I_D= 10 #in \u00b5A\n",
+ "I_D= I_D*10**-6 #in A\n",
+ "V_DD= 10 # in V\n",
+ "R_D= 4 # in k\u03a9\n",
+ "R_D= R_D*10**3 # in \u03a9\n",
+ "\n",
+ "# Formul I_D= 1/2*K1WbyL*(V_GS-Vt)**2\n",
+ "V_GS= sqrt(2*I_D/K1WbyL)+Vt # in V\n",
+ "V1= -V_GS # in V\n",
+ "# Part (b)\n",
+ "I_D= 2 # in mA\n",
+ "I_D= I_D*10**-3 # in A\n",
+ "V2= V_DD-I_D*R_D #in V\n",
+ "# Formul I_D= 1/2*K1WbyL*(V_GS-Vt)**2\n",
+ "V_GS= sqrt(2*I_D/K1WbyL)+Vt # in V\n",
+ "V3= -V_GS # in V\n",
+ "# Part (c)\n",
+ "I_D= 1 # in mA\n",
+ "I_D= I_D*10**-3 # in A\n",
+ "# Formul I_D= 1/2*K1WbyL*(V_GS-Vt)**2\n",
+ "V_GS= sqrt(2*I_D/K1WbyL)+Vt # in V\n",
+ "V4= V_GS # in V\n",
+ "# Part (d)\n",
+ "I_D= 2 # in mA\n",
+ "R_D= 2.5 # in k\u03a9\n",
+ "R_D= R_D*10**3 # in \u03a9\n",
+ "V_SS= 10 # in V\n",
+ "I_D= I_D*10**-3 # in A\n",
+ "V_GS= sqrt(2*I_D/K1WbyL)+Vt # in V\n",
+ "V5= -V_SS+I_D*R_D # in V\n",
+ "print \"The value of V1 = %0.2f Volt\" %V1\n",
+ "print \"The value of V2 = %0.f Volt\" %V2\n",
+ "print \"The value of V3 = %0.f Volt\" %V3\n",
+ "print \"The value of V4 = %0.2f Volt\" %V4\n",
+ "print \"The value of V5 = %0.f Volt\" %V5"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The value of V1 = -2.14 Volt\n",
+ "The value of V2 = 2 Volt\n",
+ "The value of V3 = -4 Volt\n",
+ "The value of V4 = 3.41 Volt\n",
+ "The value of V5 = -5 Volt\n"
+ ]
+ }
+ ],
+ "prompt_number": 23
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 2.20 - page 152"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from __future__ import division\n",
+ "# Given data \n",
+ "unCox= 20*10**-6 #in A/V**2\n",
+ "upCox= unCox/2.5 # in A/V**2\n",
+ "V_DD= 3 #in V\n",
+ "Vt= 1 # in V\n",
+ "W= 30 # in \u00b5m\n",
+ "L= 10 # in \u00b5m\n",
+ "\n",
+ "# V_GS1= V_GS2\n",
+ "# Formula V_DD= V_GS1+V_GS2\n",
+ "V_GS1= V_DD/2 #in V\n",
+ "V_GS2= V_GS1 # in V\n",
+ "V2= V_GS1 # inV\n",
+ "I1= 1/2*unCox*W/L*(V_GS1-Vt)**2 # in A\n",
+ "# Both transistor have V_D = V_G and therefore they are operating in saturation \n",
+ "#1/2*unCox*W/L*(V4-Vt)**2 = 1/2*upCox*W/L*(V_DD-V4-Vt)\n",
+ "V4= (V_DD-Vt+sqrt(unCox/upCox))/(1+sqrt(unCox/upCox)) \n",
+ "I3= 1/2*unCox*W/L*(1.39-Vt)**2 \n",
+ "print \"The value of V2 = %0.1f Volt\" %V2\n",
+ "print \"The value of I1 = %0.1f \u00b5A\" %(I1*10**6,)\n",
+ "print \"The value of V4 = %0.1f Volt \" %V4\n",
+ "print \"The value of I3 = %0.1f \u00b5A\" %(I3*10**6)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The value of V2 = 1.5 Volt\n",
+ "The value of I1 = 7.5 \u00b5A\n",
+ "The value of V4 = 1.4 Volt \n",
+ "The value of I3 = 4.6 \u00b5A\n"
+ ]
+ }
+ ],
+ "prompt_number": 24
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 2.22 - page 155"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from __future__ import division\n",
+ "from numpy import sqrt\n",
+ "# Given data \n",
+ "Vt= 0.9 # in V\n",
+ "V_A= 50 # in V\n",
+ "V_D= 2 # in V\n",
+ "R_L= 10 # in M\u03a9\n",
+ "R_L= R_L*10**3 # in \u03a9\n",
+ "R_G= 10 # in M\u03a9\n",
+ "R_G= R_G*10**6 # in \u03a9\n",
+ "I_D= 500 # in \u00b5A\n",
+ "I_D= I_D*10**-6 # in A\n",
+ "V_GS= V_D # in V\n",
+ "ro= V_A/I_D # in \u03a9\n",
+ "gm= 2*I_D/(V_GS-Vt) # in A/V\n",
+ "# vo= -gm*vi*(ro || R_L)\n",
+ "vo_by_vi = -gm*(ro*R_L/(ro+R_L)) # in V/V\n",
+ "print \"The voltage gain = %0.1f V/V\" %(vo_by_vi )\n",
+ "# For I= 1 mA or twice the current \n",
+ "I_D1= I_D # in A\n",
+ "I_D2= 2*I_D1 # in A\n",
+ "gm1= gm # in A/V\n",
+ "# Effect on V_D\n",
+ "# I_D1/I_D2 = (V_GS1-Vt)**2/(V_GS2-Vt)**2\n",
+ "V_GS1= V_GS \n",
+ "V_GS2= Vt+sqrt(2)*(V_GS1-Vt) # in V\n",
+ "print \"The new value of V_GS = %0.1f Volt\" %(V_GS2)\n",
+ "# Effect on gm\n",
+ "# gm1/gm2= sqrt(I_D1/I_D2)\n",
+ "gm2= sqrt(I_D2/I_D1)*gm1 # in A/V\n",
+ "print \"The new value of gm2 = %0.1f mA/V\" %(gm2*10**3)\n",
+ "# Effect on ro\n",
+ "# ro1/ro2= I_D2/I_D1\n",
+ "ro1= ro # in \u03a9\n",
+ "ro2= I_D1*ro1/I_D2 # in \u03a9\n",
+ "print \"The new value of ro = %0.1f k\u03a9/V\" %(ro2*10**-3)\n",
+ "# Effect on gain\n",
+ "# Av= -gm*(ro2 || R_L)\n",
+ "Av= -gm*(ro2*R_L/(ro2+R_L)) # in V/V\n",
+ "print \"The new value of voltage gain = %0.1f V/V\" %(Av)\n",
+ "#Answer wrong in the textbook because of calculation accuracy."
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The voltage gain = -8.3 V/V\n",
+ "The new value of V_GS = 2.5 Volt\n",
+ "The new value of gm2 = 1.3 mA/V\n",
+ "The new value of ro = 50.0 k\u03a9/V\n",
+ "The new value of voltage gain = -7.6 V/V\n"
+ ]
+ }
+ ],
+ "prompt_number": 26
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 2.23 - page 157"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from __future__ import division\n",
+ "from numpy import pi\n",
+ "# Given data \n",
+ "I_D= 1 # in mA\n",
+ "I_D= I_D*10**-3 # in A\n",
+ "gm= 1 #in mA/V\n",
+ "gm= gm*10**-3 #in A/V\n",
+ "f_L= 10 # in Hz\n",
+ "R_S= 6 # in k\u03a9\n",
+ "R_S= R_S*10**3 # in \u03a9\n",
+ "R_D= 10 # in k\u03a9\n",
+ "R_D= R_D*10**3 # in \u03a9\n",
+ "vo_by_vi= -gm*R_D/(1+gm*R_S) # in V/V\n",
+ "print \"Mid band gain = %0.2f V/V \" %(vo_by_vi)\n",
+ "# Formula f_L= 1/(2*pi*(1/gm || R_S)) * CS\n",
+ "CS= 1/(2*pi*(1/gm*R_S/(1/gm+R_S))*f_L) #in F\n",
+ "print \"The value of Cs = %0.2f \u00b5F\" %(CS*10**6)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Mid band gain = -1.43 V/V \n",
+ "The value of Cs = 18.57 \u00b5F\n"
+ ]
+ }
+ ],
+ "prompt_number": 29
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 2.24 - page 159"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from __future__ import division\n",
+ "from numpy import pi\n",
+ "# Given data \n",
+ "Rsig= 100 # in k\u03a9\n",
+ "Rsig= Rsig*10**3 # in \u03a9\n",
+ "R_G= 4.7 # in M\u03a9\n",
+ "R_G= R_G*10**6 # in \u03a9\n",
+ "R_D= 15 # in k\u03a9\n",
+ "R_D= R_D*10**3 # in \u03a9\n",
+ "R_L= R_D # in \u03a9\n",
+ "gm= 1 #in mA/V\n",
+ "gm= gm*10**-3 #in A/V\n",
+ "ro=150 # in k\u03a9\n",
+ "ro=ro*10**3 # in \u03a9\n",
+ "Cgs= 1 # in pF\n",
+ "Cgs=Cgs*10**-12 #in F\n",
+ "Cgd= 0.4 # in pF\n",
+ "Cgd=Cgd*10**-12 #in F\n",
+ "vgsBYvsig= R_G/(Rsig+R_G) \n",
+ "Rdesh_L= R_D*R_L/(R_D+R_L) # in \u03a9\n",
+ "voBYvgs= -gm*Rdesh_L \n",
+ "Av= voBYvgs/vgsBYvsig # in V/V\n",
+ "print \"The Mid-band gain = %0.2f V/V\" %(Av)\n",
+ "CM= Cgd*(1+gm*Rdesh_L) # in F\n",
+ "# f_H= 1/(2*pi*(Rsig || R_G)*(Cgs*CM))\n",
+ "f_H= 1/(2*pi*(Rsig * R_G/(Rsig + R_G))*(Cgs+CM)) # in Hz\n",
+ "print \"Frequency = %0.1f kHz\" %(f_H*10**-3)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The Mid-band gain = -7.66 V/V\n",
+ "Frequency = 369.4 kHz\n"
+ ]
+ }
+ ],
+ "prompt_number": 32
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
diff --git a/Electronic_Circuits_by_P._Raja/chapter3.ipynb b/Electronic_Circuits_by_P._Raja/chapter3.ipynb
new file mode 100755
index 00000000..832762c4
--- /dev/null
+++ b/Electronic_Circuits_by_P._Raja/chapter3.ipynb
@@ -0,0 +1,1818 @@
+{
+ "metadata": {
+ "name": "",
+ "signature": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter3 - Bipolar Junction Transistors(BJTs)"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 3.1 - page 182"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from __future__ import division\n",
+ "# Given data \n",
+ "V_E= -0.7 # in V\n",
+ "Bita=50 \n",
+ "RC= 5 # in k\u03a9\n",
+ "RE= 10 # in k\u03a9\n",
+ "RE= RE*10**3 # in \u03a9\n",
+ "RC= RC*10**3 # in \u03a9\n",
+ "V_CC= 10 # in V\n",
+ "V_BE= -10 # in volt\n",
+ "I_E= (V_E-V_BE)/RE # in A\n",
+ "print \"Emitter current = %0.2f mA\" %(I_E*10**3)\n",
+ "# I_E= I_B+I_C and I_C= Bita*I_B, so\n",
+ "I_B= I_E/(1+Bita) # in A\n",
+ "print \"Base current = %0.1f \u00b5A\" %(I_B*10**6)\n",
+ "I_C= I_E-I_B #in A\n",
+ "print \"Collector current = %0.2f mA\" %(I_C*10**3)\n",
+ "V_C= V_CC-I_C*RC # in V\n",
+ "print \"The value of V_C = %0.2f Volt\" %(V_C)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Emitter current = 0.93 mA\n",
+ "Base current = 18.2 \u00b5A\n",
+ "Collector current = 0.91 mA\n",
+ "The value of V_C = 5.44 Volt\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 3.2 - page 183"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from __future__ import division\n",
+ "# Given data \n",
+ "V_E= 1.7 # in V\n",
+ "V_B= 1 # in V\n",
+ "RC= 5 # in k\u03a9\n",
+ "RE= 5 # in k\u03a9\n",
+ "RE= RE*10**3 # in \u03a9\n",
+ "RC= RC*10**3 # in \u03a9\n",
+ "RB= 100 #in k\u03a9\\\n",
+ "RB= RB*10**3 # in \u03a9\n",
+ "V_CC= 10 # in V\n",
+ "V_BE= -10 # in volt\n",
+ "I_E= (V_CC-V_E)/RE # in A\n",
+ "I_B= V_B/RB # in V\n",
+ "# Formula I_B= (1-alpha)*I_E\n",
+ "alpha= 1-I_B/I_E \n",
+ "print \"Value of alpha = %0.3f \" %(alpha)\n",
+ "beta= alpha/(1-alpha) \n",
+ "print \"Value of beta = %.01f \" %beta\n",
+ "V_C= (I_E-I_B)*RC-V_CC # in volt\n",
+ "print \"Collector voltage = %0.2f Volt\" %V_C\n",
+ "# Answer in the textbook is not accurate."
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Value of alpha = 0.994 \n",
+ "Value of beta = 165.0 \n",
+ "Collector voltage = -1.75 Volt\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 3.3 - page 187"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from __future__ import division# Given data \n",
+ "from numpy import log\n",
+ "# Given data\n",
+ "V_CC= 10 # in V\n",
+ "V_CE= 3.2 # in V\n",
+ "RC= 6.8 # in k\u03a9\n",
+ "RC= RC*10**3 # in \u03a9\n",
+ "I_S= 1*10**-15 # in A\n",
+ "V_T= 25*10**-3 # in V\n",
+ "I_C1= (V_CC-V_CE)/RC # in A\n",
+ "print \"Part(a) : \"\n",
+ "# Formula I_C= I_S*%e**(V_BE1/V_T)\n",
+ "V_BE1= V_T*log(I_C1/I_S) # in volt\n",
+ "print \"Collector current = %0.1f mA\" %(I_C1*10**3)\n",
+ "print \"Value of V_BE = %0.1f Volt\" %(V_BE1)\n",
+ "\n",
+ "print \"Part(b) : \"\n",
+ "v_in= 5*10**-3 # in V\n",
+ "Av= -(V_CC-V_CE)/V_T # in V/V\n",
+ "print \"Voltage gain = %0.1f V/V\" %(Av)\n",
+ "v_o= abs(Av )*v_in # in V\n",
+ "print \"Change in output voltage = %0.2f Volt\" %v_o\n",
+ "\n",
+ "print \"Part(c) : \"\n",
+ "#for V_CE= 0.3 V\n",
+ "V_CE= 0.3 # in V\n",
+ "I_C2= (V_CC-V_CE)/RC # in A\n",
+ "# I_C1= I_S*%e**(V_BE1/V_T) (i)\n",
+ "# I_C2= I_S*%e**(V_BE2/V_T) (ii)\n",
+ "# divide the equation (ii) by (i)\n",
+ "delta_V_BE= V_T*log(I_C2/I_C1) # in volt ( where delta_V_BE = V_BE2-V_BE1 )\n",
+ "print \"The positive increament in V_BE = %0.1f mV\" %(delta_V_BE*10**3)\n",
+ "\n",
+ "print \"Part(d) : \"\n",
+ "v_o= 0.99*V_CC # in V\n",
+ "I_C3= (V_CC-v_o)/RC # in A\n",
+ "delta_V_BE= V_T*log(I_C3/I_C1) # in V\n",
+ "print \"The negative increament in V_BE = %0.1f mV\" %(delta_V_BE*10**3 )"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Part(a) : \n",
+ "Collector current = 1.0 mA\n",
+ "Value of V_BE = 0.7 Volt\n",
+ "Part(b) : \n",
+ "Voltage gain = -272.0 V/V\n",
+ "Change in output voltage = 1.36 Volt\n",
+ "Part(c) : \n",
+ "The positive increament in V_BE = 8.9 mV\n",
+ "Part(d) : \n",
+ "The negative increament in V_BE = -105.5 mV\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 3.4 - page 197"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from __future__ import division\n",
+ "# Given data \n",
+ "V_CC= 10 # in V\n",
+ "V_CE= 5 # in V\n",
+ "V_BE= 0.7 # in V\n",
+ "I_C= 5*10**-3 # in mA\n",
+ "bita= 100 \n",
+ "R_C= (V_CC-V_CE)/I_C # in \u03a9\n",
+ "I_B= I_C/bita # in A\n",
+ "R_B= (V_CC-V_BE)/I_B # in \u03a9\n",
+ "print \"The value of R_C = %0.1f k\u03a9\" %(R_C*10**-3)\n",
+ "print \"The value of I_B = %0.1f \u00b5A\" %(I_B*10**6)\n",
+ "print \"The value of R_B = %.01f k\u03a9\" %(R_B*10**-3)\n",
+ "\n",
+ "# Note: The value of base current in the book is wrong"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The value of R_C = 1.0 k\u03a9\n",
+ "The value of I_B = 50.0 \u00b5A\n",
+ "The value of R_B = 186.0 k\u03a9\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 3.5 - page 197"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "%matplotlib inline\n",
+ "from matplotlib.pyplot import *\n",
+ "from __future__ import division\n",
+ "from numpy import *\n",
+ "# Given data \n",
+ "V_CC= 6 # in V\n",
+ "bita= 100 \n",
+ "R_C= 2 # in k\u03a9\n",
+ "R_C= R_C*10**3 # in \u03a9\n",
+ "R_B= 530 # in k\u03a9\n",
+ "R_B= R_B*10**3 # in \u03a9\n",
+ "# when I_C=0\n",
+ "I_C=0 \n",
+ "V_CE= V_CC-I_C*R_C # in volt\n",
+ "V_CE= arange(0,7,0.1) # in Volt\n",
+ "# defining function to get the collector current\n",
+ "def current(V):\n",
+ " it = nditer([V, None])\n",
+ " for v_ce,i in it:\n",
+ " i[...] = (V_CC-v_ce)/R_C*1000 \n",
+ " return it.operands[1]\n",
+ "I_C=current(V_CE) # in mA\n",
+ "x=arange(-1,4,0.1)\n",
+ "y=arange(-0.5,1.02,0.1)\n",
+ "plot(V_CE,I_C) \n",
+ "plot(4*(y/y),y,'--')\n",
+ "plot(x,1*(x/x),'--')\n",
+ "text(4,1.02,'Operating Point')\n",
+ "title(\"DC load line\")\n",
+ "xlabel(\"V_CE in volts\")\n",
+ "ylabel(\"I_C in mA\")\n",
+ "# Setting axes\n",
+ "axes = gca()\n",
+ "axes.set_xlim([0,6])\n",
+ "axes.set_ylim([0,3])\n",
+ "show()\n",
+ "print \"DC load line shown in figure\"\n",
+ "# When V_CE= 0\n",
+ "I_C= V_CC/R_C #in A\n",
+ "# Operating point for silicon transistor \n",
+ "V_BE= 0.7 # in V\n",
+ "I_B= (V_CC-V_BE)/R_B #in A\n",
+ "I_CQ= bita*I_B # in A\n",
+ "V_CEQ= V_CC-I_CQ*R_C # in volt\n",
+ "print \"Operating point is \",V_CEQ,\" V and \",I_CQ*10**3,\" mA\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "metadata": {},
+ "output_type": "display_data",
+ "png": "iVBORw0KGg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4Bb0z0QoML2g2bV8n4EZmYtzqeGzMxanE8NWdOS\ndDDJ5ZnF3o6Ij9SiHrN65VNDZmYtzqeGzMxanDsCM7MW547AzKzFuSMwM2tx7gjMzFrc/wcnnOmI\nlsbj/QAAAABJRU5ErkJggg==\n",
+ "text": [
+ "<matplotlib.figure.Figure at 0x7ff85a0a27d0>"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "DC load line shown in figure\n",
+ "Operating point is 4.0 V and 1.0 mA\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 3.6 - page 203"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from __future__ import division\n",
+ "# Given data \n",
+ "V_CC= 12 # in V\n",
+ "V_BE= 0.7 # in V\n",
+ "bita= 100 \n",
+ "R_C= 10 # in k\u03a9\n",
+ "R_C= R_C*10**3 # in \u03a9\n",
+ "R_B= 100 # in k\u03a9\n",
+ "R_B= R_B*10**3 # in \u03a9\n",
+ "I_BQ= (V_CC-V_BE)/((1+bita)*R_C+R_B) # in A\n",
+ "I_CQ= bita*I_BQ # in A\n",
+ "V_CEQ= V_CC-(I_CQ+I_BQ)*R_C # in volt\n",
+ "# For dc load line\n",
+ "# When\n",
+ "I_C=0 \n",
+ "V_CE= V_CC-(I_C+I_BQ)*R_C # in volt\n",
+ "# When\n",
+ "V_CE= 0 \n",
+ "I_C= (V_CC-I_BQ*R_C)/R_C #in A\n",
+ "print \"Q- point values for circuit is\",round(V_CEQ,2),\"V and\",round(I_CQ*10**3),\"mA\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Q- point values for circuit is 1.72 V and 1.0 mA\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 3.7 - page 204"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from __future__ import division\n",
+ "# Given data \n",
+ "V_CC= 15 # in V\n",
+ "V_BE= 0.7 # in V\n",
+ "V_CE= 5 # in V\n",
+ "I_C= 5 # in mA\n",
+ "I_C=I_C*10**-3 # in A\n",
+ "bita= 100 \n",
+ "I_B= I_C/bita # in A\n",
+ "print \"Base current = %0.f \u00b5A\" %(I_B*10**6)\n",
+ "#Apply KVL to collector circuit , V_CC= (I_C+I_B)*R_C+V_CE\n",
+ "R_C= (V_CC-V_CE)/(I_C+I_B) # in \u03a9\n",
+ "print \"The value of R_C = %0.2f k\u03a9\" %(R_C*10**-3)\n",
+ "#Apply KVL to base or input circuit, V_CC= (I_C+I_B)*R_C+V_CE + I_B*R_B\n",
+ "R_B= (V_CC-V_BE-(I_C+I_B)*R_C)/I_B # in ohm\n",
+ "print \"The value of R_B = %0.f k\u03a9 \" %(R_B*10**-3)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Base current = 50 \u00b5A\n",
+ "The value of R_C = 1.98 k\u03a9\n",
+ "The value of R_B = 86 k\u03a9 \n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 3.8 - page 205"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from __future__ import division\n",
+ "# Given data \n",
+ "V_BE= 0.7 # in V\n",
+ "V_CE= 3 # in V\n",
+ "I_C= 1 # in mA\n",
+ "I_C=I_C*10**-3 # in A\n",
+ "bita= 100 \n",
+ "I_B= I_C/bita # in A\n",
+ "# V_CE= V_BE+V_CB and V_CB= I_B*R_B\n",
+ "R_B= (V_CE-V_BE)/I_B # in \u03a9\n",
+ "print \"The value of R_B = %0.f k\u03a9\" %(R_B*10**-3)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The value of R_B = 230 k\u03a9\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 3.9 - page 208"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "%matplotlib inline\n",
+ "# Exa 3.9\n",
+ "from numpy import *\n",
+ "from matplotlib.pyplot import *\n",
+ "# Given data \n",
+ "R1= 10;# in k\u03a9\n",
+ "R1=R1*10**3;# in \u03a9\n",
+ "R2= 5;# in k\u03a9\n",
+ "R2=R2*10**3;# in \u03a9\n",
+ "RC= 1;# in k\u03a9\n",
+ "RC=RC*10**3;# in \u03a9\n",
+ "RE= 2;# in k\u03a9\n",
+ "RE=RE*10**3;# in \u03a9\n",
+ "V_CC= 15;# in V\n",
+ "V_BE= 0.7;# in V\n",
+ "# When\n",
+ "I_C=0;\n",
+ "V_CE= V_CC-I_C*(RC+RE);# in V\n",
+ "# When V_CE= 0\n",
+ "I_C= V_CC/(RC+RE);# in A\n",
+ "V_B= V_CC*R2/(R1+R2);# in V\n",
+ "I_E= (V_B-V_BE)/RE;# in A\n",
+ "I_C= I_E;# in A (approx)\n",
+ "I_CQ= I_C;# in A\n",
+ "V_CE= V_CC-I_C*(RC+RE);# in V\n",
+ "V_CEQ= V_CE;# in V\n",
+ "#############\n",
+ "V_CE= arange(0,16,0.1);# in Volt\n",
+ "def current(v):\n",
+ " it = nditer([v, None])\n",
+ " for x,y in it:\n",
+ " y[...]= (V_CC-x)/(RC+RE)*1000\n",
+ " return it.operands[1]\n",
+ "I_C = current(V_CE)\n",
+ "\n",
+ "#I_C= (V_CC-V_CE)/(RC+RE)*1000;# in mA\n",
+ "plot(V_CE,I_C);\n",
+ "title(\"DC load line\")\n",
+ "xlabel(\"V_CE in volts\")\n",
+ "ylabel(\"I_C in mA\")\n",
+ "text(8.55,2.15,'Q(8.55V,2.15mA)')\n",
+ "x1=arange(0,8.55,0.01)\n",
+ "y1=arange(0,2.15,0.01)\n",
+ "a=arange(0,8.55,0.01)\n",
+ "yd=2.15*(a/a)\n",
+ "plot(a,yd,'b--')\n",
+ "b=arange(-1,2.15,0.005)\n",
+ "xd=8.55*(b/b)\n",
+ "plot(xd,b,'b--')\n",
+ "show()\n",
+ "disp(\"DC load line shown in figure\")\n",
+ "print 'Operating point is ',V_CEQ,\" V and \",I_CQ*10**3,\" mA\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "metadata": {},
+ "output_type": "display_data",
+ "png": "iVBORw0KGgoAAAANSUhEUgAAAYMAAAEaCAYAAADzDTuZAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3XuYFPWV//H3QYKiKAoBQRRBBQUGBlCIGiKDkpUgovy8\nBVZEdLNR4y2oiWjyDF7iJeqKiJE1xusvIkYjRkHBC6MoIiCICILRyAqCYsBwEV25nP2jasaeoWem\nZ6a7q7r783qefuyprq46INOnv+db9T3m7oiISGFrFHUAIiISPSUDERFRMhARESUDERFByUBERFAy\nEBERlAxEMLNzzWx2ho6908wOqea1MjM7P3z+72Y2IxMxiKRCyUByipmtNLOtZrbJzL40szfM7Odm\nZlX262tm08N91pvZW2Z2bkRhV8fDB+7+Z3c/MeJ4pIApGUiucWCIu+8DtAduAX4N/Kl8BzM7BngZ\nmAUc6u4tgQuBQdkPVyQ3KBlIznL3ze7+LHAWMMrMuoYv3QY85O63ufuGcN+F7v7TVI5rZsea2Xwz\n+5eZzQuTS/lro81sWTgy+cjM/rPKe68yszVmttrMzkv1z1K1VBWWl35uZh+Eo5uJVfY/L4xjg5m9\nYGbtUz2XSDJKBpLz3H0+sBr4kZntCRwNPFmfY5lZC2AaMB5oAfwXMC3cDvA5cFI4MhkN3GlmvcL3\nDgKuAAYCnc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/B9eQEZhSVTJsAAAAABJRU5ErkJggg==\n",
+ "text": [
+ "<matplotlib.figure.Figure at 0x7f12846e6ad0>"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "DC load line shown in figure\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Operating point is 8.55 V and 2.15 mA\n"
+ ]
+ }
+ ],
+ "prompt_number": 24
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 3.10 page 220"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from __future__ import division\n",
+ "# Given data \n",
+ "V_CC= 10 # in V\n",
+ "V_BB= 3 # in V\n",
+ "V_BE= 0.7 # in V\n",
+ "V_T= 25*10**-3 # in V\n",
+ "bita=100 \n",
+ "RC= 3 # in k\u03a9\n",
+ "RC=RC*10**3 # in \u03a9\n",
+ "RB= 100 # in k\u03a9\n",
+ "RB=RB*10**3 # in \u03a9\n",
+ "I_B= (V_BB-V_BE)/RB # in V\n",
+ "I_C= bita*I_B # in A\n",
+ "V_C= V_CC-I_C*RC # in V\n",
+ "gm= I_C/V_T # in A/V\n",
+ "r_pi= bita/gm # in \u03a9\n",
+ "# v_be= r_pi/(RB+r_pi)*v_i\n",
+ "v_be_by_v_i= r_pi/(RB+r_pi) \n",
+ "# v_o= -gm*v_be*RC\n",
+ "v_o_by_v_i= -gm*v_be_by_v_i*RC # in V/V\n",
+ "Av= v_o_by_v_i # in V/V\n",
+ "print \"Voltage gain = %0.2f V/V \" % (round(Av))\n",
+ "# Answer in the book is not accurate."
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Voltage gain = -3.00 V/V \n"
+ ]
+ }
+ ],
+ "prompt_number": 34
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 3.11 - page 253"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from __future__ import division\n",
+ "# Given data \n",
+ "V_B= 4 # in V\n",
+ "V_BE= 0.7 # in V\n",
+ "V_CC= 10 # in V\n",
+ "V_E= V_B-V_BE # in V\n",
+ "R_E= 3.3 # in k\u03a9\n",
+ "R_E=R_E*10**3 # in \u03a9\n",
+ "RC= 4.7 # in k\u03a9\n",
+ "RC=RC*10**3 # in \u03a9\n",
+ "I_E= V_E/R_E # in A\n",
+ "bita=100 \n",
+ "alpha= bita/(1+bita) \n",
+ "I_C= alpha*I_E #in A\n",
+ "print \"The value of I_C = %0.2f mA\" %(I_C*10**3)\n",
+ "V_C= V_CC-I_C*RC # in V\n",
+ "print \"The value of V_C = %0.1f Volts\" %(V_C)\n",
+ "I_B= I_E/(1+bita) # in A\n",
+ "print \"The value of I_B = %0.2f mA\" %(I_B*10**3)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The value of I_C = 0.99 mA\n",
+ "The value of V_C = 5.3 Volts\n",
+ "The value of I_B = 0.01 mA\n"
+ ]
+ }
+ ],
+ "prompt_number": 36
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 3.12 - page 254"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from __future__ import division\n",
+ "# Given data \n",
+ "V_B= 5 # in V\n",
+ "V_BE= 0.7 # in V\n",
+ "V_CC= 10 # in V\n",
+ "bita=100 \n",
+ "R_B= 100 # in k\u03a9\n",
+ "R_C= 2 # in k\u03a9\n",
+ "R_B=R_B*10**3 # in \u03a9\n",
+ "R_C=R_C*10**3 # in \u03a9\n",
+ "I_B= (V_B-V_BE)/R_B # in A\n",
+ "I_C= bita*I_B #in A\n",
+ "V_C= V_CC-I_C*R_C # in V\n",
+ "I_E= I_C # in A (approx)\n",
+ "print \"The value of I_B = %0.3f mA\" %(I_B*10**3)\n",
+ "print \"The value of I_C = %0.1f mA \" %(I_C*10**3)\n",
+ "print \"The value of V_C = %0.1f Volts\" %(V_C)\n",
+ "print \"The value of I_E = %0.1f mA\" %(I_E*10**3)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The value of I_B = 0.043 mA\n",
+ "The value of I_C = 4.3 mA \n",
+ "The value of V_C = 1.4 Volts\n",
+ "The value of I_E = 4.3 mA\n"
+ ]
+ }
+ ],
+ "prompt_number": 40
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 3.13 - page 255"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from __future__ import division\n",
+ "from sympy import *\n",
+ "V_B = symbols('V_B')\n",
+ "# Given data \n",
+ "V_EB= 0.7 # in V\n",
+ "V_E = 0.7 # in V\n",
+ "bita=100 \n",
+ "V_EC= 0.2 # in V\n",
+ "V_E= V_EB+V_B # in V\n",
+ "V_CC= 5 # in V\n",
+ "R_E= 1 # in k\u03a9\n",
+ "R_E=R_E*10**3 # in \u03a9\n",
+ "R_C= 10 # in k\u03a9\n",
+ "R_C=R_C*10**3 # in \u03a9\n",
+ "R_B= 10 # in k\u03a9\n",
+ "R_B= R_B*10**3 # in \u03a9\n",
+ "V_E= V_B+V_EB # (i)\n",
+ "V_C= V_E-V_EC # (ii)\n",
+ "I_E= (V_CC-V_E)/(R_E)*1000 # mA (iii)\n",
+ "I_B= V_B/R_B # (iv)\n",
+ "I_C= (V_C+V_CC)/R_C # (v)\n",
+ "# By using relationship, I_E= I_B+I_C\n",
+ "expr = I_E*1000-(I_B*1000+I_C*1000)\n",
+ "V_B = solve(expr,V_B)\n",
+ "V_B= (9*V_CC-11*V_EB+V_EC)/12 # in V\n",
+ "V_E= V_B+V_EB # in V\n",
+ "V_C= V_B+V_EB-V_EC # in V\n",
+ "I_E= (V_CC-V_E)/R_E# in amp\n",
+ "I_C= (V_B+V_EB-V_EC+V_CC)/R_B # in amp\n",
+ "I_B= V_B/R_B # in amp\n",
+ "print \"The value of V_B = %0.2f Volts\" %V_B\n",
+ "print \"The value of V_E = %0.2f Volts\" %V_E\n",
+ "print \"The value of V_C = %0.2f Volts\" %V_C\n",
+ "print \"The value of I_E = %0.2f mA\" %(I_E*10**3)\n",
+ "print \"The value of I_C = %0.2f mA\" %(I_C*10**3)\n",
+ "print \"The value of I_B = %0.2f mA\" %(I_B*10**3)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The value of V_B = 3.12 Volts\n",
+ "The value of V_E = 3.83 Volts\n",
+ "The value of V_C = 3.62 Volts\n",
+ "The value of I_E = 1.17 mA\n",
+ "The value of I_C = 0.86 mA\n",
+ "The value of I_B = 0.31 mA\n"
+ ]
+ }
+ ],
+ "prompt_number": 15
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 3.14 - page 257"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Given data \n",
+ "bita=100 \n",
+ "hFE= 100 \n",
+ "VCEsat= 0.2 # in V\n",
+ "VBEsat= 0.8 # in V\n",
+ "VBEactive= 0.7 # in V\n",
+ "VBB= 5 # in V\n",
+ "VCC= 10 # in V\n",
+ "R_C= 3 # in k\u03a9\n",
+ "R_C=R_C*10**3 # in \u03a9\n",
+ "R_B= 50 # in k\u03a9\n",
+ "R_B=R_B*10**3 # in \u03a9\n",
+ "# Formula VCC= ICsat*R_C+VCEsat\n",
+ "ICsat= (VCC-VCEsat)/R_C #A\n",
+ "print \"The value of IC(sat) = %0.2f mA\" %(ICsat*10**3)\n",
+ "IBmin= ICsat/bita # in A\n",
+ "# Apply KVL to input circuit, VBB= IB*R_B+VBEsat\n",
+ "IB= (VBB-VBEsat)/R_B # in A\n",
+ "print \"Actual base current = %0.f \u00b5A\" %(IB*10**6)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The value of IC(sat) = 3.27 mA\n",
+ "Actual base current = 84 \u00b5A\n"
+ ]
+ }
+ ],
+ "prompt_number": 16
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 3.16 - page 259"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Given data \n",
+ "# beta= alpha/(1-alpha)\n",
+ "# At alpha= 0.5\n",
+ "alpha= 0.5 \n",
+ "beta= alpha/(1-alpha) \n",
+ "print \"At alpha=0.5, the value of beta = %0.f \" %beta\n",
+ "# At alpha= 0.9\n",
+ "alpha= 0.9 \n",
+ "beta = alpha/(1-alpha) \n",
+ "print \"At alpha=0.9, the value of beta is %0.f \" %beta\n",
+ "# At alpha= 0.5\n",
+ "alpha= 0.999 \n",
+ "beta= alpha/(1-alpha) \n",
+ "print \"At alpha=0.999, the value of beta is %0.f \" %beta"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "At alpha=0.5, the value of beta = 1 \n",
+ "At alpha=0.9, the value of beta is 9 \n",
+ "At alpha=0.999, the value of beta is 999 \n"
+ ]
+ }
+ ],
+ "prompt_number": 17
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 3.17 - page 259"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from __future__ import division\n",
+ "# Given data \n",
+ "# alpha= beta/(1-beta)\n",
+ "# At beta= 1\n",
+ "beta=1 \n",
+ "alpha= beta/(1+beta) \n",
+ "print \"At beta=1, the value of alpha is %0.2f \" %alpha\n",
+ "# At beta= 2\n",
+ "beta=2 \n",
+ "alpha= beta/(1+beta) \n",
+ "print \"At beta=2, the value of alpha is %0.2f \" %alpha\n",
+ "# At beta= 100\n",
+ "beta=100 \n",
+ "alpha= beta/(1+beta) \n",
+ "print \"At beta=100, the value of alpha is %0.2f \" %alpha\n",
+ "# At beta= 200\n",
+ "beta=200 \n",
+ "alpha= beta/(1+beta) \n",
+ "print \"At beta=200, the value of alpha is %0.3f \"%alpha"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "At beta=1, the value of alpha is 0.50 \n",
+ "At beta=2, the value of alpha is 0.67 \n",
+ "At beta=100, the value of alpha is 0.99 \n",
+ "At beta=200, the value of alpha is 0.995 \n"
+ ]
+ }
+ ],
+ "prompt_number": 18
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 3.18 - page 260"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from numpy import exp, log\n",
+ "# Given data \n",
+ "VBE= 0.76 # in V\n",
+ "VT= 0.025 # in V\n",
+ "I_C= 10*10**-3 # in A\n",
+ "# Formula I_C= I_S*exp(VBE/VT)\n",
+ "I_S= I_C/(exp(VBE/VT)) # in A\n",
+ "print \"The value of I_S = %0.3e A\" %I_S\n",
+ "# Part(a) for VBE = 0.7 V\n",
+ "VBE= 0.7 # in V\n",
+ "I_C= I_S*exp(VBE/VT)\n",
+ "print \"For VBE = 0.7 V , The value of I_C = %0.3f mA\" %(I_C*10**3)\n",
+ "\n",
+ "# Part (b) for I_C= 10 \u00b5A\n",
+ "I_C= 10*10**-6 # in A\n",
+ "# Formula I_C= I_S*exp(VBE/VT)\n",
+ "VBE= VT*log(I_C/I_S) \n",
+ "print \"For I_C = 10 \u00b5A, The value of VBE = %0.3f V\" %VBE"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The value of I_S = 6.273e-16 A\n",
+ "For VBE = 0.7 V , The value of I_C = 0.907 mA\n",
+ "For I_C = 10 \u00b5A, The value of VBE = 0.587 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 22
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 3.19 - page 260"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from __future__ import division\n",
+ "# Given data \n",
+ "VBE= 0.7 # in V\n",
+ "VT= 0.025 # in V\n",
+ "I_B= 100 # in \u00b5A\n",
+ "I_B=I_B*10**-6 # in A\n",
+ "I_C= 10*10**-3 # in A\n",
+ "# Formula I_C= I_S*exp(VBE/VT)\n",
+ "I_S= I_C/(exp(VBE/VT)) # in A\n",
+ "alpha= I_C/(I_C+I_B) \n",
+ "beta= I_C/I_B \n",
+ "IS_by_alpha= I_S/alpha # in A\n",
+ "IS_by_beta= I_S/beta # in A\n",
+ "print \"The value of alpha is %0.2f \" %alpha\n",
+ "print \"The value of beta is %0.2f \" %beta \n",
+ "print \"The value of Is/alpha = %0.2e A\" %IS_by_alpha\n",
+ "print \"The value of Is/beta = %0.2e A\" %IS_by_beta"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The value of alpha is 0.99 \n",
+ "The value of beta is 100.00 \n",
+ "The value of Is/alpha = 6.98e-15 A\n",
+ "The value of Is/beta = 6.91e-17 A\n"
+ ]
+ }
+ ],
+ "prompt_number": 23
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 3.20 - page 261"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Given data \n",
+ "VBE= 0.7 # in V\n",
+ "VCC= 10.7 # in V\n",
+ "R_C= 10 #in k\u03a9\n",
+ "R_C=R_C*10**3 # in \u03a9\n",
+ "R_B= 10 #in k\u03a9\n",
+ "R_B=R_B*10**3 # in \u03a9\n",
+ "I1= (VCC-VBE)/R_C # in A\n",
+ "print \"The value of I1 = %0.f mA\" %(I1*10**3)\n",
+ "# Part (b)\n",
+ "VC= -4 #in V\n",
+ "VB= -10 # in V\n",
+ "R_C= 5.6 #in k\u03a9\n",
+ "R_C=R_C*10**3 # in \u03a9\n",
+ "R_B= 2.4 #in k\u03a9\n",
+ "R_B=R_B*10**3 # in \u03a9\n",
+ "VCC=12 # V\n",
+ "I_C= (VC-VB)/R_B # in A\n",
+ "V2= VCC- (R_C*I_C) \n",
+ "print \"The value of V2 = %0.f Volt\" %V2\n",
+ "# Part (c)\n",
+ "VCC= 0 \n",
+ "VCE= -10 # in V\n",
+ "R_C= 10 #in k\u03a9\n",
+ "R_C=R_C*10**3 # in \u03a9\n",
+ "I_C= (VCC-VCE)/R_C # in A\n",
+ "V4= 1 # in V\n",
+ "I3= I_C # in A (approx)\n",
+ "print \"The value of V4 = %0.f Volt\" %V4\n",
+ "print \"The value of I3 = %0.f mA\" %(I3*10**3)\n",
+ "# Part (d)\n",
+ "VBE= -10 # in V\n",
+ "VCC= 10 # in V\n",
+ "R_B= 5 #in k\u03a9\n",
+ "R_B=R_B*10**3 # in \u03a9\n",
+ "R_C= 15 #in k\u03a9\n",
+ "R_C=R_C*10**3 # in \u03a9\n",
+ "# I5= I_C and \n",
+ "# I5= (V6-0.7-VBE)/R_B and I_C= (VCC-V6)/R_C\n",
+ "V6= (VCC*R_B+R_C*(0.7+VBE))/(R_C+R_B) \n",
+ "print \"The value of V6 = %0.3f Volt\" %(V6)\n",
+ "I5= (V6-0.7-VBE)/R_B # in A\n",
+ "print \"The value of I5 = %0.3f mA\" %(I5*10**3)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The value of I1 = 1 mA\n",
+ "The value of V2 = -2 Volt\n",
+ "The value of V4 = 1 Volt\n",
+ "The value of I3 = 1 mA\n",
+ "The value of V6 = -4.475 Volt\n",
+ "The value of I5 = 0.965 mA\n"
+ ]
+ }
+ ],
+ "prompt_number": 28
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 3.21 -page 264"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Given data \n",
+ "# Part (a)\n",
+ "V_C= 2 # in V\n",
+ "R_C= 1 # in k\u03a9\n",
+ "R_C=R_C*10**3 # in \u03a9\n",
+ "V_B= 4.3 # in V\n",
+ "R_B= 200 # in k\u03a9\n",
+ "R_B=R_B*10**3 # in \u03a9\n",
+ "I_C= V_C/R_C # in A\n",
+ "I_B= V_B/R_B # in A\n",
+ "beta= I_C/I_B \n",
+ "print \"Part (a)\"\n",
+ "print \"Collector current = %0.f mA\" %(I_C*10**3)\n",
+ "print \"Base current = %0.1f \u00b5A\" %(I_B*10**6)\n",
+ "print \"The value of beta is %0.f \"%beta\n",
+ "\n",
+ "# Part (b)\n",
+ "V_C= 2.3 # in V\n",
+ "R_C= 230 # in k\u03a9\n",
+ "R_C=R_C*10**3 # in \u03a9\n",
+ "V_B= 4.3 # in V\n",
+ "R_B= 20 # in k\u03a9\n",
+ "R_B=R_B*10**3 # in \u03a9\n",
+ "I= V_C/R_C # current through 230\u03a9 resistro i.e. I_C + I_B in A\n",
+ "I_B= (V_B-V_C)/R_B # in A\n",
+ "I_C= I-I_B # in A\n",
+ "bita= abs(I_C/I_B) \n",
+ "print \"Part (b)\"\n",
+ "print \"Collector current = %0.2f mA\" %(I_C*10**3)\n",
+ "print \"Base current = %0.2f mA\" %(I_B*10**3)\n",
+ "print \"The value of beta is %0.2f \"%beta\n",
+ "\n",
+ "# Part (c)\n",
+ "V_E= 10 # in V\n",
+ "R_E= 1 # in k\u03a9\n",
+ "R_E=R_E*10**3 # in \u03a9\n",
+ "V_1= 7 # in V\n",
+ "R_C= 1 # in k\u03a9\n",
+ "R_C=R_C*10**3 # in \u03a9\n",
+ "V_B= 6.3 # in V\n",
+ "R_B= 100 # in k\u03a9\n",
+ "R_B=R_B*10**3 # in \u03a9\n",
+ "I_E= (V_E-V_1)/R_C #in A\n",
+ "I_C=I_E # in A (approx)\n",
+ "V_C= I_C*R_C # in V\n",
+ "I_B= (V_B-V_C)/R_B # in A\n",
+ "beta= I_E/I_B-1 \n",
+ "print \"Part (c)\"\n",
+ "print \"Emitter current = %0.2f mA\" %(I_E*10**3)\n",
+ "print \"Base current = %0.2f \u00b5A\" %(I_B*10**6)\n",
+ "print \"Collector voltage = %0.2f Volts\" %(V_C)\n",
+ "print \"The value of beta is %0.2f \"%(beta)\n",
+ "\n",
+ "# Note : In the book the value of base current in the first part is wrong due to calculation error.\n",
+ "#In the part (b) the values of collector current and beta are wrong due to calculation error in the first line of part (b)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Part (a)\n",
+ "Collector current = 2 mA\n",
+ "Base current = 21.5 \u00b5A\n",
+ "The value of beta is 93 \n",
+ "Part (b)\n",
+ "Collector current = -0.09 mA\n",
+ "Base current = 0.10 mA\n",
+ "The value of beta is 93.02 \n",
+ "Part (c)\n",
+ "Emitter current = 3.00 mA\n",
+ "Base current = 33.00 \u00b5A\n",
+ "Collector voltage = 3.00 Volts\n",
+ "The value of beta is 89.91 \n"
+ ]
+ }
+ ],
+ "prompt_number": 32
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 3.22 - page 266"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Given data \n",
+ "# Part (a)\n",
+ "beta= 30 \n",
+ "R_C= 2.2 # in k\u03a9\n",
+ "R_C=R_C*10**3 # in \u03a9\n",
+ "R_B= 2.2 # in k\u03a9\n",
+ "R_B=R_B*10**3 # in \u03a9\n",
+ "VCC= 3 # in V\n",
+ "VCE= -3 # in V\n",
+ "VBE= 0.7 # in V\n",
+ "V_B= 0 # in V\n",
+ "V_E= V_B-VBE # in V\n",
+ "I_E= (V_E-VCE)/R_B # in A\n",
+ "I_C= I_E # in A\n",
+ "V_C= VCC-I_E*R_C # in V\n",
+ "I_B= I_C/beta # in A\n",
+ "print \"Part (a)\"\n",
+ "print \"The value of V_B = %0.2f V \" %V_B\n",
+ "print \"The value of V_E = %0.2f V\" %V_E\n",
+ "print \"The value of I_E = %0.2f mA\" %(I_E*10**3)\n",
+ "print \"The value of V_C = %0.3f V\" %(V_C)\n",
+ "print \"The value of I_B = %0.2f mA\" %(I_B*10**3)\n",
+ "# Part (b)\n",
+ "R_C= 560 # in \u03a9\n",
+ "R_B= 1.1 # in k\u03a9\n",
+ "R_B=R_B*10**3 # in \u03a9\n",
+ "VCC= 9 # in V\n",
+ "VCE= 3 # in V\n",
+ "V_B= 3 # in V\n",
+ "V_E= V_B+VBE # in V\n",
+ "I_E= (VCC-V_E)/R_B # in A\n",
+ "alpha= beta/(1+beta) \n",
+ "I_C= I_E*alpha # in A\n",
+ "V_C= I_C*R_C # in V\n",
+ "I_B= I_C/beta # in A\n",
+ "print \"Part (b)\"\n",
+ "print \"The value of V_B = %0.2f V \" %V_B\n",
+ "print \"The value of V_E = %0.2f V\" %V_E\n",
+ "print \"The value of I_E = %0.2f mA\" %(I_C*10**3)\n",
+ "print \"The value of V_C = %0.2f V\" %(V_C)\n",
+ "print \"The value of I_B = %0.3f mA\" %(I_B*10**3)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Part (a)\n",
+ "The value of V_B = 0.00 V \n",
+ "The value of V_E = -0.70 V\n",
+ "The value of I_E = 1.05 mA\n",
+ "The value of V_C = 0.700 V\n",
+ "The value of I_B = 0.03 mA\n",
+ "Part (b)\n",
+ "The value of V_B = 3.00 V \n",
+ "The value of V_E = 3.70 V\n",
+ "The value of I_E = 4.66 mA\n",
+ "The value of V_C = 2.61 V\n",
+ "The value of I_B = 0.155 mA\n"
+ ]
+ }
+ ],
+ "prompt_number": 35
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 3.23 - page 268"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from numpy import *\n",
+ "# Given data \n",
+ "VBE= 0.7 # in V\n",
+ "VCC= 9 # in V\n",
+ "VCE= -9 # in V\n",
+ "V_B= -1.5 # in V\n",
+ "R_C= 10 # in k\u03a9\n",
+ "R_C=R_C*10**3 # in \u03a9\n",
+ "R_B= 10 # in k\u03a9\n",
+ "R_B=R_B*10**3 # in \u03a9\n",
+ "I_B= abs(V_B)/R_B # in A\n",
+ "V_E= V_B-VBE # in V\n",
+ "print \"The value of V_E = %0.2f Volt\" %V_E\n",
+ "I_E= (V_E-VCE)/R_B # in A\n",
+ "beta= I_E/I_B-1 \n",
+ "alpha= beta/(1+beta) \n",
+ "print \"The value of alpha = %0.2f Volt\" %alpha\n",
+ "print \"The value of beta = %0.2f Volt\" %beta\n",
+ "V_C= VCC-I_E*alpha*R_C # in V\n",
+ "print \"The value of V_C = %0.2f Volt\" %V_C\n",
+ "beta = inf\n",
+ "alpha= beta/(1+beta)\n",
+ "I_B= 0 \n",
+ "V_B=0 \n",
+ "V_C= VCC-I_E*R_C # in volt\n",
+ "print \"The value of V_B = %0.2f V \" %V_B\n",
+ "print \"The value of V_E = %0.2f V\" %V_E\n",
+ "print \"The value of V_C = %0.2f V\" %(V_C)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The value of V_E = -2.20 Volt\n",
+ "The value of alpha = 0.78 Volt\n",
+ "The value of beta = 3.53 Volt\n",
+ "The value of V_C = 3.70 Volt\n",
+ "The value of V_B = 0.00 V \n",
+ "The value of V_E = -2.20 V\n",
+ "The value of V_C = 2.20 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 36
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 3.24 - page 269"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Given data \n",
+ "VBE_1= 0.7 # in V\n",
+ "VBE_2= 0.5 # in V\n",
+ "V_T= 0.025 # in V\n",
+ "I_C1= 10 # in mV\n",
+ "I_C1= I_C1*10**-3 # in A\n",
+ "# I_C1= I_S*%e**(VBE_1/V_T) (i)\n",
+ "# I_C2= I_S*%e**(VBE_2/V_T) (ii)\n",
+ "# Devide equation (ii) by (i)\n",
+ "I_C2= I_C1*exp((VBE_2-VBE_1)/V_T) # in A\n",
+ "print \"The value of I_C2 = %0.2f \u00b5A\" %(I_C2*10**6)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The value of I_C2 = 3.35 \u00b5A\n"
+ ]
+ }
+ ],
+ "prompt_number": 37
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 3.25 - page 270"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Given data \n",
+ "R1= 10 # in k\u03a9\n",
+ "R1=R1*10**3 # in \u03a9\n",
+ "R2= 10 # in k\u03a9\n",
+ "R2=R2*10**3 # in \u03a9\n",
+ "I_C=.5 # mA\n",
+ "V_T= 0.025 #in V\n",
+ "I_C= I_C*10**-3 # in A\n",
+ "V= 10 # in V\n",
+ "Vth= V*R1/(R1+R2) # in V\n",
+ "Rth= R1*R2/(R1+R2) #in \u03a9\n",
+ "vo= I_C*Rth # in V\n",
+ "vi=V_T # in V\n",
+ "vo_by_vi= vo/vi #in V/V\n",
+ "print \"The value of vo/vi = %0.f V/V \" %vo_by_vi"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The value of vo/vi = 100 V/V \n"
+ ]
+ }
+ ],
+ "prompt_number": 38
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 3.27 - page 272"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Given data \n",
+ "V_B= 2 # in V\n",
+ "V_CC=5 # in V\n",
+ "V_BE= 0.7 # in V\n",
+ "R_E= 1*10**3 # in \u03a9\n",
+ "R_C= 1*10**3 # in \u03a9\n",
+ "V_E= V_B-V_BE # in V\n",
+ "I_E= V_E/R_E # in A\n",
+ "I_C= I_E # in A\n",
+ "V_C= V_CC-I_C*R_C #in V\n",
+ "print \"At V_B= +2 V\"\n",
+ "print \"The value of V_E = %0.2f Volts\" %V_E\n",
+ "print \"The value of V_C = %0.2f Volts\" %V_C\n",
+ "\n",
+ "# Part (b)\n",
+ "V_B= 0 #in V\n",
+ "V_E= 0 # in V\n",
+ "I_E= 0 # in A\n",
+ "V_C= 5 # in V\n",
+ "print \"At V_B= 0 V\"\n",
+ "print \"The value of V_E = %0.2f Volts\" %V_E\n",
+ "print \"The value of V_C = %0.2f Volts\" %V_C"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "At V_B= +2 V\n",
+ "The value of V_E = 1.30 Volts\n",
+ "The value of V_C = 3.70 Volts\n",
+ "At V_B= 0 V\n",
+ "The value of V_E = 0.00 Volts\n",
+ "The value of V_C = 5.00 Volts\n"
+ ]
+ }
+ ],
+ "prompt_number": 39
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 3.28 - page 273"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Given data \n",
+ "V_B= 0 # in V\n",
+ "R_E=1*10**3 #in \u03a9\n",
+ "R_C=1*10**3 #in \u03a9\n",
+ "V_CC=5 # in V\n",
+ "V_BE= 0.7 # in V\n",
+ "V_E= V_B-V_BE # in V\n",
+ "I_E= (1+V_E)/R_E # in A\n",
+ "I_C= I_E # (approx) in A\n",
+ "V_C= V_CC-I_C*R_C #in V\n",
+ "print \"Part (a)\"\n",
+ "print \"The value of V_E = %0.2f Volts\" %V_E\n",
+ "print \"The value of V_C = %0.2f Volts\" %V_C\n",
+ "# For saturation \n",
+ "V_CE=0.2 # V\n",
+ "V_CB= -0.5 # in V\n",
+ "# I_C= 5-V_C/R_C and V_C= V_E-VCE, So\n",
+ "# I_C= (5.2-V_E)/R_C\n",
+ "# I_E= (V_E+1)/R_E and at the edge of saturation I_C=I_E,\n",
+ "V_E= 4.2/2 #/ in V\n",
+ "V_B= V_E+0.7 # in V\n",
+ "V_C= V_E+0.2 # in V\n",
+ "print \"Part (b) \"\n",
+ "print \"The value of V_E = %0.2f Volts\" %V_E\n",
+ "print \"The value of V_B = %0.2f Volts\" %V_B\n",
+ "print \"The value of V_C = %0.2f Volts\" %V_C\n",
+ "\n",
+ "# Note: In the book , there is a miss print in the last line of this question \n",
+ "#because V_E+0.2= 2.1+0.2 = 2.3 (not 2.8) , so answer in the book is wrong "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Part (a)\n",
+ "The value of V_E = -0.70 Volts\n",
+ "The value of V_C = 4.70 Volts\n",
+ "Part (b) \n",
+ "The value of V_E = 2.10 Volts\n",
+ "The value of V_B = 2.80 Volts\n",
+ "The value of V_C = 2.30 Volts\n"
+ ]
+ }
+ ],
+ "prompt_number": 41
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 3.29 - page 275"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Given data \n",
+ "V_CC=5 # in V\n",
+ "V_E= 1 # in V\n",
+ "V_BE= 0.7 # in V\n",
+ "R_E=5*10**3 #in \u03a9\n",
+ "R_C=5*10**3 #in \u03a9\n",
+ "R_B= 20*10**3 # in \u03a9\n",
+ "I_E= (V_CC-V_E)/R_E # in A\n",
+ "# For pnp transistor V_BE= V_E-V_B\n",
+ "V_B= V_E-V_BE # in V\n",
+ "I_B= V_B/R_B # in A\n",
+ "I_C= I_E-I_B # in A\n",
+ "V_C= I_C*R_C-V_CC # in V\n",
+ "beta= I_C/I_B \n",
+ "alpha= I_C/I_E \n",
+ "print \"The value of V_B = %0.1f Volts\" %V_B\n",
+ "print \"The value of I_B = %0.3f mA\" %(I_B*10**3)\n",
+ "print \"The value of I_E = %0.1f mA\" %(I_E*10**3)\n",
+ "print \"The value of I_C = %0.3f mA\" %(I_C*10**3)\n",
+ "print \"The value of V_C = %0.3f Volts\" %V_C \n",
+ "print \"The value of beta is %0.1f \"%beta \n",
+ "print \"The value of alpha is %0.2f \"%alpha"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The value of V_B = 0.3 Volts\n",
+ "The value of I_B = 0.015 mA\n",
+ "The value of I_E = 0.8 mA\n",
+ "The value of I_C = 0.785 mA\n",
+ "The value of V_C = -1.075 Volts\n",
+ "The value of beta is 52.3 \n",
+ "The value of alpha is 0.98 \n"
+ ]
+ }
+ ],
+ "prompt_number": 47
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 3.30 - page 276"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Given data\n",
+ "V_CC=5 # in V\n",
+ "V_T= 0.025 # in V\n",
+ "R_C=7.5*10**3 #in \u03a9\n",
+ "I_C= 0.5 # in mA\n",
+ "I_C= I_C*10**-3 # in A\n",
+ "I_E=I_C # (approx) in A\n",
+ "V_C= V_CC-I_C*R_C # in V\n",
+ "print \"dc voltage at the collector = %0.2f Volt\" %V_C\n",
+ "gm= I_C/V_T # in A/V\n",
+ "print \"The value of gm = %0.f mA/V\" %(gm*10**3)\n",
+ "# v_be= -v_i\n",
+ "# v_c= -gm*v_be*R_C\n",
+ "vcbyvi= gm*R_C # in V/V\n",
+ "print \"The value of vc/vi = %0.f V/V\" %(vcbyvi)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "dc voltage at the collector = 1.25 Volt\n",
+ "The value of gm = 20 mA/V\n",
+ "The value of vc/vi = 150 V/V\n"
+ ]
+ }
+ ],
+ "prompt_number": 48
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 3.31 - page 277"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Given data\n",
+ "V_T= 0.025 # in V\n",
+ "I_E= 0.5 # in mA\n",
+ "I_E= I_E*10**-3 # in mA\n",
+ "Rsig= 50 # in \u03a9\n",
+ "R_C= 5*10**3 # in \u03a9\n",
+ "re= V_T/I_E # in ohm\n",
+ "Rin= Rsig+re # in ohm\n",
+ "print \"Input resistance = %0.f \u03a9\" %Rin\n",
+ "# Part(b)\n",
+ "# vo= -0.99*ie*R_C and ie= -v_sig/Rin\n",
+ "vo_by_v_sig= 0.99*R_C/Rin # in V/V\n",
+ "print \"The value of vo/vsig = %0.1f V/V\" %(vo_by_v_sig)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Input resistance = 100 \u03a9\n",
+ "The value of vo/vsig = 49.5 V/V\n"
+ ]
+ }
+ ],
+ "prompt_number": 49
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 3.32 - page 278"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Given data\n",
+ "beta= 200 \n",
+ "alpha= beta/(1+beta) \n",
+ "R_C= 100 # in \u03a9\n",
+ "R_B= 10 # in k\u03a9\n",
+ "Rsig= 1 # in k\u03a9\n",
+ "Rsig= Rsig*10**3 # in \u03a9\n",
+ "R_B= R_B*10**3 # in \u03a9\n",
+ "V_T= 25*10**-3 \n",
+ "V=1.5 # in V\n",
+ "I_E= 10 # in mA\n",
+ "I_E= I_E*10**-3 # in A\n",
+ "I_C= alpha*I_E # in A\n",
+ "V_C= I_C*R_C # in V\n",
+ "I_B= I_C/beta # in A\n",
+ "V_B= V-(R_B*I_B)\n",
+ "gm= I_C/V_T # in A/V\n",
+ "rpi= beta/gm # in \u03a9\n",
+ "Rib= rpi # in \u03a9\n",
+ "print \"The value of Rib = %0.2f \u03a9 \" %Rib\n",
+ "Rin= R_B*rpi/(R_B+rpi) # in \u03a9\n",
+ "print \"The value of Rin = %0.2f \u03a9\" %Rin\n",
+ "# vbe= v_sig*Rin/(Rsig+Rin) \n",
+ "vbe_by_vsig= Rin/(Rsig+Rin) \n",
+ "# vo= -gm*vbe*R_C and = -gm*v_sig*Rin/(Rsig+Rin)\n",
+ "vo_by_vsig= -gm*R_C*vbe_by_vsig # in V/V\n",
+ "print \"Overall voltage gain = %0.2f V/V\" %vo_by_vsig\n",
+ "# if \n",
+ "vo= 0.4 #(\u00b1) in V\n",
+ "vs= vo/abs(vo_by_vsig) # in V\n",
+ "vbe= vbe_by_vsig*vs # in V\n",
+ "print \"The value of v_sig = %0.2f mV\" %(vs*10**3)\n",
+ "print \"The value of v_be = %0.2f mV\" %(vbe*10**3)\n",
+ "\n",
+ "# Note: There is some difference between in this coding and book solution. But Coding is correct."
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The value of Rib = 502.50 \u03a9 \n",
+ "The value of Rin = 478.46 \u03a9\n",
+ "Overall voltage gain = -12.88 V/V\n",
+ "The value of v_sig = 31.06 mV\n",
+ "The value of v_be = 10.05 mV\n"
+ ]
+ }
+ ],
+ "prompt_number": 50
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 3.33 - page 280"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Given data\n",
+ "V_T= 0.025 # in V\n",
+ "# Part(a)\n",
+ "print \"Part (a) : \"\n",
+ "V_BE= 690 # in mV\n",
+ "V_BE=V_BE*10**-3 # in V\n",
+ "I_C= 1 # in mA\n",
+ "I_B= 50 # in \u00b5A\n",
+ "I_C=I_C*10**-3 # in A\n",
+ "I_B=I_B*10**-6 # in A\n",
+ "beta= I_C/I_B \n",
+ "alpha= beta/(1+beta) \n",
+ "I_E= I_C/alpha # in A\n",
+ "# I_C= I_S*exp(V_BE/V_T)\n",
+ "I_S= I_C/(exp(V_BE/V_T)) \n",
+ "print \"The value of beta is %0.1f \" %beta\n",
+ "print \"The value of alpha is %0.4f \"%alpha\n",
+ "print \"The value of I_E = %0.2f mA\" %(I_E*10**3)\n",
+ "print \"The value of I_S = %0.2e A\" %I_S\n",
+ "\n",
+ "# Part(b)\n",
+ "print \"Part (b) : \"\n",
+ "V_BE= 690 # in mV\n",
+ "V_BE=V_BE*10**-3 # in V\n",
+ "I_C= 1 # in mA\n",
+ "I_C=I_C*10**-3 # in A\n",
+ "I_E= 1.070 # in mA\n",
+ "I_E=I_E*10**-3 # in A\n",
+ "beta= I_C/I_B \n",
+ "alpha= I_C/I_E \n",
+ "beta= alpha/(1-alpha) \n",
+ "I_B= I_C/beta # in A\n",
+ "# I_C= I_S*exp(V_BE/V_T)\n",
+ "I_S= I_C/(exp(V_BE/V_T)) \n",
+ "print \"The value of beta is %0.3f \" %beta\n",
+ "print \"The value of alpha is %0.4f \"%alpha\n",
+ "print \"The value of I_B = %0.2f \u00b5A\" %(I_B*10**6)\n",
+ "print \"The value of I_S = %0.2e A\" %I_S\n",
+ "\n",
+ "# Part(c)\n",
+ "print \"Part (C) : \"\n",
+ "V_BE= 580 # in mV\n",
+ "V_BE=V_BE*10**-3 # in V\n",
+ "I_E= 0.137 # in mA\n",
+ "I_B= 7 # in \u00b5A\n",
+ "I_E=I_E*10**-3 # in A\n",
+ "I_B=I_B*10**-6 # in A\n",
+ "# I_C= alpha*I_E = bita*I_B\n",
+ "beta= I_E/I_B-1 \n",
+ "alpha= beta/(1+beta) \n",
+ "I_C= beta*I_B # in A\n",
+ "# I_C= I_S*exp(V_BE/V_T)\n",
+ "I_S= I_C/(exp(V_BE/V_T)) \n",
+ "print \"The value of beta is %0.3f \" %beta\n",
+ "print \"The value of alpha is %0.4f \"%alpha\n",
+ "print \"The value of I_C = %0.3f mA\" %(I_C*10**3)\n",
+ "print \"The value of I_S = %0.3e A\" %I_S\n",
+ "\n",
+ "# Part(d)\n",
+ "print \"Part (d) : \"\n",
+ "V_BE= 780 # in mV\n",
+ "V_BE=V_BE*10**-3 # in V\n",
+ "I_C= 10.10 # in mA\n",
+ "I_B= 120 # in \u00b5A\n",
+ "I_C=I_C*10**-3 # in A\n",
+ "I_B=I_B*10**-6 # in A\n",
+ "beta= I_C/I_B \n",
+ "alpha= beta/(1+beta) \n",
+ "I_E= I_C/alpha # in A\n",
+ "# I_C= I_S*%e**(V_BE/V_T)\n",
+ "I_S= I_C/(exp(V_BE/V_T)) \n",
+ "print \"The value of beta is %0.3f \" %beta\n",
+ "print \"The value of alpha is %0.4f \"%alpha\n",
+ "print \"The value of I_E = %0.2f mA\" %(I_E*10**3)\n",
+ "print \"The value of I_S = %0.4e A\" %I_S\n",
+ "\n",
+ "# Part(e)\n",
+ "print \"Part (e) : \"\n",
+ "V_BE= 820 # in mV\n",
+ "V_BE=V_BE*10**-3 # in V\n",
+ "I_E= 75 # in mA\n",
+ "I_B= 1050 # in \u00b5A\n",
+ "I_E=I_E*10**-3 # in A\n",
+ "I_B=I_B*10**-6 # in A\n",
+ "# I_C= alpha*I_E = bita*I_B\n",
+ "beta= I_E/I_B-1 \n",
+ "alpha= beta/(1+beta) \n",
+ "I_C= beta*I_B # in A\n",
+ "# I_C= I_S*exp(V_BE/V_T)\n",
+ "I_S= I_C/(exp(V_BE/V_T)) \n",
+ "print \"The value of beta is %0.3f \" %beta\n",
+ "print \"The value of alpha is %0.3f \"%alpha\n",
+ "print \"The value of I_C = %0.2f mA\" %(I_C*10**3)\n",
+ "print \"The value of I_S = %0.3e A\" %I_S"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Part (a) : \n",
+ "The value of beta is 20.0 \n",
+ "The value of alpha is 0.9524 \n",
+ "The value of I_E = 1.05 mA\n",
+ "The value of I_S = 1.03e-15 A\n",
+ "Part (b) : \n",
+ "The value of beta is 14.286 \n",
+ "The value of alpha is 0.9346 \n",
+ "The value of I_B = 70.00 \u00b5A\n",
+ "The value of I_S = 1.03e-15 A\n",
+ "Part (C) : \n",
+ "The value of beta is 18.571 \n",
+ "The value of alpha is 0.9489 \n",
+ "The value of I_C = 0.130 mA\n",
+ "The value of I_S = 1.092e-14 A\n",
+ "Part (d) : \n",
+ "The value of beta is 84.167 \n",
+ "The value of alpha is 0.9883 \n",
+ "The value of I_E = 10.22 mA\n",
+ "The value of I_S = 2.8466e-16 A\n",
+ "Part (e) : \n",
+ "The value of beta is 70.429 \n",
+ "The value of alpha is 0.986 \n",
+ "The value of I_C = 73.95 mA\n",
+ "The value of I_S = 4.208e-16 A\n"
+ ]
+ }
+ ],
+ "prompt_number": 55
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
diff --git a/Electronic_Circuits_by_P._Raja/chapter4.ipynb b/Electronic_Circuits_by_P._Raja/chapter4.ipynb
new file mode 100755
index 00000000..bdffc74f
--- /dev/null
+++ b/Electronic_Circuits_by_P._Raja/chapter4.ipynb
@@ -0,0 +1,923 @@
+{
+ "metadata": {
+ "name": "",
+ "signature": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 4 - Differential amplifiers"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 4.1 - page 317"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Given data\n",
+ "V_CC= 10 # in volt\n",
+ "V_EE= -10 # in volt\n",
+ "I= 1 # in mA\n",
+ "I=I*10**-3 # in A\n",
+ "R_C= 10 # in kohm\n",
+ "R_C=R_C*10**3 # in kohm\n",
+ "V_BE=0.7 # in volt\n",
+ "\n",
+ "i_C1= I/2 # in A\n",
+ "i_C2= i_C1 # in A\n",
+ "print \"Value of i_C1 = %0.2f mA\" %(i_C1*10**3)\n",
+ "\n",
+ "V_C1= V_CC-i_C1*R_C # in V\n",
+ "# For V_cm=0 volt\n",
+ "V_E= -0.7 # in volt\n",
+ "V_CE1= V_C1-V_E # in volt\n",
+ "print \"For V_cm =0, The value of V_CE1 = %0.2f Volt\" %(V_CE1)\n",
+ "\n",
+ "# For V_cm= -5 volt\n",
+ "V_cm= -5 # in V\n",
+ "V_B= V_cm # in V\n",
+ "# From V_BE= V_B-V_E\n",
+ "V_E= V_B-V_BE # in volt\n",
+ "V_CE1= V_C1-V_E # in volt\n",
+ "print \"For V_cm =-5V, The value of V_CE1 = %0.2f Volt\" %V_CE1\n",
+ "\n",
+ "# For V_cm= 5 volt\n",
+ "V_cm= 5 # in V\n",
+ "V_B= V_cm # in V\n",
+ "V_E= V_B-V_BE # in volt\n",
+ "V_CE1= V_C1-V_E # in volt\n",
+ "print \"For V_cm =5V, The value of V_CE1 = %0.2f Volt\" %V_CE1"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Value of i_C1 = 0.50 mA\n",
+ "For V_cm =0, The value of V_CE1 = 5.70 Volt\n",
+ "For V_cm =-5V, The value of V_CE1 = 10.70 Volt\n",
+ "For V_cm =5V, The value of V_CE1 = 0.70 Volt\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 4.2 - page 338"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from numpy import *\n",
+ "# Given data\n",
+ "V_DD= 1.5 # in V\n",
+ "V_SS= V_DD # in V\n",
+ "KnWL= 4 # in mA/V**2\n",
+ "KnWL=KnWL*10**-3 # in A/V**2\n",
+ "Vt= 0.5 # in V\n",
+ "I=0.4 # in mA\n",
+ "I=I*10**-3 #in A\n",
+ "R_D= 2.5 # in k\u03a9\n",
+ "R_D= R_D*10**3 # in \u03a9\n",
+ "\n",
+ "# Part (a)\n",
+ "print \"Part (a)\"\n",
+ "V_OV= sqrt(I/KnWL) # in V\n",
+ "V_GS= V_OV+Vt # in V\n",
+ "print \"Value of V_OV = %0.2f Volt\" %V_OV\n",
+ "print \"Value of V_GS = %0.2f Volt\" %V_GS\n",
+ "\n",
+ "# Part (b)\n",
+ "print \"Part (b)\"\n",
+ "V_CM= 0 # in volt\n",
+ "V_S= -V_GS # in volt\n",
+ "print \"Value of V_S = %0.2f Volt\" %V_S\n",
+ "I=0.4 # in mw\n",
+ "i_D1= I/2 # in mA\n",
+ "print \"Value of i_D1 = %0.2f mA\" %i_D1\n",
+ "i_D1=i_D1*10**-3 # in A\n",
+ "V_D1= V_DD-i_D1*R_D # in V\n",
+ "V_D2=V_D1 # in V\n",
+ "print \"Value of V_D1 = %0.2f Volt\" %V_D1\n",
+ "print \"Value of V_D2 = %0.2f Volt\" %V_D2\n",
+ "\n",
+ "\n",
+ "# Part (c)\n",
+ "print \"Part (c)\"\n",
+ "V_CM=1 # in V\n",
+ "V_GS= 0.82 # in V\n",
+ "V_G= 1 # in V\n",
+ "V_S= V_G-V_GS # in V\n",
+ "print \"Value of V_S = %0.2f Volt\" %V_S\n",
+ "i_D1= I/2 # in mA\n",
+ "print \"Value of i_D1 = %0.2f mA\" %i_D1\n",
+ "i_D1=i_D1*10**-3 # in A\n",
+ "V_D1= V_DD-i_D1*R_D # in V\n",
+ "V_D2=V_D1 # in V\n",
+ "print \"Value of V_D1 = %0.2f Volt\" %V_D1\n",
+ "print \"Value of V_D2 = %0.2f Volt\" %V_D2\n",
+ "\n",
+ "# Part (d)\n",
+ "print \"Part (d)\"\n",
+ "V_CM_max= Vt+V_DD-i_D1*R_D\n",
+ "print \"Highest value of V_CM = %0.2f Volt\" %V_CM_max\n",
+ "\n",
+ "# Part (e)\n",
+ "V_S= 0.4 # in V\n",
+ "print \"Part (e)\"\n",
+ "V_CM_min= -V_SS+V_S+Vt+V_OV # in V\n",
+ "print \"Lowest value of V_CM = %0.2f Volt \" %V_CM_min\n",
+ "V_Smin= V_CM_min-V_GS # in volt\n",
+ "print \"Lowest value of V_S = %0.2f Volt\" %V_Smin"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Part (a)\n",
+ "Value of V_OV = 0.32 Volt\n",
+ "Value of V_GS = 0.82 Volt\n",
+ "Part (b)\n",
+ "Value of V_S = -0.82 Volt\n",
+ "Value of i_D1 = 0.20 mA\n",
+ "Value of V_D1 = 1.00 Volt\n",
+ "Value of V_D2 = 1.00 Volt\n",
+ "Part (c)\n",
+ "Value of V_S = 0.18 Volt\n",
+ "Value of i_D1 = 0.20 mA\n",
+ "Value of V_D1 = 1.00 Volt\n",
+ "Value of V_D2 = 1.00 Volt\n",
+ "Part (d)\n",
+ "Highest value of V_CM = 1.50 Volt\n",
+ "Part (e)\n",
+ "Lowest value of V_CM = -0.28 Volt \n",
+ "Lowest value of V_S = -1.10 Volt\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 4.3 - page 341"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Given data\n",
+ "I= 0.4 # in mA\n",
+ "unCox= 0.2 # in mA/V**2\n",
+ "i_D= I/2 # in mA\n",
+ "V_OV1= 0.2 # in V\n",
+ "V_OV2= 0.3 # in V\n",
+ "V_OV3= 0.4 # in V\n",
+ "WbyL1= 2*i_D/(unCox*V_OV1**2) \n",
+ "gm1= I/V_OV1 # in mA/V\n",
+ "WbyL2= 2*i_D/(unCox*V_OV2**2) \n",
+ "gm2= I/V_OV2 # in mA/V\n",
+ "WbyL3= 2*i_D/(unCox*V_OV3**2) \n",
+ "gm3= I/V_OV3 # in mA/V\n",
+ "print \"Vov (in V) \",V_OV1,\" \",V_OV2,\" \",V_OV3\n",
+ "print \"W/L \",WbyL1,\" \",round(WbyL2,1),\" \",WbyL3\n",
+ "print \"gm(in mA/V) \",gm1,\" \",round(gm2,2),\" \",gm3"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Vov (in V) 0.2 0.3 0.4\n",
+ "W/L 50.0 22.2 12.5\n",
+ "gm(in mA/V) 2.0 1.33 1.0\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 4.4 - page 341"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Given data\n",
+ "V_A= 20 # in V\n",
+ "R_D= 5 # in k\u03a9\n",
+ "R_D= R_D*10**3 # in \u03a9\n",
+ "I= 0.8 # in mA\n",
+ "I=I*10**-3 # in A\n",
+ "i_D= I/2 # in A\n",
+ "unCox= 0.2 # mA/V**2\n",
+ "unCox= unCox*10**-3 # in A/V**2\n",
+ "WbyL= 100 \n",
+ "# Formula i_D= 1/2*unCox*WbyL*V_OV**2\n",
+ "V_OV= sqrt(2*i_D/(unCox*WbyL)) # in V\n",
+ "print \"The value of V_OV = %0.2f Volts\" %V_OV\n",
+ "gm= I/V_OV # in A/V \n",
+ "print \"The value of gm = %0.f mA/V\" %(gm*10**3)\n",
+ "r_o= V_A/i_D # in \u03a9\n",
+ "print \"The value of r_o = %0.f k\u03a9\" %(r_o*10**-3)\n",
+ "# Ad= v_o/v_id = gm*(R_D || r_o)\n",
+ "Ad= gm*(R_D*r_o/(R_D+r_o)) # in V/V\n",
+ "print \"Differential gain = %0.1f V/V \" %Ad"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The value of V_OV = 0.20 Volts\n",
+ "The value of gm = 4 mA/V\n",
+ "The value of r_o = 50 k\u03a9\n",
+ "Differential gain = 18.2 V/V \n"
+ ]
+ }
+ ],
+ "prompt_number": 14
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 4.5 - page 342"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from __future__ import division\n",
+ "from numpy import log10\n",
+ "# Given data\n",
+ "R_D= 5 # in k\u03a9\n",
+ "R_D= R_D*10**3 # in \u03a9\n",
+ "R_SS= 25 # in k\u03a9\n",
+ "R_SS= R_SS*10**3 # in \u03a9\n",
+ "I= 0.8 # in mA\n",
+ "I=I*10**-3 # in A\n",
+ "i_D= I/2 # in A\n",
+ "unCox= 0.2 # mA/V**2\n",
+ "unCox= unCox*10**-3 # in A/V**2\n",
+ "WbyL= 100 \n",
+ "# Formula i_D= 1/2*unCox*WbyL*V_OV**2\n",
+ "V_OV= sqrt(2*i_D/(unCox*WbyL)) # in V\n",
+ "gm= i_D/V_OV # in A/V \n",
+ "\n",
+ "# Part (a)\n",
+ "Ad= 1/2*gm*R_D # in V/V\n",
+ "print \"Differential gain = %0.f V/V\" %(Ad)\n",
+ "Acm= -R_D/(2*R_SS) # in V/V\n",
+ "print \"Common mode gain = %0.1f V/V\" %Acm\n",
+ "CMRR= abs(Ad)/abs(Acm) \n",
+ "CMRRindB= round(20*log10(CMRR)) # in dB\n",
+ "print \"Common mode rejection ratio = %0.f dB\" %CMRRindB\n",
+ "\n",
+ "\n",
+ "# Part (b)\n",
+ "print \"Part (b) when output is taken differentially\"\n",
+ "Ad= gm*R_D # in V/V\n",
+ "print \"Differential gain = %0.f V/V\" %Ad\n",
+ "Acm= 0 \n",
+ "print \"Common mode gain = %0.1f V/V \"%Acm\n",
+ "CMRRindB= 20*log10(Ad/Acm) # in dB\n",
+ "print \"Common mode rejection ratio = %0.f dB\" %CMRRindB\n",
+ "\n",
+ "\n",
+ "# Part (c)\n",
+ "print \"Part (c) when output is taken differentially but the drain resistance have a 1% mismatch.\"\n",
+ "Ad= gm*R_D # in V/V\n",
+ "print \"Differential gain = %0.f V/V\" %Ad\n",
+ "# delta_R_D= 1% of R_D\n",
+ "delta_R_D= R_D*1/100 # in \u03a9 \n",
+ "Acm= R_D/(2*R_SS)*delta_R_D/R_D # in V/V\n",
+ "print \"Common mode gain = %0.3f V/V\" %Acm\n",
+ "CMRRindB= 20*log10(abs(Ad)/abs(Acm)) # in dB\n",
+ "print \"Common mode rejection ratio = %0.1f dB\" %CMRRindB\n",
+ "\n",
+ "# Note: In the book, there is putting wrong value of Ad (20 at place of 10)\n",
+ "#to evaluate the value of CMRR in dB in part(c) , So the answer of CMRR in dB of Part (c) is wrong"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Differential gain = 5 V/V\n",
+ "Common mode gain = -0.1 V/V\n",
+ "Common mode rejection ratio = 34 dB\n",
+ "Part (b) when output is taken differentially\n",
+ "Differential gain = 10 V/V\n",
+ "Common mode gain = 0.0 V/V \n",
+ "Common mode rejection ratio = inf dB\n",
+ "Part (c) when output is taken differentially but the drain resistance have a 1% mismatch.\n",
+ "Differential gain = 10 V/V\n",
+ "Common mode gain = 0.001 V/V\n",
+ "Common mode rejection ratio = 80.0 dB\n"
+ ]
+ }
+ ],
+ "prompt_number": 22
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 4.6 - page 343"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Given data (From Exa 4.4)\n",
+ "R_D= 5 # in k\u03a9\n",
+ "R_D= R_D*10**3 # in \u03a9\n",
+ "R_SS= 25 # in k\u03a9\n",
+ "R_SS= R_SS*10**3 # in \u03a9\n",
+ "I= 0.8 # in mA\n",
+ "I=I*10**-3 # in A\n",
+ "i_D= I/2 # in A\n",
+ "unCox= 0.2 # mA/V**2\n",
+ "unCox= unCox*10**-3 # in A/V**2\n",
+ "WbyL= 100 \n",
+ "# Formula i_D= 1/2*unCox*WbyL*V_OV**2\n",
+ "V_OV= sqrt(2*i_D/(unCox*WbyL)) # in V\n",
+ "gm= i_D/V_OV # in A/V \n",
+ "# gm mismatch have a negligible effect on Ad\n",
+ "Ad= gm*R_D # in V/V(approx) \n",
+ "# delta_gm= 1% of gm\n",
+ "delta_gm = gm*1/100 # in A/V\n",
+ "Acm= R_D/(2*R_SS)*delta_gm/gm \n",
+ "CMRRindB= 20*log10(Ad/Acm) \n",
+ "print \"CMRR is %0.f dB\"%CMRRindB"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "CMRR is 80 dB\n"
+ ]
+ }
+ ],
+ "prompt_number": 25
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 4.7 - page 344"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Given data \n",
+ "V_CM= 0 \n",
+ "V_BE= -0.7 # in volt\n",
+ "v_E= V_CM-V_BE # in volt\n",
+ "print \"Value of v_E = %0.1f Volts\" %v_E\n",
+ "\n",
+ "I_E= (5-0.7)/10**3 # in A\n",
+ "v_B1= 0.5 # in V\n",
+ "v_B2= 0 # in V\n",
+ "# Due to Q1 is off therefore\n",
+ "v_C1= -5 # in V\n",
+ "v_C2= I_E*10**3-5 # in V\n",
+ "print \"Value of v_C1 = %0.1f Volts\" %v_C1\n",
+ "print \"Value of v_C2 = %0.1f Volts\" %v_C2"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Value of v_E = 0.7 Volts\n",
+ "Value of v_C1 = -5.0 Volts\n",
+ "Value of v_C2 = -0.7 Volts\n"
+ ]
+ }
+ ],
+ "prompt_number": 27
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 4.8 - page 345"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Given data \n",
+ "iE1_by_I= 0.99 # as it is given that iE1= 0.99 *I\n",
+ "VT= 0.025 # in volt\n",
+ "# Formula iE1= I/(1+%e**(-vid/VT))\n",
+ "# %e**(-vid/VT)= 1/iE1_by_I-1\n",
+ "vid= log( 1/iE1_by_I-1)*(-VT) # in volt\n",
+ "print \"Input differential signal = %0.1f mV\" %round(vid*10**3)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Input differential signal = 115.0 mV\n"
+ ]
+ }
+ ],
+ "prompt_number": 28
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 4.9 - page 345"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Given data \n",
+ "Beta= 100 \n",
+ "\n",
+ "# Part (a)\n",
+ "RE= 150 # in \u03a9\n",
+ "VT= 25 # in mV\n",
+ "VT= VT*10**-3 # in V\n",
+ "IE= 0.5 # in mA\n",
+ "IE=IE*10**-3 # in A\n",
+ "re1= VT/IE #in \u03a9\n",
+ "R_id= 2*(Beta+1)*(re1+RE) # in \u03a9\n",
+ "R_id= round(R_id*10**-3) # in k\u03a9\n",
+ "print \"(a) The input differential resistance = %0.1f k\u03a9\" %R_id\n",
+ "\n",
+ "# Part (b)\n",
+ "RC=10 #in k\u03a9\n",
+ "RC=RC*10**3 #in \u03a9\n",
+ "Rsig= 5+5 # in k\u03a9\n",
+ "VoltageGain1= R_id/(Rsig+R_id) #voltage gain from the signal source to the base of Q1 and Q2 in V/V\n",
+ "VoltageGain2= 2*RC/(2*(re1+RE)) # voltage gain from the bases to the output in V/V\n",
+ "Ad= VoltageGain1*VoltageGain2 #in V/V\n",
+ "print \"(b) The overall differential voltage gain = %0.1f V/V\" %Ad\n",
+ "\n",
+ "# Part (c)\n",
+ "delta_RC= 0.02*RC \n",
+ "R_EE= 200 #in k\u03a9\n",
+ "R_EE=R_EE*10**3 #in \u03a9\n",
+ "Acm= RC/(2*R_EE)*delta_RC/RC #in V/V\n",
+ "print \"(c) Common mode gain = %0.e V/V\" %Acm\n",
+ "\n",
+ "# Part (d)\n",
+ "CMRRindB= 20*log10(Ad/Acm) # in dB\n",
+ "print \"(d) CMRR = %.f dB\" %CMRRindB\n",
+ "\n",
+ "# Part (e)\n",
+ "V_A= 100 # in V\n",
+ "r_o= V_A/(IE) # in \u03a9\n",
+ "# Ricm= (Beta+1)*(R_EE || r_o/2)\n",
+ "Ricm= (Beta+1)*(R_EE*(r_o/2)/(R_EE+(r_o/2))) \n",
+ "print \"(e) Input common mode resistance = %0.1f M\u03a9\" %(Ricm*10**-6)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(a) The input differential resistance = 40.0 k\u03a9\n",
+ "(b) The overall differential voltage gain = 40.0 V/V\n",
+ "(c) Common mode gain = 5e-04 V/V\n",
+ "(d) CMRR = 98 dB\n",
+ "(e) Input common mode resistance = 6.7 M\u03a9\n"
+ ]
+ }
+ ],
+ "prompt_number": 32
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 4.10 - page 347"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Given data \n",
+ "delta_RDbyRD= 2/100 \n",
+ "delta_WLbyWL= 2/100 \n",
+ "delta_Vt= 2 #in mV\n",
+ "delta_Vt= delta_Vt*10**-3 # in V\n",
+ "#(From Exa 4.4)\n",
+ "V_A= 20 # in V\n",
+ "R_D= 5 # in k\u03a9\n",
+ "R_D= R_D*10**3 # in \u03a9\n",
+ "I= 0.8 # in mA\n",
+ "I=I*10**-3 # in A\n",
+ "i_D= I/2 # in A\n",
+ "unCox= 0.2 # mA/V**2\n",
+ "unCox= unCox*10**-3 # in A/V**2\n",
+ "WbyL= 100 \n",
+ "# Formula i_D= 1/2*unCox*WbyL*V_OV**2\n",
+ "V_OV= sqrt(2*i_D/(unCox*WbyL)) # in V\n",
+ "V_OS1= V_OV/2*delta_RDbyRD # in V\n",
+ "\n",
+ "# V_OS due to W/L ratio\n",
+ "V_OS2= V_OV/2*delta_WLbyWL # in V\n",
+ "\n",
+ "# V_OS due to threshold voltage\n",
+ "V_OS3= delta_Vt # in V\n",
+ "# Total offset voltage\n",
+ "V_OS= sqrt(V_OS1**2+V_OS2**2+V_OS3**2) # in V\n",
+ "V_OS= V_OS*10**3 # in mV\n",
+ "print \"Total offset voltage = %0.1f mV\" %V_OS"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Total offset voltage = 3.5 mV\n"
+ ]
+ }
+ ],
+ "prompt_number": 33
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 4.11 - page 348"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Given data \n",
+ "WLn= 100 \n",
+ "WLp= 200 \n",
+ "unCox= 0.2 # mA/V**2\n",
+ "unCox=unCox*10**-3 #in A/V**2\n",
+ "RSS= 25 # in k\u03a9\n",
+ "RSS= RSS*10**3 # in \u03a9\n",
+ "I=0.8 # in mA\n",
+ "I=I*10**-3 #in A\n",
+ "V_A= 20 # in V\n",
+ "i_D= I/2 # in A\n",
+ "# Formula i_D= 1/2*unCox*WLn*V_OV**2\n",
+ "V_OV= sqrt(2*i_D/(unCox*WLn)) # in V\n",
+ "gm= I/V_OV # in A/V\n",
+ "print \"Value of Gm = %0.1f mA/V\" %(gm*10**3)\n",
+ "ro2= V_A/(I/2) # in ohm\n",
+ "ro4= ro2 # in ohm\n",
+ "Ro= ro2*ro4/(ro2+ro4) # in ohm\n",
+ "print \"Value of Ro = %0.1f k\u03a9\" %(Ro*10**-3)\n",
+ "Ad= gm*Ro # in V/V\n",
+ "print \"Value of Ad = %0.1f V/V\" %Ad\n",
+ "# Finding the value of gm3\n",
+ "upCox= 0.1 # mA/V**2\n",
+ "upCox=upCox*10**-3 #in A/V**2\n",
+ "# Formula i_D= 1/2*upCox*WLp*V_OV**2\n",
+ "V_OV= sqrt(2*i_D/(upCox*WLp)) # in V\n",
+ "gm3= I/V_OV # in A/V\n",
+ "Acm= 1/(2*gm3*RSS) #in V/V\n",
+ "print \"Value of |Acm| = %0.3f V/V\" %(abs(Acm))\n",
+ "CMRRindB= 20*log10(abs(Ad)/abs(Acm)) #in dB\n",
+ "print \"CMRR = %0.f dB\" %(round(CMRRindB))"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Value of Gm = 4.0 mA/V\n",
+ "Value of Ro = 25.0 k\u03a9\n",
+ "Value of Ad = 100.0 V/V\n",
+ "Value of |Acm| = 0.005 V/V\n",
+ "CMRR = 86 dB\n"
+ ]
+ }
+ ],
+ "prompt_number": 36
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 4.12 - page 349"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Given data \n",
+ "I=0.8 # in mA\n",
+ "I=I*10**-3 #in A\n",
+ "V_A= 100 # in V\n",
+ "Beta=160 \n",
+ "VT=25 # in mV\n",
+ "VT= VT*10**-3 #in V\n",
+ "gm= (I/2)/VT # in A/V\n",
+ "Gm= gm # Short circuit trnsconductance in mA/V\n",
+ "print \"The value of Gm = %0.1f mA/V\" %(Gm*10**3)\n",
+ "ro2= V_A/(I/2) # in ohm\n",
+ "ro4= ro2 # in ohm\n",
+ "Ro= ro2*ro4/(ro2+ro4) # in ohm\n",
+ "print \"The value of Ro = %0.1f k\u03a9\" %(Ro*10**-3)\n",
+ "Ad= Gm*Ro # in V/V\n",
+ "print \"Value of Ad = %0.1f V/V\" %Ad\n",
+ "r_pi= Beta/gm #in \u03a9\n",
+ "Rid= 2*r_pi # in \u03a9\n",
+ "print \"The value of Rid = %0.1f k\u03a9\" %(Rid*10**-3)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The value of Gm = 16.0 mA/V\n",
+ "The value of Ro = 125.0 k\u03a9\n",
+ "Value of Ad = 2000.0 V/V\n",
+ "The value of Rid = 20.0 k\u03a9\n"
+ ]
+ }
+ ],
+ "prompt_number": 37
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 4.13 - page 349"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Given data \n",
+ "Vtp= -0.8 # in V\n",
+ "KpWL= 3.5 # in mA/V**2\n",
+ "I=0.7 # in mA\n",
+ "I=I*10**-3 # in A\n",
+ "R_D= 2 # in k\u03a9\n",
+ "R_D=R_D*10**3 # in \u03a9\n",
+ "KpWL=KpWL*10**-3 #in A/V**2\n",
+ "v_G1= 0 # in V\n",
+ "v_G2=v_G1 # in V\n",
+ "VSS= 2.5 # in V\n",
+ "VDD=VSS # in V\n",
+ "VCS= 0.5 # in V\n",
+ "print \"Part (a)\"\n",
+ "V_OV= -sqrt(I/KpWL) # in V\n",
+ "print \"The value of V_OV = %0.2f Volts\" %V_OV\n",
+ "V_GS= V_OV+Vtp # in V\n",
+ "print \"The value of V_GS = %0.2f Volts\" %V_GS\n",
+ "V_G= 0 # as gate is connected ground\n",
+ "v_S1= V_G-V_GS # in V\n",
+ "v_S2= v_S1 # in V\n",
+ "print \"The value of v_S1 = %0.2f Volts\" %v_S1\n",
+ "v_D1= I/2*R_D-VDD # in V\n",
+ "v_D2=v_D1 # in V\n",
+ "print \"The value of v_D1 = %0.1f Volts\" %v_D1\n",
+ "print \"The value of v_D2 = %0.1f Volts\" %v_D2\n",
+ "\n",
+ "print \"Part (b)\"\n",
+ "V_CMmin= I*R_D/2-VDD+Vtp # in V\n",
+ "V_CMmax= VSS-VCS+Vtp+V_OV # in V\n",
+ "print \"The value of V_CMmin = %0.1f Volts\" %V_CMmin\n",
+ "print \"The value of V_CMmax = %0.2f Volts\" %V_CMmax"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Part (a)\n",
+ "The value of V_OV = -0.45 Volts\n",
+ "The value of V_GS = -1.25 Volts\n",
+ "The value of v_S1 = 1.25 Volts\n",
+ "The value of v_D1 = -1.8 Volts\n",
+ "The value of v_D2 = -1.8 Volts\n",
+ "Part (b)\n",
+ "The value of V_CMmin = -2.6 Volts\n",
+ "The value of V_CMmax = 0.75 Volts\n"
+ ]
+ }
+ ],
+ "prompt_number": 46
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 4.14 - page 351"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Given data \n",
+ "V_OV= 0.2 # in V\n",
+ "gm=1 # in mA/V\n",
+ "gm=gm*10**-3 # in A/V\n",
+ "Vt=0.8 # in V\n",
+ "unCox= 90 # in \u00b5A/V**2\n",
+ "unCox=unCox*10**-6 # in A/V**2\n",
+ "# gm= I/V_OV\n",
+ "I= gm*V_OV # in A\n",
+ "print \"Bias current = %0.1f mA\" %(I*10**3)\n",
+ "I_D= I/2 # in A\n",
+ "# Formula I_D= 1/2*unCox*WLn*V_OV**2\n",
+ "WbyL= 2*I_D/(unCox*V_OV**2) \n",
+ "print \"W/L ratio is %0.1f \"%WbyL"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Bias current = 0.2 mA\n",
+ "W/L ratio is 55.6 \n"
+ ]
+ }
+ ],
+ "prompt_number": 49
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 4.15 - page 351"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Given data \n",
+ "I=0.5 # in mA\n",
+ "I=I*10**-3 # in A\n",
+ "WbyL= 50 \n",
+ "unCox= 250 # in \u00b5A/V**2\n",
+ "unCox=unCox*10**-6 # in A/V**2\n",
+ "V_A= 10 # in V\n",
+ "R_D= 4 #in k\u03a9\n",
+ "R_D= R_D*10**3 #in \u03a9\n",
+ "V_OV= sqrt(I/(WbyL*unCox)) #in V\n",
+ "print \"The value of V_OV = %0.2f V \" %V_OV\n",
+ "gm= I/V_OV # in A/V\n",
+ "print \"The value of gm = %0.2f mA/V\" %(gm*10**3)\n",
+ "I_D=I/2 # in A\n",
+ "ro= V_A/I_D # in \u03a9\n",
+ "print \"The value of ro = %0.2f k\u03a9\" %(ro*10**-3)\n",
+ "Ad= gm*(R_D*ro/(R_D+ro)) # in V/V\n",
+ "print \"The value of Ad = %0.2f V/V \" %Ad"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The value of V_OV = 0.20 V \n",
+ "The value of gm = 2.50 mA/V\n",
+ "The value of ro = 40.00 k\u03a9\n",
+ "The value of Ad = 9.09 V/V \n"
+ ]
+ }
+ ],
+ "prompt_number": 50
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 4.16 - page 352"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Given data \n",
+ "I=1 # in mA\n",
+ "I=I*10**-3 # in A\n",
+ "i_C=1 # in mA\n",
+ "i_C=i_C*10**-3 # in A\n",
+ "V_CC= 5 # in V\n",
+ "V_CM= -2 # in V\n",
+ "V_BE= 0.7 # in V\n",
+ "R_C= 3 # in k\u03a9\n",
+ "R_C= R_C*10**3 # in \u03a9\n",
+ "Alpha=1 \n",
+ "Beta=100 \n",
+ "V_B= 1 # in V\n",
+ "i_C1= Alpha*I # in A\n",
+ "i_C2=0 # A\n",
+ "v_E= V_B-V_BE # in V\n",
+ "print \"Emitters voltage = %0.2f Volt\" %v_E,\n",
+ "v_C1= V_CC-i_C1*R_C # in V\n",
+ "v_C2= V_CC-i_C2*R_C # in V\n",
+ "print \"Output voltage is\",v_C1,\"V &\",v_C2,\"V\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Emitters voltage = 0.30 Volt Output voltage is 2.0 V & 5 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 52
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
diff --git a/Electronic_Circuits_by_P._Raja/chapter5.ipynb b/Electronic_Circuits_by_P._Raja/chapter5.ipynb
new file mode 100755
index 00000000..ce987715
--- /dev/null
+++ b/Electronic_Circuits_by_P._Raja/chapter5.ipynb
@@ -0,0 +1,909 @@
+{
+ "metadata": {
+ "name": "",
+ "signature": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Chapter5 - Feedback amplifiers"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 5.1 - page 383"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from __future__ import division\n",
+ "# Given data\n",
+ "A= 800 # unit less\n",
+ "Af= 50 # unit less\n",
+ "# Formula Af= A/(1+Bita*A)\n",
+ "Beta= 1/Af-1/A \n",
+ "print \"Percentage of output which is feedback to the input = %0.3f %%\" %(Beta*100)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Percentage of output which is feedback to the input = 1.875 %\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 5.2 - page 384"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Given data\n",
+ "Af= 100 # unit less\n",
+ "Vi= 50 # in mV\n",
+ "Vi= Vi*10**-3 # in V\n",
+ "Vs= 0.5 # in V\n",
+ "# Formula Af= Vo/Vs\n",
+ "Vo= Af*Vs # in V\n",
+ "A= Vo/Vi \n",
+ "print \"Value of A is %0.f \"%A\n",
+ "# Formula Af= A/(1+B*A)\n",
+ "B= 1/Af-1/A \n",
+ "B=B*100 # in %\n",
+ "print \"Value of B is %0.1f %%\" %B"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Value of A is 1000 \n",
+ "Value of B is 0.9 %\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 5.3 - page 385"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Given data\n",
+ "Beta= 5/100 \n",
+ "f_H= 50 # in kHz\n",
+ "f_H= f_H*10**3 # in Hz\n",
+ "f_L= 50 # in kHz\n",
+ "Amid= 1000 \n",
+ "f_LF= f_L/(1+Beta*Amid) # in Hz\n",
+ "f_HF= f_H*(1+Beta*Amid) # in Hz\n",
+ "print \"Value of f_LF = %0.2f Hz\" %f_LF\n",
+ "print \"Value of f_HF = %0.2f MHz\" %(f_HF*10**-6)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Value of f_LF = 0.98 Hz\n",
+ "Value of f_HF = 2.55 MHz\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 5.4 - page 385"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Given data\n",
+ "dAf_by_Af= 0.2/100 \n",
+ "dA_by_A= 150/2000 \n",
+ "A=2000 \n",
+ "# Formula dAf_by_Af = 1/(1+Bita*A) * dA_by_A\n",
+ "Beta= dA_by_A/(A*dAf_by_Af )-1/A \n",
+ "Af= A/(1+Beta*A) \n",
+ "print \"Value of Beta = %0.3f %%\" %(Beta*100)\n",
+ "print \"Value of Af is %0.2f \" %Af"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Value of Beta = 1.825 %\n",
+ "Value of Af is 53.33 \n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 5.5 - page 386"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Given data\n",
+ "Av= 140 \n",
+ "Avf= 17.5 \n",
+ "# Formula Avf= Av/(1+Av*Beta)\n",
+ "Beta= 1/Avf-1/Av \n",
+ "print \"Fraction of the output is %0.2f \"%Beta"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Fraction of the output is 0.05 \n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 5.6 - page 386"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Given data\n",
+ "Av= 100 \n",
+ "Avf= 50 \n",
+ "# Formula Avf= Av/(1+Av*Beta)\n",
+ "Beta= 1/Avf-1/Av \n",
+ "print \"The vlaue of beta is %0.2f\" %Beta\n",
+ "\n",
+ "# Part(ii)\n",
+ "Avf= 75 \n",
+ "# Formula Avf= Av/(1+Av*Beta)\n",
+ "Av= Avf/(1-Beta*Avf)\n",
+ "print \"Value of amplifier gain is %0.f \"%Av"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The vlaue of beta is 0.01\n",
+ "Value of amplifier gain is 300 \n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 5.7 - page 387"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Given data\n",
+ "Av= 50 \n",
+ "Avf= 25 \n",
+ "# Formula Avf= Av/(1+Av*Beta)\n",
+ "Beta= 1/Avf-1/Av \n",
+ "# Part(i)\n",
+ "Av=50 \n",
+ "Avf= 40 \n",
+ "Perc_reduction= (Av-Avf)/Av*100 # Percentage of reduction in stage gain in %\n",
+ "print \"Without feedback, percentage of reduction in stage gain = %0.f %%\" %(Perc_reduction)\n",
+ "\n",
+ "# Part(ii)\n",
+ "Av= 40 \n",
+ "Avf= 25 \n",
+ "gain_with_neg_feed= Av/(1+Beta*Av) \n",
+ "Perc_reduction= (Avf-gain_with_neg_feed)/Avf*100 # in %\n",
+ "print \"With feedback, percentage reduction in stage gain = %0.1f %%\" %Perc_reduction"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Without feedback, percentage of reduction in stage gain = 20 %\n",
+ "With feedback, percentage reduction in stage gain = 11.1 %\n"
+ ]
+ }
+ ],
+ "prompt_number": 15
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 5.8 - page 387"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from numpy import pi\n",
+ "# Given data\n",
+ "Ao= 10**4 \n",
+ "Afo= 50 \n",
+ "omega_H= 2*pi*100 # in rad/s\n",
+ "# Formula Afo= Ao/(1+Ao*Beta)\n",
+ "Beta= 1/Afo-1/Ao \n",
+ "omega_f_H= omega_H*(1+Ao*Beta) \n",
+ "print \"Closed loop bandwidth in rad/s is\",omega_f_H,\"or 2*pi*20*10**3\" "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Closed loop bandwidth in rad/s is 125663.706144 or 2*pi*20*10**3\n"
+ ]
+ }
+ ],
+ "prompt_number": 17
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 5.10 - page 399"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from numpy import inf\n",
+ "# Given data\n",
+ "gm=50 \n",
+ "R_E= 100 # in ohm\n",
+ "R_S= 1 # in kohm\n",
+ "R_S=R_S*10**3 # in ohm\n",
+ "r_pi= 1100 # in ohm\n",
+ "h_ie= r_pi \n",
+ "# Formula Av= Vo/Vs, But Vo= gm*vpi*R_E and Vs= Ib*(Ri+rpi), so\n",
+ "Av= gm*R_E/(R_S+h_ie)\n",
+ "# As Vo=Vf, so\n",
+ "Beta=1 \n",
+ "D= 1+Beta*Av \n",
+ "Avf= Av/D \n",
+ "Ri= R_S+r_pi # in ohm\n",
+ "Ri= Ri*10**-3 # in kohm\n",
+ "R_if= Ri*D # in kohm\n",
+ "Ro= inf # ohm\n",
+ "Rof= Ro*D # ohm\n",
+ "print \"Value of Av = %0.2f \" %Av\n",
+ "print \"Value of Beta = %0.f\" %Beta\n",
+ "print \"Value of Avf = %0.2f\" %Avf\n",
+ "print \"Value of Ri = %0.2f kohm\" %Ri\n",
+ "print \"Value of R_if = %0.2f kohm\" % R_if\n",
+ "print \"Value of R_of = %0.2f \" % Rof\n",
+ "# Answer slightly mismatch because of calculation accuracy in the textbook."
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Value of Av = 2.38 \n",
+ "Value of Beta = 1\n",
+ "Value of Avf = 0.70\n",
+ "Value of Ri = 2.10 kohm\n",
+ "Value of R_if = 7.10 kohm\n",
+ "Value of R_of = inf \n"
+ ]
+ }
+ ],
+ "prompt_number": 26
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 5.11 - page 400"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Given data\n",
+ "gm=2 # in mA/V\n",
+ "gm=gm*10**-3 # in A/V\n",
+ "r_d= 40 # in kohm\n",
+ "r_d= r_d*10**3 # in ohm\n",
+ "Rs= 3 # in kohm\n",
+ "Rs= Rs*10**3 # in ohm\n",
+ "miu= gm*r_d \n",
+ "Bita=1 \n",
+ "Av= miu*Rs/(r_d+Rs) \n",
+ "D= 1+Bita*Av \n",
+ "Avf= Av/D \n",
+ "Ri=inf # ohm\n",
+ "R_if = Ri*D # ohm\n",
+ "Rof= r_d/D # in ohm\n",
+ "print \"Value of Av = %0.2f \" %Av\n",
+ "print \"Value of D = %0.2f \" %D\n",
+ "print \"Value of Avf = %0.3f \" %Avf\n",
+ "print \"Value of R_if = %0.2f \" % R_if\n",
+ "print \"Value of R_of = %0.2e \" % Rof"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Value of Av = 5.58 \n",
+ "Value of D = 6.58 \n",
+ "Value of Avf = 0.848 \n",
+ "Value of R_if = inf \n",
+ "Value of R_of = 6.08e+03 \n"
+ ]
+ }
+ ],
+ "prompt_number": 29
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 5.12 - page 406"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Given data\n",
+ "gm=75 # in A/V\n",
+ "Rs= 1 # in kohm\n",
+ "Rs= Rs*10**3 # in ohm\n",
+ "R_E= 1 # in kohm\n",
+ "R_E= R_E*10**3 # in ohm\n",
+ "rpi= 1 # in kohm\n",
+ "rpi= rpi*10**3 # in ohm\n",
+ "hie=rpi \n",
+ "\n",
+ "Io= -gm \n",
+ "Vi= Rs+R_E+rpi \n",
+ "Gm= Io/Vi \n",
+ "print \"Value of Gm = %0.3f \" %Gm\n",
+ "Beta=-R_E \n",
+ "print \"Value of Beta = %0.f \" %Beta\n",
+ "D= 1+Beta*Gm \n",
+ "print \"Value of D = %0.f \" %D\n",
+ "Gmf= -Gm/D \n",
+ "print \"Value of Gmf = %0.1e\" %Gmf\n",
+ "Ri= Rs+R_E+hie # in ohm\n",
+ "Rif= Ri*D # in ohm\n",
+ "Rif=Rif*10**-3 # in kohm\n",
+ "print \"Value of Rif = %0.f kohm\" %Rif\n",
+ "Ro=inf \n",
+ "R_of = Ro*D # ohm\n",
+ "print \"Value of R_of = %0.2f \" %R_of"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Value of Gm = -0.025 \n",
+ "Value of Beta = -1000 \n",
+ "Value of D = 26 \n",
+ "Value of Gmf = 9.6e-04\n",
+ "Value of Rif = 78 kohm\n",
+ "Value of R_of = inf \n"
+ ]
+ }
+ ],
+ "prompt_number": 38
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 5.19 - page 417"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Given data\n",
+ "A= 10**5 \n",
+ "Af= 100 \n",
+ "# Formula Af= A/(1+A*Bita)\n",
+ "Bita= 1/Af-1/A \n",
+ "\n",
+ "\n",
+ "#when A= 10**3\n",
+ "A=10**3 \n",
+ "Af_desh= A/(1+A*Bita) \n",
+ "\n",
+ "delta_Af= Af_desh-Af \n",
+ "Perc_Change_inAf= delta_Af/Af*100 # in %\n",
+ "print \"Percentage change in Af = %0.f %% \" %Perc_Change_inAf"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Percentage change in Af = -9 % \n"
+ ]
+ }
+ ],
+ "prompt_number": 40
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 5.20 - page 417"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from numpy import log10\n",
+ "# Given data\n",
+ "A= 100 \n",
+ "Vs=1 # in volt\n",
+ "Beta=1 # as in the voltage follower, the output voltage is same as input\n",
+ "Af= A/(1+Beta*A) \n",
+ "CLG= 1+A*Beta # closed loop gain\n",
+ "print \"Closed loop gain = %0.f\" %CLG\n",
+ "CLG_dB= 20*log10(CLG) \n",
+ "print \"Closed loop gain = %0.1f dB\" %CLG_dB\n",
+ "Vo= Af*Vs # in V\n",
+ "print \"Value of Vo = %0.2f Volt\" %Vo\n",
+ "Vi= Vs-Vo # in V\n",
+ "print \"Value of Vi = %0.2f mV\" %round(Vi*10**3)\n",
+ "# If A decrease 10%,i.e.\n",
+ "A=90 \n",
+ "Af_desh= A/(1+Beta*A) \n",
+ "Per_gain_reduction= (Af_desh-Af)/Af*100 # in %\n",
+ "print \"Percentage of gain reduction = %0.1f %%\" %Per_gain_reduction"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Closed loop gain = 101\n",
+ "Closed loop gain = 40.1 dB\n",
+ "Value of Vo = 0.99 Volt\n",
+ "Value of Vi = 10.00 mV\n",
+ "Percentage of gain reduction = -0.1 %\n"
+ ]
+ }
+ ],
+ "prompt_number": 43
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 5.21 - page 418"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Given data\n",
+ "# Part (a)\n",
+ "PerError= 1 # in %\n",
+ "A= 10**5 # (Assumed value)\n",
+ "ABita= 1/PerError*100 \n",
+ "Bita= 1/(PerError*A) \n",
+ "print \"% error A A\u00df 1+A\u00df\"\n",
+ "print PerError,\" %.e\"%A,\" \",ABita,\" \",1+ABita\n",
+ "# Part (b)\n",
+ "PerError= 5 # in %\n",
+ "ABita= 1/PerError*100 \n",
+ "Bita= 1/(PerError*A) \n",
+ "print PerError,\" %.e\"%A,\" \",ABita,\" \",1+ABita\n",
+ "# Part (c)\n",
+ "PerError= 50 # in %\n",
+ "ABita= 1/PerError*100 \n",
+ "Bita= 1/(PerError*A) \n",
+ "print PerError,\" %.e\"%A,\" \",ABita,\" \",1+ABita"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "% error A A\u00df 1+A\u00df\n",
+ "1 1e+05 100.0 101.0\n",
+ "5 1e+05 20.0 21.0\n",
+ "50 1e+05 2.0 3.0\n"
+ ]
+ }
+ ],
+ "prompt_number": 49
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 5.22 - page 419"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Given data\n",
+ "S= -20 # sensitivity of closed to open loop gain in dB\n",
+ "# sensitivity of closed to open loop gain = 1/(1+AB) = S\n",
+ "# or (1+AB) = -S\n",
+ "AB= 10**(-S/20) - 1 \n",
+ "print \"The loop gain AB = %0.2f, \\nfor which the sensitivity of closed loop gain to open loop gain is -20 dB\" %AB\n",
+ "\n",
+ "# Part (b) when \n",
+ "S= 1/2 # sensitivity of closed to open loop gain in dB\n",
+ "#S= 1/(1+AB)\n",
+ "AB= 1/S-1 \n",
+ "print \"The loop gain AB = %0.2f, \\nfor which the sensitivity of closed loop gain to open loop gain is 1/2 \" %AB"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The loop gain AB = 9.00, \n",
+ "for which the sensitivity of closed loop gain to open loop gain is -20 dB\n",
+ "The loop gain AB = 1.00, \n",
+ "for which the sensitivity of closed loop gain to open loop gain is 1/2 \n"
+ ]
+ }
+ ],
+ "prompt_number": 50
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 5.23 - page 419"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from __future__ import division\n",
+ "#Given Data\n",
+ "A = 1e5\n",
+ "Af = 1e3\n",
+ "Beta = 0.99*1e-3 \n",
+ "GDF = 1+A*Beta\n",
+ "print \"Gain density factor %0.2f\" %GDF\n",
+ "# part (a)\n",
+ "A_dash = A*90/100\n",
+ "Af_dash = A_dash/(1+A_dash*Beta)\n",
+ "cp = (Af-Af_dash)/Af*100 # Corresponding %\n",
+ "print \"(a) Corresponding % =\",round(cp,2),\"%\"\n",
+ "# part (a)\n",
+ "A_dash = A*70/100\n",
+ "Af_dash = A_dash/(1+A_dash*Beta)\n",
+ "cp = (Af-Af_dash)/Af*100 # Corresponding %\n",
+ "print \"(b) Corresponding % =\",round(cp,2),\"%\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Gain density factor 100.00\n",
+ "(a) Corresponding % = 0.11 %\n",
+ "(b) Corresponding % = 0.43 %\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 5.24 - page 420"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Given data\n",
+ "A=100 \n",
+ "Af= 10 \n",
+ "f_L= 100 # in Hz\n",
+ "f_H= 10 # in kHz\n",
+ "# Af= A/(1+A*Bita)\n",
+ "Bita= 1/Af-1/A \n",
+ "f_desh_L= f_L/(1+A*Bita) # in Hz\n",
+ "f_desh_H= f_H/(1+A*Bita) # in kHz\n",
+ "print \"Low frequency = %0.2f Hz\" %f_desh_L\n",
+ "print \"High frequency = %0.2f kHz\" %f_desh_H\n",
+ "\n",
+ "# Note: In the book Calculation to find the value of high frequency i.e. f_desh_H is wrong so the answer in the book is wrong "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Low frequency = 10.00 Hz\n",
+ "High frequency = 1.00 kHz\n"
+ ]
+ }
+ ],
+ "prompt_number": 58
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 5.25 - page 420"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Given data\n",
+ "Vs= 100 # in mV\n",
+ "Vf= 95 # in mV\n",
+ "Vs= Vs*10**-3 # in V\n",
+ "Vf= Vf*10**-3 # in V\n",
+ "Vo=10 # in V\n",
+ "Vi= Vs-Vf # in V\n",
+ "Av= Vo/Vi # in V/V\n",
+ "print \"Value of Av = %0.e V/V\" %Av\n",
+ "Beta= Vf/Vo # in V/V\n",
+ "print \"Value of Bita = %0.1e V/V\" %Beta\n",
+ "\n",
+ "# Note: In the book Calculation to find the value of Beta is wrong so the asnwer in the book is wrong"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Value of Av = 2e+03 V/V\n",
+ "Value of Bita = 9.5e-03 V/V\n"
+ ]
+ }
+ ],
+ "prompt_number": 64
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 5.26 - page 420"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Given data\n",
+ "Is= 100 # in \u00b5A\n",
+ "Is= Is*10**-6 # in A\n",
+ "If= 95 # in \u00b5A\n",
+ "Io= 10 # in mA\n",
+ "A= Io*1e-3/((Is-If)*1e-6) # n A/A\n",
+ "Beta= If/Io # A/A\n",
+ "print \"Value of Av = %0.e V/V\" %Av\n",
+ "print \"Value of Beta = %0.1f \u00b5A/mA\" %Beta\n",
+ "# Note: In the book , to evaluating the value of Beta, they putted wrong value of If (90 at place of 95)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Value of Av = 2e+03 V/V\n",
+ "Value of Beta = 9.5 \u00b5A/mA\n"
+ ]
+ }
+ ],
+ "prompt_number": 75
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 5.28 - page 422"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Given data\n",
+ "A=2000 #V/V\n",
+ "Beta= 0.1 # inV/V\n",
+ "Ri= 1 # in kohm\n",
+ "Ri= Ri*10**3 # in ohm\n",
+ "Ro= 1 # in kohm\n",
+ "Ro= Ro*10**3 # in ohm\n",
+ "Af= A/(1+A*Bita) \n",
+ "print \"The gain Af = %0.2f \"%Af\n",
+ "Rif= Ri*(1+A*Beta) # in ohm\n",
+ "print \"The input resistance = %0.f kohm\" %(Rif*10**-3)\n",
+ "Rof= Ro*1e3/(1+A*Beta) # in ohm\n",
+ "print \"The output resistance = %0.3f kohm\" %(Rof*10**-3)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The gain Af = 9.95 \n",
+ "The input resistance = 201 kohm\n",
+ "The output resistance = 4.975 kohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 82
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 5.29 - page 423"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Given data\n",
+ "\n",
+ "# Part (b)\n",
+ "Af= 10 \n",
+ "A= 10**4 \n",
+ "# Af= A/(1+A*Beta) \n",
+ "Beta= 1/Af-1/A \n",
+ "# Beta= R1/(R1+R2)\n",
+ "R2_by_R1= 1/Beta-1 \n",
+ "print \"(b) Value of R2/R1 = %0.2f\" %R2_by_R1\n",
+ "\n",
+ "# Part (c)\n",
+ "Vs= 1 # in V\n",
+ "Vo= (1+R2_by_R1)*Vs \n",
+ "print \"(c) Value of Vo = %0.2f Volt\" %Vo\n",
+ "Vf= Vo/(1+R2_by_R1)\n",
+ "print \"Value of Vf = %0.2f Volt\" %Vf"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "(b) Value of R2/R1 = 9.01\n",
+ "(c) Value of Vo = 10.01 Volt\n",
+ "Value of Vf = 1.00 Volt\n"
+ ]
+ }
+ ],
+ "prompt_number": 83
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
diff --git a/Electronic_Circuits_by_P._Raja/chapter6.ipynb b/Electronic_Circuits_by_P._Raja/chapter6.ipynb
new file mode 100755
index 00000000..ec4b3342
--- /dev/null
+++ b/Electronic_Circuits_by_P._Raja/chapter6.ipynb
@@ -0,0 +1,517 @@
+{
+ "metadata": {
+ "name": "",
+ "signature": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter6 - Oscillators"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 6.1 - page 438"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Given data\n",
+ "Vf= 0.0125 # in volt\n",
+ "Vo= 0.5 # in volt\n",
+ "Beta= Vf/Vo \n",
+ "# For oscillator A*Beta= 1\n",
+ "A= 1/Beta \n",
+ "print \"Amplifier Should have a minimum gain of\",A,\"to provide oscillation\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Amplifier Should have a minimum gain of 40.0 to provide oscillation\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 6.2 - page 439"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "from numpy import *\n",
+ "# Given data\n",
+ "R1= 50 # in kohm\n",
+ "R1=R1*10**3 # in ohm\n",
+ "R2=R1 # in ohm\n",
+ "R3=R2 # in ohm\n",
+ "C1= 60 # in pF\n",
+ "C1= C1*10**-12 # in F\n",
+ "C2=C1 # in F\n",
+ "C3=C2 # in F\n",
+ "f= 1/(2*pi*R1*C1*sqrt(6)) \n",
+ "print \"Frequency of oscilltions = %0.2f kHz\" %( f*10**-3)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Frequency of oscilltions = 21.66 kHz\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 6.3 - page 445"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Given data\n",
+ "f=2 # in kHz\n",
+ "f=f*10**3 # in Hz\n",
+ "# Let\n",
+ "R= 10 # in kohm (As R should be greater than 1 kohm)\n",
+ "R=R*10**3 # in ohm\n",
+ "# Formula f= 1/(2*pi*R*C)\n",
+ "C= 1/(2*pi*f*R) # in F\n",
+ "C= C*10**9 # in nF\n",
+ "# For Bita to be 1/3, Choose\n",
+ "R4= R # in ohm\n",
+ "R3= 2*R4 # in ohm\n",
+ "print \"Value of C = %0.2f nF\" %C\n",
+ "print \"Value of R3 = %0.f kohm\" %(R3*10**-3)\n",
+ "print \"Value of R4 = %0.f kohm\" %(R4*10**-3)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Value of C = 7.96 nF\n",
+ "Value of R3 = 20 kohm\n",
+ "Value of R4 = 10 kohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 6.4 - page 445"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Given data\n",
+ "R1= 200 # in kohm\n",
+ "R1=R1*10**3 # in ohm\n",
+ "R2=R1 # in ohm\n",
+ "C1= 200 # in pF\n",
+ "C1= C1*10**-12 # in F\n",
+ "C2=C1 # in F\n",
+ "f= 1/(2*pi*R1*C1) # in Hz\n",
+ "print \"Frequency of oscilltions = %0.2f kHz\" %(f*10**-3)\n",
+ "\n",
+ "# Note: Calculation to find the value of f in the book is wrong, so answer in the book is wrong"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Frequency of oscilltions = 3.98 kHz\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 6.5 - page 460"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Given data\n",
+ "L= 100 # in \u00b5H\n",
+ "L= L*10**-6 # in H\n",
+ "C1= .001 # in \u00b5F\n",
+ "C1= C1*10**-6 # in F\n",
+ "C2= .01 # in \u00b5F\n",
+ "C2= C2*10**-6 # in F\n",
+ "C= C1*C2/(C1+C2) # in F\n",
+ "# (i)\n",
+ "f= 1/(2*pi*sqrt(L*C)) # in Hz\n",
+ "print \"Operating frequency = %0.f kHz\" %(round(f*10**-3))\n",
+ "# (ii)\n",
+ "Beta= C1/C2 \n",
+ "print \"Feedback fraction = %0.1f \" %Beta\n",
+ "# (iii)\n",
+ "# A*Bita >=1, so Amin*Bita= 1\n",
+ "Amin= 1/Beta \n",
+ "print \"Minimum gain to substain oscillations is\",Amin"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Operating frequency = 528 kHz\n",
+ "Feedback fraction = 0.1 \n",
+ "Minimum gain to substain oscillations is 10.0\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 6.6 - page 460"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Given data\n",
+ "L= 15 # in \u00b5H\n",
+ "L= L*10**-6 # in H\n",
+ "C1= .004 # in \u00b5F\n",
+ "C1= C1*10**-6 # in F\n",
+ "C2= .04 # in \u00b5F\n",
+ "C2= C2*10**-6 # in F\n",
+ "C= C1*C2/(C1+C2) # in F\n",
+ "f= 1/(2*pi*sqrt(L*C)) # in Hz\n",
+ "print \"Frequency of oscilltions = %0.1f kHz\" %(f*10**-3)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Frequency of oscilltions = 681.5 kHz\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 6.7 - page 461"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Given data\n",
+ "L= 0.01 # in H\n",
+ "C= 10 # in pF\n",
+ "C= C*10**-12 # in F\n",
+ "f= 1/(2*pi*sqrt(L*C)) # in Hz\n",
+ "print \"Frequency of oscilltions = %0.2f kHz\" %(f*10**-3)\n",
+ "# Note: Calculation to find the value of f in the book is wrong, so answer in the book is wrong"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Frequency of oscilltions = 503.29 kHz\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 6.8 - page 463"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Given data\n",
+ "L= 0.8 # in H\n",
+ "\n",
+ "C= .08 # in pF\n",
+ "C= C*10**-12 # in F\n",
+ "C_M= 1.9 # in pF\n",
+ "C_M= C_M*10**-12 # in F\n",
+ "C_T= C*C_M/(C+C_M) # in F\n",
+ "R=5 # in kohm\n",
+ "f_s= 1/(2*pi*sqrt(L*C)) # in Hz\n",
+ "print \"Series resonant frequency = %0.f kHz\" %(f_s*10**-3)\n",
+ "# (ii)\n",
+ "f_p= 1/(2*pi*sqrt(L*C_T)) # in Hz\n",
+ "print \"Parallel resonant frequency = %0.f kHz\" %(f_p*10**-3)\n",
+ "# Note: Calculation to find the value of parallel resonant frequency in the book is wrong, so answer in the book is wrong"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Series resonant frequency = 629 kHz\n",
+ "Parallel resonant frequency = 642 kHz\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 6.10 - page 466"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Given data\n",
+ "R1= 220 # in kohm\n",
+ "R1=R1*10**3 # in ohm\n",
+ "R2=R1 # in ohm\n",
+ "C1= 250 # in pF\n",
+ "C1= C1*10**-12 # in F\n",
+ "C2=C1 # in F\n",
+ "f= 1/(2*pi*R1*C1) \n",
+ "print \"Frequency of oscilltions = %0.2f Hz\" %f"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Frequency of oscilltions = 2893.73 Hz\n"
+ ]
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 6.11 - page 467"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Given data\n",
+ "R= 10 # in kohm\n",
+ "R=R*10**3 # in ohm\n",
+ "f=1000 \n",
+ "fie= 60 # in \u00b0\n",
+ "# The impedence of given circuit , Z= R+j*1/(omega*C)\n",
+ "# the phase shift, tan(fie)= imaginary part/ Real part\n",
+ "# tand(fie) = 1/(omega*R*C)\n",
+ "C= 1/(2*pi*R*tan(fie*pi/180)) \n",
+ "print \"The value of C = %0.2f pF\" %(C*10**12)\n",
+ "# Note : There is an calculation error to evaluate the value of C, So the answer in the book is wrong"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The value of C = 9188814.92 pF\n"
+ ]
+ }
+ ],
+ "prompt_number": 17
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Given data\n",
+ "R= 10 # in kohm\n",
+ "R=R*10**3 # in ohm\n",
+ "f=1000 \n",
+ "fie= 60 # in \u00b0\n",
+ "# The impedence of given circuit , Z= R+j*1/(omega*C)\n",
+ "# the phase shift, tan(fie)= imaginary part/ Real part\n",
+ "# tand(fie) = 1/(omega*R*C)\n",
+ "C= 1/(2*pi*R*tan(fie*pi/180)) \n",
+ "print \"The value of C = %0.2f \u00b5F\" %(C*10**6)\n",
+ "# Note : There is an calculation error to evaluate the value of C, So the answer in the book is wrong"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The value of C = 9.19 \u00b5F\n"
+ ]
+ }
+ ],
+ "prompt_number": 27
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 6.12 - page 467"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Given data\n",
+ "L= 50 # in \u00b5H\n",
+ "L= L*10**-6 # in H\n",
+ "C1= 300 # in pF\n",
+ "C1= C1*10**-12 # in F\n",
+ "C2= 100 # in pF\n",
+ "C2= C2*10**-12 # in F\n",
+ "C_eq= C1*C2/(C1+C2) # in F\n",
+ "f= 1/(2*pi*sqrt(L*C_eq)) # in Hz\n",
+ "print \"Frequency of oscillations = %0.1f MHz\" %(f*10**-6)\n",
+ "Beta= C2/C1 \n",
+ "# (iii)\n",
+ "# A*Beta >=1, so A*Bita= 1 (for sustained oscillations)\n",
+ "Amin= 1/Beta \n",
+ "print \"Minimum gain to substain oscillations is\",Amin"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Frequency of oscillations = 2.6 MHz\n",
+ "Minimum gain to substain oscillations is 3.0\n"
+ ]
+ }
+ ],
+ "prompt_number": 29
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 6.14 - page 469"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Given data\n",
+ "L1= 2 # in mH\n",
+ "L1= L1*10**-3 # in H\n",
+ "L2= 1.5 # in mH\n",
+ "L2= L2*10**-3 # in H\n",
+ "# Formula f= 1/(2*pi*sqrt((L1+L2)*C)\n",
+ "# For f= 1000 kHz, C will be maximum\n",
+ "f=1000 # in kHz\n",
+ "f=f*10**3 # in Hz\n",
+ "Cmax= 1/((2*pi*f)**2*(L1+L2)) # in F\n",
+ "# For f= 2000 kHz, C will be maximum\n",
+ "f=2000 # in kHz\n",
+ "f=f*10**3 # in Hz\n",
+ "Cmin= 1/((2*pi*f)**2*(L1+L2)) # in F\n",
+ "print \"Maximum Capacitance = %0.1f pF\" %(Cmax*10**12)\n",
+ "print \"Minimum Capacitance = %0.1f pF\" %(Cmin*10**12)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Maximum Capacitance = 7.2 pF\n",
+ "Minimum Capacitance = 1.8 pF\n"
+ ]
+ }
+ ],
+ "prompt_number": 32
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
diff --git a/Electronic_Circuits_by_P._Raja/chapter7.ipynb b/Electronic_Circuits_by_P._Raja/chapter7.ipynb
new file mode 100755
index 00000000..78dc3860
--- /dev/null
+++ b/Electronic_Circuits_by_P._Raja/chapter7.ipynb
@@ -0,0 +1,182 @@
+{
+ "metadata": {
+ "name": "",
+ "signature": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Solved Examination Paper"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 1.b - page 476"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Given data\n",
+ "R1= 10 # in k\u03a9\n",
+ "R2= 10 # in k\u03a9\n",
+ "Rf= 50 # in k\u03a9\n",
+ "V= 2 # in V\n",
+ "V1= V*R1/(R1+R2) # in V\n",
+ "V01= -Rf/R1*V1 # in V\n",
+ "print \"The value of V1 = %0.f Volts\" %(V1)\n",
+ "print \"The value of V01 = %0.f Volts\" %(V01)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The value of V1 = 1 Volts\n",
+ "The value of V01 = -5 Volts\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 2.a - page 479"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Given data\n",
+ "V_P= -4 # in V\n",
+ "I_DSS= 10 # in mA\n",
+ "V_GS= 0 # in V\n",
+ "R_D= 1.8 # in k\u03a9\n",
+ "V_DD= 20 # in V\n",
+ "I_D= I_DSS*(1-V_GS/V_P)**2 # in mA\n",
+ "# Applying KVL to the circuit, we get V_DD= I_D*R_D+V_D\n",
+ "V_D= V_DD-I_D*R_D # in V\n",
+ "print \"The value of I_D = %0.f mA\" %(I_D)\n",
+ "print \"The value of V_D = %0.f Volts\" %V_D"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The value of I_D = 10 mA\n",
+ "The value of V_D = 2 Volts\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 2.c - page 480"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Given data\n",
+ "V_GS= 3 # in V\n",
+ "Vth= 1 # in V\n",
+ "unCox= 25 # in mA/V**2\n",
+ "unCox= unCox*10**-3 # in A/V**2\n",
+ "W=3 # in \u00b5m\n",
+ "L=1 # in \u00b5m\n",
+ "r_DS= 1/(unCox*W/L*(V_GS-Vth)) # in \u03a9\n",
+ "print \"The value of r_DS = %0.2f \u03a9 \" %r_DS"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The value of r_DS = 6.67 \u03a9 \n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Exa 3.b - page 481"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Given data\n",
+ "I_CQ= 10 # in mA\n",
+ "I_CQ= I_CQ*10**-3 # in A\n",
+ "V_CQ= 5 # in V\n",
+ "V_CC= 10 # in V\n",
+ "R_C= 0.4 # in k\u03a9\n",
+ "R_C= R_C*10**3 # in \u03a9\n",
+ "V_BE= 0.075 # in V\n",
+ "V_BB= 0.175 # in V\n",
+ "beta=100 \n",
+ "beta_max=120 \n",
+ "beta_min= 40 \n",
+ "# Applying KVL we get, V_CQ= V_CC-I_C*(R_C+R_E)\n",
+ "R_E= (V_CC-V_CQ)/I_CQ-R_C # in \u03a9\n",
+ "print \"The value of R_E = %0.f \u03a9\" %( R_E)\n",
+ "I_B= I_CQ/beta # in A\n",
+ "R_B= (V_BB-V_BE)/I_B # in \u03a9\n",
+ "print \"The value of R_B = %0.f k\u03a9\" %(R_B*10**-3)\n",
+ "I_Cmax= beta_max*I_B # in A\n",
+ "I_Cmin= beta_min*I_B # in A\n",
+ "delta_I_CQ= I_Cmax-I_Cmin # in A\n",
+ "print \"The value of delta_I_C = %0.f mA\" %(delta_I_CQ*10**3)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The value of R_E = 100 \u03a9\n",
+ "The value of R_B = 1 k\u03a9\n",
+ "The value of delta_I_C = 8 mA\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}