{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Chapter 12 - Waveshaping and Waveform Generation" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 12_1 Page No. 370" ] }, { "cell_type": "code", "execution_count": 1, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "VEE= 15.00 volts\n", "VCC= 15.00 volts\n", "VHI= 5.00 volts\n", "VLO= -5.00 volts\n", "IZmin= 0.00 A\n", "SR= 500000.00 volts/seconds\n", "RB= 100.00 ohm\n", "RA= 10000.00 ohm\n", "A = 5000.00\n", "VREF= 1.00 volts\n", "part(i)\n", "RD=(VCC-Vo)/IZmin= 10000.00 ohm\n", "part(ii)\n", "t=(VHI-VLO)/SR= 2.00e-05 seconds\n", "tp=(VHI-VLO)/SR= 2.00e-04 seconds\n", "fmax=1/(2*tp) = 2500.00 Hz\n", "part(iii)\n", "B=RB/(RA+RB)= 0.01\n", "VLTP=(VLO*B)+[VREF*(RA/(RA+RB))]= 0.94 volts\n", "VUTP=(VHI*B)+[VREF*(RA/(RA+RB))]= 1.04 volts\n", "VH=VUTP-VLTP= 0.10 volts\n" ] } ], "source": [ "from __future__ import division \n", "VEE=15\n", "print \"VEE= %0.2f\"%(VEE),\" volts\" # voltage supply \n", "VCC=15\n", "print \"VCC= %0.2f\"%(VCC),\" volts\" # voltage supply\n", "VHI=+5\n", "print \"VHI= %0.2f\"%(VHI),\" volts\" # output voltage upper limit\n", "VLO=-5\n", "print \"VLO= %0.2f\"%(VLO),\" volts\" # output voltage Lower limit\n", "Vo=-VLO\n", "IZmin=1*10**(-3)\n", "print \"IZmin= %0.2f\"%(IZmin),\" A\" # Zener diode current rating\n", "SR=0.5*10**(6)\n", "print \"SR= %0.2f\"%(SR),\" volts/seconds\"#Slew rate\n", "RB=100\n", "print \"RB= %0.2f\"%(RB)+ \" ohm\" # resistance\n", "RA=10*10**(3) \n", "print \"RA= %0.2f\"%(RA)+ \" ohm\" # resistance\n", "A = 5000\n", "print \"A = %0.2f\"%(A)#op-amp gain\n", "VREF=1\n", "print \"VREF= %0.2f\"%(VREF),\" volts\" # Reference- voltage \n", "print \"part(i)\"\n", "RD=(VCC-Vo)/IZmin\n", "print \"RD=(VCC-Vo)/IZmin= %0.2f\"%(RD)+ \" ohm\" # Series dropping-resistance\n", "\n", "print \"part(ii)\"\n", "t=(VHI-VLO)/SR\n", "print \"t=(VHI-VLO)/SR= %0.2e\"%(t),\" seconds\"# Time required to swing the output\n", "tp=10*t\n", "print \"tp=(VHI-VLO)/SR= %0.2e\"%(tp),\" seconds\"# Pulse width\n", "fmax=1/(2*tp) \n", "print \"fmax=1/(2*tp) = %0.2f\"%(fmax),\" Hz\"# Maximum frequency of operation of OP-AMP comparator\n", "print \"part(iii)\"\n", "B=RB/(RA+RB)\n", "print \"B=RB/(RA+RB)= %0.2f\"%(B)#Feedback factor\n", "VLTP=(VLO*B)+(VREF*(RA/(RA+RB)))\n", "print \"VLTP=(VLO*B)+[VREF*(RA/(RA+RB))]= %0.2f\"%(VLTP),\" volts\" # Lower trigger point\n", "VUTP=(VHI*B)+(VREF*(RA/(RA+RB)))\n", "print \"VUTP=(VHI*B)+[VREF*(RA/(RA+RB))]= %0.2f\"%(VUTP),\" volts\" # Upper trigger point\n", "VH=VUTP-VLTP\n", "print \"VH=VUTP-VLTP= %0.2f\"%(VH),\" volts\" # Hysteresis voltage " ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 12_2 Page No. 372" ] }, { "cell_type": "code", "execution_count": 4, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Vo= 14.00 volts\n", "f = 500.00 Hz\n", "IB2= 5.00e-07 A\n", "B=0.50\n", "vf=B*Vo= +7.00 , -7.00 volts\n", "IR=100*IB2= 5.00e-05 A\n", "RB=vf/IR= 140000.00 ohm\n", "RA=RB*((1/B)-1)= 140000.00 ohm\n", "RF= 100000.00 ohm\n", "C1=1/[2*RF*f*log(1+(2*RB/RA))]= 9.10e-09 farad\n" ] } ], "source": [ "from math import log\n", "from __future__ import division \n", "Vo=14\n", "print \"Vo= %0.2f\"%(Vo),\" volts\" # output voltage\n", "f=500 \n", "print \"f = %0.2f\"%(f),\" Hz\"#frequency\n", "IB2=500*10**(-9)\n", "print \"IB2= %0.2e\"%(IB2),\" A\" #base- Current\n", "B=0.5\n", "print \"B=%0.2f\"%(B)#Feedback factor\n", "vf=B*Vo\n", "print \"vf=B*Vo= +%0.2f\"%(vf),\", -%0.2f\"%(vf),\" volts\" # Feedback voltage\n", "IR=100*IB2# Taking IR as 100 times that of IB2\n", "print \"IR=100*IB2= %0.2e\"%(IR),\" A\" # Current in RB resistor\n", "RB=vf/IR\n", "print \"RB=vf/IR= %0.2f\"%(RB)+ \" ohm\" # resistance\n", "RA=RB*((1/B)-1)# Using formulae B=RA/(RA+RB)\n", "print \"RA=RB*((1/B)-1)= %0.2f\"%(RA)+ \" ohm\" # resistance\n", "RF=100*10**(3)#Choosing RF=100k\n", "print \"RF= %0.2f\"%(RF)+ \" ohm\" #Feedback resistance\n", "C1=1/(2*RF*f*log(1+(2*RB/RA)))\n", "print \"C1=1/[2*RF*f*log(1+(2*RB/RA))]= %0.2e\"%(C1),\" farad\" # calculated capacitance value" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 12_3 Page No. 373" ] }, { "cell_type": "code", "execution_count": 1, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Vo= 14.00 volts\n", "f = 500.00 Hz\n", "R2= 10000.00 ohm\n", "VTW= 14.00 volts\n", "C2=(Vo*T)/(2*VTW*R2)= 1.00e-07 farad\n" ] } ], "source": [ "from __future__ import division \n", "Vo=14\n", "print \"Vo= %0.2f\"%(Vo),\" volts\" # output voltage\n", "f=500 \n", "print \"f = %0.2f\"%(f),\" Hz\"#frequency\n", "R2=10*10**(3)\n", "print \"R2= %0.2f\"%(R2)+ \" ohm\" # resistance\n", "VTW=14\n", "print \"VTW= %0.2f\"%(VTW),\" volts\" # Triangular peak-peak output voltage\n", "T=1/f\n", "C2=(Vo*T)/(2*VTW*R2)\n", "print \"C2=(Vo*T)/(2*VTW*R2)= %0.2e\"%(C2),\" farad\" # calculated capacitance value for deriving triangular wave from square wave astable multivibrator" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 12_4 Page No. 374" ] }, { "cell_type": "code", "execution_count": 2, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "VI= -15.00 volts\n", "TSW= 2.00e-03 seconds\n", "R= 10000.00 ohm\n", "C= 5.00e-07 farad\n", "Sweep rate=VI/(R*C)=3000.00 V/s\n", "VSW=TSW*S= 6.00 volts\n" ] } ], "source": [ "from __future__ import division \n", "VI=-15\n", "print \"VI= %0.2f\"%(VI),\" volts\" # Input voltage\n", "TSW=2*10**(-3)\n", "print \"TSW= %0.2e\"%(TSW),\" seconds\"# triangular wave Sweep time\n", "R=10*10**(3)\n", "print \"R= %0.2f\"%(R)+ \" ohm\" # resistance as ckt. parameter\n", "C=0.5*10**(-6)\n", "print \"C= %0.2e\"%(C),\" farad\" # capacitance as ckt. parameter\n", "S=-VI/(R*C)\n", "print \"Sweep rate=VI/(R*C)=%0.2f\"%(S)+ \" V/s\" # Sweep rate for sweep generator\n", "VSW=TSW*S\n", "print \"VSW=TSW*S= %0.2f\"%(VSW),\" volts\" # Sweep voltage amplitude\n", "\n", "\n", "# note in book author has not provided any variable for sweep rate ... but here I have used 'S' for it ." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 12_5 Page No. 375" ] }, { "cell_type": "code", "execution_count": 3, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "VEE= 15.00 volts\n", "VCC= 15.00 volts\n", "R1= 10000.00 ohm\n", "RF= 20000.00 ohm\n", "R1= 10000.00 ohm\n", "RF1= 1000.00 ohm\n", "Av= 1000.00\n", "part(i)\n", "VBR1=VBR2=(VCC*RF1)/RB1= 5.00 volts\n", "So=-RF/R1= -2.00\n", "S1=S2=-RF1/R1= -0.10\n", "VSL=VSU=(-VBR1/So)= 2.50 volts\n", "part(ii)\n", "VSU=VSL=(VBR2/Av)= -0.01 , +0.01 volts\n" ] } ], "source": [ "from __future__ import division \n", "VEE=15\n", "print \"VEE= %0.2f\"%(VEE),\" volts\" # voltage supply \n", "VCC=15\n", "print \"VCC= %0.2f\"%(VCC),\" volts\" # voltage supply\n", "R1=10*10**(3)\n", "print \"R1= %0.2f\"%(R1)+ \" ohm\" # resistance\n", "RF=20*10**(3) \n", "print \"RF= %0.2f\"%(RF)+ \" ohm\" # Feedback resistance\n", "RB1=3*10**(3)\n", "print \"R1= %0.2f\"%(R1)+ \" ohm\" # resistance\n", "RB2=RB1\n", "RF1=1*10**(3) \n", "print \"RF1= %0.2f\"%(RF1)+ \" ohm\" # Feedback resistance\n", "RF2=RF1\n", "Av=1*10**(3)\n", "print \"Av= %0.2f\"%(Av) \n", "print \"part(i)\"\n", "VBR1= (VCC*RF1)/RB1\n", "VBR2 = VBR1\n", "print \"VBR1=VBR2=(VCC*RF1)/RB1= %0.2f\"%(VBR1),\" volts\" #Limit values at the break points and VBR=VBR1=VBR2\n", "So=-RF/R1\n", "print \"So=-RF/R1= %0.2f\"%(So) # slope of Transfer characteristic at zero crossings \n", "S1=-(RF1/R1)\n", "print \"S1=S2=-RF1/R1= %0.2f\"%(S1)# slope of Transfer characteristic at the extreme ends\n", "VSL=(-VBR1/So)\n", "print \"VSL=VSU=(-VBR1/So)= %0.2f\"%(VSL),\" volts\" # magnitude of input voltage required to produce vo=VBR\n", "VSU=VSL\n", "print \"part(ii)\"\n", "VSU=(VBR2/Av)#Formulae\n", "print \"VSU=VSL=(VBR2/Av)= -%0.2f\"%(VSU),\", +%0.2f\"%(VSU),\" volts\" # magnitude of input voltage required to produce vo=VBR in case gain Av is very large" ] } ], "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.9" } }, "nbformat": 4, "nbformat_minor": 0 }