{ "cells": [ { "cell_type": "markdown", "metadata": { "collapsed": true }, "source": [ "# Chapter 3: An Op-Amp with Negative Feedback" ] }, { "cell_type": "markdown", "metadata": { "collapsed": true }, "source": [ "## Example 3.1" ] }, { "cell_type": "code", "execution_count": 1, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Closed-loop voltage gain is 11.0\n", "Input resistance with feedback is 36.37 Giga Ohm\n", "Output resistance with feedback is 4.12 mOhm\n", "Bandwidth with feedback is 90.91 KHz\n", "Total output offset voltage with feedback is 0.715 mV\n" ] } ], "source": [ "#Example 3.1\n", "#Compute the following parameters of voltage-series feedback amplifier\n", "#Af,Ri,Ro,fF,VooT\n", "\n", "from __future__ import division #to perform decimal division\n", "\n", "#Variable declaration\n", "R1=1000 #Resistance in ohms\n", "Rf=10000 #Feedback Resistance in Ohms \n", "A=200000 #Open-loop voltage gain\n", "Ri=2*10**6 #Input resistance without feedback\n", "Ro=75 #Output resistance without feedback\n", "fo=5 #Break frequency of an Op-amp\n", "Vsat=13 #Saturation voltage\n", "\n", "#calculation\n", "B=R1/(R1+Rf) #Gain of the feedback circuit\n", "Af=A/(1+A*B) #Closed-loop voltage gain\n", "RiF=Ri*(1+A*B) #Input resistance with feedback\n", "RoF=Ro/(1+A*B) #Output resistance with feedback\n", "fF=fo*(1+A*B) #Bandwidth with feedback\n", "VooT=Vsat/(1+A*B) #Total output offset voltage with feedback\n", "\n", "#Result\n", "print \"Closed-loop voltage gain is\",round(Af,2)\n", "print \"Input resistance with feedback is\",round(RiF/10**9,2),\"Giga Ohm\"\n", "print \"Output resistance with feedback is\",round(RoF*10**3,2),\"mOhm\"\n", "print \"Bandwidth with feedback is\",round(fF/10**3,2),\"KHz\"\n", "print \"Total output offset voltage with feedback is \",round(VooT*10**3,3),\"mV\"" ] }, { "cell_type": "markdown", "metadata": { "collapsed": true }, "source": [ "## Example 3.2" ] }, { "cell_type": "code", "execution_count": 2, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Closed-loop voltage gain is 1.0\n", "Input resistance with feedback is 400.0 Giga Ohm\n", "Output resistance with feedback is 0.375 mOhm\n", "Bandwidth with feedback is 1.0 MHz\n", "Total output offset voltage with feedback is 65.0 uV\n" ] } ], "source": [ "#Example 3.2\n", "#Compute the following parameters of voltage follower circuit of figure 3-7\n", "#Af,Ri,Ro,fF,VooT\n", "\n", "from __future__ import division #to perform decimal division\n", "\n", "#Variable declaration\n", "R1=1000 #Resistance in ohms\n", "Rf=10000 #Feedback Resistance in Ohms \n", "A=200000 #Open-loop voltage gain\n", "Ri=2*10**6 #Input resistance without feedback\n", "Ro=75 #Output resistance without feedback\n", "fo=5 #Break frequency of an Op-amp\n", "Vsat=13 #Saturation voltage\n", "B=1 #Gain of the feedback circuit of voltage follower\n", "\n", "#calculation\n", "\n", "Af=A/(1+A*B) #Closed-loop voltage gain\n", "RiF=Ri*(1+A*B) #Input resistance with feedback\n", "RoF=Ro/(1+A*B) #Output resistance with feedback\n", "fF=fo*(1+A*B) #Bandwidth with feedback\n", "VooT=Vsat/(1+A*B) #Total output offset voltage with feedback\n", "\n", "#Result\n", "print \"Closed-loop voltage gain is\",round(Af)\n", "print \"Input resistance with feedback is\",round(RiF/10**9),\"Giga Ohm\"\n", "print \"Output resistance with feedback is\",round(RoF*10**3,3),\"mOhm\"\n", "print \"Bandwidth with feedback is\",round(fF/10**6,2),\"MHz\"\n", "print \"Total output offset voltage with feedback is \",round(VooT*10**6,3),\"uV\"" ] }, { "cell_type": "markdown", "metadata": { "collapsed": true }, "source": [ "## Example 3.3" ] }, { "cell_type": "code", "execution_count": 14, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Closed-loop voltage gain is -10.0\n", "Input resistance with feedback is 470.0 Ohm\n", "Output resistance with feedback is 4.12 mOhm\n", "Bandwidth with feedback is 100.0 kHz\n", "Total output offset voltage with feedback is 0.715 mV\n" ] } ], "source": [ "#Example 3.3\n", "#Compute the following parameters of inverting amplifierof figure 3-8\n", "#Af,Ri,Ro,fF,VooT\n", "\n", "from __future__ import division #to perform decimal division\n", "\n", "#Variable declaration\n", "R1=470 #Resistance in ohms\n", "Rf=4.7*10**3 #Feedback Resistance in Ohms \n", "A=200000 #Open-loop voltage gain\n", "Ri=2*10**6 #Input resistance without feedback\n", "Ro=75 #Output resistance without feedback\n", "fo=5 #Break frequency of an Op-amp\n", "Vsat=13 #Saturation voltage\n", "\n", "\n", "#calculation\n", "\n", "K=Rf/(R1+Rf) #Voltage attenuation factor\n", "B=R1/(R1+Rf) #Gain of the feedback circuit\n", "Af=-A*K/(1+A*B) #Closed-loop voltage gain\n", "X=Rf/(1+A)\n", "RiF=R1+(X*Ri)/(X+Ri) #Input resistance with feedback\n", "RoF=Ro/(1+A*B) #Output resistance with feedback\n", "fF=fo*(1+A*B)/K #Bandwidth with feedback\n", "VooT=Vsat/(1+A*B) #Total output offset voltage with feedback\n", "\n", "#Result\n", "print \"Closed-loop voltage gain is\",round(Af)\n", "print \"Input resistance with feedback is\",round(RiF),\"Ohm\"\n", "print \"Output resistance with feedback is\",round(RoF*10**3,2),\"mOhm\"\n", "print \"Bandwidth with feedback is\",round(fF/10**3),\"kHz\"\n", "print \"Total output offset voltage with feedback is \",round(VooT*10**3,3),\"mV\"" ] }, { "cell_type": "markdown", "metadata": { "collapsed": true }, "source": [ "## Example 3.4" ] }, { "cell_type": "code", "execution_count": 3, "metadata": { "collapsed": false }, "outputs": [ { "data": { "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYIAAAEZCAYAAACaWyIJAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3Xd8VGX69/FP6E0UAakqGAsigiAdlNCLCAi6iK51m/5c\nt7hr31X28Xksu7qu6/5cy7oKdkRFQSGEkKB0qdJEBRQQQaQICFKSef64ZiRCQmaSmblP+b5fr7yY\nhJlzLsg557r7DSIiIiIiIiIiIiIiIi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"text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "name": "stdout", "output_type": "stream", "text": [ "Output voltage is -10.0 V peak to peak\n" ] } ], "source": [ "%matplotlib inline\n", "\n", "from __future__ import division #to perform decimal division\n", "from matplotlib.pyplot import ylabel, xlabel, title, plot, show\n", "import matplotlib.pyplot as plt\n", "import math\n", "import numpy as np\n", "#Variable declaration\n", "R1=470 #Resistance in ohms\n", "Rf=4.7*10**3 #Feedback Resistance in Ohms \n", "A=200000 #Open-loop voltage gain\n", "vin=1 #input voltage in Volts\n", "\n", "\n", "\n", "#calculation\n", "K=Rf/(R1+Rf) #Voltage attenuation factor\n", "B=R1/(R1+Rf) #Gain of the feedback circuit\n", "Af=-A*K/(1+A*B) #Closed-loop voltage gain\n", "vo=Af*vin #output voltage\n", "\n", "x=np.arange(0,4*math.pi,0.1)\n", "y=-5*np.sin(x)\n", "plt.plot(x,y)\n", "plt.ylabel('vo')\n", "plt.xlabel('t')\n", "plt.title(r'$output voltage$')\n", "plt.show()\n", "#Result\n", "print \"Output voltage is\",round(vo),\"V peak to peak\"" ] }, { "cell_type": "markdown", "metadata": { "collapsed": true }, "source": [ "## Example 3.5_a & 3.5_b" ] }, { "cell_type": "code", "execution_count": 4, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Voltage gain is -10.0\n", "Input resistance of inverting amplifier is 1.0 kilo ohms\n", "Input resistance of noninverting amplifier is 11.0 kilo ohms\n", "Output voktage is 3.0 V peak to peak at 100 Hz\n" ] } ], "source": [ "#Example 3.5_a & 3.5_b\n", "#For the circuit of figure 3_14,R1=R2=1 kilo ohm and the opamp is 741 IC.\n", "#a) What are the gain and input resistance of the amplifier?\n", "#b) Calculate output voltage vo if vx=2.7 V pp and vy=3 V pp sine waves at 100 Hz\n", "\n", "\n", "\n", "from __future__ import division #to perform decimal division\n", "\n", "#Variable declaration\n", "R1=1000 #Resistance in ohms\n", "R2=1000 #Resistance in ohms\n", "Rf=10*10**3 #Feedback Resistance in Ohms\n", "R3=10*10**3\n", "vx=2.7 #input voltage in Volts\n", "vy=3 #input voltage in Volts\n", "\n", "\n", "#calculation\n", "#part a\n", "AD=-Rf/R1 #voltage gain\n", "RiFx=R1 #Input resistance of inverting amplifier\n", "RiFy=R2+R3 #Input resistance of noninverting amplifier\n", "#part b\n", "vxy=vx-vy\n", "vo=AD*vxy #output volatage\n", "\n", "#Result\n", "print \"Voltage gain is\",AD\n", "print \"Input resistance of inverting amplifier is\",RiFx/10**3,\"kilo ohms\"\n", "print \"Input resistance of noninverting amplifier is\",round(RiFy/10**3),\"kilo ohms\"\n", "print \"Output voktage is\",vo,\"V peak to peak at 100 Hz\"\n" ] }, { "cell_type": "markdown", "metadata": { "collapsed": true }, "source": [ "## Example 3.6_a & 3.6_b" ] }, { "cell_type": "code", "execution_count": 5, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Voltage gain is 11.0\n", "Input resistance of first stage amplifier is 364.0 Giga ohms\n", "Input resistance of second stage amplifier is 36.4 Giga ohms\n", "Output voLtage is 5.5 V peak to peak at 1 KHz\n" ] } ], "source": [ "#Example 3.6_a & 3.6_b\n", "#For the differential amplifier of figure 3_16, R1=R3=680 ohm, Rf=R2=6.8 Kilo ohm\n", "#vx=-1.5 V pp, vy=-2 V pp sine waves at 1 KHz and the opamp is 741 IC.\n", "#a) What are the gain and input resistance of the amplifier?\n", "#b) Calculate output voltage of the amplifier.(Assume vooT=0V)\n", "\n", "\n", "\n", "from __future__ import division #to perform decimal division\n", "\n", "#Variable declaration\n", "R1=680 #Resistance in ohms\n", "R2=6800 #Resistance in ohms\n", "Rf=6800 #Feedback Resistance in Ohms\n", "R3=680\n", "Ri=2*10**6 #Open loop input resistance of the opamp\n", "vx=-1.5 #input voltage in Volts\n", "vy=-2 #input voltage in Volts\n", "A=200000 #openloop gain\n", "\n", "\n", "#calculation\n", "#part a\n", "AD=1+Rf/R1 #voltage gain\n", "B=R2/(R2+R3)\n", "RiFy=Ri*(1+A*B) #Input resistance of first stage amplifier\n", "B=R1/(R1+Rf)\n", "RiFx=Ri*(1+A*B) #Input resistance of second stage amplifier\n", "#part b\n", "vxy=vx-vy\n", "vo=AD*vxy #output volatage\n", "\n", "#Result\n", "print \"Voltage gain is\",AD\n", "print \"Input resistance of first stage amplifier is\",round(RiFy/10**9),\"Giga ohms\"\n", "print \"Input resistance of second stage amplifier is\",round(RiFx/10**9,1),\"Giga ohms\"\n", "print \"Output voLtage is\",vo,\"V peak to peak at 1 KHz\"\n" ] } ], "metadata": { "kernelspec": { "display_name": "Python 2", "language": "python", "name": "python2" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 2 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython2", "version": "2.7.6" } }, "nbformat": 4, "nbformat_minor": 0 }