{ "metadata": { "name": "", "signature": "sha256:1cb6068538d8c97f156cb67d11e52aad1d6c0b391f69a34791cef94fb6857610" }, "nbformat": 3, "nbformat_minor": 0, "worksheets": [ { "cells": [ { "cell_type": "heading", "level": 1, "metadata": {}, "source": [ "Chapter1 - Constant current sources" ] }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Ex 1.1 - page 4" ] }, { "cell_type": "code", "collapsed": false, "input": [ "from __future__ import division\n", "Iout=8 #micro A\n", "VBE=0.7 #V\n", "Beta=80 #unitless\n", "VCC=20 #V\n", "IREF=Iout*(1+2/Beta) #micro A\n", "R=(VCC-VBE)/IREF #Mohm\n", "print \"Reference current is %0.2f uA\" %IREF\n", "print \"Resistance required is %0.2f Mohm\" %R" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "Reference current is 8.20 uA\n", "Resistance required is 2.35 Mohm\n" ] } ], "prompt_number": 2 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Ex 1.2 - page 5" ] }, { "cell_type": "code", "collapsed": false, "input": [ "from __future__ import division\n", "Iout=1 #mA\n", "VBE=0.7 #V\n", "Beta=100 #unitless\n", "VCC=30 #V\n", "IREF=Iout*(1+2/Beta) #mA\n", "R=(VCC-VBE)/IREF #kohm\n", "print \"Reference current is %0.2f mA\" %IREF \n", "print \"Resistance required is %0.1f kohm\" %R" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "Reference current is 1.02 mA\n", "Resistance required is 28.7 kohm\n" ] } ], "prompt_number": 5 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Ex 1.3 - page 5" ] }, { "cell_type": "code", "collapsed": false, "input": [ "from __future__ import division\n", "Iout=0.5 #mA\n", "Beta=50 #unitless\n", "VEB=0.7 #V\n", "VCC=5 #V\n", "IREF=Iout*(1+2/Beta) #mA\n", "R=(VCC-VEB)/IREF #kohm\n", "print \"Reference current is %0.2f mA\" %IREF \n", "print \"Resistance required is %0.2f kohm\" %R" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "Reference current is 0.52 mA\n", "Resistance required is 8.27 kohm\n" ] } ], "prompt_number": 6 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Ex 1.4 - page 8" ] }, { "cell_type": "code", "collapsed": false, "input": [ "from __future__ import division\n", "Iout=8 #micro A\n", "Beta=100 #unitless\n", "VBE=0.7 #V\n", "VCC=20 #V\n", "IREF=Iout/(1+2/Beta/(1+Beta)) #micro A\n", "R=(VCC-2*VBE)/IREF #Mohm\n", "print \"Reference current is %0.2f micro A\" %IREF \n", "print \"Resistance required is %0.2f Mohm\" %R" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "Reference current is 8.00 micro A\n", "Resistance required is 2.33 Mohm\n" ] } ], "prompt_number": 9 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Ex 1.5 - page 8" ] }, { "cell_type": "code", "collapsed": false, "input": [ "from __future__ import division\n", "Iout=60 #micro A\n", "VBE=0.7 #V\n", "Beta=150 #unitless\n", "VCC=30 #V\n", "IREF=Iout*(1+2/Beta/(1+Beta)) #micro A\n", "R=(VCC-2*VBE)/IREF #Mohm\n", "R*=10**3 #kohm\n", "print \"Reference current is %0.3f mA\" %IREF \n", "print \"Resistance required is %0.1f kohm\" %R" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "Reference current is 60.005 mA\n", "Resistance required is 476.6 kohm\n" ] } ], "prompt_number": 12 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Ex 1.6 - page 9" ] }, { "cell_type": "code", "collapsed": false, "input": [ "from __future__ import division\n", "VBE=0.7 #V\n", "Beta=120 #unitless\n", "VCC=10 #V\n", "R=5.6 #kohm\n", "#KCL at node x : IREF=IC1+I1 #as Beta>>1\n", "#KCL at node y : I1=IC2+IB3 #as Beta>>1\n", "IREF=(VCC-VBE)/R #mA\n", "#as IREF=2*IC+IB3=IC*(2+1/Beta)=2*IC #as Beta>>1\n", "IC=IREF/2 #mA\n", "Iout=IC #mA\n", "print \"Output current is %0.2f mA\" %Iout" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "Output current is 0.83 mA\n" ] } ], "prompt_number": 14 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Ex 1.7 - page 13" ] }, { "cell_type": "code", "collapsed": false, "input": [ "from __future__ import division\n", "import math\n", "Iout=6 #micro A\n", "IREF=1.2 #mA\n", "VBE2=0.7 #V\n", "VT=26 #mV\n", "Beta=120 #unitless\n", "VCC=20 #V\n", "R=(VCC-VBE2)/IREF #kohm\n", "print \"Value of resistance R is %0.f kohm \" %R\n", "IC1=Iout #micro A\n", "IC2=(IREF-IC1*10**-3/Beta)/(1+1/Beta) #mA\n", "RS=1/(IC1*10**-6)*VT*10**-3*math.log(IC2*1000/IC1) #ohm\n", "RS/=10**3 #kohm\n", "print \"Value of resistance RS is %0.1f kohm\" %RS" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "Value of resistance R is 16 kohm \n", "Value of resistance RS is 22.9 kohm\n" ] } ], "prompt_number": 17 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Ex 1.8 - page 14" ] }, { "cell_type": "code", "collapsed": false, "input": [ "from __future__ import division\n", "IREF=1 #mA\n", "Io2=20 #micro A\n", "Io3=40 #micro A\n", "VBE1=0.7 #V\n", "VT=26 #mV\n", "VCC=10 #V\n", "VEE=-10 #V\n", "R=(VCC-VBE1-VEE)/IREF #kohm\n", "print \"Value of resistance R is %0.2f kohm \" %R \n", "RE2=VT/Io2*math.log(IREF*1000/Io2) #kohm\n", "print \"Value of resistance RE2 is %0.2f kohm\" %RE2 \n", "RE3=VT/Io3*math.log(IREF*1000/Io3) #kohm\n", "print \"Value of resistance RE3 is %0.2f kohm \" %RE3 \n", "VBE2=VBE1-RE2*Io2/1000 #V\n", "print \"Value of Base emitter voltage of transistor Q2 is %0.4f V\" %VBE2 \n", "VBE3=VBE1-RE3*Io3/1000 #V\n", "print \"Value of Base emitter voltage of transistor Q3 is %0.4f V\" %VBE3" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "Value of resistance R is 19.30 kohm \n", "Value of resistance RE2 is 5.09 kohm\n", "Value of resistance RE3 is 2.09 kohm \n", "Value of Base emitter voltage of transistor Q2 is 0.5983 V\n", "Value of Base emitter voltage of transistor Q3 is 0.6163 V\n" ] } ], "prompt_number": 21 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Ex 1.9 - page 18" ] }, { "cell_type": "code", "collapsed": false, "input": [ "from __future__ import division\n", "Beta=100 #unitless\n", "VBE=0.715 #V\n", "R=5.6 #kohm\n", "RC=1 #kohm\n", "VCC=10 #V\n", "VCB1=0 #V(Q1 will act as diode)\n", "IREF=(VCC-VBE)/R #mA\n", "#KCL at node x : IREF=IC1+2*IB \n", "#KCL at node y : I1=IC2+IB3 #as Beta>>1\n", "IREF=(VCC-VBE)/R #mA\n", "#as IREF=2*IC1/Beta+IC1\n", "IC1=IREF/(1+2/Beta) #mA\n", "IC2=IC1 #mA\n", "IC3=IC1 #mA\n", "print \"Collector current in each transistor, IC1=IC2=IC3 is %0.2f mA\" %IC1\n", "IRC=IC1+IC2+IC3 #mA\n", "print \"Current through RC is %0.2f mA\" %IRC\n", "#Answer wrong in the textbook." ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "Collector current in each transistor, IC1=IC2=IC3 is 1.63 mA\n", "Current through RC is 4.88 mA\n" ] } ], "prompt_number": 23 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Ex 1.10 - page 19" ] }, { "cell_type": "code", "collapsed": false, "input": [ "from __future__ import division\n", "Vout=5 #V\n", "Beta=180 #unitless\n", "R=22 #kohm\n", "VCC=10 #V\n", "VBE=0.7 #V\n", "IREF=(VCC-VBE)/R #mA\n", "IC=(IREF-VBE/R)/(1+2/Beta) #mA\n", "RC=(VCC-Vout)/IC #kohm\n", "print \"IC1 & IC2 are %0.2f mA\" %IC\n", "print \"RC is %0.2f kohm\" %RC\n", "#Answer in the book is wrong." ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "IC1 & IC2 are 0.39 mA\n", "RC is 12.93 kohm\n" ] } ], "prompt_number": 25 } ], "metadata": {} } ] }