{
 "metadata": {
  "name": "",
  "signature": "sha256:a1991f0c2ad3cdd162c5a3598633b434636cdfbb3e50ee12bef51cec75158259"
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "Chapter 1 - Differential Amplifiers"
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Exa 1.8 - pg:19"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#given data\n",
      "BETAac=100  #unitless\n",
      "BETAdc=100  #unitless\n",
      "VBE3=0.715  #in volts\n",
      "VD1=0.715  #in Volts\n",
      "VZ=6.2  #in Volts\n",
      "VT=25  #in mVolts\n",
      "IZt=41  #in mA \n",
      "VCC=10  #in Volts\n",
      "VEE=-10  #in Volts\n",
      "RC1=2.7  #in kohm\n",
      "RC=4.7  #in kohm\n",
      "#Part (a)\n",
      "VB3=VEE+VZ+VD1  #in volts\n",
      "VE3=VB3-VBE3\n",
      "IE3=(VE3-VEE)/RC1  #in mA\n",
      "#As the differential amplifier is symmetrical, ICQ1=IE1=ICQ2=IE2\n",
      "IE2=IE3/2  #in mA\n",
      "ICQ1=IE2  #in mA\n",
      "ICQ2=IE2  #in mA\n",
      "IE1=IE2  #in mA\n",
      "VCEQ=VCC+VBE3-RC*ICQ1# formula for VCEQ \n",
      "print \"Operating point for Q1 and Q2 are : \"\n",
      "print \"VCEQ is \",round(VCEQ,2),\" V\"\n",
      "print \"ICQ is \",round(ICQ1,2),\" mA\"\n",
      "print \"and the operating point for Q3 will be : \"\n",
      "VCE3=-VBE3-VE3  #in Volts\n",
      "print \"VCE3 is \",round(VCE3,2),\" V\"\n",
      "IC3=IE3  #in mA\n",
      "print \"IE3 is \",round(IE3,2),\" mA\"\n",
      "#Part (b)\n",
      "re=(2*VT)/IC3  #in ohm\n",
      "Ad=(RC*1000)/re  #unitless\n",
      "print \"Differential voltage gain is \",round(Ad,2)\n",
      "#Part (c)\n",
      "Ri=2*BETAac*re  #in ohm\n",
      "Ri/=1000  # kohm\n",
      "print \"Input resistance is \",round(Ri,2),\" kohm\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Operating point for Q1 and Q2 are : \n",
        "VCEQ is  5.32  V\n",
        "ICQ is  1.15  mA\n",
        "and the operating point for Q3 will be : \n",
        "VCE3 is  3.08  V\n",
        "IE3 is  2.3  mA\n",
        "Differential voltage gain is  215.85\n",
        "Input resistance is  4.35  kohm\n"
       ]
      }
     ],
     "prompt_number": 14
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Exa 1.9 : pg-29"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#given data\n",
      "Io=180  #in uA\n",
      "Vcc=20  #in Volts\n",
      "VBE=0.7  #in Volts\n",
      "BETA=120  #unitless\n",
      "IR=Io*(1+2/BETA)  #in uA\n",
      "R=(Vcc-VBE)/(IR*10**-3)  #in kohm\n",
      "print \"Value of IR is \",round(IR,2),\" uA\"\n",
      "print \"Value of R is \",round(R,2),\" kohm\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Value of IR is  180.0  uA\n",
        "Value of R is  107.22  kohm\n"
       ]
      }
     ],
     "prompt_number": 19
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Exa 1.16 : pg-31"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#given data\n",
      "BETAac=100  #unitless\n",
      "BETAdc=100  #unitless\n",
      "VBEon=0.7  #in volts\n",
      "VCC=5  #in volts\n",
      "VEE=-5  #in volts\n",
      "VT=25  #in mVolts\n",
      "R=18.6  #in kohm\n",
      "Ad=200  #unitless\n",
      "IR=(VCC-VBEon -VEE)/R  #in mA\n",
      "IC1=IR/2  #in mA\n",
      "IC2=IC1  #in mA\n",
      "re1=(2*VT)/IR  #in ohm\n",
      "re2=re1  #in ohm\n",
      "RC=Ad*re1*10**-3  #in kohm\n",
      "print \"Rc is \",round(RC,2),\" kohm\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Rc is  20.0  kohm\n"
       ]
      }
     ],
     "prompt_number": 20
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Exa 1.18 : pg-33"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#given data\n",
      "Iload=20  #in uA\n",
      "VBE=0.7  #in volts\n",
      "VCC=10  #in Volts\n",
      "IR=Iload  #in mA\n",
      "R=(VCC-2*VBE)/(IR*10**-3)  #in kohm\n",
      "print \"R is \",round(R,2),\" kohm\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "R is  430.0  kohm\n"
       ]
      }
     ],
     "prompt_number": 22
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Exa 1.23 : pg-26"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#given data\n",
      "Vo=5  #in volts\n",
      "BETAac=150  #unitless\n",
      "BETAdc=150  #unitless\n",
      "VT=25  #in mV\n",
      "VCC=10  #in mV\n",
      "VD=0.7  #in mV\n",
      "R1=2.7  #in kohm\n",
      "R2=1.5  #in kohm\n",
      "# part (i) #\n",
      "# IC1/IC2=exp((VBE1-VBE2)/VT)\n",
      "# Writing KVL for the loop\n",
      "IR=(VCC-VD)/R1  #in mA\n",
      "IC=(IR-VD/R2)/(1+2/BETAac)  #in mA\n",
      "IC1=IC  #in mA\n",
      "IC2=IC  #in mA\n",
      "RC=(VCC-Vo)/IC  #in kohm\n",
      "print \"IC1 is \",round(IC1,2),\" mA\"\n",
      "print \"IC2 is \",round(IC2,2),\" mA\"\n",
      "print \"RC is \",round(RC,2),\" kohm\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "IC1 is  2.98  mA\n",
        "IC2 is  2.98  mA\n",
        "RC is  1.68  kohm\n"
       ]
      }
     ],
     "prompt_number": 17
    }
   ],
   "metadata": {}
  }
 ]
}