diff options
author | Trupti Kini | 2016-03-11 23:30:11 +0600 |
---|---|---|
committer | Trupti Kini | 2016-03-11 23:30:11 +0600 |
commit | dbec910485355b63438dd664ed8d808ea623fe23 (patch) | |
tree | 07d97d32fa3bb02393260d0ea562ffcd4ec015fb /Linear_Integrated_Circuit_by_M._S._Sivakumar | |
parent | 24dd1367c5c963b5ec424c7437e809c31186ad44 (diff) | |
download | Python-Textbook-Companions-dbec910485355b63438dd664ed8d808ea623fe23.tar.gz Python-Textbook-Companions-dbec910485355b63438dd664ed8d808ea623fe23.tar.bz2 Python-Textbook-Companions-dbec910485355b63438dd664ed8d808ea623fe23.zip |
Added(A)/Deleted(D) following books
A College_Physics_(volume_2)_by_R._A._Serway_and_J._S._Faughn/Ch15.ipynb
A College_Physics_(volume_2)_by_R._A._Serway_and_J._S._Faughn/Ch16.ipynb
A College_Physics_(volume_2)_by_R._A._Serway_and_J._S._Faughn/Ch17.ipynb
A College_Physics_(volume_2)_by_R._A._Serway_and_J._S._Faughn/Ch18.ipynb
A College_Physics_(volume_2)_by_R._A._Serway_and_J._S._Faughn/Ch19.ipynb
A College_Physics_(volume_2)_by_R._A._Serway_and_J._S._Faughn/Ch20.ipynb
A College_Physics_(volume_2)_by_R._A._Serway_and_J._S._Faughn/Ch21.ipynb
A College_Physics_(volume_2)_by_R._A._Serway_and_J._S._Faughn/Ch22.ipynb
A College_Physics_(volume_2)_by_R._A._Serway_and_J._S._Faughn/Ch23.ipynb
A College_Physics_(volume_2)_by_R._A._Serway_and_J._S._Faughn/Ch24.ipynb
A College_Physics_(volume_2)_by_R._A._Serway_and_J._S._Faughn/Ch25.ipynb
A College_Physics_(volume_2)_by_R._A._Serway_and_J._S._Faughn/Ch26.ipynb
A College_Physics_(volume_2)_by_R._A._Serway_and_J._S._Faughn/Ch27.ipynb
A College_Physics_(volume_2)_by_R._A._Serway_and_J._S._Faughn/Ch28.ipynb
A College_Physics_(volume_2)_by_R._A._Serway_and_J._S._Faughn/Ch29.ipynb
A College_Physics_(volume_2)_by_R._A._Serway_and_J._S._Faughn/Ch30.ipynb
A College_Physics_(volume_2)_by_R._A._Serway_and_J._S._Faughn/screenshots/1RefractionOfLaserLight.png
A College_Physics_(volume_2)_by_R._A._Serway_and_J._S._Faughn/screenshots/2PropertiesOfImage.png
A College_Physics_(volume_2)_by_R._A._Serway_and_J._S._Faughn/screenshots/3PositionOf1DarkFringe.png
A Introductory_Methods_Of_Numerical_Analysis__by_S._S._Sastry/Chapter9_7.ipynb
A Introductory_Methods_Of_Numerical_Analysis__by_S._S._Sastry/chapter1_7.ipynb
A Introductory_Methods_Of_Numerical_Analysis__by_S._S._Sastry/chapter2_7.ipynb
A Introductory_Methods_Of_Numerical_Analysis__by_S._S._Sastry/chapter3_7.ipynb
A Introductory_Methods_Of_Numerical_Analysis__by_S._S._Sastry/chapter4_7.ipynb
A Introductory_Methods_Of_Numerical_Analysis__by_S._S._Sastry/chapter6_7.ipynb
A Introductory_Methods_Of_Numerical_Analysis__by_S._S._Sastry/chapter7_7.ipynb
A Introductory_Methods_Of_Numerical_Analysis__by_S._S._Sastry/chapter8_7.ipynb
A Introductory_Methods_Of_Numerical_Analysis__by_S._S._Sastry/chapter_5_7.ipynb
A Introductory_Methods_Of_Numerical_Analysis__by_S._S._Sastry/screenshots/1.2_2.png
A Introductory_Methods_Of_Numerical_Analysis__by_S._S._Sastry/screenshots/3.7_2.png
A Introductory_Methods_Of_Numerical_Analysis__by_S._S._Sastry/screenshots/6.7_2.png
A Linear_Integrated_Circuit_by_M._S._Sivakumar/Ch11.ipynb
A Linear_Integrated_Circuit_by_M._S._Sivakumar/Ch12.ipynb
A Linear_Integrated_Circuit_by_M._S._Sivakumar/Ch13.ipynb
A Linear_Integrated_Circuit_by_M._S._Sivakumar/Ch14.ipynb
A Linear_Integrated_Circuit_by_M._S._Sivakumar/Ch3.ipynb
A Linear_Integrated_Circuit_by_M._S._Sivakumar/Ch4.ipynb
A Linear_Integrated_Circuit_by_M._S._Sivakumar/Ch5.ipynb
A Linear_Integrated_Circuit_by_M._S._Sivakumar/Ch6.ipynb
A Linear_Integrated_Circuit_by_M._S._Sivakumar/Ch7.ipynb
A Linear_Integrated_Circuit_by_M._S._Sivakumar/Ch8.ipynb
A Linear_Integrated_Circuit_by_M._S._Sivakumar/Ch9.ipynb
A Linear_Integrated_Circuit_by_M._S._Sivakumar/screenshots/BiasingVoltage.png
A Linear_Integrated_Circuit_by_M._S._Sivakumar/screenshots/InOutCrrnt.png
A Linear_Integrated_Circuit_by_M._S._Sivakumar/screenshots/inAndOutCurrnt.png
A principle_of_physics_by_V.K.MEHTA_,_ROHIT_MEHTA_/Chapter10.ipynb
A principle_of_physics_by_V.K.MEHTA_,_ROHIT_MEHTA_/Chapter28.ipynb
A principle_of_physics_by_V.K.MEHTA_,_ROHIT_MEHTA_/Chapter29.ipynb
A principle_of_physics_by_V.K.MEHTA_,_ROHIT_MEHTA_/chapter1.ipynb
A principle_of_physics_by_V.K.MEHTA_,_ROHIT_MEHTA_/chapter11.ipynb
A principle_of_physics_by_V.K.MEHTA_,_ROHIT_MEHTA_/chapter12.ipynb
A principle_of_physics_by_V.K.MEHTA_,_ROHIT_MEHTA_/chapter13.ipynb
A principle_of_physics_by_V.K.MEHTA_,_ROHIT_MEHTA_/chapter14.ipynb
A principle_of_physics_by_V.K.MEHTA_,_ROHIT_MEHTA_/chapter15.ipynb
A principle_of_physics_by_V.K.MEHTA_,_ROHIT_MEHTA_/chapter16.ipynb
A principle_of_physics_by_V.K.MEHTA_,_ROHIT_MEHTA_/chapter17.ipynb
A principle_of_physics_by_V.K.MEHTA_,_ROHIT_MEHTA_/chapter18.ipynb
A principle_of_physics_by_V.K.MEHTA_,_ROHIT_MEHTA_/chapter19.ipynb
A principle_of_physics_by_V.K.MEHTA_,_ROHIT_MEHTA_/chapter2.ipynb
A principle_of_physics_by_V.K.MEHTA_,_ROHIT_MEHTA_/chapter20.ipynb
A principle_of_physics_by_V.K.MEHTA_,_ROHIT_MEHTA_/chapter21.ipynb
A principle_of_physics_by_V.K.MEHTA_,_ROHIT_MEHTA_/chapter22.ipynb
A principle_of_physics_by_V.K.MEHTA_,_ROHIT_MEHTA_/chapter23.ipynb
A principle_of_physics_by_V.K.MEHTA_,_ROHIT_MEHTA_/chapter24.ipynb
A principle_of_physics_by_V.K.MEHTA_,_ROHIT_MEHTA_/chapter25.ipynb
A principle_of_physics_by_V.K.MEHTA_,_ROHIT_MEHTA_/chapter26.ipynb
A principle_of_physics_by_V.K.MEHTA_,_ROHIT_MEHTA_/chapter27.ipynb
A principle_of_physics_by_V.K.MEHTA_,_ROHIT_MEHTA_/chapter3.ipynb
A principle_of_physics_by_V.K.MEHTA_,_ROHIT_MEHTA_/chapter4.ipynb
A principle_of_physics_by_V.K.MEHTA_,_ROHIT_MEHTA_/chapter5.ipynb
A principle_of_physics_by_V.K.MEHTA_,_ROHIT_MEHTA_/chapter6.ipynb
A principle_of_physics_by_V.K.MEHTA_,_ROHIT_MEHTA_/chapter7.ipynb
A principle_of_physics_by_V.K.MEHTA_,_ROHIT_MEHTA_/chapter8.ipynb
A principle_of_physics_by_V.K.MEHTA_,_ROHIT_MEHTA_/chapter9.ipynb
A principle_of_physics_by_V.K.MEHTA_,_ROHIT_MEHTA_/screenshots/image_1.png
A principle_of_physics_by_V.K.MEHTA_,_ROHIT_MEHTA_/screenshots/image_2.png
A principle_of_physics_by_V.K.MEHTA_,_ROHIT_MEHTA_/screenshots/image_3.png
A sample_notebooks/KhushbuPattani/chapter1_1.ipynb
Diffstat (limited to 'Linear_Integrated_Circuit_by_M._S._Sivakumar')
14 files changed, 7715 insertions, 0 deletions
diff --git a/Linear_Integrated_Circuit_by_M._S._Sivakumar/Ch11.ipynb b/Linear_Integrated_Circuit_by_M._S._Sivakumar/Ch11.ipynb new file mode 100644 index 00000000..45094840 --- /dev/null +++ b/Linear_Integrated_Circuit_by_M._S._Sivakumar/Ch11.ipynb @@ -0,0 +1,757 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 11 Digital To Analog Converter(D/A Converter)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 11.1 Pg 313" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "the full scale voltage of D/A converter VFS is = 24.00 V \n" + ] + } + ], + "source": [ + "from __future__ import division\n", + "from math import sqrt, pi\n", + "# to determine the full scale voltage of D/A\n", + "Vref = 12 #\n", + "Rf = 10 # # K ohm\n", + "R = 5 # # K ohm\n", + "\n", + "# the full scale voltage of D/A converter \n", + "VFS = Vref*(Rf/R) #\n", + "print 'the full scale voltage of D/A converter VFS is = %0.2f'%VFS,' V '" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 11.2 Pg 313" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "For BI 10101010 the output of D/A converter is = 2.04 V \n", + "For BI 11001100 the output of D/A converter is = 2.448 V \n", + "For BI 11101110 the output of D/A converter is = 2.856 V \n", + "For BI 00010001 the output of D/A converter is = 0.204 V \n" + ] + } + ], + "source": [ + " # determine the output voltage of D/A converter for the binary inputs a) 10101010 b) 11001100 c) 11101110 d) 00010001 \n", + "Del = 12*10**-3 # # mA\n", + "\n", + "# the input voltage of D/A converter \n", + " #Vo = Del*binary input (BI)\n", + "\n", + "# For BI 10101010 the output\n", + "BI = '10101010' #\n", + "BI = int(BI,2)#\n", + "Vo = Del*BI #\n", + "print 'For BI 10101010 the output of D/A converter is = ',Vo,' V '\n", + "\n", + "# For BI 11001100 the output\n", + "BI = '11001100' #\n", + "BI = int(BI,2)#\n", + "Vo = Del*BI #\n", + "print 'For BI 11001100 the output of D/A converter is = ',Vo,' V '\n", + "\n", + "# For BI 11101110 the output\n", + "BI = '11101110' #\n", + "BI = int(BI,2)#\n", + "Vo = Del*BI #\n", + "print 'For BI 11101110 the output of D/A converter is = ',Vo,' V '\n", + "\n", + "# For BI 00010001 the output\n", + "BI = '00010001' #\n", + "BI = int(BI,2)#\n", + "Vo = Del*BI #\n", + "print 'For BI 00010001 the output of D/A converter is = ',Vo,' V '" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 11.3 Pg 314" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "the resolution of 4-bit D/A converter is = 0.80 V \n" + ] + } + ], + "source": [ + "# determine the resolution of 4-bit D/A converter\n", + "VFS = 12 #\n", + "N = 4 #\n", + "\n", + "# the resolution of 4-bit D/A converter is defined as\n", + "Resolution = VFS/(2**N-1) #\n", + "print 'the resolution of 4-bit D/A converter is = %0.2f'%Resolution,' V '" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 11.4 314" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "the number of bit required to design a 4-bit D/A converter is = 8.97 = 9 \n" + ] + } + ], + "source": [ + "from math import log10\n", + "# determine the number of bit required to design a 4-bit D/A converter\n", + "VFS = 5 #\n", + "Resolution = 10*10**-3 # # A\n", + "\n", + "# the resolution of 4-bit D/A converter is defined as\n", + "# Resolution = VFS/(2**N-1) #\n", + "N = (VFS/Resolution)+1 # \n", + "N = log10(N)/log10(2)#\n", + "print 'the number of bit required to design a 4-bit D/A converter is = %0.2f'%N,' = 9 '" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 11.5 Pg 315" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "for the binary input 101 analog output is = -60.00 V \n", + "for the binary input 111 analog output is = -84.00 V \n", + "for the binary input 011 analog output is = -72.00 V \n", + "for the binary input 001 analog output is = -48.00 V \n", + "for the binary input 100 analog output is = -12.00 V\n" + ] + } + ], + "source": [ + "# determine the analog output voltage\n", + "Vref = 12 # \n", + "BI = 101 # BI = 111 # BI = 011 # BI = 001 # BI = 100 #\n", + "Rf = 40*10**3 #\n", + "R = 0.25*Rf #\n", + "\n", + "# The output voltage of given binary weighted resistor D/A converter is defined as\n", + "\n", + "# Vo = -(Rf*Vref/R)*(2**0*b0+2**-1*b1+2**-2*b2) #\n", + "\n", + "# Vo = -(Rf*Vref/R)*(b0+2**-1*b1+2**-2*b2) #\n", + "\n", + "# for the given value Rf,R and Vref the output voltage\n", + "\n", + "# Vo = -48*(b0+2**-1*b1+2**-2*b2) #\n", + "\n", + "# for the binary input 101 analog output is\n", + "b2 = 1 #\n", + "b1 = 0 #\n", + "b0 = 1 #\n", + "Vo = -48*(b0+2**-1*b1+2**-2*b2) #\n", + "print 'for the binary input 101 analog output is = %0.2f'%Vo,' V '\n", + "\n", + "\n", + "# for the binary input 111 analog output is\n", + "b2 = 1 #\n", + "b1 = 1 #\n", + "b0 = 1 #\n", + "Vo = -48*(b0+2**-1*b1+2**-2*b2) #\n", + "print 'for the binary input 111 analog output is = %0.2f'%Vo,' V '\n", + "\n", + "\n", + "# for the binary input 011 analog output is\n", + "b2 = 0 #\n", + "b1 = 1 #\n", + "b0 = 1 #\n", + "Vo = -48*(b0+2**-1*b1+2**-2*b2) #\n", + "print 'for the binary input 011 analog output is = %0.2f'%Vo,' V '\n", + "\n", + "\n", + "# for the binary input 001 analog output is\n", + "b2 = 0 #\n", + "b1 = 0 #\n", + "b0 = 1 #\n", + "Vo = -48*(b0+2**-1*b1+2**-2*b2) #\n", + "print 'for the binary input 001 analog output is = %0.2f'%Vo,' V '\n", + "\n", + "\n", + "# for the binary input 100 analog output is\n", + "b2 = 1 #\n", + "b1 = 0 #\n", + "b0 = 0 #\n", + "Vo = -48*(b0+2**-1*b1+2**-2*b2) #\n", + "print 'for the binary input 100 analog output is = %0.2f'%Vo,' V'" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 11.6 Pg 316" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "for the binary input 1001 analog output is = -67.50 V \n", + "the feedback current If is = 2.70 mA \n", + "for the binary input 1101 analog output is = -82.50 V \n", + "the feedback current If is = 3.30 mA \n", + "for the binary input 1010 analog output is = -37.50 V \n", + "the feedback current If is = 1.50 mA \n", + "for the binary input 0011 analog output is = -90.00 V \n", + "the feedback current If is = 3.60 mA \n" + ] + } + ], + "source": [ + "# determine the analog output voltage and feed back current If\n", + "Vref = 12 # \n", + "BI = 1001 # BI = 1101 # BI = 1010 # BI = 0011 #\n", + "Rf = 25 # # K ohm\n", + "R = 0.25*Rf #\n", + "\n", + "# The output voltage of given binary weighted resistor D/A converter is defined as\n", + "\n", + "# Vo = -(Rf*Vref/R)*(2**0*b0+2**-1*b1+2**-2*b2+2**-3*b3) #\n", + "\n", + "# Vo = -(Rf*Vref/R)*(b0+2**-1*b1+2**-2*b2+2**-3*b3) #\n", + "\n", + "# for the given value Rf,R and Vref the output voltage\n", + "\n", + "# Vo = -60*(b0+2**-1*b1+2**-2*b2+2**-3*b3) #\n", + "\n", + "# for the binary input 1001 analog output is\n", + "b3 = 1 #\n", + "b2 = 0 #\n", + "b1 = 0 #\n", + "b0 = 1 #\n", + "Vo = -60*(b0+2**-1*b1+2**-2*b2+2**-3*b3) #\n", + "print 'for the binary input 1001 analog output is = %0.2f'%Vo,' V '\n", + "\n", + "# the feedback current If is given by\n", + "If = -(Vo/Rf) #\n", + "print 'the feedback current If is = %0.2f'%If,' mA '\n", + "\n", + "\n", + "# for the binary input 1101 analog output is\n", + "b3 = 1 #\n", + "b2 = 1 #\n", + "b1 = 0 #\n", + "b0 = 1 #\n", + "Vo = -60*(b0+2**-1*b1+2**-2*b2+2**-3*b3) #\n", + "print 'for the binary input 1101 analog output is = %0.2f'%Vo,' V '\n", + "\n", + "# the feedback current If is given by\n", + "If = -(Vo/Rf) #\n", + "print 'the feedback current If is = %0.2f'%If,' mA '\n", + "\n", + "\n", + "# for the binary input 1010 analog output is\n", + "b3 = 1 #\n", + "b2 = 0 #\n", + "b1 = 1 #\n", + "b0 = 0 #\n", + "Vo = -60*(b0+2**-1*b1+2**-2*b2+2**-3*b3) #\n", + "print 'for the binary input 1010 analog output is = %0.2f'%Vo,' V '\n", + "\n", + "# the feedback current If is given by\n", + "If = -(Vo/Rf) #\n", + "print 'the feedback current If is = %0.2f'%If,' mA '\n", + "\n", + "\n", + "# for the binary input 0011 analog output is\n", + "b3 = 0 #\n", + "b2 = 0 #\n", + "b1 = 1 #\n", + "b0 = 1 #\n", + "Vo = -60*(b0+2**-1*b1+2**-2*b2+2**-3*b3) #\n", + "print 'for the binary input 0011 analog output is = %0.2f'%Vo,' V '\n", + "\n", + "# the feedback current If is given by\n", + "If = -(Vo/Rf) #\n", + "print 'the feedback current If is = %0.2f'%If,' mA '" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 11.7 Pg 319" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "for the binary input 001 analog output is = 1.60 mA \n", + "An analog output voltage Vo is = -40.00 V \n", + "for the binary input 010 analog output is = 0.80 mA\n", + "An analog output voltage Vo is = -20.00 V \n", + "for the binary input 110 analog output is = 1.20 mA \n", + "An analog output voltage Vo is = -30.00 V \n" + ] + } + ], + "source": [ + "# determine the feed back current If and analog output voltage\n", + "Vref = 8 # # V\n", + "BI = 001 #\n", + "BI = 010 #\n", + "BI = 110 #\n", + "Rf = 25*10**3 # # Hz\n", + "R = 0.2*Rf #\n", + "\n", + "# The output current of given binary weighted resistor D/A converter is defined as\n", + "\n", + "# If = -(Vref/R)*(2**0*b0+2**-1*b1+2**-2*b2) #\n", + "\n", + "# If = -(Vref/R)*(b0+2**-1*b1+2**-2*b2) #\n", + "\n", + "# for the given value Rf,R and Vref the output current\n", + "\n", + "# If = -(1.6*10**-3)*(b0+2**-1*b1+2**-2*b2) #\n", + "\n", + "# for the binary input 001 the feedback current If is given by\n", + "b2 = 0 #\n", + "b1 = 0 #\n", + "b0 = 1 #\n", + "If = (1.6*10**-3)*(b0+2**-1*b1+2**-2*b2) #\n", + "print 'for the binary input 001 analog output is = %0.2f'%(If*1000),' mA '\n", + "\n", + "# An analog output voltage Vo is\n", + "Vo = -If*Rf #\n", + "print 'An analog output voltage Vo is = %0.2f'%Vo,' V '\n", + "\n", + "\n", + "# for the binary input 010 the feedback current If is given by\n", + "b2 = 0 #\n", + "b1 = 1 #\n", + "b0 = 0 #\n", + "If = (1.6*10**-3)*(b0+2**-1*b1+2**-2*b2) #\n", + "print 'for the binary input 010 analog output is = %0.2f'%(If*1000),' mA'\n", + "\n", + "# the An analog output voltage Vo is\n", + "Vo = -If*Rf #\n", + "print 'An analog output voltage Vo is = %0.2f'%Vo,' V '\n", + "\n", + "\n", + "# for the binary input 110 the feedback current If is given by\n", + "b2 = 1 #\n", + "b1 = 1 #\n", + "b0 = 0 #\n", + "If = (1.6*10**-3)*(b0+2**-1*b1+2**-2*b2) #\n", + "print 'for the binary input 110 analog output is = %0.2f'%(If*1000),' mA '\n", + "\n", + "# the An analog output voltage Vo is\n", + "Vo = -If*Rf #\n", + "print 'An analog output voltage Vo is = %0.2f'%Vo,' V '" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 11.8 Pg 320" + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "for the binary input 101 analog output is = 0.625 mA \n", + "An analog output voltage Vo is = -15.625 V \n", + "for the binary input 011 analog output is = 0.75 mA\n", + "An analog output voltage Vo is = -18.750 V \n", + "for the binary input 100 analog output is = 0.125 mA \n", + "An analog output voltage Vo is = -3.12 V \n", + "for the binary input 001 analog output is = 0.5 mA \n", + "An analog output voltage Vo is = -12.50 V \n" + ] + } + ], + "source": [ + "from __future__ import division\n", + "# determine the feed back current If and analog output voltage\n", + "Vref = 5 # \n", + "BI = 101 # BI = 011 # BI = 100 # BI = 001 #\n", + "Rf = 25*10**3 # \n", + "R = 0.2*Rf #\n", + "\n", + "# The output current of given R-2R ladder D/A converter is defined as\n", + "\n", + "# If = -(Vref/2*R)*(2**0*b0+2**-1*b1+2**-2*b2) #\n", + "\n", + "# If = -(Vref/2*R)*(b0+2**-1*b1+2**-2*b2) #\n", + "\n", + "# for the given value Rf,R and Vref the output current\n", + "\n", + "# If = (0.5*10**-3)*(b0+2**-1*b1+2**-2*b2) #\n", + "\n", + "# for the binary input 101 the feedback current If is given by\n", + "b2 = 1 #\n", + "b1 = 0 #\n", + "b0 = 1 #\n", + "If = (0.5*10**-3)*(b0+2**-1*b1+2**-2*b2) #\n", + "print 'for the binary input 101 analog output is = %0.3f'%(If*1e3),' mA '\n", + "\n", + "# An analog output voltage Vo is\n", + "Vo = -If*Rf #\n", + "print 'An analog output voltage Vo is = %0.3f'%Vo,' V '\n", + "\n", + "\n", + "# for the binary input 011 the feedback current If is given by\n", + "b2 = 0 #\n", + "b1 = 1 #\n", + "b0 = 1 #\n", + "If = (0.5*10**-3)*(b0+2**-1*b1+2**-2*b2) #\n", + "print 'for the binary input 011 analog output is = %0.2f'%(If*1e3),' mA'\n", + "\n", + "# the An analog output voltage Vo is\n", + "Vo = -If*Rf #\n", + "print 'An analog output voltage Vo is = %0.3f'%Vo,' V '\n", + "\n", + "\n", + "# for the binary input 100 the feedback current If is given by\n", + "b2 = 1 #\n", + "b1 = 0 #\n", + "b0 = 0 #\n", + "If = (0.5*10**-3)*(b0+2**-1*b1+2**-2*b2) #\n", + "print 'for the binary input 100 analog output is = %0.3f'%(If*1e3),'mA '\n", + "\n", + "# the An analog output voltage Vo is\n", + "Vo = -If*Rf #\n", + "print 'An analog output voltage Vo is = %0.2f'%Vo,' V '\n", + "\n", + "# for the binary input 001 the feedback current If is given by\n", + "b2 = 0 #\n", + "b1 = 0 #\n", + "b0 = 1 #\n", + "If = (0.5*10**-3)*(b0+2**-1*b1+2**-2*b2) #\n", + "print 'for the binary input 001 analog output is = %0.1f'%(If*1e3),' mA '\n", + "\n", + "# the An analog output voltage Vo is\n", + "Vo = -If*Rf #\n", + "print 'An analog output voltage Vo is = %0.2f'%Vo,' V '" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 11.9 Pg 322" + ] + }, + { + "cell_type": "code", + "execution_count": 15, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "for the binary input 1001 analog output is = -14.0625 V \n", + "the feedback current If is = 0.28 mA \n", + "for the binary input 1100 analog output is = -4.6875 V \n", + "the feedback current If is = 0.09 mA \n", + "for the binary input 1010 analog output is = -7.8125 V \n", + "the feedback current If is = 0.16 mA \n", + "for the binary input 0011 analog output is = -18.75 V \n", + "the feedback current If is = 0.375 mA \n" + ] + } + ], + "source": [ + " # determine the analog output voltage and feed back current If\n", + "Vref = 10 # \n", + "BI = 1001 # BI = 1100 # BI = 1010 # BI = 0011 #\n", + "Rf = 50 # # K ohm\n", + "R = 0.4*Rf #\n", + "\n", + "# The output voltage of given R-2R ladder D/A converter is defined as\n", + "\n", + "# Vo = -(Rf*Vref/2R)*(2**0*b0+2**-1*b1+2**-2*b2+2**-3*b3) #\n", + "\n", + "# Vo = -(Rf*Vref/2R)*(b0+2**-1*b1+2**-2*b2+2**-3*b3) #\n", + "\n", + "# for the given value Rf,R and Vref the output voltage\n", + "\n", + "# Vo = -12.5*(b0+2**-1*b1+2**-2*b2+2**-3*b3) #\n", + "\n", + "# for the binary input 1001 analog output is\n", + "b3 = 1 #\n", + "b2 = 0 #\n", + "b1 = 0 #\n", + "b0 = 1 #\n", + "Vo = -12.5*(b0+2**-1*b1+2**-2*b2+2**-3*b3) #\n", + "print 'for the binary input 1001 analog output is = %0.4f'%Vo,' V '\n", + "\n", + "# the feedback current If is given by\n", + "If = -(Vo/Rf) #\n", + "print 'the feedback current If is = %0.2f'%If,' mA '\n", + "\n", + "\n", + "# for the binary input 1100 analog output is\n", + "b3 = 1 #\n", + "b2 = 1 #\n", + "b1 = 0 #\n", + "b0 = 0 #\n", + "Vo = -12.5*(b0+2**-1*b1+2**-2*b2+2**-3*b3) #\n", + "print 'for the binary input 1100 analog output is = %0.4f'%Vo,' V '\n", + "\n", + "# the feedback current If is given by\n", + "If = -(Vo/Rf) #\n", + "print 'the feedback current If is = %0.2f'%If,' mA '\n", + "\n", + "\n", + "# for the binary input 1010 analog output is\n", + "b3 = 1 #\n", + "b2 = 0 #\n", + "b1 = 1 #\n", + "b0 = 0 #\n", + "Vo = -12.5*(b0+2**-1*b1+2**-2*b2+2**-3*b3) #\n", + "print 'for the binary input 1010 analog output is = %0.4f'%Vo,' V '\n", + "\n", + "# the feedback current If is given by\n", + "If = -(Vo/Rf) #\n", + "print 'the feedback current If is = %0.2f'%If,' mA '\n", + "\n", + "\n", + "# for the binary input 0011 analog output is\n", + "b3 = 0 #\n", + "b2 = 0 #\n", + "b1 = 1 #\n", + "b0 = 1 #\n", + "Vo = -12.5*(b0+2**-1*b1+2**-2*b2+2**-3*b3) #\n", + "print 'for the binary input 0011 analog output is = %0.2f'%Vo,' V '\n", + "\n", + "# the feedback current If is given by\n", + "If = -(Vo/Rf) #\n", + "print 'the feedback current If is = %0.3f'%If,' mA '" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 11.10 Pg 324" + ] + }, + { + "cell_type": "code", + "execution_count": 17, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "for the binary input 1000 output voltage is = 18.75 V \n", + "the feedback current If is = -0.469 mA \n" + ] + } + ], + "source": [ + " # determine the analog output voltage and feed back current If\n", + "Vref = 15 # \n", + "BI = 1000 #\n", + "Rf = 40 # # K ohm\n", + "R = 0.4*Rf #\n", + "\n", + "# by using voltage divider rule Vin can be calculated as\n", + "Vin = -(Vref*2*R)/(2*R+2*R) #\n", + " \n", + "# The output voltage of given R-2R ladder D/A converter is defined as\n", + "\n", + "# Vo = -(Rf*Vin/R)\n", + "\n", + "Vo = (Vref*Rf)/(2*R)\n", + "print 'for the binary input 1000 output voltage is = %0.2f'%Vo,' V '\n", + "\n", + "# the feedback current If is given by\n", + "If = -(Vo/Rf) #\n", + "print 'the feedback current If is = %0.3f'%If,' mA '" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 11.11 Pg 326" + ] + }, + { + "cell_type": "code", + "execution_count": 20, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "For the BI 10101111 output analog voltage is = 6.86 V \n", + "For the BI 11100010 output analog voltage is = 8.8627 V \n", + "For the BI 00101001 output analog voltage is = 1.6078 V \n", + "For the BI 01000110 output analog voltage is = 2.745 V \n" + ] + } + ], + "source": [ + "# to find the resolution and analog output voltage of 8-bit D/A converter\n", + "VFS = 10 #\n", + "N = 8 #\n", + "BI = 10101111 #\n", + "BI = 11100011 # \n", + "BI = 00101001 #\n", + "BI = 01000110\n", + "\n", + "# the resolution of 8-bit D/A converter is defined as\n", + "Resolution = VFS/(2**N-1) #\n", + "\n", + "# An analog output voltage of D/A converter is given by\n", + "# Vo = Resolution*(2**-0*b0+2**-1*b1+....+2**-N*bn-1)\n", + "# Vo = Resolution*(2**-0*b0+2**-1*b1+2**-2*b2+2**-3*b3+2**-4*b4+2**-5*b5+2**-6*b6+2**-7*b7)#\n", + "\n", + "# For the BI 10101111 output analog voltage is\n", + "BI = '10101111'#\n", + "BI = int(BI,2)#\n", + "Vo = Resolution*BI #\n", + "print 'For the BI 10101111 output analog voltage is = %0.2f'%Vo,' V '\n", + "\n", + "# For the BI 11100010 output analog voltage is\n", + "BI = '11100010'#\n", + "BI = int(BI,2)#\n", + "Vo = Resolution*BI #\n", + "print 'For the BI 11100010 output analog voltage is = %0.4f'%Vo,' V '\n", + "\n", + "# For the BI 00101001 output analog voltage is\n", + "BI = '00101001'#\n", + "BI = int(BI,2)#\n", + "Vo = Resolution*BI #\n", + "print 'For the BI 00101001 output analog voltage is = %0.4f'%Vo,' V '\n", + "\n", + "# For the BI 01000110 output analog voltage is\n", + "BI = '01000110'#\n", + "BI = int(BI,2)#\n", + "Vo = Resolution*BI #\n", + "print 'For the BI 01000110 output analog voltage is = %0.3f'%Vo,' V '" + ] + } + ], + "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 +} diff --git a/Linear_Integrated_Circuit_by_M._S._Sivakumar/Ch12.ipynb b/Linear_Integrated_Circuit_by_M._S._Sivakumar/Ch12.ipynb new file mode 100644 index 00000000..c39c8ba5 --- /dev/null +++ b/Linear_Integrated_Circuit_by_M._S._Sivakumar/Ch12.ipynb @@ -0,0 +1,229 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 12 Analog To Digital Converter(A/D Converter)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 12.2 Pg 350" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Normalized step size of A/D converter is = 0.00390625\n", + "Actual step size of A/D converter is = 0.046875\n", + "Normalized maximum quantization level of A/D converter is = 0.9961\n", + "Actual maximum quantization level of A/D converter is = 11.9531\n", + "Normalized peak quantization error of A/D converter is = 0.001953\n", + "Actual peak quantization error of A/D converter is = 0.023438 V \n", + "Percentage of quantization error of A/D converter is = 0.1953\n" + ] + } + ], + "source": [ + "from __future__ import division\n", + "# Determine the following parameter of 8-bit A/D converter a) Normalized step size b) Actual step size c) Normalized maximum quantization level d) Actual maximum quantization e) Normalized peak quantization error f) Actual peak quantization error g) Percentage of quantization error\n", + "N = 8 #\n", + "Vin = 12 #\n", + "\n", + "#a) Normalized step size of A/D converter\n", + "Ns = 2**-N #\n", + "print 'Normalized step size of A/D converter is = %0.8f'%Ns\n", + "\n", + "# b) Actual step size of A/D converter\n", + "As = Vin*Ns #\n", + "print 'Actual step size of A/D converter is = %0.6f'%As\n", + "\n", + "# c) Normalized maximum quantization level of A/D converter\n", + "Qmax = 1-2**-N #\n", + "print 'Normalized maximum quantization level of A/D converter is = %0.4f'%Qmax\n", + "\n", + "# d) Actual maximum quantization level of A/D converter\n", + "QAmax = Qmax*Vin #\n", + "print 'Actual maximum quantization level of A/D converter is = %0.4f'%QAmax\n", + "\n", + "# e) Normalized peak quantization error of A/D converter\n", + "Qp = 2**-(N+1)#\n", + "print 'Normalized peak quantization error of A/D converter is = %0.6f'%Qp\n", + "\n", + "# f) Actual peak quantization error of A/D converter\n", + "Qe = Qp*Vin #\n", + "print 'Actual peak quantization error of A/D converter is = %0.6f'%Qe,' V '#\n", + "\n", + "# g) Percentage of quantization error of A/D converter\n", + "per_Qp = 2**-(N+1)*100 #\n", + "print 'Percentage of quantization error of A/D converter is = %0.4f'%per_Qp" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 12.3 Pg 351" + ] + }, + { + "cell_type": "code", + "execution_count": 12, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "charging time of capacitor is = 128.00 u sec\n", + "the integrator output is = -5.44 V\n", + "the decimal output of a dual slope A/D converter is = 217.60 = 218\n", + "The binary output of a dual slope A/D converter is = 11011010\n" + ] + } + ], + "source": [ + "# to determine the binary output of the 8-bit dual slope A/D converter\n", + "Vin = 8.5 #\n", + "VR = 10 #\n", + "f = 2 # #MHz\n", + "N = 8 #\n", + "C = 0.1*10**-6 #\n", + "R = 2*10**3 #\n", + "\n", + "# the output of integrator is defined as \n", + "# Viao(T1) = -(Vin/R*C)*T1 #\n", + "\n", + "# charging time of capacitor \n", + "T1 = 2**N/f #\n", + "print 'charging time of capacitor is = %0.2f'%T1,' u sec'\n", + "\n", + "# the integrator output\n", + "T1 = T1*10**-6 #\n", + "Viao =-(Vin/(R*C))*T1#\n", + "print 'the integrator output is = %0.2f'%Viao,' V'\n", + "\n", + "# the binary output of a dual slope A/D converter\n", + "Bn = (2**N*Vin)/VR#\n", + "print 'the decimal output of a dual slope A/D converter is = %0.2f'%Bn,' = 218'#\n", + "\n", + "Bn=218#\n", + "Bn = bin(Bn) #\n", + "print 'The binary output of a dual slope A/D converter is =',Bn[2:]" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 12.4 Pg 352" + ] + }, + { + "cell_type": "code", + "execution_count": 16, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Resolution of an A/D converter is = 0.0037 V \n" + ] + } + ], + "source": [ + " # to determine the resolution of 12-bit A/D converter\n", + "N =12 #\n", + "Vin = 15 #\n", + "\n", + "# Resolution of an A/D converter\n", + "Resolution = Vin/(2**N-1)#\n", + "print 'Resolution of an A/D converter is = %0.4f'%Resolution,' V '\n", + "#" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 12.5 Pg 352" + ] + }, + { + "cell_type": "code", + "execution_count": 14, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "The output time of a V/T converter is = 0.15 msec\n", + "The duty cycle of V?T converter is = 2.00\n", + "The output voltage of an integrator is is = -0.75 V\n" + ] + } + ], + "source": [ + "# to determine the output time and duty cycle of V/T converter\n", + "Vin = 5 #\n", + "C = 0.1*10**-6 # \n", + "R = 10*10**3 #\n", + "C1 = 100*10**-6 #\n", + "\n", + "# The output time of a V/T converter is given as\n", + "T = (7.5*C1)/(Vin) #\n", + "print 'The output time of a V/T converter is =',T*1000,' msec'\n", + "\n", + "TH = 0.075 #\n", + "TL=TH # # we consider\n", + "# The duty cycle of V?T converter\n", + "D = (TL+TH)/(TH) #\n", + "print 'The duty cycle of V?T converter is = %0.2f'%D\n", + "\n", + "# The output voltage of an integrator is define as\n", + "Vio = -(Vin)/(R*C)*T #\n", + "print 'The output voltage of an integrator is is = %0.2f'%Vio,' V'" + ] + } + ], + "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 +} diff --git a/Linear_Integrated_Circuit_by_M._S._Sivakumar/Ch13.ipynb b/Linear_Integrated_Circuit_by_M._S._Sivakumar/Ch13.ipynb new file mode 100644 index 00000000..bf527bf0 --- /dev/null +++ b/Linear_Integrated_Circuit_by_M._S._Sivakumar/Ch13.ipynb @@ -0,0 +1,438 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 13 Waveform Generators" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 13.1 Pg 378" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "the frequency selective element resistor is = 6.50 K ohm \n", + "The feedback resistance is = 188.4 K ohm\n" + ] + } + ], + "source": [ + "from math import sqrt, pi\n", + "from __future__ import division\n", + "# to design RC phase shift oscillator for the oscillation frequency f = 1 KHz\n", + "f =1 # # KHz\n", + "C = 0.01 # # uF\n", + "\n", + "# The oscillation frequency of practical RC phase shift oscillator is defined as\n", + "#w = 1/(sqrt(6)*R*C)#\n", + "\n", + "# gain of practical RC phase shift oscillator is\n", + "#A = R1/R = 29 equation 1\n", + "# the frequency selective element resistor\n", + "#R = 1/(sqrt(6)*w*C)#\n", + "R = 1/(sqrt(6)*2*pi*f*C)#\n", + "print 'the frequency selective element resistor is = %0.2f'%R,' K ohm '\n", + "\n", + "# The feedback resistance\n", + "R1 = 29*R # # from equation 1\n", + "print 'The feedback resistance is = %0.1f'%R1,' K ohm'" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 13.2 Pg 379" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "the oscillator frequency of practical RC phase shift oscillator f is = 0.52 KHz \n" + ] + } + ], + "source": [ + "# to determine the oscillaton frequency of the phase shift oscillator\n", + "C = 0.05 # # uF\n", + "R = 2.5 # # K ohm\n", + "\n", + "# the oscillator frequency of practical RC phase shift oscillator f\n", + "f = 1/(2*pi*(sqrt(6)*(R*C)))#\n", + "print 'the oscillator frequency of practical RC phase shift oscillator f is = %0.2f'%f,' KHz '" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 13.3 Pg 380" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "the oscillator frequency of practical RC phase shift oscillator f is = 6.63 kHz \n" + ] + } + ], + "source": [ + "# to calculate the frequency of a wein bridge oscillator\n", + "C = 2400*10**-12 # # F\n", + "R = 10*10**3 # # ohm\n", + "\n", + "# the oscillator frequency of practical RC phase shift oscillator f\n", + "f = 1/(2*pi*R*C)/1e3#\n", + "print 'the oscillator frequency of practical RC phase shift oscillator f is = %0.2f'%f,' kHz '" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 13.4 Pg 380" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "the resistor R is = 15.9 K ohm \n", + "The resistor R2 value is = 20.00 K ohm \n" + ] + } + ], + "source": [ + "# to design the wien bridge oscillator for the oscillation frequency f = 1 KHz\n", + "f = 1 # # K ohm\n", + "C = 0.01 # # uF\n", + "\n", + "\n", + "# the frequency f is define as\n", + "# f = 1/(2*pi*R*C)#\n", + "\n", + "# the resistor R is\n", + "R = 1/(2*pi*f*C)#\n", + "print 'the resistor R is = %0.1f'%R,' K ohm '\n", + "\n", + "# the loop gain of the wien bridge oscillator is unity which is defined as\n", + "# A = (1+(R2/R1))*(1/3) = 1 #\n", + "# R2/R1 = 2 #\n", + "R1 = 10 # # K ohm we assume\n", + "R2 = 2*R1 #\n", + "print 'The resistor R2 value is = %0.2f'%R2,' K ohm '" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 13.5 Pg 382" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "the frequency of wien bridge oscillator f is = 159.155 Hz \n" + ] + } + ], + "source": [ + "# to calculate the frequency of a wein bridge oscillator\n", + "C = 0.05*10**-6 # # F\n", + "R = 20*10**3 # # ohm\n", + "R1 = 10*10**3 # # ohm\n", + "R2 = 20*10**3 # #ohm\n", + "\n", + "# the frequency of wien bridge oscillator f\n", + "f = 1/(2*pi*R*C)#\n", + "print 'the frequency of wien bridge oscillator f is = %0.3f'%f,' Hz '" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 13.6 Pg 382" + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "The frequency of the astable multivibrator is = 0.87/(C*R)\n" + ] + } + ], + "source": [ + "from sympy import symbols, log, N\n", + "R, C = symbols('R C')\n", + "# Determine the frequency response of the astable multivibrator circuit\n", + "Vsat = 2.5 #\n", + "VT = 0.7 #\n", + "\n", + "# The frequency of the astable multivibrator is\n", + "f = (1/(2*R*C*log((Vsat+VT)/(Vsat-VT))))#\n", + "print 'The frequency of the astable multivibrator is =',N(f,2)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 13.7 Pg 383" + ] + }, + { + "cell_type": "code", + "execution_count": 11, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "The value of resistance R2 is = 32.86 K ohm \n", + "The value of resistor R is = 10.52 K ohm\n" + ] + } + ], + "source": [ + "from math import log\n", + "# Design astable multivibrator for the frequency f = 10 KHz\n", + "f = 10 # # K ohm\n", + "Vsat = 3 #\n", + "VT = 0.7 #\n", + "\n", + "# The saturation voltage of an astable multivibrator is defined as\n", + "# Vsat = (R1+R2/R1)+VT #\n", + "R1 = 10 # # K ohm we choose\n", + "R2 = ((Vsat/VT)-1)*R1 #\n", + "print 'The value of resistance R2 is = %0.2f'%R2,' K ohm '\n", + "\n", + "# The frequency of an astable multivibrator is defined as\n", + "C = 0.01 # # uF\n", + "# f = (1/(2*R*C*log(1+(2*R1/R2))))#\n", + "\n", + "R = 1/(2*f*C*log(1+2*R1/R2))#\n", + "print 'The value of resistor R is = %0.2f'%R,' K ohm'" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 13.8 Pg 384" + ] + }, + { + "cell_type": "code", + "execution_count": 12, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "The value of resistor R is = 200.00 ohm \n" + ] + } + ], + "source": [ + "# to design astable multivibrator \n", + "f = 25*10**3 #\n", + "\n", + "# The output frequency of practical astable multivibrator is defined as\n", + "# f = 1/(2*R*C)#\n", + "C = 0.1*10**-6 # # uF we choose\n", + "R = 1/(2*f*C)#\n", + "print 'The value of resistor R is = %0.2f'%R,'ohm '" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 13.9 Pg 385" + ] + }, + { + "cell_type": "code", + "execution_count": 14, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "The value of resistance R is = 579.7 ohm \n", + "The value of resistance R2 is = 9.94 K ohm \n" + ] + } + ], + "source": [ + "# Design a monostable circuit with frequency f = 25 KHz\n", + "f =25*10**3 # # Hz\n", + "\n", + "# The output frequency of monostable multivibrator is defined as \n", + "# f = 1/(0.69*R*C)#\n", + "C = 0.1*10**-6 #\n", + "R = 1/(0.69*f*C)#\n", + "print 'The value of resistance R is = %0.1f'%R,' ohm '\n", + "\n", + "# In the practical monostable multivibrator\n", + "# ln(1+(R2/R1))= 0.69 #\n", + "R1 = 10*10**3 # # we choose\n", + "R2 = R1*(1.99372-1)#\n", + "print 'The value of resistance R2 is = %0.2f'%(R2/1000),' K ohm ' # Round Off Error " + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 13.10 Pg 386" + ] + }, + { + "cell_type": "code", + "execution_count": 16, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "the output of monostable multivibrator is = 6.01 kHz\n" + ] + } + ], + "source": [ + "# Determine the frequency of the monostable multivibrator\n", + "R1 = 5*10**3 #\n", + "R2 =15*10**3 #\n", + "C = 0.01*10**-6 #\n", + "R = 12*10**3 #\n", + "\n", + "# the output of monostable multivibrator is defined as\n", + "f = 1/(R*C*(log(1+(R2/R1))))/1e3 # kHz\n", + "print 'the output of monostable multivibrator is = %0.2f'%f,' kHz'" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 13.11 Pg 386" + ] + }, + { + "cell_type": "code", + "execution_count": 17, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "the output of monostable multivibrator is = 4.00 KHz\n" + ] + } + ], + "source": [ + " # Determine the frequency of the monostable multivibrator\n", + "R1 = 5*10**3 #\n", + "R2 =15*10**3 #\n", + "C = 0.01 #\n", + "R = 25 #\n", + "\n", + "# the output of monostable multivibrator is defined as\n", + "f = 1/(R*C)#\n", + "print 'the output of monostable multivibrator is = %0.2f'%f,' KHz'" + ] + } + ], + "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 +} diff --git a/Linear_Integrated_Circuit_by_M._S._Sivakumar/Ch14.ipynb b/Linear_Integrated_Circuit_by_M._S._Sivakumar/Ch14.ipynb new file mode 100644 index 00000000..d64bea33 --- /dev/null +++ b/Linear_Integrated_Circuit_by_M._S._Sivakumar/Ch14.ipynb @@ -0,0 +1,636 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 14 Special Function ICs" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 14.1 Pg 415" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "the output voltage of the adjustable voltage regulator is = 22.25 V \n" + ] + } + ], + "source": [ + "from __future__ import division\n", + "\n", + "# to determine the regulated voltage \n", + "R1 = 250 # #ohm \n", + "R2 = 2500 # # ohm \n", + "Vref = 2 # #V #reference voltage\n", + "Iadj = 100*10**-6# # A # adjacent current\n", + "\n", + "#the output voltage of the adjustable voltage regulator is defined by\n", + "Vo = (Vref*((R2/R1)+1)+(Iadj*R2)) #\n", + "print 'the output voltage of the adjustable voltage regulator is = %0.2f'%Vo,' V '" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 14.2 Pg 416" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "the total power dissipation of the IC is = 25.00 mA \n" + ] + } + ], + "source": [ + "# to determine the current drawn from the dual power supply \n", + "V = 10 # # V\n", + "P = 500 # # mW\n", + "\n", + "# we assume that each power supply provides half power supply to IC\n", + "P1 = (P/2)#\n", + "\n", + "# the total power dissipation of the IC\n", + "# P1 = V*I #\n", + "I = P1/V #\n", + "print 'the total power dissipation of the IC is = %0.2f'%I,' mA '" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 14.3 Pg 416" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "the output voltage of the adjustable voltage regulator is = 7.50 V \n" + ] + } + ], + "source": [ + "# to determine the output voltage \n", + "R1 = 100*10**3 # #ohm \n", + "R2 = 500*10**3 # # ohm \n", + "Vref = 1.25 # #V #reference voltage\n", + "\n", + "#the output voltage of the adjustable voltage regulator is defined by\n", + "Vo = Vref*(R1+R2)/R1#\n", + "print 'the output voltage of the adjustable voltage regulator is = %0.2f'%Vo,' V '" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 14.4 Pg 417" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "The output voltage of switching regulator circuit is = 3.50 V \n" + ] + } + ], + "source": [ + "# determine the output voltage of the switching regulator circuit\n", + "d = 0.7 # # duty cycle\n", + "Vin = 5 # # V # input voltage\n", + "\n", + "# The output voltage of switching regulator circuit is given by\n", + "Vo = d*Vin #\n", + "print 'The output voltage of switching regulator circuit is = %0.2f'%Vo,' V '" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 14.5 Pg 417" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "The output voltage of switching regulator circuit is = 0.96 \n" + ] + } + ], + "source": [ + "# determine the duty cycle of the switching regulator circuit\n", + "Vo = 4.8 # # V # output voltage\n", + "Vin = 5 # # V # input voltage\n", + "\n", + "# The output voltage of switching regulator circuit is given by\n", + "# Vo = d*Vin #\n", + "\n", + "# Duty cycle is given as\n", + "d =Vo/Vin #\n", + "print 'The output voltage of switching regulator circuit is = %0.2f'%d,' '" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 14.6 Pg 418" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "The output voltage of switching regulator circuit is = 0.50 \n" + ] + } + ], + "source": [ + "# determine the duty cycle of the switching regulator circuit\n", + "T =120 # #msec # total pulse time\n", + "# T = ton + toff #\n", + "ton = T/2 #\n", + "\n", + "# The duty cycle of switching regulator circuit is given by\n", + "d = ton/T#\n", + "print 'The output voltage of switching regulator circuit is = %0.2f'%d,' '" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 14.7 Pg 418" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "The output voltage of switching regulator circuit is = 0.67 \n" + ] + } + ], + "source": [ + "# determine the duty cycle of the switching regulator circuit\n", + "ton = 12 # #msec # on time of pulse\n", + "# ton = 2*toff # given\n", + "# T = ton + toff #\n", + "toff = ton/2 #\n", + "T = ton+toff # # total time\n", + "\n", + "# The duty cycle of switching regulator circuit is given by\n", + "d = ton/T#\n", + "print 'The output voltage of switching regulator circuit is = %0.2f'%d,' '" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 14.8 Pg 419" + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "The emitter bias voltage is = 3.80 V \n", + "The output voltage of the IC LM380 is = 7.90 V \n" + ] + } + ], + "source": [ + " # determine the output voltage of the audio power amplifier IC LM380\n", + "Vcc = 12 # # V\n", + "Ic3 = 12*10**-6 # # A # collector current of the transistor Q3\n", + "Ic4 = 12*10**-6 # # A # collector current of the transistor Q4\n", + "R11 = 25*10**3 # # ohm\n", + "R12 = 25*10**3 # # ohm\n", + "\n", + "# the collector current of Q3 is defined as\n", + " # Ic3 = (Vcc-3*Veb)/(R11+R12)#\n", + "Veb = (Vcc-(R11+R12)*Ic3)/3 #\n", + "print 'The emitter bias voltage is = %0.2f'%Veb,' V '\n", + "\n", + "# the output voltage of the IC LM380\n", + "Vo = (1/2)*Vcc+(1/2)*Veb#\n", + "print 'The output voltage of the IC LM380 is = %0.2f'%Vo,' V '" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 14.9 Pg 420" + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "The emitter bias voltage is = 3.33 V \n", + "The output voltage of the IC LM380 is = 6.67 V \n" + ] + } + ], + "source": [ + "# determine the output voltage of the audio power amplifier IC LM380\n", + "Vcc = 10 # # V\n", + "Ic3 = 0.01*10**-6 # # A # collector current of the transistor Q3\n", + "Ic4 = 0.01*10**-6 # # A # collector current of the transistor Q4\n", + "R11 = 25*10**3 # # ohm\n", + "R12 = 25*10**3 # # ohm\n", + "\n", + "# the collector current of Q3 is defined as\n", + " # Ic3 = (Vcc-3*Veb)/(R11+R12)#\n", + "Veb = (Vcc-(R11+R12)*Ic3)/3 #\n", + "print 'The emitter bias voltage is = %0.2f'%Veb,' V '\n", + "\n", + "# the output voltage of the IC LM380\n", + "Vo = (1/2)*Vcc+(1/2)*Veb#\n", + "print 'The output voltage of the IC LM380 is = %0.2f'%Vo,' V '" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 14.10 Pg 421" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "The emitter resistor of Q3 is = 52.00 ohm ( at temperature 25 degree celsius) \n", + "The trans conductance of transistor is = 38.5 mA/V \n", + "The base emitter resistor rbe is = 1.30 K ohm \n", + "The emitter capacitor Ce = 7.65 pF \n", + "The value of resistance RL is = 264.55 ohm \n", + "The pole frequency fa is = 601.91 M Hz \n", + "The pole frequency fb is = 1073.74 M Hz \n", + "The pole frequency fc is = 3060.67 M Hz \n", + "Hence fa is a dominant pole frequency \n" + ] + } + ], + "source": [ + "from numpy import inf\n", + "from math import sqrt, pi\n", + "# Design a video amplifier of IC 1550 circuit\n", + "Vcc = 12 # # V\n", + "Av = -10 #\n", + "Vagc = 0 # # at bandwidth of 20 MHz\n", + "hfe = 50 # # forward emitter parameter\n", + "rbb = 25 # # ohm # base resistor\n", + "Cs = 1*10**-12 # # F # source capacitor\n", + "Cl = 1*10**-12 # # F # load capacitor\n", + "Ie1 = 1*10**-3 # # A # emitter current of Q1\n", + "f = 1000*10**6 # # Hz\n", + "fT = 800*10**6 # # Hz\n", + "Vt = 52*10**-3 #\n", + "Vt1 = 0.026 #\n", + "\n", + "# When Vagc =0 the transistor Q2 is cut-off and the collector current of transistor Q2 flow through the transistor Q3\n", + "# i.e Ic1=Ie1=Ie3\n", + "Ie3 = 1*10**-3 # # A # emitter current of Q3\n", + "Ic1 = 1*10**-3 # # A # collector current of the transistor Q1\n", + "\n", + "# it indicates that the emitter current of Q2 is zero Ie2 = 0 then the emitter resistor of Q2 is infinite\n", + "\n", + "re2 = inf #\n", + "\n", + "# emitter resistor of Q3 \n", + "re3 = (Vt/Ie1)#\n", + "print 'The emitter resistor of Q3 is = %0.2f'%re3,' ohm ( at temperature 25 degree celsius) '\n", + "\n", + "# the trans conductance of transistor is\n", + "gm = (Ie1/Vt1)#\n", + "print 'The trans conductance of transistor is = %0.1f'%(gm*1000),' mA/V ' # Round Off Error\n", + "\n", + "# the base emitter resistor rbe\n", + "rbe = (hfe/gm)#\n", + "print 'The base emitter resistor rbe is = %0.2f'%(rbe/1000),' K ohm ' # Round Off Error\n", + "\n", + "# the emitter capacitor Ce \n", + "\n", + "Ce = (gm/(2*pi*fT))#\n", + "print 'The emitter capacitor Ce = %0.2f'%(Ce*1e12),' pF ' # Round Off Error\n", + "\n", + "# the voltage gain of video amplifier is\n", + "# Av = (Vo/Vin) #\n", + "# Av = -((alpha3*gm)/(rbb*re3)*((1/rbb)+(1/rbe)+sCe)*((1/re2)+(1/re3)+sC3)*((1/Rl)+(s(Cs+Cl)))) \n", + " # At Avgc = 0 i.e s=0 in the above Av equation\n", + "alpha3 = 1 #\n", + "s = 0 #\n", + "# Rl = -((alpha3*gm)/(rbb*re3)*(((1/rbb)+(1/rbe))*((1/re2)+(1/re3))*(Av)))# \n", + "\n", + "# After solving above equation for Rl We get Rl Equation as\n", + "Rl = 10/(37.8*10**-3)#\n", + "print 'The value of resistance RL is = %0.2f'%Rl,' ohm '\n", + "\n", + "# there are three poles present in the transfer function of video amplifier each pole generate one 3-db frequency \n", + "Rl = 675 #\n", + "# fa = 1/(2*pi*Rl*(Cs+Cl))#\n", + "# after putting value of Rl ,Cs and Cl we get\n", + "fa = 1/(2*3.14*264.55*1*10**-12)#\n", + "print 'The pole frequency fa is = %0.2f'%(fa*10**-3/1000),' M Hz '# Round Off Error\n", + "\n", + "\n", + "#fb = 1/(2*pi*Ce*((rbb*rbe)/(rbb+rbe)))#\n", + "# after putting value of Ce rbb and rbe we get\n", + "fb = 1/(2*pi*6.05*10**-12*24.5)#\n", + "print 'The pole frequency fb is = %0.2f'%(fb*10**-3/1000),' M Hz '\n", + "\n", + "fc = 1/(2*pi*Cs*re3)#\n", + "print 'The pole frequency fc is = %0.2f'%(fc*10**-3/1000),' M Hz '\n", + "\n", + "print 'Hence fa is a dominant pole frequency '" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 14.11 Pg 423" + ] + }, + { + "cell_type": "code", + "execution_count": 13, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "The emitter resistor of Q3 is = 52.00 ohm \n", + "The trans conductance of transistor is = 38.5 mA/V \n", + "The base emitter resistor rbe is = 1.3 kohm \n", + "The emitter capacitor is = 6.12 pF \n", + "The value of resistance RL is = 5.00 ohm \n", + "The pole frequency fa is = 600.58 MHz \n", + "The pole frequency fb is = 1060.00 MHz \n", + "The pole frequency fc is = 3060.67 MHz \n", + "Hence fa is a dominant pole frequency \n" + ] + } + ], + "source": [ + "# Design a video amplifier of IC 1550 circuit\n", + "Vcc = 12 # # V\n", + "Av = -10 #\n", + "Vagc = 0 # # at bandwidth of 20 MHz\n", + "hfe = 50 # # forward emitter parameter\n", + "rbb = 25 # # ohm # base resistor\n", + "Cs = 1*10**-12 # # F # source capacitor\n", + "Cl = 1*10**-12 # # F # load capacitor\n", + "Ie1 = 1*10**-3 # # A # emitter current of Q1\n", + "f = 1000*10**6 # # Hz\n", + "Vt = 52*10**-3 #\n", + "Vt1 = 0.026 #\n", + "\n", + "# When Vagc =0 the transistor Q2 is cut-off and the collector current of transistor Q2 flow through the transistor Q3\n", + "# i.e Ic1=Ie1=Ie3\n", + "Ie3 = 1*10**-3 # # A # emitter current of Q3\n", + "Ic1 = 1*10**-3 # # A # collector current of the transistor Q1\n", + "\n", + "# it indicates that the emitter current of Q2 is zero Ie2 = 0 then the emitter resistor of Q2 is infinite\n", + "re2 = inf #\n", + "\n", + "# emitter resistor of Q3 \n", + "re3 = (Vt/Ie1)#\n", + "print 'The emitter resistor of Q3 is = %0.2f'%re3,' ohm '\n", + "\n", + "# the trans conductance of transistor is\n", + "gm = (Ie1/Vt1)#\n", + "print 'The trans conductance of transistor is = %0.1f'%(gm*1e3),' mA/V '\n", + "\n", + "# the base emitter resistor rbe\n", + "rbe = (hfe/gm)#\n", + "print 'The base emitter resistor rbe is = %0.1f'%(rbe/1e3),' kohm '\n", + "\n", + "# the emitter capacitor Ce \n", + "Ce = (gm/(2*pi*f))#\n", + "print 'The emitter capacitor is = %0.2f'%(Ce*1e12),' pF '\n", + "\n", + "# the voltage gain of video amplifier is\n", + "# Av = (Vo/Vin) #\n", + "# Av = -((alpha3*gm)/(rbb*re3)*((1/rbb)+(1/rbe)+sCe)*((1/re2)+(1/re3)+sC3)*((1/Rl)+(s(Cs+Cl)))) \n", + " # At Avgc = 0 i.e s=0 in the above Av equation\n", + "alpha3 = 1 #\n", + "s = 0 #\n", + "Av =-10 #\n", + "Rl = -((alpha3*gm)/((rbb*re3)*(((1/rbb)+(1/rbe))*((1/re2)+(1/re3))*(Av))))# \n", + "Rl = (1/Rl)#\n", + "print 'The value of resistance RL is = %0.2f'%Rl,' ohm '\n", + "\n", + "# there are three poles present in the transfer function of video amplifier each pole generate one 3-db frequency \n", + "Rl = 265\n", + "fa = 1/(2*pi*Rl*(Cs))/1e6#\n", + "print 'The pole frequency fa is = %0.2f'%fa,'MHz '\n", + "\n", + "\n", + "fb = 1/(2*pi*Ce*((rbb*rbe)/(rbb+rbe)))/1e6\n", + "print 'The pole frequency fb is = %0.2f'%fb,'MHz '\n", + "\n", + "fc = 1/(2*pi*Cs*re3)/1e6\n", + "print 'The pole frequency fc is = %0.2f'%fc,'MHz '\n", + "\n", + "print 'Hence fa is a dominant pole frequency '" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 14.12 Pg 425" + ] + }, + { + "cell_type": "code", + "execution_count": 18, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "The input current is = 0.50 mA \n", + "The output of an op-amp is = 27.50 V \n" + ] + } + ], + "source": [ + "# Determine the output voltage of an isolation amplifier IC ISO100\n", + "Vin = 5.0 # # V\n", + "Rin = 10*10**3 # \n", + "Rf = 55*10**3 # # ohm # feedback resistance\n", + "\n", + "# the input voltage of an amplifier 1\n", + "# Vin = Rin*Iin\n", + "Iin = Vin/Rin # \n", + "print 'The input current is = %0.2f'%(Iin*1e3),'mA '\n", + "\n", + "# In isolation amplifier ISO 100 the input current Iin is equal to the output current Iout , but both are opposite in direction\n", + "# Iin = -Iout\n", + "# the output of an op-amp\n", + "# Vo = -Rf*Iout\n", + "Vo = Rf*Iin#\n", + "print 'The output of an op-amp is = %0.2f'%Vo,' V '" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 14.13 Pg 426" + ] + }, + { + "cell_type": "code", + "execution_count": 24, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "The input current is = 12 mA \n", + "The output of an op-amp is = 204 V \n" + ] + } + ], + "source": [ + "# Determine the output voltage of an isolation amplifier IC ISO100\n", + "Vin = 12.0 # # V\n", + "Rin = 1*10**3 # \n", + "Rf = 17*10**3 # # ohm # feedback resistance\n", + "\n", + "# the input voltage of an amplifier 1\n", + "# Vin = Rin*Iin\n", + "Iin = Vin/Rin # \n", + "print 'The input current is = %0.f'%(Iin*1e3),'mA '\n", + "\n", + "# In isolation amplifier ISO 100 the input current Iin is equal to the output current Iout , but both are opposite in direction\n", + "# Iin = -Iout\n", + "# the output of an op-amp\n", + "# Vo = -Rf*Iout\n", + "Vo = Rf*Iin#\n", + "print 'The output of an op-amp is = %0.f'%Vo,' V '" + ] + } + ], + "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 +} diff --git a/Linear_Integrated_Circuit_by_M._S._Sivakumar/Ch3.ipynb b/Linear_Integrated_Circuit_by_M._S._Sivakumar/Ch3.ipynb new file mode 100644 index 00000000..7a4856f8 --- /dev/null +++ b/Linear_Integrated_Circuit_by_M._S._Sivakumar/Ch3.ipynb @@ -0,0 +1,344 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 3 Current Voltage Sources and Differential Amplifiers" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 3.1 Pg 53" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "The collector current of difference amplifier Ic1 = Ic2 = 0.50 mA \n", + "The collector voltages of transistors Q1 and Q2 are Vc1 = Vc2 = 5.00 volt \n", + "For Ve = -0.7 Volt the collector - emitter voltage Vce1 = 5.70 Volt\n", + "For Ve = 4.3 Volt the collector - emitter voltage Vce1 = 0.70 Volt\n", + "For Ve = -5.7 Volt the collector - emitter voltage Vce1 = 10.70 Volt\n" + ] + } + ], + "source": [ + "from __future__ import division\n", + "# Determine the collector current Ic1 and collector-emitter voltage Vce1 for the difference amplifier circuit\n", + "\n", + "V1 = 0 # # volt\n", + "V2 = -5 # #volt\n", + "Vcm = 5 # #volt\n", + "Vcc = 10# #volt\n", + "Vee = -10 # #volt\n", + "Ie = 1 # #mA\n", + "Rc = 10 # #kilo ohm\n", + "\n", + "# Transistor parameters\n", + "# base current are negligible\n", + "Vbe = 0.7 # # volt\n", + "\n", + "# The collector current of difference amplifier is\n", + "Ic1 = Ie/2 # \n", + "print 'The collector current of difference amplifier Ic1 = Ic2 = %0.2f'%Ic1,' mA '\n", + "\n", + "# The collector voltages of transistors Q1 and Q2 are expressed as\n", + "\n", + "Vc1 = Vcc-Ic1*Rc #\n", + "print 'The collector voltages of transistors Q1 and Q2 are Vc1 = Vc2 = %0.2f'%Vc1,' volt '\n", + "\n", + "# We know common mode voltage (Vcm) , from this the emitter voltage can be identified as follows\n", + "# For the common mode voltage Vcm = 0 V , the emitter voltage is Ve = -0.7 V\n", + "# For the common mode voltage Vcm = 5 V , the emitter voltage is Ve = 4.3 V\n", + "# For the common mode voltage Vcm = -5 V , the emitter voltage is Ve = -5.7 V\n", + "\n", + "# For the different emitter voltages the collector-emitter voltage can be calculated as\n", + "\n", + "Ve = -0.7 # # volt\n", + "Vce1 = Vc1-Ve#\n", + "print 'For Ve = -0.7 Volt the collector - emitter voltage Vce1 = %0.2f'%Vce1,' Volt'\n", + "\n", + "Ve = 4.3 # # volt\n", + "Vce1 = Vc1-Ve#\n", + "print 'For Ve = 4.3 Volt the collector - emitter voltage Vce1 = %0.2f'%Vce1,' Volt'\n", + "\n", + "Ve = -5.7 # # volt\n", + "Vce1 = Vc1-Ve#\n", + "print 'For Ve = -5.7 Volt the collector - emitter voltage Vce1 = %0.2f'%Vce1,' Volt'" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 3.2 Pg 54" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + " The differential mode gain Ad = 184.6\n", + " The common mode gain Acm = -0.237\n" + ] + } + ], + "source": [ + "# To determine the difference-mode and common-mode gain of the difference amplifier\n", + "\n", + "Vcc = 10 # # volt\n", + "Vee = -10 # #volt\n", + "Iq = 0.8 # #mA\n", + "Ie = 0.8 # #mA\n", + "Rc = 12 # #kilo-Ohm\n", + "Vt = 0.026 # # volt\n", + "\n", + "# Transistor parameter\n", + "beta = 100 #\n", + "Rs = 0 # #Ohm\n", + "Ro = 25 # #kilo-Ohm \n", + "# The differential mode gain Ad\n", + "gm = (Ie/ 2*Vt) #\n", + "# Ad = (gm*r*Rc/r+Rc) # # where r is r-pi\n", + "# For Rb=0 , the differential mode gain is\n", + "\n", + "Ad = (Ie/(2*Vt))*Rc#\n", + "#But\n", + "print ' The differential mode gain Ad = %0.1f'%Ad\n", + "\n", + "#The common mode gain Acm\n", + "# Acm = - (gm*Rc/1+2*gm*Re+2*Re/r)\n", + "Acm =-(Ad/(1+(((1+beta)*Ie*Ro)/(beta*Vt))))\n", + "print ' The common mode gain Acm = %0.3f'%Acm" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 3.3 Pg 56" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "The output of a difference amplifier is Vo = -47.40 sinwt uV \n" + ] + } + ], + "source": [ + "# To find the output of a difference amplifier when only common mode signal is applied\n", + "\n", + "# V1 = V2 = Vcm = 200*sin(wt) # # micro volt (uV)\n", + "Acm = -0.237 #\n", + "\n", + "# When the common mode input signal is applied to the difference amplifier , the difference mode gain is zero\n", + "Vcm = 200 #\n", + "Vo = Acm*Vcm #\n", + "print 'The output of a difference amplifier is Vo = %0.2f'%Vo,'sinwt uV ' # multiply by sinwt because it is in Vcm" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 3.4 Pg 56" + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "The differential mode gain Ad = 184.6\n", + "The common mode gain Acm = -0.237\n", + "The CMRR of difference amplifier is = 389\n", + "In decibel CMRR is = 51.80\n" + ] + } + ], + "source": [ + "from math import log10\n", + "#Determine the common mode rejection ratio(CMRR) of the difference amplifier\n", + "\n", + "Vcc = 10 # # volt\n", + "Vee = -10 # #volt\n", + "Iq = 0.8 # #mA\n", + "Ie = 0.8 # #mA\n", + "Rc = 12 # #kilo-Ohm\n", + "Vt = 0.026 # # volt\n", + "\n", + "# Transistor parameter\n", + "beta = 100 #\n", + "Rs = 0 # #Ohm\n", + "Ro = 25 # #kilo-Ohm\n", + " \n", + "# The differential mode gain Ad\n", + "gm = (Ie/ 2*Vt) #\n", + "# Ad = (gm*r*Rc/r+Rc) # # where r is r-pi\n", + "# For Rb=0 , the differential mode gain is\n", + "\n", + "Ad = (Ie/(2*Vt))*Rc#\n", + "#But\n", + "print 'The differential mode gain Ad = %0.1f'%Ad\n", + "\n", + "#The common mode gain Acm\n", + "# Acm = - (gm*Rc/1+2*gm*Re+2*Re/r)\n", + "Acm =-(Ad/(1+(((1+beta)*Ie*Ro)/(beta*Vt))))\n", + "print 'The common mode gain Acm = %0.3f'%Acm\n", + "\n", + "# The CMRR of difference amplifier is given as\n", + "Ad = Ad/2 #\n", + "CMRR = abs(Ad/Acm)\n", + "print 'The CMRR of difference amplifier is = %0.f'%CMRR\n", + "\n", + "# In decibel it can be expressed as\n", + "CMRRdb = 20*log10(CMRR)\n", + "print 'In decibel CMRR is = %0.2f'%CMRRdb" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 3.5 Pg 58" + ] + }, + { + "cell_type": "code", + "execution_count": 13, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + " The CMRR of difference amplifier is = 3.16e+04\n", + " The value of resistance RE is = 2.04 Mohm \n" + ] + } + ], + "source": [ + "# To determine emitter resistance of the difference amplifier\n", + "\n", + "Vcc = 10 # # volt\n", + "Vee = -10 # #volt\n", + "Iq = 0.8 # #mA\n", + "Ie = 0.8 # #mA\n", + "CMRRdb = 90 # #dB\n", + "Vt = 0.026 #\n", + "\n", + "# Transistor parameter\n", + "beta = 100 #\n", + "\n", + "# CMRR = abs(Ad/Acm)\n", + "# the CMRR of the difference amplifier is defined as\n", + "#CMRR = ((1/2)*(1+((1+beta)*Ie*Re)/beta*Vt))\n", + "\n", + "# CMRRdb = 20*log10(CMRR)\n", + "CMRR = 10**(CMRRdb/20)\n", + "print ' The CMRR of difference amplifier is = %0.2e'%CMRR\n", + "\n", + "# The resistance RE is calculated as\n", + "\n", + "RE = (((2*CMRR)-1)/((1+beta)*Ie))*(beta*Vt)/1e3\n", + "print ' The value of resistance RE is = %0.2f'%RE,' Mohm '" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 3.6 Pg 59" + ] + }, + { + "cell_type": "code", + "execution_count": 16, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + " The differential mode gain Ad is = 321\n" + ] + } + ], + "source": [ + "# determine the differential mode gain when load resistance RL = 100 k ohm\n", + "\n", + "RL = 100*10**3 # # k ohm # load resistance\n", + "IE = 0.20*10**-3 # # mA # biasing current\n", + "VA = 100 # # V # early voltage\n", + "VT = 0.026 # # threshold volt\n", + "\n", + "# the differential gain of differential amplifier with an active load circuit\n", + "#Ad = Vo/Vd = gm(ro2 || ro4 || RL )\n", + "ro2 = (2*VA)/IE#\n", + "ro4 = ro2 #\n", + "gm = IE/(2*VT) #\n", + "\n", + "Ad = gm/((1/ro2)+(1/ro4)+(1/RL))\n", + "print ' The differential mode gain Ad is = %0.f'%Ad" + ] + } + ], + "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 +} diff --git a/Linear_Integrated_Circuit_by_M._S._Sivakumar/Ch4.ipynb b/Linear_Integrated_Circuit_by_M._S._Sivakumar/Ch4.ipynb new file mode 100644 index 00000000..d9148952 --- /dev/null +++ b/Linear_Integrated_Circuit_by_M._S._Sivakumar/Ch4.ipynb @@ -0,0 +1,393 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 4 Operational Amplifier" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 4.1 Pg 79" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + " closed loop gain of an op-amp is = 35.00\n", + " the input impedance Zin = 10.00 kohm \n", + " the output impedance Z0 = 0.020 ohm \n" + ] + } + ], + "source": [ + "from __future__ import division\n", + "# For an op-amp circuit find a) closed loop gain Acl b) input impedance Zin c) output impedance Zo\n", + "ro = 85 # # ohm\n", + "A = 150*10**3 # # ohm\n", + "R2 = 350*10**3 # # ohm # Feedback resistance\n", + "R1 = 10*10**3 # # ohm # Input resistance\n", + "\n", + "# a) closed loop gain\n", + "# ACL = abs(Vo/Vin) = abs(R2/R1)\n", + "ACL = abs(R2/R1) #\n", + "print ' closed loop gain of an op-amp is = %0.2f'%ACL# # 1/beta = ACL\n", + "beta = (1/ACL) #\n", + "\n", + "# b) the input impedance Zin\n", + "Zin = R1 #\n", + "print ' the input impedance Zin = %0.2f'%(Zin/1e3),'kohm '#\n", + "\n", + "# c0 the output impedance Z0\n", + "Z0 = (ro)/(1+(beta*A))#\n", + "print ' the output impedance Z0 = %0.3f'%Z0,' ohm '#" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 4.2 Pg 80" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + " The difference voltage is = 10.00 V \n", + " The open loop gain is = 2.00 \n" + ] + } + ], + "source": [ + "# Determine the differece voltage and open loop gain of an op-amp\n", + "V1 = -5 # # volt # input voltage\n", + "V2 = 5 # # volt\n", + "Vo = 20 # #volt # output voltage\n", + "\n", + "# the difference voltage is given by \n", + "Vd = V2-V1 #\n", + "print ' The difference voltage is = %0.2f'%Vd,' V '\n", + "\n", + "# open loop gain \n", + "A = (Vo/Vd)#\n", + "print ' The open loop gain is = %0.2f'%A,' '" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 4.3 Pg 80" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + " The difference voltage is = 5.00 V \n", + " The open loop gain is = 4.00 \n" + ] + } + ], + "source": [ + "# Determine the differece voltage and open loop gain of an op-amp\n", + "V1 = -5 # # volt # input voltage\n", + "V2 = 0 # # volt # GND\n", + "Vo = 20 # #volt # output voltage\n", + "\n", + "# the difference voltage is given by \n", + "Vd = V2-V1 #\n", + "print ' The difference voltage is = %0.2f'%Vd,' V '\n", + "\n", + "# open loop gain \n", + "A = (Vo/Vd)#\n", + "print ' The open loop gain is = %0.2f'%A,' '" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 4.4 Pg 81" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + " The difference voltage is = 5.00 V \n", + " The open loop gain is = 4.00 \n" + ] + } + ], + "source": [ + "# Determine the differece voltage and open loop gain of an op-amp\n", + "V1 = 0 # # volt # input voltage # GND\n", + "V2 = 5 # # volt \n", + "Vo = 20 # #volt # output voltage\n", + "\n", + "# the difference voltage is given by \n", + "Vd = V2-V1 #\n", + "print ' The difference voltage is = %0.2f'%Vd,' V '\n", + "\n", + "# open loop gain \n", + "A = (Vo/Vd)#\n", + "print ' The open loop gain is = %0.2f'%A,' '" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 4.5 Pg 81" + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + " The difference voltage is = -10.00 V \n", + " The open loop gain is = 2.00 \n" + ] + } + ], + "source": [ + "# Determine the differece voltage and open loop gain of an op-amp\n", + "V1 = 5 # # volt # input voltage # GND\n", + "V2 = -5 # # volt \n", + "Vo = -20 # #volt # output voltage\n", + "\n", + "# the difference voltage is given by \n", + "Vd = V2-V1 #\n", + "print ' The difference voltage is = %0.2f'%Vd,' V '\n", + "\n", + "# open loop gain \n", + "A = (Vo/Vd)#\n", + "print ' The open loop gain is = %0.2f'%A,' '" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 4.6 Pg 82" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "The Closed loop gain of an inverting op-amp is = -2.50 \n", + "The |Ac| Closed loop gain of an inverting op-amp is = 2.50 \n", + "The output voltage of an inverting op-amp is = -25.00 V \n" + ] + } + ], + "source": [ + "from __future__ import division\n", + "# To find closed loop gain and output voltage Vo of an inverting op-amp\n", + "R1 = 10 # #kilo ohm # input resistance\n", + "R2 = 25 # # kilo ohm # feedback resistance\n", + "Vin = 10 # #volt # input voltage\n", + "\n", + "# Closed loop gain of an inverting op-amp\n", + "Ac = -(R2/R1) #\n", + "print 'The Closed loop gain of an inverting op-amp is = %0.2f'%Ac,' '\n", + "Ac = abs(Ac)#\n", + "print 'The |Ac| Closed loop gain of an inverting op-amp is = %0.2f'%Ac,' '\n", + "\n", + "# the output voltage of an inverting op-amp\n", + "Vo = -(R2/R1)*Vin #\n", + "print 'The output voltage of an inverting op-amp is = %0.2f'%Vo,' V '" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 4.7 Pg 82" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + " The Closed loop gain of an non-inverting op-amp is = 3.50 \n", + " The output voltage of an non-inverting op-amp is = 35.00 V \n" + ] + } + ], + "source": [ + "# To find closed loop gain and output voltage Vo of an non-inverting op-amp\n", + "R1 = 10 # #kilo ohm # input resistance\n", + "R2 = 25 # # kilo ohm # feedback resistance\n", + "Vin = 10 # #volt # input voltage\n", + "\n", + "# Closed loop gain of an non-inverting op-amp\n", + "Ac = 1+(R2/R1) #\n", + "Ac = abs(Ac)#\n", + "print ' The Closed loop gain of an non-inverting op-amp is = %0.2f'%Ac,' '\n", + "\n", + "# the output voltage of an inverting op-amp\n", + "Vo = (1+R2/R1)*Vin #\n", + "print ' The output voltage of an non-inverting op-amp is = %0.2f'%Vo,' V '" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 4.8 Pg 83" + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "The closed loop gain of differntial op-amp is = 2.50 \n", + "The output voltage of an non-inverting op-amp is= 50.00 V \n" + ] + } + ], + "source": [ + "# to find out closed loop gain and output voltage Vo\n", + "R1 = 10 # #kilo ohm # input resistance\n", + "R3 = 10 # #kilo ohm # input resistance\n", + "R2 = 25 # # kilo ohm # feedback resistance\n", + "R4 = 25 # # kilo ohm # feedback resistance\n", + "Vin2 = 10 # #volt # input voltage\n", + "Vin1 = -10 # #volt # input voltage\n", + "\n", + "# closed loop gain of differntial op-amp is given by\n", + "Ac = (R2/R1) #\n", + "Ac = abs(Ac)# \n", + "print 'The closed loop gain of differntial op-amp is = %0.2f'%Ac,' '\n", + "\n", + "# the output voltage of an non-inverting op-amp is given by\n", + "Vo = (R2/R1)*(Vin2-Vin1) #\n", + "print 'The output voltage of an non-inverting op-amp is= %0.2f'%Vo,' V '" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 4.9 Pg 84" + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + " The upper voltage is = 2.86 V \n", + " The lower voltage is = -2.86 V \n" + ] + } + ], + "source": [ + "# Determine the non-inverting input voltage\n", + "R1 = 10 # #kilo ohm # input resistance\n", + "R2 = 25 # #kilo ohm # feedback resistance\n", + "Voh = 10 # # volt #output voltage\n", + "Vol = -10 # # volt # output voltage\n", + "\n", + "# upper voltage\n", + "V = (R1/(R1+R2)*Voh) #\n", + "print ' The upper voltage is = %0.2f'%V,' V '\n", + "\n", + "# Lower voltage\n", + "V = (R1/(R1+R2)*Vol) #\n", + "print ' The lower voltage is = %0.2f'%V,' V '" + ] + } + ], + "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 +} diff --git a/Linear_Integrated_Circuit_by_M._S._Sivakumar/Ch5.ipynb b/Linear_Integrated_Circuit_by_M._S._Sivakumar/Ch5.ipynb new file mode 100644 index 00000000..648c0739 --- /dev/null +++ b/Linear_Integrated_Circuit_by_M._S._Sivakumar/Ch5.ipynb @@ -0,0 +1,1582 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 5 Characteristic of Operational Amplifier" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 5.1 Pg 110" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + " the output voltage (Vo) of an op-amp circuit due to input offset voltage (Vos) is = 404.00 mV \n", + " the output voltage (Vo) of an op-amp circuit due to input offset current (Ios) is = 75.00 mV \n", + " the total offset voltage (Vo) of an op-amp circuit is = 479.00 mV \n" + ] + } + ], + "source": [ + "from __future__ import division\n", + "# find the total offset voltage of feedback op-amp\n", + "\n", + "Vos = 4 # #mV # input offset volt\n", + "Ios = 150*10**-3 # # input offset current\n", + "R1 = 5 # #kilo ohm # input resistance\n", + "R2 = 500 # #kilo ohm # feedback resistance\n", + "\n", + "# the output voltage (Vo) of an op-amp circuit due to input offset voltage (Vos) is\n", + "Vo1 = ((R1+R2)/(R1)*Vos) #\n", + "print ' the output voltage (Vo) of an op-amp circuit due to input offset voltage (Vos) is = %0.2f'%Vo1,' mV '#\n", + "\n", + "# the output voltage (Vo) of an op-amp circuit due to input offset current (Ios) is\n", + "Vo2 = R2*Ios #\n", + "print ' the output voltage (Vo) of an op-amp circuit due to input offset current (Ios) is = %0.2f'%Vo2,' mV '#\n", + "\n", + "# the total offset voltage is\n", + "Vo = Vo1+Vo2 #\n", + "print ' the total offset voltage (Vo) of an op-amp circuit is = %0.2f'%Vo,' mV '#" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 5.2 Pg 111" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + " the output voltage (Vo) of an op-amp circuit due to input offset voltage (Vos) is = 52.00 mV \n", + " the output voltage (Vo) of an op-amp circuit due to input offset current (Ios) is = 5.00 mV \n", + " the total offset voltage (Vo) of an op-amp circuit is = 57.00 mV \n" + ] + } + ], + "source": [ + "# find the total offset voltage of feedback op-amp\n", + "\n", + "Vos = 2 # #mV # input offset volt\n", + "Ios = 20*10**-3 # # input offset current\n", + "R1 = 10 # #kilo ohm # input resistance\n", + "R2 = 250 # #kilo ohm # feedback resistance\n", + "\n", + "# the output voltage (Vo) of an op-amp circuit due to input offset voltage (Vos) is\n", + "Vo1 = ((R1+R2)/(R1)*Vos) #\n", + "print ' the output voltage (Vo) of an op-amp circuit due to input offset voltage (Vos) is = %0.2f'%Vo1,' mV '#\n", + "\n", + "# the output voltage (Vo) of an op-amp circuit due to input offset current (Ios) is\n", + "Vo2 = R2*Ios #\n", + "print ' the output voltage (Vo) of an op-amp circuit due to input offset current (Ios) is = %0.2f'%Vo2,' mV '#\n", + "\n", + "# the total offset voltage is\n", + "Vo = Vo1+Vo2 #\n", + "print ' the total offset voltage (Vo) of an op-amp circuit is = %0.2f'%Vo,' mV '#" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 5.3 Pg 111" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "the input offset voltage (Vos) of an op-amp circuit is = 1.187 mV \n" + ] + } + ], + "source": [ + "# find the input offset voltage of an op-amp circuit\n", + "\n", + "Vo = 90.2 # #mV # output voltage\n", + "R1 = 2 # #kilo ohm # input resistence\n", + "R2 = 150 # #kilo ohm # feedback resistence\n", + "\n", + "# the input offset voltage (Vos) of an op-amp circuit is defined as\n", + "Vos = ((R1)/(R1+R2)*Vo) #\n", + "print 'the input offset voltage (Vos) of an op-amp circuit is = %0.3f'%Vos,' mV '#" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 5.4 Pg 112" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "the output voltage due to the input offset voltage is = 36.00 mV \n" + ] + } + ], + "source": [ + "# find the output voltage of an op-amp circuit\n", + "\n", + "Vos = 1 # #mV # input offset volt\n", + "R1 = 10 # #kilo ohm # input resistance\n", + "R2 = 350 # #kilo ohm # feedback resistance\n", + "\n", + "# the output voltage due to the input offset voltage of the op-amp circuit is defined by\n", + "Vo1 = ((R1+R2)/(R1)*Vos) #\n", + "print 'the output voltage due to the input offset voltage is = %0.2f'%Vo1,' mV '#" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 5.5 Pg 113" + ] + }, + { + "cell_type": "code", + "execution_count": 46, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "the output voltage of the circuit due to bias current is = 0.11 V \n", + "Bias compensated resistor is = 9.09 kilo ohm \n", + "Bias compensated output voltage is = 0.01 V \n" + ] + } + ], + "source": [ + "# Determine the bias current effect with and without current compensation method\n", + "\n", + "R1 = 10 # #kilo ohm\n", + "R2 = 100 # #kilo ohm\n", + "Ib1 = 1.1*10**-3 #\n", + "Ib2 = 1*10**-3 # \n", + "# the output voltage of the circuit due to bias current is\n", + "Vo = Ib1*R2 #\n", + "print 'the output voltage of the circuit due to bias current is = %0.2f'%Vo,' V '#\n", + "\n", + "#Bias compensated resistor is given by\n", + "R3 = (R1*R2)/(R1+R2) #\n", + "print 'Bias compensated resistor is = %0.2f'%R3,' kilo ohm '#\n", + "\n", + "#Bias compensated output voltage is given by\n", + "Vo = R2*(Ib1-Ib2)#\n", + "print 'Bias compensated output voltage is = %0.2f'%Vo,' V '#" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 5.6 Pg 113" + ] + }, + { + "cell_type": "code", + "execution_count": 11, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "the output voltage (Vo) of an op-amp circuit due to input offset current (Ios) is = 80 nA \n" + ] + } + ], + "source": [ + "# find the input offset current of an op-amp circuit\n", + "\n", + "Vo = 12*10**-3# # V # output voltage\n", + "R1 = 2*10**3 # # ohm # input resistence\n", + "R2 = 150*10**3# # ohm # feedback resistence\n", + "\n", + "# the output voltage (Vo) of an op-amp circuit due to input offset current (Ios) is\n", + "# Vo = R2*Ios #\n", + "Ios = Vo/R2 *1e9 # nA\n", + "print 'the output voltage (Vo) of an op-amp circuit due to input offset current (Ios) is = %0.f'%Ios,'nA '#" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 5.7 Pg 114" + ] + }, + { + "cell_type": "code", + "execution_count": 12, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "The current in the inverting input terminal is = 27.50 nA \n", + "The current in the non-inverting input terminal is= 32.50 nA \n" + ] + } + ], + "source": [ + "# Determine the bias current of inverting and non-inverting\n", + "Ios = 5 # #nA # input offset current\n", + "Ib = 30 # #nA # input bias current\n", + "\n", + "# the input bias current of an op-amp is \n", + "\n", + "#Ib =(Ib1+Ib2)/(2)#\n", + "\n", + "# the offset current Ios is define as\n", + "\n", + "#Ios = abs(Ib1-Ib2) #\n", + "\n", + "Ib1=Ib-(Ios/2)#\n", + "print 'The current in the inverting input terminal is = %0.2f'%Ib1,' nA '#\n", + "\n", + "Ib2 =Ib+(Ios/2)#\n", + "print 'The current in the non-inverting input terminal is= %0.2f'%Ib2,' nA '#" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 5.8 Pg 115" + ] + }, + { + "cell_type": "code", + "execution_count": 49, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Feedback transfer function is = 0.01 \n", + "OR 1/Beta is = 100.10 \n", + "Feedback transfer function is = -0.01 \n", + "OR 1/Beta is = -100.10 \n" + ] + } + ], + "source": [ + "#determine the feedback transfer function of an op-amp for the following condition\n", + "# a) When open loop gain of 10**5 and the closed loop gain of 100\n", + "A = 10**5 # # open loop gain\n", + "Af = 100 # #closed loop gain\n", + "# Feedback transfer function is\n", + "beta =(1/Af)-(1/A)#\n", + "print 'Feedback transfer function is = %0.2f'%beta,''#\n", + "beta = 1/beta #\n", + "print 'OR 1/Beta is = %0.2f'%beta,''#\n", + "\n", + "# For an open loop gain of -10**5 and closed loop gain of -100\n", + "A = -10**5 # # open loop gain\n", + "Af = -100 # #closed loop gain\n", + "# Feedback transfer function is\n", + "beta =(1/Af)-(1/A)#\n", + "print 'Feedback transfer function is = %0.2f'%beta,''#\n", + "beta = 1/beta #\n", + "print 'OR 1/Beta is = %0.2f'%beta,''#" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 5.9 Pg 115" + ] + }, + { + "cell_type": "code", + "execution_count": 51, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "open loop gain is = 2000.00\n" + ] + } + ], + "source": [ + "#to determine open loop gain\n", + "beta = 0.0120 # # Feedback transfer function\n", + "Af = 80 # #closed loop gain\n", + "A = (Af)/(1-beta*Af) #\n", + "print 'open loop gain is = %0.2f'%A" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 5.10 Pg 116" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "close loop gain dAf is = 49.78\n", + "the percent change of closed loop gain dAf is = 0.45 %\n" + ] + } + ], + "source": [ + " # To Determine the percent of change in the closed loop gain Af of feedback op-amp circuit\n", + "A = 10**5 # # open loop gain\n", + "Af = 50 # # close loop gain\n", + "beta = 0.01999 # # feedback transfer function\n", + "dA = 10**4 # # the change in the open llop gain \n", + "\n", + "# close loop gain\n", + "dAf = ((dA)/(1+dA*beta))#\n", + "print 'close loop gain dAf is = %0.2f'%dAf\n", + "\n", + "# the percent change of closed loop gain \n", + "dAf = (((Af-dAf)/(Af))*100)#\n", + "print 'the percent change of closed loop gain dAf is = %0.2f'%dAf,'%'#" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 5.11 Pg 116" + ] + }, + { + "cell_type": "code", + "execution_count": 14, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "the feedback transfer function beta is = 0.0199\n", + "the closed loop bandwidth wfH is = 125600\n" + ] + } + ], + "source": [ + "# To Determine the bandwidth of feedback amplifier\n", + "A = 10**4 # # open loop gain\n", + "Af = 50 # # close loop gain\n", + "wH = 628 # #(2*pi*100) # rad/sec # open loop bandwidth\n", + "\n", + "# close loop gain of an op-amp is defined as\n", + "# Af = ((A)/(1+A*beta))# \n", + "\n", + "# the feedback transfer function is given as\n", + "beta = (1/Af)-(1/A) #\n", + "print 'the feedback transfer function beta is = %0.4f'%beta\n", + "\n", + "# closed loop bandwidth\n", + "wfH = wH*(1+beta*A)#\n", + "print 'the closed loop bandwidth wfH is = %0.f'%wfH" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 5.12 Pg 117" + ] + }, + { + "cell_type": "code", + "execution_count": 17, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "the unity gain bandwidth is = 1e+06 Hz\n", + "the maximum close loop gain ACL is = 50.00 \n" + ] + } + ], + "source": [ + "from __future__ import division\n", + "# To calculate unity gain bandwidth and maximum close loop gain\n", + "A = 10**5 # # open loop gain\n", + "fo = 10 # # Hz # dominant pole frequency\n", + "fdb = 20*10**3 # #Hz # 3-db frequency\n", + "\n", + "# the unity gain bandwidth\n", + "f1 = fo*A #\n", + "print 'the unity gain bandwidth is = %0.e'%f1,'Hz'#\n", + "\n", + "# the maximum close loop gain\n", + "ACL = (f1/fdb) #\n", + "print 'the maximum close loop gain ACL is = %0.2f'%ACL,''#" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 5.13 Pg 117" + ] + }, + { + "cell_type": "code", + "execution_count": 19, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "the unity gain bandwidth is = 60 kHz\n", + "the maximum close loop gain ACL is = 5.00 \n" + ] + } + ], + "source": [ + "# To calculate unity gain bandwidth and maximum close loop gain\n", + "A = 10**3 # # open loop gain\n", + "fo = 60 # # Hz # dominant pole frequency\n", + "fdb = 12*10**3 # #Hz # 3-db frequency\n", + "\n", + "# the unity gain bandwidth\n", + "f1 = fo*A #\n", + "print 'the unity gain bandwidth is = %0.f'%(f1/1e3),'kHz'#\n", + "\n", + "# the maximum close loop gain\n", + "ACL = (f1/fdb) #\n", + "print 'the maximum close loop gain ACL is = %0.2f'%ACL,''#" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 5.14 Pg 118" + ] + }, + { + "cell_type": "code", + "execution_count": 22, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "the dominant pole frequency (fPD) of an op-amp is = 2.5 kHz\n" + ] + } + ], + "source": [ + "# To determine the dominant pole frequency of an op-amp\n", + "Ao = 2*10**5 # # low frequency open loop gain\n", + "f = 5*10**6 # # Hz # pole frequency\n", + "ACL = 100 # # low frequency closed lkoop gain\n", + "p_margin = 80 # \n", + "\n", + "# the dominant pole frequency of an op-amp\n", + "fPD = (ACL)*(f/Ao)/1e3\n", + "print 'the dominant pole frequency (fPD) of an op-amp is = %0.1f'%fPD,'kHz'#" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 5.15 Pg 118" + ] + }, + { + "cell_type": "code", + "execution_count": 23, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "FL = 6.37 KHz \n", + "Acom = [ magnitude = 6.3*10**-3 angle = -89.6 degree ]\n", + "Ac = [ magnitude = 0.68 angle = 0.4 degree ]\n" + ] + } + ], + "source": [ + " # Determine the loop gain of compensated network\n", + "C = 0.0025*10**-6 # # farad\n", + "R = 10*10**3 # # ohm\n", + "F = 1*10**6 # # Hz\n", + "Ac1 = 100 # \n", + "angle1 = 90 #\n", + "\n", + "# the close loop gain of a compensated network is defined as\n", + "# Ac = Acl*Acom #\n", + "\n", + "#Acom = 1/(1+%(F/FL))#\n", + "\n", + "FL = 1/(2*3.14*R*C)#\n", + "print 'FL = %0.2f'%(FL/1000),' KHz '# # Round Off Error\n", + "\n", + "# Acom = 1/(1+%j(F/FL))#\n", + "# After putting value of F ,FL we get\n", + "\n", + "# Acom = 1/(1+%j(158.7))# # 1+%j(158.7) Rectangular Form where real part is 1 and imaginary part is 158.7\n", + "\n", + "# After converting rectangular from into polar from we get\n", + " \n", + "print 'Acom = [ magnitude = 6.3*10**-3 angle = -89.6 degree ]'#\n", + "\n", + "# Ac = Ac1*Acom # equation 1\n", + "\n", + "# after putting Ac1 and Acom value in equation 1 we get Ac1 = 100 angle 90 and Acom = 6.3*10**-3 angle = -89.6 \n", + "\n", + "print 'Ac = [ magnitude = 0.68 angle = 0.4 degree ]'#" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 5.16 Pg 119" + ] + }, + { + "cell_type": "code", + "execution_count": 25, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "FL = 1.1 KHz \n", + "Acom = [ magnitude = 0.68 angle = -47.7 degree ]\n" + ] + } + ], + "source": [ + "# Determine the loop gain of compensated network\n", + "\n", + "C = 0.01*10**-6 # # farad\n", + "R = 15*10**3 # # ohm\n", + "F = 1*10**6 # # Hz\n", + "\n", + "# the close loop gain of a compensated network is defined as\n", + "# Ac = Acl*Acom #\n", + "\n", + "#Acom = 1/(1+%(F/FL))#\n", + "\n", + "FL = 1/(2*3.14*R*C)#\n", + "print 'FL = %0.1f'%(FL/1000),' KHz '# # Round Off Error\n", + "\n", + "# Acom = 1/(1+%j(F/FL))#\n", + "# After putting value of F ,FL we get\n", + "\n", + "# Acom = 1/(1+%j(0.9))# # 1+%j(0.9) Rectangular Form where real part is 1 and imaginary part is 0.9\n", + "\n", + "# After converting rectangular from into polar from we get\n", + " \n", + "print 'Acom = [ magnitude = 0.68 angle = -47.7 degree ]'#" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 5.17 Pg 120" + ] + }, + { + "cell_type": "code", + "execution_count": 26, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "FL = 4.25 KHz \n", + "Acom for F = 0 KHz = [ magnitude = 150 angle = 85 degree ]\n", + "Acom for F = 2 KHz= [ magnitude = 136.4 angle = 64.5 degree ]\n", + "Acom for F = 4 KHz = [ magnitude = 107.14 angle = 41.7 degree ]\n", + "Acom for F = 6 KHz = [ magnitude = 88.24 angle = 30.25 degree ]\n", + "Acom for F = 8 KHz = [ magnitude = 71.4 angle = 23 degree ]\n", + "Acom for F = 10 KHz = [ magnitude = 58.59 angle = 18 degree ]\n", + "Acom for F = 20 KHz = [ magnitude = 31.12 angle = 7 degree ]\n", + "Acom for F = 40 KHz = [ magnitude = 15.9 angle = 1.1 degree ]\n", + "Acom for F = 80 KHz = [ magnitude = 7.9 angle = -2 degree ]\n", + "Acom for F = 100 KHz = [ magnitude = 6.4 angle = -2.6 degree ]\n", + "Acom for F = 200 KHz = [ magnitude = 3.18 angle = -3.8 degree ]\n", + "Acom for F = 400 KHz = [ magnitude = 1.59 angle = -4.4 degree ]\n", + "Acom for F = 800 KHz = [ magnitude = 0.79 angle = -4.7 degree ]\n", + "Acom for F = 1 MHz = [ magnitude = 0.64 angle = -4.7 degree ]\n", + "Acom for F = 1.2 MHz = [ magnitude = 0.52 angle = -4.7 degree ]\n", + "Acom for F = 1.4 MHz = [ magnitude = 0.45 angle = -4.7 degree ]\n", + "Acom for F = 1.6 MHz = [ magnitude = 0.4 angle = -4.7 degree ]\n" + ] + } + ], + "source": [ + "# Determine the loop gain of compensated network\n", + "\n", + "C = 0.5*10**-6 # # farad\n", + "R = 75 # # ohm\n", + "F = 1*10**6 # # Hz\n", + "Ac1 = 150 # \n", + "angle1 = 85 #\n", + "\n", + "# the close loop gain of a compensated network is defined as\n", + "# Ac = Acl*Acom #\n", + "\n", + "#Acom = 1/(1+%(F/FL))#\n", + "\n", + "FL = 1/(2*3.14*R*C)#\n", + "print 'FL = %0.2f'%(FL/1000),' KHz '# # Round Off Error\n", + "\n", + "# Acom = 1/(1+%j(F/FL))#\n", + "\n", + "# After putting value of FL we get\n", + "\n", + "# Acom = 1/(1+%j(F/4.24*10**3))# equation 1\n", + "\n", + "# As F is unknown in above equation 1 \n", + "# by putting different value of F we get Acom for different frequency\n", + "\n", + "\n", + "# If F = 0 KHz\n", + "\n", + "# Acom = 1/(1+%j(0/4.24*10**3))# \n", + "\n", + "# After solving and converting rectangular from into polar from we get\n", + " \n", + "print 'Acom for F = 0 KHz = [ magnitude = 150 angle = 85 degree ]'#\n", + "\n", + "\n", + "# If F = 2 KHz\n", + "\n", + "# Acom = 1/(1+%j(2*10**3/4.24*10**3))# \n", + "\n", + "# After solving and converting rectangular from into polar from we get\n", + " \n", + "print 'Acom for F = 2 KHz= [ magnitude = 136.4 angle = 64.5 degree ]'#\n", + "\n", + "\n", + "# If F = 4 KHz\n", + "\n", + "# Acom = 1/(1+%j(4*10**3/4.24*10**3))# \n", + "\n", + "# After solving and converting rectangular from into polar from we get\n", + " \n", + "print 'Acom for F = 4 KHz = [ magnitude = 107.14 angle = 41.7 degree ]'#\n", + "\n", + "\n", + "# If F = 6 KHz\n", + "\n", + "# Acom = 1/(1+%j(6*10**3/4.24*10**3))# \n", + "\n", + "# After solving and converting rectangular from into polar from we get\n", + " \n", + "print 'Acom for F = 6 KHz = [ magnitude = 88.24 angle = 30.25 degree ]'#\n", + "\n", + "\n", + "\n", + "# If F = 8 KHz\n", + "\n", + "# Acom = 1/(1+%j(8*10**3/4.24*10**3))# \n", + "\n", + "# After solving and converting rectangular from into polar from we get\n", + " \n", + "print 'Acom for F = 8 KHz = [ magnitude = 71.4 angle = 23 degree ]'#\n", + "\n", + "\n", + "\n", + "# If F = 10 KHz\n", + "\n", + "# Acom = 1/(1+%j(10*10**3/4.24*10**3))# \n", + "\n", + "# After solving and converting rectangular from into polar from we get\n", + " \n", + "print 'Acom for F = 10 KHz = [ magnitude = 58.59 angle = 18 degree ]'#\n", + "\n", + "\n", + "\n", + "# If F = 20 KHz\n", + "\n", + "# Acom = 1/(1+%j(20*10**3/4.24*10**3))# \n", + "\n", + "# After solving and converting rectangular from into polar from we get\n", + " \n", + "print 'Acom for F = 20 KHz = [ magnitude = 31.12 angle = 7 degree ]'#\n", + "\n", + "\n", + "\n", + "# If F = 40 KHz\n", + "\n", + "# Acom = 1/(1+%j(40*10**3/4.24*10**3))# \n", + "\n", + "# After solving and converting rectangular from into polar from we get\n", + " \n", + "print 'Acom for F = 40 KHz = [ magnitude = 15.9 angle = 1.1 degree ]'#\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "# If F = 80 KHz\n", + "\n", + "# Acom = 1/(1+%j(80*10**3/4.24*10**3))# \n", + "\n", + "# After solving and converting rectangular from into polar from we get\n", + " \n", + "print 'Acom for F = 80 KHz = [ magnitude = 7.9 angle = -2 degree ]'#\n", + "\n", + "\n", + "\n", + "\n", + "# If F = 100 KHz\n", + "\n", + "# Acom = 1/(1+%j(100*10**3/4.24*10**3))# \n", + "\n", + "# After solving and converting rectangular from into polar from we get\n", + " \n", + "print 'Acom for F = 100 KHz = [ magnitude = 6.4 angle = -2.6 degree ]'#\n", + "\n", + "\n", + "\n", + "\n", + "# If F = 200 KHz\n", + "\n", + "# Acom = 1/(1+%j(200*10**3/4.24*10**3))# \n", + "\n", + "# After solving and converting rectangular from into polar from we get\n", + " \n", + "print 'Acom for F = 200 KHz = [ magnitude = 3.18 angle = -3.8 degree ]'#\n", + "\n", + "\n", + "\n", + "# If F = 400 KHz\n", + "\n", + "# Acom = 1/(1+%j(400*10**3/4.24*10**3))# \n", + "\n", + "# After solving and converting rectangular from into polar from we get\n", + " \n", + "print 'Acom for F = 400 KHz = [ magnitude = 1.59 angle = -4.4 degree ]'#\n", + "\n", + "\n", + "# If F = 800 KHz\n", + "\n", + "# Acom = 1/(1+%j(800*10**3/4.24*10**3))# \n", + "\n", + "# After solving and converting rectangular from into polar from we get\n", + " \n", + "print 'Acom for F = 800 KHz = [ magnitude = 0.79 angle = -4.7 degree ]'#\n", + "\n", + "\n", + "# If F = 1 MHz\n", + "\n", + "# Acom = 1/(1+%j(1*10**6/4.24*10**3))# \n", + "\n", + "# After solving and converting rectangular from into polar from we get\n", + " \n", + "print 'Acom for F = 1 MHz = [ magnitude = 0.64 angle = -4.7 degree ]'#\n", + "\n", + "\n", + "# If F = 1.2 MHz\n", + "\n", + "# Acom = 1/(1+%j(1.2*10**6/4.24*10**3))# \n", + "\n", + "# After solving and converting rectangular from into polar from we get\n", + " \n", + "print 'Acom for F = 1.2 MHz = [ magnitude = 0.52 angle = -4.7 degree ]'#\n", + "\n", + "\n", + "\n", + "# If F = 1.4 MHz\n", + "\n", + "# Acom = 1/(1+%j(1.4*10**6/4.24*10**3))# \n", + "\n", + "# After solving and converting rectangular from into polar from we get\n", + " \n", + "print 'Acom for F = 1.4 MHz = [ magnitude = 0.45 angle = -4.7 degree ]'#\n", + "\n", + "\n", + "# If F = 1.6 MHz\n", + "\n", + "# Acom = 1/(1+%j(1.6*10**6/4.24*10**3))# \n", + "\n", + "# After solving and converting rectangular from into polar from we get\n", + " \n", + "print 'Acom for F = 1.6 MHz = [ magnitude = 0.4 angle = -4.7 degree ]'#" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 5.18 Pg 123" + ] + }, + { + "cell_type": "code", + "execution_count": 27, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "The compensating resistor value is = 15.92 ohm \n" + ] + } + ], + "source": [ + "# to design compensating network\n", + "fp = 500*10**3 # # pole frequency\n", + "C = 0.02*10**-6 # # F # we choose\n", + "# loop gain of compensated network\n", + "\n", + "# ACom =(1)/(1+j(f/fp))\n", + "# fp = (1/2*pie*R*C)\n", + "R = (1/(2*3.14*C*fp))#\n", + "print 'The compensating resistor value is = %0.2f'%R,' ohm '#" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 5.19 Pg 123" + ] + }, + { + "cell_type": "code", + "execution_count": 20, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "FH = 6.37 KHz \n", + "FL = 2.12 KHz \n", + "Acom = [ magnitude = 0.34 angle = -0.24 degree ]\n", + "Ac = [ magnitude = 34 angle = 89.76 degree ]\n" + ] + } + ], + "source": [ + " # Determine the loop gain of compensated network\n", + "\n", + "C = 0.0025*10**-6 # # farad\n", + "R1 = 10*10**3 # # ohm\n", + "R2 = 20*10**3 # # ohm\n", + "F = 1*10**6 # # Hz\n", + "Ac1 = 100 # \n", + "angle1 = 90 #\n", + "\n", + "# the close loop gain of a compensated network is defined as\n", + "\n", + "# Ac = Acl*Acom #\n", + "\n", + "#Acom = (1+%(F/FH))/(1+%(F/FL))#\n", + "\n", + "FH = 1/(2*3.14*R1*C)#\n", + "print 'FH = %0.2f'%(FH/1000),' KHz '# # Round Off Error\n", + "\n", + "\n", + "FL = 1/(2*3.14*(R1+R2)*C)#\n", + "print 'FL = %0.2f'%(FL/1000),' KHz '# # Round Off Error\n", + "\n", + "\n", + "#Acom = (1+%(F/FH))/(1+%(F/FL))#\n", + "\n", + "# After putting value of FH ,FL we get\n", + "\n", + "# Acom = (1+%j(158.7))/(1+%j(471.7) \n", + "\n", + "# After converting rectangular from into polar from we get\n", + " \n", + "print 'Acom = [ magnitude = 0.34 angle = -0.24 degree ]'#\n", + "\n", + "# Ac = Ac1*Acom # equation 1\n", + "\n", + "# after putting Ac1 and Acom value in equation 1 we get Ac1 = 100 angle 90 and Acom = 0.34 angle = -0.24 \n", + "\n", + "print 'Ac = [ magnitude = 34 angle = 89.76 degree ]'#" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 5.20 Pg 124" + ] + }, + { + "cell_type": "code", + "execution_count": 28, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "FH = 1.59 KHz \n", + "FL = 0.64 KHz \n", + "Acom = [magnitude = 0.4] \n" + ] + } + ], + "source": [ + " # Determine the loop gain of compensated network\n", + "C = 0.01*10**-6 # # farad\n", + "R1 = 10*10**3 # # ohm\n", + "R2 = 15*10**3 # # ohm\n", + "F = 1*10**6 # # Hz\n", + "\n", + "\n", + "# the close loop gain of a compensated network is defined as\n", + "\n", + "#Acom = (1+%(F/FH))/(1+%(F/FL))#\n", + "\n", + "FH = 1/(2*3.14*R1*C)#\n", + "print 'FH = %0.2f'%(FH/1000),' KHz '# # Round Off Error\n", + "\n", + "\n", + "FL = 1/(2*3.14*(R1+R2)*C)#\n", + "print 'FL = %0.2f'%(FL/1000),' KHz '# # Round Off Error\n", + "\n", + "\n", + "#Acom = (1+%(F/FH))/(1+%(F/FL))#\n", + "\n", + "# After putting value of FH ,FL we get\n", + "\n", + "# Acom = (1+%j(658.9))/(1+%j(1.56*10**3) \n", + "\n", + "# After converting rectangular from into polar from we get\n", + " \n", + "print 'Acom = [magnitude = 0.4] '#" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 5.21 Pg 125" + ] + }, + { + "cell_type": "code", + "execution_count": 29, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "The compensating first resistor R1 value is = 0.80 K ohm \n", + "The compensating second resistor R2 value is = 7.17 K ohm \n" + ] + } + ], + "source": [ + "# to design compensating network\n", + "fH = 10 # #k ohm # break frequency initiated by a zero\n", + "fL = 1 # #k ohm # break frequency initiated by a pole\n", + "C = 0.02# # uF # we choose\n", + "# loop gain of compensated network\n", + "\n", + "# ACom =(1+j(f/fH))/(1+j(f/fL))\n", + "# fH = (1/2*pie*R1*C)\n", + "# fL = (1/2*pie*(R1+R2)*C)\n", + "R1 = (1/(2*3.14*C*fH))#\n", + "print 'The compensating first resistor R1 value is = %0.2f'%R1,' K ohm '#\n", + "R2 = ((1)/(2*3.14*C*fL))-(R1)#\n", + "print 'The compensating second resistor R2 value is = %0.2f'%R2,' K ohm '#" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 5.22 Pg 126" + ] + }, + { + "cell_type": "code", + "execution_count": 31, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "The input miller capacitance Cin value is = 10.10 uF \n", + "The output miller capacitance Cout value is = 0.10 uF \n" + ] + } + ], + "source": [ + "# To determine input output miller capacitances\n", + "A = 100 # #gain\n", + "Cm = 0.1 # # uF # compensated capacitor\n", + "\n", + "# the input output miller capacitance are defined as\n", + "Cin = Cm*(A+1)#\n", + "print 'The input miller capacitance Cin value is = %0.2f'%Cin,'uF '#\n", + "Cout = (Cm*((A+1)/A))# \n", + "print 'The output miller capacitance Cout value is = %0.2f'%Cout,'uF '#" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 5.23 Pg 127" + ] + }, + { + "cell_type": "code", + "execution_count": 27, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "The input miller capacitance Cin value is = 3.02 uF \n", + "The output miller capacitance Cout value is = 0.02 uF \n", + "The initiated frequency of miller compensating network by pole is = 7.96 KHz \n" + ] + } + ], + "source": [ + "from math import pi\n", + "# To determine input output miller capacitances\n", + "A = 150 # #gain\n", + "Cm = 0.02 # # uF # compensated capacitor\n", + "\n", + "# the input output miller capacitance are defined as\n", + "Cin = Cm*(A+1)#\n", + "print 'The input miller capacitance Cin value is = %0.2f'%Cin,'uF '#\n", + "Cout = (Cm*((A+1)/A))# \n", + "print 'The output miller capacitance Cout value is = %0.2f'%Cout,'uF '#\n", + "\n", + "# In the miller compensating network input capacitance introduce a pole . The initiated frequency of miller compensating network by pole is define as\n", + "\n", + "# fp = 1/(2*pi*R*Cin)#\n", + "R = 1 # # K ohm\n", + "fp = 1/(2*pi*R*Cout)#\n", + "print 'The initiated frequency of miller compensating network by pole is = %0.2f'%fp,' KHz '#" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 5.24 Pg 128" + ] + }, + { + "cell_type": "code", + "execution_count": 41, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "the slew rate of an op-amp is = 17.58 V/u sec \n", + "The compansated capacitance value is = 1.12 pF \n" + ] + } + ], + "source": [ + "# To determine the slew rate of an op-amp\n", + "f = 1 # # MHz # unity frequency\n", + "Ic = 1*10**-6 # # uA # capacitor current\n", + "Vt = 0.7 # # V # threshold voltage\n", + "\n", + "# the slew rate of an op-amp is defined as\n", + "# Slew rate = (dVo/dt)\n", + "Slewrate = 8*3.14*Vt*f #\n", + "print 'the slew rate of an op-amp is = %0.2f'%Slewrate,' V/u sec '#\n", + "\n", + "# The compansated capacitance Cm is\n", + "gm = (Ic/Vt)#\n", + "Cm = (gm/4*3.14*f)*1e6 # pF\n", + "print 'The compansated capacitance value is = %0.2f'%Cm,'pF '#" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 5.25 Pg 129" + ] + }, + { + "cell_type": "code", + "execution_count": 42, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Cut -off frequency of an op-amp is = 5.00 Hz \n" + ] + } + ], + "source": [ + " # To determine the cut off frequency of an op-amp\n", + "f = 1*10**3 # # Hz # unity frequency\n", + "Av = 200 # # V/mV # dc gain\n", + "\n", + "# the unity gain frequency of an op-amp is defined as\n", + "# f = Av*fc #\n", + "\n", + "# cut off frequency\n", + "fc = (f/Av)#\n", + "print 'Cut -off frequency of an op-amp is = %0.2f'%fc,' Hz '#" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 5.26 Pg 129" + ] + }, + { + "cell_type": "code", + "execution_count": 43, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "the closed loop gain ACL is = 35.00 \n", + "The output gain factor K is = 0.88 V\n", + "The maximum frequency of an op-amp fmax = 145.59 KHz\n" + ] + } + ], + "source": [ + "# To find the maximum frequency of input signal in op-amp circuit\n", + "Vin = 25*10**-3 # # V # input voltage\n", + "Slewrate = 0.8/10**-6 # # V/uV # Slew rate of an op-amp\n", + "R2 = 350*10**3 # # ohm # feedback resistance\n", + "R1 = 10*10**3 # # ohm # input resistance\n", + "\n", + "# the closed loop gain\n", + "# ACL = (mod (Vo/Vin)) = (mod(R2/R1))#\n", + "ACL = abs(R2/R1)#\n", + "print 'the closed loop gain ACL is = %0.2f'%ACL,' '#\n", + "\n", + "# the output gain factor K is given as\n", + "K = ACL*Vin #\n", + "print 'The output gain factor K is = %0.2f'%K,' V'#\n", + "\n", + "# the maximum frequency of an op-amp is\n", + "wmax = (Slewrate/K)#\n", + "fmax = wmax/(2*3.14)#\n", + "print 'The maximum frequency of an op-amp fmax = %0.2f'%(fmax/1000),' KHz'#" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 5.27 Pg 129" + ] + }, + { + "cell_type": "code", + "execution_count": 44, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "the closed loop gain ACL is = 24.00 \n", + "The output gain factor K is = 0.36 V\n", + "The wmax is = 2.22 *10**6 rad/sec\n" + ] + } + ], + "source": [ + "# To find the maximum frequency of op-amp circuit\n", + "Vin = 0.015 # # V # input voltage\n", + "Slewrate = 0.8 # # V/uV # Slew rate of an op-amp\n", + "R2 = 120*10**3 # # ohm # feedback resistance\n", + "R1 = 5*10**3 # # ohm # input resistance\n", + "\n", + "# the closed loop gain\n", + "# ACL = (mod (Vo/Vin)) = (mod(R2/R1))#\n", + "ACL = abs(R2/R1)#\n", + "print 'the closed loop gain ACL is = %0.2f'%ACL,' '#\n", + "\n", + "# the output gain factor K is given as\n", + "K = ACL*Vin #\n", + "print 'The output gain factor K is = %0.2f'%K,' V'#\n", + "\n", + "# the maximum frequency of an op-amp is\n", + "wmax = (Slewrate/K)#\n", + "print 'The wmax is = %0.2f'%wmax,'*10**6 rad/sec'# # *10**6 because Slewrate is V/uV \n", + "\n", + "# the signal frequency may be w = 500*10**3 rad/sec that is less than the maximum frequency value" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 5.28 Pg 130" + ] + }, + { + "cell_type": "code", + "execution_count": 49, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "the unity frequency f is = 568.70 kHz \n", + "The compansated capacitance Cm value is = 0.2 nF \n" + ] + } + ], + "source": [ + " # To determine the compensated capacitance of an op-amp\n", + "Slewrate = 10 # # V/u sec\n", + "Ic = 1*10**-3 # # mA # capacitor current\n", + "Vt = 0.7 # # V # threshold voltage\n", + "\n", + "# the slew rate of an op-amp is defined as\n", + "# Slew rate = (dVo/dt)\n", + "# the unity frequency f is\n", + "f =(Slewrate/(8*3.14*Vt))#\n", + "f = f*10**6# # *10**6 because Slew rate is V/uV \n", + "print 'the unity frequency f is = %0.2f'%(f/1e3),'kHz '#\n", + "\n", + "# The compansated capacitance Cm is\n", + "gm = (Ic/Vt)#\n", + "Cm = (gm)/(4*3.14*f)*1e9 #\n", + "print 'The compansated capacitance Cm value is = %0.1f'%Cm,'nF '#" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 5.29 Pg 131" + ] + }, + { + "cell_type": "code", + "execution_count": 51, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "the Slew rate of an op-amp is = 0.50 V/u sec\n" + ] + } + ], + "source": [ + " # To find Slew rate of an op-amp\n", + "Iq = 15 # # uA # bias current\n", + "Cm = 30 # # pF # internal frequency compensated capacitor\n", + "Slewrate = (Iq/Cm)\n", + "print 'the Slew rate of an op-amp is = %0.2f'%Slewrate,' V/u sec'#" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 5.30 Pg 131" + ] + }, + { + "cell_type": "code", + "execution_count": 52, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "the Slew rate of an op-amp is = 0.68 V/u sec\n" + ] + } + ], + "source": [ + "# To find Slew rate of an op-amp\n", + "Iq = 21 # # uA # bias current\n", + "Cm = 31 # # pF # internal frequency compensated capacitor\n", + "Slewrate = (Iq/Cm)#\n", + "print 'the Slew rate of an op-amp is = %0.2f'%Slewrate,' V/u sec'#" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 5.31 Pg 131" + ] + }, + { + "cell_type": "code", + "execution_count": 56, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "The full power bandwidth FPBW is = 8.12 kHz \n", + "The 3-db frequency or small signal band width f3db is = 10 kHz \n" + ] + } + ], + "source": [ + " # To determine full power and small signal bandwidth of an op-amp with unity gain\n", + "f = 100*10**6 # # Hz unity gain bandwidth\n", + "ACL = 10**4 # # maximum closed loop gain\n", + "Slewrate = 0.51 # # V/u sec\n", + "Vp = 10 # # V peak volt\n", + "\n", + "# The full power bandwidth\n", + "FPBW = (Slewrate/(2*3.14*Vp))#\n", + "FPBW = FPBW*10**6 # # *10**6 because Slew rate is V/uV \n", + "print 'The full power bandwidth FPBW is = %0.2f'%(FPBW/1e3),'kHz '#\n", + "\n", + "# the 3-db frequency or small signal band width \n", + "f3db = (f/ACL)#\n", + "print 'The 3-db frequency or small signal band width f3db is = %0.f'%(f3db/1e3),'kHz '#" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 5.32 Pg 132" + ] + }, + { + "cell_type": "code", + "execution_count": 59, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "The full power bandwidth FPBW is = 8.12 kHz \n", + "The 3-db frequency or small signal band width f3db is = 10 kHz \n" + ] + } + ], + "source": [ + "# To determine full power and small signal bandwidth of an op-amp with unity gain\n", + "f = 100*10**6 # # Hz unity gain bandwidth\n", + "ACL = 10**4 # # maximum closed loop gain\n", + "Slewrate = 0.51 # # V/u sec\n", + "Vp = 10 # # V peak volt\n", + "\n", + "# The full power bandwidth\n", + "FPBW = (Slewrate/(2*3.14*Vp))#\n", + "FPBW = FPBW*10**6 # # *10**6 because Slew rate is V/uV \n", + "print 'The full power bandwidth FPBW is = %0.2f'%(FPBW/1e3),'kHz '#\n", + "\n", + "# the 3-db frequency or small signal band width \n", + "f3db = (f/ACL)#\n", + "print 'The 3-db frequency or small signal band width f3db is = %0.f'%(f3db/1e3),'kHz '#" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 5.33 Pg 132" + ] + }, + { + "cell_type": "code", + "execution_count": 60, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "the Slew rate of an op-amp is = 0.31 V/u sec \n", + "The closed loop gain ACL is = 83.33 \n" + ] + } + ], + "source": [ + "# To find Slew rate and closed loop gain of an op-amp\n", + "fu = 1*10**6 # # Hz # unity gain bandwidth\n", + "fmax = 5*10**3 # # KHz # full power bandwidth\n", + "F3db = 12*10**3 # # Hz # small signal bandwidth\n", + "Vp = 10 # # V # peak volt\n", + "\n", + "# the full power bandwidth of an op-amp\n", + "# fmax=FPBW = (Slew rate/2*3.14*Vp)#\n", + "Slewrate = 2*3.14*Vp*fmax#\n", + "Slewrate = Slewrate*(10**-6)# # *10**-6 because Slewrate is V/u \n", + "print 'the Slew rate of an op-amp is = %0.2f'%Slewrate,' V/u sec '#\n", + "\n", + "# # the 3-db frequency or small signal band width \n", + "#f3db = (f/ACL)#\n", + "#the closed loop gain ACL\n", + "ACL = fu/F3db #\n", + "print 'The closed loop gain ACL is = %0.2f'%ACL,' '#" + ] + } + ], + "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 +} diff --git a/Linear_Integrated_Circuit_by_M._S._Sivakumar/Ch6.ipynb b/Linear_Integrated_Circuit_by_M._S._Sivakumar/Ch6.ipynb new file mode 100644 index 00000000..c7160709 --- /dev/null +++ b/Linear_Integrated_Circuit_by_M._S._Sivakumar/Ch6.ipynb @@ -0,0 +1,2030 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 6 Applications of Operational Amplifier" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 6.1 Pg 140" + ] + }, + { + "cell_type": "code", + "execution_count": 116, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "the input resistance is = 20.00 kohm\n", + "The resistance R2 is = 100.00 kohm\n" + ] + } + ], + "source": [ + "# Design an inverting amplifier\n", + "Av = -5 #\n", + "#V1 = 0.1 sin wt #\n", + "V1 = 0.1 # # *sin wt #\n", + "i = 5*10**-6 #\n", + "\n", + "# the input resistance \n", + "R1 = V1/i / 1000 # kohm\n", + "print 'the input resistance is = %0.2f'%R1,'kohm'#\n", + "\n", + "# The resistance R2\n", + "#Av = -(R2/R1)#\n", + "R2 = -(Av*R1)#\n", + "print 'The resistance R2 is = %0.2f'%R2,'kohm'#" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 6.2 Pg 141" + ] + }, + { + "cell_type": "code", + "execution_count": 117, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "the input resistance is = 20.00 kohm\n", + "The resistance R2 is = 80.00 kohm\n" + ] + } + ], + "source": [ + "# Design an non inverting amplifier\n", + "Av = 5 #\n", + "#V1 = 0.1 sin wt #\n", + "V1 = 0.1 #\n", + "i = -5*10**-6 #\n", + "\n", + "# the input resistance \n", + "R1 = -V1/i/1000 # kohm\n", + "print 'the input resistance is = %0.2f'%R1,'kohm'#\n", + "\n", + "# The resistance R2\n", + "#Av = 1+(R2/R1)#\n", + "R2 = (Av-1)*R1#\n", + "print 'The resistance R2 is = %0.2f'%R2,'kohm'#" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 6.3 Pg 146" + ] + }, + { + "cell_type": "code", + "execution_count": 118, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "the cut off frequency of phase shifter is = 723.43 Hz\n", + "The phase shift is = -15.75\n" + ] + } + ], + "source": [ + "# To calculate phase shift between two extremes \n", + "C = 0.22*10**-6 #\n", + "R = 1*10**3 #\n", + "f = 1*10**3 #\n", + "\n", + "# the cut off frequency of phase shifter \n", + "fc = 1/(2*pi*R*C) #\n", + "print 'the cut off frequency of phase shifter is = %0.2f'%fc,'Hz'#\n", + "f\n", + "# the phase shift\n", + "f = 1 # # KHz\n", + "fc = 7.23 # # KHz \n", + "from math import atan ,degrees\n", + "PS = -2*degrees(atan(f/fc))\n", + "print 'The phase shift is = %0.2f'%PS" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 6.4 Pg 146" + ] + }, + { + "cell_type": "code", + "execution_count": 119, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "The value of resistance is = 1.92 kohm\n" + ] + } + ], + "source": [ + "# To design a phase shifter\n", + "f = 2*10**3 #\n", + "PS = -135 #\n", + "# the phase shift\n", + "# PS = -2*atand(2*pi*R*C)#\n", + "#RC = 192.1*10**-6 #\n", + "C = 0.1*10**-6 #\n", + "R = (192.1*10**-6)/C/1000 # kohm\n", + "print 'The value of resistance is = %0.2f'%R,'kohm'#" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 6.5 Pg 153" + ] + }, + { + "cell_type": "code", + "execution_count": 120, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "The value of resistance R1 is = 25.00 kohm\n", + "The value of resistance R3 is = 25.00 kohm\n", + "The value of resistance R2 is = 750.00 kohm\n", + "The value of resistance R4 is = 750.00 kohm\n" + ] + } + ], + "source": [ + "# Design a difference amplifier\n", + "Ri = 50 # kohm\n", + "Ad = 30 \n", + "\n", + "R1 = Ri/2 #\n", + "print 'The value of resistance R1 is = %0.2f'%R1,'kohm'#\n", + "R3 = R1 #\n", + "print 'The value of resistance R3 is = %0.2f'%R3,'kohm'#\n", + "\n", + "# the differential gain\n", + "#Ad = R2/R1 #\n", + "R2 = 30*R1 #\n", + "print 'The value of resistance R2 is = %0.2f'%R2,'kohm'#\n", + "\n", + "R4 = R2 #\n", + "print 'The value of resistance R4 is = %0.2f'%R4,'kohm'# " + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 6.6 Pg 154" + ] + }, + { + "cell_type": "code", + "execution_count": 121, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "The common mode rejection ratio is = 26.58 dB\n" + ] + } + ], + "source": [ + "# Calculate CMRR ratio\n", + "Ad = 10.24 #\n", + "Acm = 0.48 #\n", + "\n", + "# the common mode rejection ratio CMRR is defined as\n", + "CMRRdB = 20*log10(Ad/Acm)#\n", + "print 'The common mode rejection ratio is = %0.2f'%CMRRdB,' dB'" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 6.7 Pg 156" + ] + }, + { + "cell_type": "code", + "execution_count": 122, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + " The feedback resistance is = 100.00 kohm\n", + " The value of resistance R1 is = 100.00 kohm\n" + ] + } + ], + "source": [ + "# Design current to voltage converter\n", + "Vo =-10 #\n", + "Is = 100*10**-6 #\n", + "\n", + "# the output voltage of current to voltage converter is defined as\n", + "#Vo =-1s*R2 \n", + "R2 = -Vo/Is/1000 #kohm\n", + "print ' The feedback resistance is = %0.2f'%R2,'kohm'#\n", + "\n", + "R1 = R2 #\n", + "print ' The value of resistance R1 is = %0.2f'%R1,'kohm'#" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 6.8 Pg 157" + ] + }, + { + "cell_type": "code", + "execution_count": 123, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "The value of resistance R2 is = 44.78 kohm\n" + ] + } + ], + "source": [ + "# Design high sensitivity current to voltage converter\n", + "R1 = 5 # kohm\n", + "Is = 1 #\n", + "KR = 0.01/10**9 # # V / nA\n", + "\n", + "# the output voltage of high sensitivity current to voltage converter\n", + "Vo =-KR*Is #\n", + "KR = 10*10**6 #\n", + "R = 1*10**6 # #we assume then\n", + "K = 10 #\n", + "#1 + (R2/R1)+(R2/R) = 10 #\n", + "# solving above equation we get\n", + "\n", + "R2 = 9*((5*10**6)/(10**3+5))/1000 # kohm\n", + "print 'The value of resistance R2 is = %0.2f'%R2,'kohm'# " + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 6.9 Pg 160" + ] + }, + { + "cell_type": "code", + "execution_count": 124, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "The load current iL is = 5.00 mA\n", + "The current i3 is = 0.50 mA\n", + "The current iA is = 5.50 mA\n", + "The output voltage is = 6.00 V\n", + "The current i1 is = 49.40 A\n", + "The current i2 is = 49.40 A\n" + ] + } + ], + "source": [ + "# Determine a load current in a V to I converter\n", + "R1 = 10 # kohm\n", + "R2 = 10 # koohm\n", + "R3 = 1 # kohm\n", + "R4 = 1 # kohm\n", + "VI = -5 #\n", + "\n", + "# The Load Current\n", + "iL = -VI/R3 #\n", + "print 'The load current iL is = %0.2f'%iL,'mA'#\n", + "\n", + "VL = 0.5 #\n", + "# The Current i3 and iA\n", + "i3 = VL/R3 #\n", + "print 'The current i3 is = %0.2f'%i3,'mA'#\n", + "\n", + "iA = i3+iL #\n", + "print 'The current iA is = %0.2f'%iA,'mA'#\n", + "\n", + "# the output voltage \n", + "Vo = (iA*R3)+VL #\n", + "print 'The output voltage is = %0.2f'%Vo,' V'#\n", + "\n", + "ZL =100 #\n", + "# The current i1 and i2 \n", + "#i1 = (VI-iL*ZL)/R1 #\n", + "i1 = (iL*ZL-Vo)/R2 #\n", + "print 'The current i1 is = %0.2f'%i1,' A'#\n", + "\n", + "i2 = i1 #\n", + "print 'The current i2 is = %0.2f'%i2,' A'#" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 6.10 Pg 163" + ] + }, + { + "cell_type": "code", + "execution_count": 125, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "The value of resistance R1f is = 0.0606 K ohm \n", + "The value of resistance R2 is = 75.5 K ohm \n" + ] + } + ], + "source": [ + "# Design an instrumentation amplifier\n", + "#A = 5 to 500 # adjustable gain\n", + "VR = 100*10**3 #\n", + "\n", + "# the maximum differential gain of instrumentation amplifier is 500 \n", + "#Amax = (R4/R3)*(1+(2R2/R1))#\n", + "#by solving above equation we get following equation\n", + "# 2R2 -249R1f = 0 equation 1\n", + "\n", + "# the minimum differential gain of instrumentation amplifier is 5\n", + "# Amin = (R4/R3)*(1+(2R2/R1)) #\n", + "#by solving above equation we get following equation\n", + "# 2R2 -1.5R1f = 150*10**3 equation 2\n", + "\n", + "#by solving equation 1 and 2 we get\n", + "print 'The value of resistance R1f is = 0.0606 K ohm '#\n", + "\n", + "print 'The value of resistance R2 is = 75.5 K ohm '#" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 6.11 Pg 164" + ] + }, + { + "cell_type": "code", + "execution_count": 127, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "The value of resistane R1 is = 9.09 kohm\n" + ] + } + ], + "source": [ + " # To find the value of resistance R1 for instrumentation amplifier\n", + "A =100 #\n", + "R2 = 450*10**3 #\n", + "R3 = 1*10**3 #\n", + "R4 = 1*10**3 #\n", + "\n", + "# The gain of differential amplifier \n", + "# A = (R4/R3)*(1+(2R2/R1)) #\n", + "#but R3 = R4 then\n", + "# A = 1+(2R2/R1) #\n", + "R1 = 2*R2/(A-1)/1000 # kohm\n", + "print 'The value of resistane R1 is = %0.2f'%R1,'kohm'# " + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 6.12 Pg 167" + ] + }, + { + "cell_type": "code", + "execution_count": 130, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + " At t = 1 msec the time constant RC is = 0.10 m sec\n", + " if C = 0.01 uF then R of RC time constant is = 10 K ohm \n", + " if C = 0.001 uF then R of RC time constant is = 100 K ohm \n" + ] + } + ], + "source": [ + "# determine the time constant of an integrator\n", + "Vo = 10 # # at t= 1 m sec\n", + "t = 1 # # m sec\n", + "\n", + "# the output of integrator \n", + "#Vo = t/RC # when t is from 0 to 1\n", + "RC = t/Vo #\n", + "print ' At t = 1 msec the time constant RC is = %0.2f'%RC,' m sec'#\n", + "\n", + "print ' if C = 0.01 uF then R of RC time constant is = 10 K ohm '#\n", + "\n", + "print ' if C = 0.001 uF then R of RC time constant is = 100 K ohm '#" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 6.13 Pg 168" + ] + }, + { + "cell_type": "code", + "execution_count": 131, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + " The feedback resistance Rf is = 100.00 kohm\n", + " The frequency fa is = 2.00 kHz\n", + " The value of capacitor C is = 0.8 nF \n" + ] + } + ], + "source": [ + "# Design an integrator circuit\n", + "A = 10 #\n", + "f =20*10**3 #\n", + "R = 10*10**3 # # we assume \n", + "Rf =10*R #\n", + "\n", + "print ' The feedback resistance Rf is = %0.2f'%(Rf/1000),'kohm'#\n", + "\n", + "# for proper integration f>= 10fa \n", + "fa = f/10/1000 #\n", + "print ' The frequency fa is = %0.2f'%fa,'kHz'#\n", + "\n", + "# in practical integrator\n", + "#fa = 1/(2*pi*Rf*C)#\n", + "\n", + "C = 1/(2*pi*Rf*fa)*1e6# nF\n", + "print ' The value of capacitor C is = %0.1f'%C,'nF '#" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 6.1 Pg 185" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "the value of resistance R1 is = 0.199 Mohm\n", + "the value of resistance R2 is = 1 Mohm\n" + ] + } + ], + "source": [ + "from __future__ import division\n", + "# design an inverting amplifier with a closed loop voltage gain of Av = -5\n", + "Av = -5 #\n", + "Is = 5*10**-6 # # A\n", + "Rs = 1*10**3 # # ohm\n", + "# input voltage source Vs = sinwt volts\n", + "\n", + "# in an inverting amplifier frequency effect is neglected then i/p volt Vin = 1 V and total resistance equal to Rs+R1\n", + "\n", + "# the input current can be written as Iin=Is\n", + "# Is = (Vin/Rs+R1)#\n", + "Iin = Is#\n", + "Vin = 1 # # V\n", + "R1 = (1-(Iin*Rs))/Iin #\n", + "print 'the value of resistance R1 is = %0.3f'%(R1/1e6),'Mohm'#\n", + "\n", + "# closed loop voltage gain of an inverting amplifier\n", + "#Av = -(R2/Rs+R1)\n", + "R2 = -(Av*(Rs+R1))#\n", + "print 'the value of resistance R2 is = %0.f'%(R2/1e6),'Mohm'#" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 6.2 Pg 186" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "the value of resistance R1 is = 8 kohm\n", + "the value of resistance R2 is = 72 kohm\n" + ] + } + ], + "source": [ + " # design an inverting amplifier with a closed loop voltage gain of Av = 10\n", + "Av = 10 #\n", + "Vin = 0.8 # #V\n", + "Iin = 100*10**-6 # # A\n", + "# in an non- inverting amplifier the input voltage Vin=V1=V2 because of vortual short effect then the i/p current In = Vin/R1\n", + "R1 = Vin/Iin/1e3\n", + "print 'the value of resistance R1 is = %0.f'%R1,'kohm'#\n", + "\n", + "# closed loop voltage gain of an non-inverting amplifier\n", + "#Av = Vo/Vin = (1+R2/R1)\n", + "R2 = (Av-1)*R1 # kohm\n", + "print 'the value of resistance R2 is = %0.f'%R2,'kohm'#" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 6.3 Pg 187" + ] + }, + { + "cell_type": "code", + "execution_count": 13, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "the value of resistance R1 is = 20.00 kohm\n", + "the value of resistance R2 is = 80.00 kohm\n", + "the output current I2 is = 50 uA\n" + ] + } + ], + "source": [ + "# design an non-inverting amplifier with colsed loop gain of 5 limited voltage of -5 V <= Vo <= 5 V and maximum i/p c/n 50 uA\n", + "R1 = 8*10**3 # # ohm\n", + "R2 = 72*10**3 # # ohm\n", + "Iin = 50*10**-6 # # A\n", + "Vo = 5 # # V \n", + "\n", + "# closed loop gain\n", + "#Av = Vo/Vin = (1+R2/R1)\n", + "Av = 1+(R2/R1)#\n", + "# but \n", + "Av = 5 #\n", + "# then\n", + "# (R2/R1) = 4 #\n", + "\n", + "# the output voltage of the amplifier is Vo = 5 V \n", + "#i.e\n", + "Vin = 1 # # V\n", + "# Iin = Vin/R1 #\n", + "R1 = Vin/Iin/1e3\n", + "print 'the value of resistance R1 is = %0.2f'%R1,'kohm'#\n", + "\n", + "R2 = 4*R1 #\n", + "print 'the value of resistance R2 is = %0.2f'%R2,'kohm'#\n", + "\n", + "# the output current I2 is given as\n", + "I2 = (Vo-Vin)/R2*1e3 # uA\n", + "print 'the output current I2 is = %0.f'%I2,'uA'#" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 6.4 Pg 188" + ] + }, + { + "cell_type": "code", + "execution_count": 16, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "the value of resistance Ria is = 20.00 kohm\n", + "the value of resistance Rib is = 15.00 kohm\n", + "the value of resistance Ric is = 30.00 kohm\n" + ] + } + ], + "source": [ + "# Design a op-amp circuit to provide the output voltage Vo = -2(3 V1 +4 V2 +2 V3)\n", + "# Vo = -2(3 V1 + 4 V2+ 2 V3)# equation 1\n", + "# the output of the summer circuit is given as\n", + "# Vo = -R2((Via/Ria)+(Vib/Rib)+(Vic/Ric)) equation 2\n", + "\n", + "# compare equation 1 and 2 of Vo we get \n", + "\n", + "# (R2/Ria)= 6 #\n", + "# (R2/Rbi=8 #\n", + "# (R2/Ric)=4 #\n", + "\n", + "R2 = 120*10**3/1e3 # # we choose then \n", + "\n", + "Ria = R2/6 #\n", + "print 'the value of resistance Ria is = %0.2f'%Ria,'kohm'#\n", + "\n", + "Rib = R2/8 #\n", + "print 'the value of resistance Rib is = %0.2f'%Rib,'kohm'#\n", + "\n", + "Ric = R2/4 #\n", + "print 'the value of resistance Ric is = %0.2f'%Ric,'kohm'#" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 6.5 Pg 188" + ] + }, + { + "cell_type": "code", + "execution_count": 20, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "the value of resistance Ria is = 90.00 kohm\n", + "the value of resistance Rib is = 42.00 kohm\n", + "the value of resistance Ric is = 63.00 kohm\n", + "the value of resistance Rid is = 210.00 kohm\n" + ] + } + ], + "source": [ + " # Design a summing amplifier circuit to provide the output voltage Vo = -(7 V11 + 15 V12 + 10 V13 + 3 V14)\n", + "R2 = 630# kohm # Assume feedback resistance\n", + "# Vo = -(7 V11 + 15 V12 + 10 V13 + 3 V14)# equation 1\n", + "# the output of the summer circuit is given as\n", + "# Vo = -R2((Via/Ria)+(Vib/Rib)+(Vic/Ric)+(Vid/Rid)) equation 2\n", + "\n", + "# compare equation 1 and 2 of Vo we get \n", + "\n", + "# (R2/Ria)= 7 #\n", + "# (R2/Rbi= 15 #\n", + "# (R2/Ric)= 10 #\n", + "# (R2/Rid)= 3 #\n", + "\n", + "Ria = R2/7 #\n", + "print 'the value of resistance Ria is = %0.2f'%Ria,' kohm'#\n", + "\n", + "Rib = R2/15 #\n", + "print 'the value of resistance Rib is = %0.2f'%Rib,' kohm'#\n", + "\n", + "Ric = R2/10 #\n", + "print 'the value of resistance Ric is = %0.2f'%Ric,' kohm'#\n", + "\n", + "Rid = R2/3 #\n", + "print 'the value of resistance Rid is = %0.2f'%Rid,'kohm'#" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 6.6 Pg 190" + ] + }, + { + "cell_type": "code", + "execution_count": 22, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "the value of resistance R2 is = 300.00 kohm\n", + "the value of resistance R4 is = 33333.33 kohm\n" + ] + } + ], + "source": [ + "# Design a op-amp circuit to provide the output voltage Vo = V2 - 3 V1 with Ri1 =Ri2 = 100*10**3\n", + "Ri1 = 100 # # kohm\n", + "Ri2 = 100 # # kohm\n", + "# the i/p resistance \n", + "R1 = Ri1 #\n", + "R3 = Ri2 #\n", + "\n", + "# Vo = V2 - 3 V1# equation 1\n", + "# the output of the summer circuit is given as\n", + "# Vo = [(R4/(R3+R4)*(1+(R2/R1))*Vi2-(R2/R1)*Vi1] equation 2\n", + "\n", + "# compare equation 1 and 2 of Vo we get \n", + "# (R4/(R3+R4)*(1+(R2/R1)) = 1 # equation 3\n", + "# R2/R1 = 3 # equation 4\n", + "\n", + "# by subsituting the value of R1 and R3 in equation 3 and 4\n", + "\n", + "# from equation 4\n", + "R2 = 3*R1 #\n", + "print 'the value of resistance R2 is = %0.2f'%R2,'kohm'#\n", + "\n", + "# from equation 3\n", + "R4 = (100*10**3)/3 #\n", + "print 'the value of resistance R4 is = %0.2f'%R4,'kohm'#" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 6.7 Pg 191" + ] + }, + { + "cell_type": "code", + "execution_count": 31, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "The load current iL is = 5 mA\n", + "The voltage across load VL is = 1.00 V\n", + "The non-inverting current across i3 is = 1.00 mA\n", + "The non-inverting current across i4 is = 6.00 mA\n", + "The output voltage of given voltage to current converter is = 6.00 V\n" + ] + } + ], + "source": [ + " # determine the load current and output voltage\n", + "Vin = -5 # # V\n", + "ZL = 200 # # ohm\n", + "R1 = 10*10**3 # # ohm\n", + "R2 = 10*10**3 # # ohm\n", + "R3 = 1*10**3 # # ohm\n", + "R4 = 1*10**3 # # ohm\n", + "\n", + "# the load c/n of the given voltage to c/n converter circuit is given by\n", + "iL =-Vin/(R1*R4)*R2*1e3 # m\n", + "print 'The load current iL is = %0.f'%iL,'mA'#\n", + "\n", + "# the voltage across the load \n", + "VL = iL/1e3*ZL#\n", + "print 'The voltage across load VL is = %0.2f'%VL,' V'#\n", + "\n", + "# the non-inverting current across i3 and i4 are\n", + "i3 = VL/R3*1000 #mA\n", + "print 'The non-inverting current across i3 is = %0.2f'%i3,'mA'#\n", + "\n", + "i4 = iL+i3 # mA\n", + "print 'The non-inverting current across i4 is = %0.2f'%i4,'mA'#\n", + "\n", + "# the output voltage of given voltage to current converter is given by\n", + "Vo = (iL/1e3*R3)+VL #\n", + "print 'The output voltage of given voltage to current converter is = %0.2f'%Vo,' V'#" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 6.8 Pg 192" + ] + }, + { + "cell_type": "code", + "execution_count": 33, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "The common mode rejection ratio CMRR is = 120.50 \n", + "The common mode rejection ratio CMRR in decibel is = 41.62 dB \n" + ] + } + ], + "source": [ + "from math import log10\n", + "# determine the common mode rejection ratio CMRR\n", + "# R2/R1 = 10 #\n", + "# R4/R3 = 11 #\n", + "\n", + "# the output of the difference amplifier is given by\n", + "# Vo = (((R4)/(R3+R4))*(((1+(R2/R1))*VI2))-((R2/R1)*VI1))#\n", + "\n", + "# putting R1 R2 R3 R4 value in above equation we get Vo as\n", + "\n", + "# Vo =(121/12)*VI2-10VI1 # equation 1\n", + "\n", + "# the differential mode input of difference amplifier is given by\n", + "# Vd = VI2-VI1 # eqution 2\n", + "\n", + "# the common mode input of difference amplifier is given by\n", + "# VCM = (VI2+VI1)/2 # equation 3\n", + "\n", + "# from equation 2 and 3 \n", + "\n", + "# VI1 = VCM-Vd/2 # equation 4\n", + "\n", + "# VI2 = VCM+Vd/2 # equation 5\n", + "\n", + "# substitute equation 4 and 5 in 1 we get \n", + "# Vo = (VCM/12)+(241Vd/24)# equation6\n", + "\n", + "# Vd = Ad*Vd+ACM*VCM # equation 7\n", + "\n", + "#equation from equation 6 and 7 we get\n", + "\n", + "Ad = 241/24 #\n", + "ACM = 1/12 #\n", + "\n", + "# the common mode rejection ratio CMRR is \n", + "CMRR = abs(Ad/ACM)#\n", + "print 'The common mode rejection ratio CMRR is = %0.2f'%CMRR,' '#\n", + "\n", + "# in decibal it can be expressed as\n", + "\n", + "CMRR = 20*log10(CMRR)#\n", + "print 'The common mode rejection ratio CMRR in decibel is = %0.2f'%CMRR,' dB '#" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 6.9 Pg 194" + ] + }, + { + "cell_type": "code", + "execution_count": 34, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "The output of the difference amplifier is = -8.12 V \n", + "The output of the difference amplifier is = 0.12 V \n", + "the common mode input of difference amplifier is = 2.00 \n", + "the common mode gain ACM of difference amplifier is = 0.06 \n", + "the differential gain of the difference amplifier is = 2.00 \n", + "The common mode rejection ratio CMRR is = 32.00 \n", + "The common mode rejection ratio CMRR in decibel is = 30.10 dB \n" + ] + } + ], + "source": [ + "# determine Vo when 1) VI1 = 2 V VI2 = -2 V and 2) VI1 = 2 V VI2 = 2 V\n", + "# and common mode rejection ratio CMRR\n", + "R1 = 10*10**3 # # ohm\n", + "R2 = 20*10**3 # # ohm\n", + "R3 = 10*10**3 # # ohm\n", + "R4 = 22*10**3 # # ohm\n", + "\n", + "\n", + "# the output of the difference amplifier is given by\n", + "# Vo = (((R4)/(R3+R4))*(((1+(R2/R1))*VI2))-((R2/R1)*VI1))#\n", + "\n", + "# Case 1 when VI1 = 2 V VI2 = -2 V\n", + "VI1 = 2 #\n", + "VI2 = -2 #\n", + "\n", + "Vo = (((R4)/(R3+R4))*(((1+(R2/R1))*VI2))-((R2/R1)*VI1))#\n", + "print 'The output of the difference amplifier is = %0.2f'%Vo,' V '#\n", + "\n", + "# case 2 when VI1 = 2 V VI2 = 2 V\n", + "VI1 = 2 #\n", + "VI2 = 2 #\n", + "\n", + "Vo = (((R4)/(R3+R4))*(((1+(R2/R1))*VI2))-((R2/R1)*VI1))#\n", + "print 'The output of the difference amplifier is = %0.2f'%Vo,' V '#\n", + "\n", + "# the common mode input of difference amplifier is given by\n", + "VCM = (VI2+VI1)/2 #\n", + "print 'the common mode input of difference amplifier is = %0.2f'%VCM,' '#\n", + "\n", + "# the common mode gain ACM of difference amplifier is given by\n", + "ACM = Vo/VCM\n", + "print 'the common mode gain ACM of difference amplifier is = %0.2f'%ACM,' '#\n", + "\n", + "# the differential gain of the difference amplifier is given \n", + "Ad = R2/R1 # \n", + "print 'the differential gain of the difference amplifier is = %0.2f'%Ad,' '#\n", + "\n", + "# the common mode rejection ratio CMRR is \n", + "CMRR = abs(Ad/ACM)#\n", + "print 'The common mode rejection ratio CMRR is = %0.2f'%CMRR,' '#\n", + "\n", + "# in decibal it can be expressed as\n", + "CMRR = 20*log10(CMRR)#\n", + "print 'The common mode rejection ratio CMRR in decibel is = %0.2f'%CMRR,' dB '#" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 6.10 Pg 195" + ] + }, + { + "cell_type": "code", + "execution_count": 35, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "the maximum differential voltage gain of the instrumentation amplifier is = 101.00 \n", + "the minimum differential voltage gain of the instrumentation amplifier is = 5.00 \n", + " the range of the differential voltage gain of the instrumentation amplifier is \n", + " 5 <= Av <= 101 \n" + ] + } + ], + "source": [ + "# To determine the range of the differential voltage gain\n", + "#R1 = 1 K ohm to 25 K ohm #\n", + "R2 = 50 # # K ohm\n", + "R3 = 10 # # K ohm\n", + "R4 = 10 # # K ohm\n", + "\n", + "# the output of instrumentation amplifier is given by\n", + "#Vo = (R4/R3)*(1+(2*R2/R1))*(VI@-VI1)#\n", + "\n", + "# the differential voltage gain of the instrumentation amplifier can be written as\n", + "#Av = (Vo/(VI2-VI1)) = (R4/R3)*(1+(2R2/R1))#\n", + "\n", + "# For R1 = 1 K ohm the maximum differential voltage gain of the instrumentation amplifier is\n", + "R1 = 1 # # K ohm\n", + "Av = (R4/R3)*(1+(2*R2/R1))#\n", + "print 'the maximum differential voltage gain of the instrumentation amplifier is = %0.2f'%Av,' '#\n", + "\n", + "# For R1 = 25 K ohm the mminimum differential voltage gain of the instrumentation amplifier is\n", + "R1 = 25 # # K ohm\n", + "Av = (R4/R3)*(1+(2*R2/R1))#\n", + "print 'the minimum differential voltage gain of the instrumentation amplifier is = %0.2f'%Av,' '#\n", + "\n", + "print ' the range of the differential voltage gain of the instrumentation amplifier is '#\n", + "print ' 5 <= Av <= 101 '#" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 6.11 Pg 196" + ] + }, + { + "cell_type": "code", + "execution_count": 36, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "The variable resistance R1 varies is 401 ohm <= R1 <= 100.2 K-ohm \n" + ] + } + ], + "source": [ + "# To design an instrumentation amplifier\n", + "# 4 <= Av <= 1000 # gain\n", + "Ad = 2 #\n", + "Res = 100 # # K ohm\n", + "\n", + "# we cosider the variable resistance is R1 , the maximum and the minimum range of variable resistance \n", + "# R1min = R1 # \n", + "# R1max = R1+100 #\n", + "\n", + "# the gain of difference amplifier \n", + "#A3 = Ad = Vo/(Vo2-Vo1) = (R4/R3)\n", + "\n", + "# the maximum range of differential voltage gain Avmax = 1000 when R1min = R1\n", + "#Avmax = R4/R3*(1+(2*R2/R1min))#\n", + "\n", + "# by solvin we get following equation\n", + "# 499*R1-2*R2=0 equation 1\n", + "\n", + "# the maximum range of differential voltage gain Avmin =4 when R1max = R1+100 K ohm\n", + "# Avmin = (R4/R3)*(1+(2R2/R1max))#\n", + "\n", + "# by solving above equation we get\n", + "# R1 -2 R2 = -200 K ohm equation 2\n", + "\n", + "#by solving equation 1 and 2 we get\n", + "R1 = 401 # # ohm\n", + "R2 = 100.2 # # ohm\n", + "print 'The variable resistance R1 varies is 401 ohm <= R1 <= 100.2 K-ohm ' #" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 6.12 Pg 198" + ] + }, + { + "cell_type": "code", + "execution_count": 41, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + " The time constant of the given filter is RC = 0.20 msec \n" + ] + } + ], + "source": [ + " # Determine the time constant of the integrator\n", + "Vo = 10 #\n", + "t = 2*10**-3 #\n", + "VI = -1 # # at t =0 #\n", + "\n", + "# The output voltage of an integrator is define as\n", + "RC = t/10*1e3 # ms\n", + "print ' The time constant of the given filter is RC = %0.2f'%RC,'msec '#" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 6.13 Pg 198" + ] + }, + { + "cell_type": "code", + "execution_count": 48, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + " The time constant of the given filter is RC = 0.1 msec \n", + "The capacitor value is = 0.1 F\n" + ] + } + ], + "source": [ + "from __future__ import division\n", + "# Determine the time constant of the integrator\n", + "Vo = 20 #\n", + "t = 1*10**-3 #\n", + "VI = -1 # # at t =0 #\n", + "\n", + "# The output voltage of an integrator is define as\n", + "RC = t/10 #\n", + "print ' The time constant of the given filter is RC = %0.1f'%(RC*1000),'msec '#\n", + "\n", + "R = 1*10**3 # # we assume \n", + "C = RC/R*10**6 #\n", + "print 'The capacitor value is = %0.1f'%C,'F'#" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 6.14 Pg 199" + ] + }, + { + "cell_type": "code", + "execution_count": 49, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "The value of resistance RIa is = 90.00 K ohm \n", + "The value of resistance RIb is = 22.50 K ohm \n", + "The value of resistance RIc is = 18.00 K ohm \n", + "The value of resistance RId is = 15.00 K ohm \n" + ] + } + ], + "source": [ + " # to design a summing amplifier\n", + "\n", + "# the output of the summing amplifier is given by\n", + "#Vo = -R2*((VIa/RIa)+(VIb/RIb)+(VIc/RIc)+(VId/RId))# equation 1\n", + "\n", + "# the equation given is\n", + "#Vo = -(3*VIa+12*VIb+15*VIc+18*VId)# equation 2\n", + "\n", + "# comparing equation 1 and 2\n", + "#R2/RIa = 3 #\n", + "#R2/RIb = 12 #\n", + "#R2/RIc = 15 #\n", + "#R2/RId = 18 # \n", + "\n", + "# the feedback resistance R2= 270 K ohm \n", + "R2 = 270 # # K ohm\n", + "RIa = R2/3 #\n", + "print 'The value of resistance RIa is = %0.2f'%RIa,' K ohm '#\n", + "\n", + "RIb = R2/12 #\n", + "print 'The value of resistance RIb is = %0.2f'%RIb,' K ohm '#\n", + "\n", + "RIc = R2/15 #\n", + "print 'The value of resistance RIc is = %0.2f'%RIc,' K ohm '#\n", + "\n", + "RId = R2/18 #\n", + "print 'The value of resistance RId is = %0.2f'%RId,' K ohm '#" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 6.15 Pg 200" + ] + }, + { + "cell_type": "code", + "execution_count": 50, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "The output of first op-amp A1 is = -275*sin wt mV \n", + "The output of second op-amp A2 is = 275*sin wt mV \n", + "The output of third op-amp A3 is = 825*sin wt mV \n", + "current through the resistor R1 and R2 is = 5 sin wt uA \n", + "current through the non-inverting terminal resistor R3 and R4 = 5.5 sin wt uA \n", + "current through the inverting terminal resistor R3 and R4 = 22 sin wt uA \n" + ] + } + ], + "source": [ + "# for the instrumentation amplifier find Vo1 , Vo2 , Vo \n", + "# Vi1 = -25 sin wt # # mV\n", + "# Vi2 = 25 sin wt # # mV\n", + "R1 = 10*10**3 #\n", + "R2 = 20*10**3 #\n", + "R3 = 20*10**3 #\n", + "R4 = 10*10**3 #\n", + "\n", + "# the output of first op-amp A1 is given by\n", + "# Vo1 = (1+(R2/R1))*Vi1-(R2/R1)*Vi2 #\n", + "#by solving above equation we get\n", + "print 'The output of first op-amp A1 is = -275*sin wt mV '#\n", + "\n", + "# the output of second op-amp A2 is given by\n", + "# Vo2 = (1+(R2/R1))*Vi2-(R2/R1)*Vi1 #\n", + "#by solving above equation we get\n", + "print 'The output of second op-amp A2 is = 275*sin wt mV '#\n", + "\n", + "# the output of third op-amp A3 is given by\n", + "# Vo = (R4/R3)-(1+(2R2/R1)*(Vi2-Vi1) #\n", + "#by solving above equation we get\n", + "print 'The output of third op-amp A3 is = 825*sin wt mV '#\n", + "\n", + "# current through the resistor R1 and R2 is\n", + "#i = (Vi1-Vi2)/R1 #\n", + "print 'current through the resistor R1 and R2 is = 5 sin wt uA '#\n", + "\n", + "# current through the non-inverting terminal resistor R3 and R4 \n", + "#i3 = Vo2/(R3+R4)#\n", + "print 'current through the non-inverting terminal resistor R3 and R4 = 5.5 sin wt uA '#\n", + "\n", + "# current through the inverting terminal resistor R3 and R4 \n", + "#i2 = Vo1-(R3/(R3+R4))*Vo2/R3 #\n", + "print 'current through the inverting terminal resistor R3 and R4 = 22 sin wt uA '#" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 6.16 Pg 202" + ] + }, + { + "cell_type": "code", + "execution_count": 52, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "The input resistance Rin is = 0.00999 ohm \n", + "The value of Resistance Rs is = 1.0990 K ohm \n" + ] + } + ], + "source": [ + " # for the a current to voltage converter show a) Rin = (Rf/1+Aop) b) Rf = 10 K ohm Aop = 1000 \n", + "\n", + "#a) The input resistance given as\n", + "#Rin = (Rf)/(1+Aop) #\n", + "\n", + "# The input resistance of the circuit can be written as\n", + "#Rin = (V1/i!)#\n", + "\n", + "# the feedback current of the given circuit is defined as\n", + "#i1 =(V1-Vo)/RF #\n", + "\n", + "# the feedback resistance RF is \n", + "#RF =(V1-Vo)/i1 #\n", + "\n", + "# The output voltage Vo is\n", + "#Vo = -Aop*V1 #\n", + "\n", + "#by using this output feedback currenty i1 can be reformed as\n", + "#i1 = (V1-(-Aop*V1))/RF #\n", + "\n", + "#i1 = V1*(1+Aop)/RF #\n", + "\n", + "# Then Rin Becomes \n", + "#Rin =Rf/(1+Aop)#\n", + "\n", + "Rf =10*10**3 #\n", + "Aop = 1000 #\n", + "\n", + "# the input current and output voltage of the circuit are defined as\n", + "#i1 =(Rs)/(Rs+Rin) #\n", + "# Vo = -(Aop*(RF/1+Aop))*i1 #\n", + "\n", + "#the input resistance Rin is \n", + "Rin =(Rf/(1+Aop)) #\n", + "\n", + "# subsituting the value of RF Aop Rin and Vo we get \n", + "RF = 10 #\n", + "Rin = RF/(1+Aop)\n", + "print 'The input resistance Rin is = %0.5f'%Rin,' ohm '#\n", + "\n", + "Aop = 1000 #\n", + "#(1000/1001)*(Rs/(Rs*0.00999))> 0.99 #\n", + "# by solving above equation we get \n", + "Rs = 1.099 # # K ohm \n", + "print 'The value of Resistance Rs is = %0.4f'%Rs,' K ohm '#" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 6.17 Pg 204" + ] + }, + { + "cell_type": "code", + "execution_count": 54, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "for Aop = 10**4 closed loop gain is = 0.9999 \n", + "for Aop = 10**3 closed loop gain is = 0.9990 \n", + "for Aop = 10**2 closed loop gain is = 0.9901 \n", + "for Aop = 10**1 closed loop gain is = 0.9091 \n" + ] + } + ], + "source": [ + " # determine the closed loop gain\n", + "\n", + "# the output of the voltage follower is given as\n", + "#Vo = Aop(V1-Vo)#\n", + "\n", + "# the closed loop gain of the voltage follower \n", + "#A = 1/(1+(1/Aop))#\n", + " \n", + "# for Aop = 10**4 closed loop gain\n", + "Aop = 10**4 #\n", + "A = 1/(1+(1/Aop))#\n", + "print 'for Aop = 10**4 closed loop gain is = %0.4f'%A,' '#\n", + "\n", + "# for Aop = 10**3 closed loop gain\n", + "Aop = 10**3 #\n", + "A = 1/(1+(1/Aop))#\n", + "print 'for Aop = 10**3 closed loop gain is = %0.4f'%A,' '#\n", + "\n", + "# for Aop = 10**2 closed loop gain\n", + "Aop = 10**2 #\n", + "A = 1/(1+(1/Aop))#\n", + "print 'for Aop = 10**2 closed loop gain is = %0.4f'%A,' '#\n", + "\n", + "# for Aop = 10**1 closed loop gain\n", + "Aop = 10**1 #\n", + "A = 1/(1+(1/Aop))#\n", + "print 'for Aop = 10**1 closed loop gain is = %0.4f'%A,' '#" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 6.18 Pg 205" + ] + }, + { + "cell_type": "code", + "execution_count": 56, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "for the frequency f = 10 Hz the output is = 106.10 V \n", + "for the frequency f = 1000 Hz the output is = 1.06 V \n", + "for the frequency f = 10000 Hz the output is = 0.106 V \n" + ] + } + ], + "source": [ + "from math import pi\n", + "# To determine the output voltage of integrator\n", + "Vin = 1 #\n", + "R = 150*10**3 ## ohm\n", + "C = 1*10**-9 # # F\n", + "\n", + "# the output voltage of an integrator is given as\n", + "#Vo = (fc/f)*Vin #\n", + "\n", + "#fc = 1/(2*pi*R*C)#\n", + "\n", + "#Vo = (1/(2*pi*R*C*f))*Vin#\n", + "\n", + "#for the frequency f = 10 Hz the output is\n", + "f = 10 # # Hz\n", + "Vo = (1/(2*pi*R*C*f))*Vin#\n", + "print 'for the frequency f = 10 Hz the output is = %0.2f'%Vo,' V '#\n", + "\n", + "#for the frequency f = 1000 Hz the output is\n", + "f = 1000 # # Hz\n", + "Vo = (1/(2*pi*R*C*f))*Vin#\n", + "print 'for the frequency f = 1000 Hz the output is = %0.2f'%Vo,' V '#\n", + "\n", + "#for the frequency f = 10000 Hz the output is\n", + "f = 10000 # # Hz\n", + "Vo = (1/(2*pi*R*C*f))*Vin#\n", + "print 'for the frequency f = 10000 Hz the output is = %0.3f'%Vo,' V '#" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 6.19 Pg 206" + ] + }, + { + "cell_type": "code", + "execution_count": 63, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "The cutoff frequency of the integrator is = 13.263 kHz\n", + "The gain of the integrator is = 3.18\n" + ] + } + ], + "source": [ + "from math import sqrt\n", + "# To determine the magnitude gain of the integrator\n", + "Vin = 1 #\n", + "f = 50*10**3 #\n", + "Rf = 120*10**3 #\n", + "R = 10*10**3 #\n", + "C = 0.1*10**-9 #\n", + "\n", + "# the magnitude gain of the integrator is given by\n", + "#A = (Rf/R)/(sqrt(1+(f/fc)**2))#\n", + "\n", + "# the cutoff frequency of the integrator \n", + "fc = 1/(2*pi*Rf*C)/1e3\n", + "print 'The cutoff frequency of the integrator is = %0.3f'%fc,'kHz'#\n", + "\n", + "\n", + "A = (Rf/R)/(sqrt(1+(f/fc)**2))*1e3#\n", + "print 'The gain of the integrator is = %0.2f'%A" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 6.20 Pg 207" + ] + }, + { + "cell_type": "code", + "execution_count": 67, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "the break frequency fa is = 31.83 kHz \n", + "the break frequency fb is = 21.22 kHz \n", + "The gain of the differentiator is = 0.6667 \n" + ] + } + ], + "source": [ + " # To determine the magnitude gain of the differentiator\n", + "Vin = 1 #\n", + "f = 50*10**3 #\n", + "R = 75*10**3 #\n", + "R1 = 50*10**3 #\n", + "C = 0.1*10**-9 #\n", + "\n", + "# the magnitude gain of the differentiator is given by\n", + "#A = (f/fa)/(sqrt(1+(f/fb)**2))#\n", + "\n", + "# the break frequency fa is defined as\n", + "fa = 1/(2*pi*R1*C) / 1e3\n", + "print 'the break frequency fa is = %0.2f'%fa,'kHz '#\n", + "\n", + "# the break frequency fb is defined as\n", + "fb = 1/(2*pi*R*C) /1e3\n", + "print 'the break frequency fb is = %0.2f'%fb,'kHz '#\n", + "\n", + "\n", + "A = (f/fa)/(sqrt(1+(f/fb)**2))#\n", + "print 'The gain of the differentiator is = %0.4f'%A,' '#" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 6.21 Pg 209" + ] + }, + { + "cell_type": "code", + "execution_count": 70, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "The input voltage of an op-amp is = -40 mV\n" + ] + } + ], + "source": [ + " # to determine the input voltage of an op-amp\n", + "Vo = 2 # # V\n", + "R1 = 20*10**3 # # ohm\n", + "R2 = 1*10**6 # # ohm\n", + "\n", + "# the input voltage of an op-amp\n", + "Vin = -(R1/R2)*Vo *1000 # mV\n", + "print 'The input voltage of an op-amp is = %0.f'%Vin,'mV'#" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 6.22 Pg 209" + ] + }, + { + "cell_type": "code", + "execution_count": 71, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "the output voltage of follower Vo1 is = 2.00 V\n", + "The output voltage of an inverting amplifier is = -20.00 V \n" + ] + } + ], + "source": [ + "# To determine the output voltage\n", + "Vin = 2 #\n", + "R2 = 20*10**3 #\n", + "R1 = 2*10**3 #\n", + "\n", + "# the output voltage of follower Vo1 is\n", + "Vo1 = Vin #\n", + "print 'the output voltage of follower Vo1 is = %0.2f'%Vo1,' V'#\n", + "# the output voltage of an inverting amplifier\n", + "Vo = -(R2/R1)*Vo1 #\n", + "print 'The output voltage of an inverting amplifier is = %0.2f'%Vo,' V '#" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 6.23 Pg 210" + ] + }, + { + "cell_type": "code", + "execution_count": 72, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "The output of the inverting amplifier is = -15.00 V\n", + "The output of the non-inverting amplifier is = 20.00 V\n" + ] + } + ], + "source": [ + "# to determine the output voltage of an op-amp\n", + "Vin = 5 # # V\n", + "R1 = 25*10**3 # # ohm\n", + "R2 = 75*10**3 # # ohm\n", + "\n", + "# in this problem op-amp A1 perform the voltage follower and op-amp A2 perform inverting amplifier and op-amp A3 perform non-inverting amplifier\n", + "\n", + "# the output voltage of follower op-amp A1\n", + "Vo1 = Vin #\n", + "\n", + "# the output of the inverting amplifier A2\n", + "Vo2 = -((R2/R1)*Vo1) #\n", + "print 'The output of the inverting amplifier is = %0.2f'%Vo2,' V'#\n", + "\n", + "# the output of the non-inverting amplifier A3\n", + "Vo =(1+(R2/R1))*Vo1 #\n", + "print 'The output of the non-inverting amplifier is = %0.2f'%Vo,' V'#" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 6.24 Pg 211" + ] + }, + { + "cell_type": "code", + "execution_count": 73, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "The output voltage of an inverting amplifier is = 27.50 V \n", + "the output voltage of follower Vo1 is = 2.50 V\n", + "the output of the inverting summing amplifier is = 101.25 V \n" + ] + } + ], + "source": [ + " # To determine the output voltage\n", + "Vin = 2.5 #\n", + "Rf = 100*10**3 #\n", + "R1 = 10*10**3 #\n", + "RI1 = 25*10**3 #\n", + "RI2 = 10*10**3 #\n", + "R2 = 100*10**3 #\n", + "\n", + "# the output voltage of an inverting amplifier\n", + "Vo1 = (1+(R2/R1))*Vin # #\n", + "print 'The output voltage of an inverting amplifier is = %0.2f'%Vo1,' V '#\n", + "\n", + "# the output voltage of follower Vo2 is\n", + "Vo2 = Vin #\n", + "print 'the output voltage of follower Vo1 is = %0.2f'%Vo2,' V'#\n", + "\n", + "# the output of the inverting summing amplifier\n", + "R2 = 75*10**3 #\n", + "Vo = R2*((Vo1/RI1)+(Vo2/RI2))#\n", + "print 'the output of the inverting summing amplifier is = %0.2f'%Vo,' V '#" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 6.25 Pg 212" + ] + }, + { + "cell_type": "code", + "execution_count": 74, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "the total gain of the circuit is = 36.00 \n", + "The output voltage of the op-amp is = 90.00 V\n" + ] + } + ], + "source": [ + "# To calculate the output voltage\n", + "Vin = 2.5 # \n", + "R1 = 10*10**3 #\n", + "R2 = 10*10**3 #\n", + "R3 = 10*10**3 #\n", + "Rf = 30*10**3 #\n", + "\n", + "# the total gain of the circuit \n", + "#Av =A1v*A2v*A3v #\n", + "Av = (1+(Rf/R1))*(-Rf/R2)*(-Rf/R3)#\n", + "print 'the total gain of the circuit is = %0.2f'%Av,' '#\n", + "\n", + "# The output voltage of the op-amp \n", + "Vo = Av*Vin #\n", + "print 'The output voltage of the op-amp is = %0.2f'%Vo,' V'#" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 6.26 Pg 212" + ] + }, + { + "cell_type": "code", + "execution_count": 76, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "The output of op-amp A1 is = -10.00 V1\n", + "The output of op-amp A2 is Vo = 40V1 - 2V2 \n", + "The output is equal to the difference between 40V1 and 2V2 \n" + ] + } + ], + "source": [ + "# to calculate the output voltage of op-amp circuit\n", + "Rf = 100*10**3 # # ohm\n", + "R1 = 10*10**3 # # ohm\n", + "R2 = 25*10**3 # # ohm\n", + "R3 = 50*10**3 # # ohm\n", + "\n", + "# the output of op-amp A1 is\n", + "# VA1 = (-Rf/R1)*V1 #\n", + "VA1 = (-Rf/R1)#\n", + "print 'The output of op-amp A1 is = %0.2f'%VA1,'V1' # # *V1 because the output is come from 1 op-amp\n", + "\n", + "# the output of op-amp A2 is\n", + "# Vo = -Rf*((VA1/R2)+(V2/R3))#\n", + "#Vo = -100*(-0.4*V1+0.02V2)#\n", + "print 'The output of op-amp A2 is Vo = 40V1 - 2V2 '# \n", + "\n", + "print 'The output is equal to the difference between 40V1 and 2V2 '# " + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 6.27 Pg 213" + ] + }, + { + "cell_type": "code", + "execution_count": 77, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "the upper crossover voltage of schmitt trigger is = 1.00 V\n", + "the lower crossover voltage of schmitt trigger is = -1.00 V\n", + "the hysteresis width HW of schmitt trigger is = 2.00 V\n" + ] + } + ], + "source": [ + " # to determine the hysteresis width of a schmitt trigger\n", + "R1 = 25*10**3 # # ohm\n", + "R2 = 75*10**3 # # ohm\n", + "VTH = 4 # # V\n", + "VTL = -4 # # V\n", + "\n", + "# the upper crossover voltage of schmitt trigger is defined as\n", + "VU = (R1/(R1+R2))*VTH#\n", + "print 'the upper crossover voltage of schmitt trigger is = %0.2f'%VU,' V'\n", + "\n", + "# the lower crossover voltage of schmitt trigger is defined as\n", + "VL = (R1/(R1+R2))*VTL#\n", + "print 'the lower crossover voltage of schmitt trigger is = %0.2f'%VL,' V'\n", + "\n", + "# the hysteresis width of schmitt trigger is\n", + "HW = VU-VL #\n", + "print 'the hysteresis width HW of schmitt trigger is = %0.2f'%HW,' V'" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 6.28 Pg 214" + ] + }, + { + "cell_type": "code", + "execution_count": 78, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "the upper crossover voltage of schmitt trigger is = 1.43 V\n", + "the lower crossover voltage of schmitt trigger is = -1.43 V\n", + "the hysteresis width HW of schmitt trigger is = 2.86 V\n" + ] + } + ], + "source": [ + " # to determine the hysteresis width of a schmitt trigger\n", + "R1 = 15*10**3 # # ohm\n", + "R2 = 90*10**3 # # ohm\n", + "VTH = 10 # # V\n", + "VTL = -10 # # V\n", + "\n", + "# the upper crossover voltage of schmitt trigger is defined as\n", + "VU = (R1/(R1+R2))*VTH#\n", + "print 'the upper crossover voltage of schmitt trigger is = %0.2f'%VU,' V'\n", + "\n", + "# the lower crossover voltage of schmitt trigger is defined as\n", + "VL = (R1/(R1+R2))*VTL#\n", + "print 'the lower crossover voltage of schmitt trigger is = %0.2f'%VL,' V'\n", + "\n", + "# the hysteresis width of schmitt trigger is\n", + "HW = VU-VL #`\n", + "print 'the hysteresis width HW of schmitt trigger is = %0.2f'%HW,' V'" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 6.29 Pg 214" + ] + }, + { + "cell_type": "code", + "execution_count": 80, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "the value of resistance R1 is = 5.00 kohm\n" + ] + } + ], + "source": [ + "# to determine the resistance R1 when low and high saturated output states are given\n", + "R2 = 20*10**3 # # ohm\n", + "VH = 2 # # V crossover voltage\n", + "VL = -2 # # V crossover voltage\n", + "VOH = 10 # # V saturated output states\n", + "VOL = -10 # # V saturated output states\n", + "\n", + "# the upper crossover voltage of schmitt trigger is defined as\n", + "# V = (R1/(R1+R2))*VOH#\n", + "# solving above equation we get \n", + "# 2R1+2R2 = 10R1 #\n", + "R1 = (2*R2)/8/1000 # kohm\n", + "print 'the value of resistance R1 is = %0.2f'%R1,'kohm'" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 6.30 Pg 215" + ] + }, + { + "cell_type": "code", + "execution_count": 82, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "the value of resistance R2 is = 30.00 kohm\n" + ] + } + ], + "source": [ + "# to determine the value of resistance R1 and R2 when low and high saturated output states are given\n", + "VH = 3 # # V crossover voltage\n", + "VL = -3 # # V crossover voltage\n", + "VOH = 12 # # V saturated output states\n", + "VOL = -12 # # V saturated output states\n", + "\n", + "# the upper crossover voltage of schmitt trigger is defined as\n", + "# V = (R1/(R1+R2))*VOH#\n", + "# solving above equation we get \n", + "# 3R1+3R2 = 12R1 #\n", + "\n", + "# 3*R1 = R2 #\n", + "R1 = 10*10**3 # # ohm we assume\n", + "R2 = 3*R1 / 1e3#\n", + "print 'the value of resistance R2 is = %0.2f'%R2,'kohm'" + ] + } + ], + "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 +} diff --git a/Linear_Integrated_Circuit_by_M._S._Sivakumar/Ch7.ipynb b/Linear_Integrated_Circuit_by_M._S._Sivakumar/Ch7.ipynb new file mode 100644 index 00000000..b665ce02 --- /dev/null +++ b/Linear_Integrated_Circuit_by_M._S._Sivakumar/Ch7.ipynb @@ -0,0 +1,722 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 7 Filters and Rectifiers" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 7.1 Pg 232" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "The resistor value is = 1.59 k ohm \n" + ] + } + ], + "source": [ + "from __future__ import division\n", + "from math import pi, sqrt\n", + "# Design active low filter with cut-off frequency 10 kHz\n", + "fc = 10 # # kHz\n", + "C = 0.01 # #uF # we assume\n", + "\n", + "# the cut-off frequency of active low pass filter is defined as\n", + "# fc = (1/2*pi*R3*C)#\n", + "\n", + "# R3 can be calculated as\n", + "R3 = (1/(2*pi*fc*C))#\n", + "print 'The resistor value is = %0.2f'%R3,' k ohm '" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 7.2 Pg 233" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "The resistor value is = 106 ohm \n", + "The pass band gain is = 1.50 \n" + ] + } + ], + "source": [ + " # Design active low filter with cut-off frequency 15 kHz\n", + "fc = 15*10**3 # # Hz \n", + "C = 0.1*10**-6 # #F # we assume\n", + "\n", + "# the cut-off frequency of active low pass filter is defined as\n", + "# fc = (1/2*pi*R3*C)#\n", + "\n", + "# R3 can be calculated as\n", + "R3 = (1/(2*pi*fc*C))#\n", + "print 'The resistor value is = %0.f'%R3,' ohm '\n", + "\n", + "# the pass band gain of filter is given by\n", + "# Af = 1+(R2/R1)#\n", + "# assume that the inverting terminal resistor R2=0.5*R1#\n", + "# in Af equation if we put R2=0.5R1 in R1 R1 cancellout each other \n", + "Af = 1+(0.5)\n", + "print 'The pass band gain is = %0.2f'%Af,' '" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 7.3 Pg 234" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "The resistor value is = 159 Kohm \n", + "The resistor R2 value is = 900.00 k ohm \n", + "The magnitude of an active low pass filter is = 1.96 \n", + "The phase angle of the filter is = -78.69 \n" + ] + } + ], + "source": [ + "from __future__ import division\n", + "# Design active low filter with cut-off frequency 20 kHz\n", + "fc = 20 # # kHz \n", + "f = 100 # # frequency of filter\n", + "Af = 10 # # desired pass band gain\n", + "C = 0.05 # #nF # we assume\n", + "\n", + "# the cut-off frequency of active low pass filter is defined as\n", + "# fc = (1/2*pi*R3*C)#\n", + "\n", + "# R3 can be calculated as\n", + "R3 = (1/(2*pi*fc*1e3*C*1e-9))/1e3 # Kohm\n", + "print 'The resistor value is = %0.f'%R3,' Kohm '\n", + "\n", + "# the pass band gain of filter is given by\n", + "# Af = 1+(R2/R1)#\n", + "# assume that the inverting terminal resistor R1= 100 k ohm#\n", + "R1 = 100 # # k ohm\n", + "R2 = (Af*R1)-R1#\n", + "print 'The resistor R2 value is = %0.2f'%R2,' k ohm '\n", + "\n", + "# the magnitude of an active low pass filter is given as\n", + "A = Af/(sqrt(1+(f/fc)**2))#\n", + "print 'The magnitude of an active low pass filter is = %0.2f'%A,' '\n", + "\n", + "#the phase angle of the filter\n", + "from math import atan , degrees\n", + "Angle = -degrees(atan(f/fc))#\n", + "print 'The phase angle of the filter is = %0.2f'%Angle,' '" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 7.4 Pg 236" + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "The frequency of the first order low pass filter is = 2.65 kHz \n", + "The pass band gain of filter is = 13.00 \n" + ] + } + ], + "source": [ + " # to determine the cut-off frequency and pass band gain Af\n", + "R1 = 1 # # k ohm\n", + "R2 = 12 # # k ohm\n", + "R3 = 1.2 # # k ohm\n", + "C = 0.05 # #uF # we assume\n", + "\n", + "# the frequency of the first order low pass filter is defined as\n", + "fc = (1/(2*pi*R3*C))#\n", + "print 'The frequency of the first order low pass filter is = %0.2f'%fc,' kHz '\n", + "\n", + "# the pass band gain of filter is given by\n", + "Af =(1+R2/R1)#\n", + "print 'The pass band gain of filter is = %0.2f'%Af,''" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 7.5 Pg 236" + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "The capacitor of high pass filter is = 25.13 uF \n", + "The second resistor value is = 90.00 K ohm \n" + ] + } + ], + "source": [ + " # to design a first order high pass filter with cut-off frequency 2kHz\n", + "Af = 10 #\n", + "fc = 2 # # kHz \n", + "R3 = 2 # #K ohm # we assume\n", + "R1 = 10 # # k ohm\n", + "# the capacitor of high pass filter is given by\n", + "C = 2*pi*R3*fc#\n", + "print 'The capacitor of high pass filter is = %0.2f'%C,' uF '\n", + "\n", + "# the voltage gain of the high pass filter is\n", + "# Af = 1+(R2/R1)#\n", + "R2 = R1*(Af-1)#\n", + "print 'The second resistor value is = %0.2f'%R2,' K ohm '" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 7.6 Pg 237" + ] + }, + { + "cell_type": "code", + "execution_count": 11, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "The resistance R3 is = 1.59 K ohm \n" + ] + } + ], + "source": [ + " # to design an active high pass filter with cut-off frequency 10kHz\n", + "fc = 10 # # kHz \n", + "C = 0.01 # #uF # we assume\n", + "# the cut-off frequency of active high pass filter is given by\n", + "# fc = 2*pi*R3*C#\n", + "# R3 can be calculated as\n", + "R3 = (1/(2*pi*fc*C))#\n", + "print 'The resistance R3 is = %0.2f'%R3,' K ohm '" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 7.7 Pg 238" + ] + }, + { + "cell_type": "code", + "execution_count": 13, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "The resistance R3 is = 64 Kohm \n", + "The pass band gain is = 1.20 \n" + ] + } + ], + "source": [ + "# to design an active high pass filter with cut-off frequency 25kHz\n", + "fc = 25 # # kHz \n", + "C = 0.1 # #nF # we assume\n", + "# the cut-off frequency of active high pass filter is given by\n", + "# fc = 2*pi*R3*C#\n", + "# R3 can be calculated as\n", + "R3 = (1/(2*pi*fc*1e3*C*1e-9)) / 1e3 # Kohm\n", + "print 'The resistance R3 is = %0.f'%R3,' Kohm '\n", + "\n", + "# the desire pass band gain of filter is given by \n", + "#Af = 1+(R2/R1)#\n", + "# assume that the inverting terminal resistor R2=0.2*R1#\n", + "# in Af equation if we put R2=0.2R1 in R1 R1 cancellout each other \n", + "Af = 1+(0.2)\n", + "print 'The pass band gain is = %0.2f'%Af,' '" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 7.8 Pg 239" + ] + }, + { + "cell_type": "code", + "execution_count": 15, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "The resistance R3 is = 159 K ohm \n", + "The resistance R2 is = 700.00 K ohm \n", + "The magnitude of an active high pass filter is = 14.55 \n", + "The phase angle of the filter is = 14.04 degree\n" + ] + } + ], + "source": [ + "## # to design an active high pass filter with cut-off frequency 20kHz \n", + "Af = 15 #\n", + "fc = 20 # #kHz\n", + "f = 80 # # kHz the frequency of filter \n", + "C = 0.05 # #nF # we assume\n", + "# the cut-off frequency of active high pass filter is given by\n", + "# fc = 2*pi*R3*C#\n", + "# R3 can be calculated as\n", + "R3 = (1/(2*pi*fc*C))#\n", + "print 'The resistance R3 is = %0.f'%(R3*1000),' K ohm ' # Round Off Error\n", + "\n", + "# the desire pass band gain of filter is given by \n", + "#Af = 1+(R2/R1)#\n", + "# assume that the inverting terminal resistor R1=50 K ohm#\n", + "R1 = 50 # # K ohm\n", + "R2 = (R1*Af)-(R1)\n", + "print 'The resistance R2 is = %0.2f'%R2,' K ohm '\n", + "\n", + "# the magnitude of an active high pass filter is given as\n", + "A = Af*(f/fc)/(sqrt(1+(f/fc)**2))#\n", + "print 'The magnitude of an active high pass filter is = %0.2f'%A,' '\n", + "\n", + "#the phase angle of the filter\n", + "from numpy import inf\n", + "Angle = degrees(-atan(f/fc)+atan(inf))\n", + "print 'The phase angle of the filter is = %0.2f'%Angle,' degree' # Round Off Error" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 7.9 Pg 241" + ] + }, + { + "cell_type": "code", + "execution_count": 17, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "The lower cut-off frequency FLC of band pass filter is = 159.2 Hz \n", + "The upper cut-off frequency FUC of band pass filter is = 15.92 kHz \n" + ] + } + ], + "source": [ + "# to calculate upper and lower cut-off frequency of the band pass filter\n", + "R1 = 10*10**3 # #K ohm\n", + "R2 = 10 # #K ohm\n", + "C1 = 0.1*10**-6 # # uF\n", + "C2 = 0.001 # #uF\n", + "\n", + "# the lower cut-off frequency of band pass filter is\n", + "fLC = 1/(2*pi*R1*C1)#\n", + "print 'The lower cut-off frequency FLC of band pass filter is = %0.1f'%fLC,' Hz '\n", + "\n", + "# The upper cut-off frequency of band pass filter is\n", + "fUC = 1/(2*pi*R2*C2)#\n", + "print 'The upper cut-off frequency FUC of band pass filter is = %0.2f'%fUC,' kHz '" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 7.10 Pg 242" + ] + }, + { + "cell_type": "code", + "execution_count": 18, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "The resistance R3 Value is = 7.96 M ohm \n", + "The resistance R6 value is = 1.59 M ohm \n" + ] + } + ], + "source": [ + "# to design an active band pass filter with lower cut-off frequency 10 kHz an upper 50 kHz\n", + "fL = 10 # # kHz\n", + "fH = 50 # # kHz\n", + "C1 = 0.002 # # nF\n", + "C2 = 0.002 # # nF\n", + "\n", + "# the lower cut-off frequency of band pass filter is\n", + "# fL = 1/(2*pi*R3*C1)#\n", + "R3 = 1/(2*pi*fL*C1)#\n", + "print 'The resistance R3 Value is = %0.2f'%R3,' M ohm '\n", + "\n", + "# The upper cut-off frequency of band pass filter is\n", + "# fH = 1/(2*pi*R6*C2)#\n", + "R6 = 1/(2*pi*fH*C2)#\n", + "print 'The resistance R6 value is = %0.2f'%R6,' M ohm '" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 7.11 Pg 243" + ] + }, + { + "cell_type": "code", + "execution_count": 20, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "The resistance R3 Value is = 7.96 M ohm \n", + "The resistance R6 value is = 3.98 M ohm \n", + "The desire pass band gain of filter is = 15 \n" + ] + } + ], + "source": [ + "# to design an active band pass filter with lower cut-off frequency 20 kHz an upper 40 kHz\n", + "fL = 20 # # kHz\n", + "fH = 40 # # kHz\n", + "# the inverting terminal resistance 2R1=R2 and 4R4=R5\n", + "C1 = 0.001 # # nF\n", + "C2 = 0.001 # # nF\n", + "\n", + "# the lower cut-off frequency of band pass filter is\n", + "# fL = 1/(2*pi*R3*C1)#\n", + "R3 = 1/(2*pi*fL*C1)#\n", + "print 'The resistance R3 Value is = %0.2f'%R3,' M ohm '\n", + "\n", + "# The upper cut-off frequency of band pass filter is\n", + "# fH = 1/(2*pi*R6*C2)#\n", + "R6 = 1/(2*pi*fH*C2)#\n", + "print 'The resistance R6 value is = %0.2f'%R6,' M ohm '\n", + "\n", + "# the desire pass band gain of filter is defined as\n", + "R1 = 1 # # M ohm we assume\n", + "#we define inverting terminal resistance 2R1=R2\n", + "R2 = 2 # # M ohm\n", + "# then\n", + "R4 = 1 # #M ohm\n", + "R5 = 4 # # M ohm\n", + "Af = (1+(R2/R1))*(1+(R5/R4))#\n", + "print 'The desire pass band gain of filter is = %d'%Af,' '" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 7.12 Pg 244" + ] + }, + { + "cell_type": "code", + "execution_count": 23, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "The resistance R3 Value is = 7.96 M ohm \n", + "The resistance R6 value is = 1.99 M ohm \n", + "The desire pass band gain of filter is = 15.00 \n", + "The magnitude of gain of band pass filter is = 11.49 \n", + "The phase angle of gain of band pass filter is = 50 degree\n" + ] + } + ], + "source": [ + "# to design an active band pass filter with lower cut-off frequency 20 kHz an upper 80 kHz\n", + "f = 100 # # kHz the frequency of band pass filter\n", + "fL = 20 # # kHz\n", + "fH = 80 # # kHz\n", + "# the inverting terminal resistance R1=0.5*R2 and R4=0.25*R5\n", + "C1 = 0.001 # # nF\n", + "C2 = 0.001 # # nF\n", + "\n", + "# the lower cut-off frequency of band pass filter is\n", + "# fL = 1/(2*pi*R3*C1)#\n", + "R3 = 1/(2*pi*fL*C1)#\n", + "print 'The resistance R3 Value is = %0.2f'%R3,' M ohm '\n", + "\n", + "# The upper cut-off frequency of band pass filter is\n", + "# fH = 1/(2*pi*R6*C2)#\n", + "R6 = 1/(2*pi*fH*C2)#\n", + "print 'The resistance R6 value is = %0.2f'%R6,' M ohm ' # Round Off Error\n", + "\n", + "# the desire pass band gain of filter is defined as\n", + "R1 = 1 # # M ohm we assume\n", + "#we define inverting terminal resistance R1=0.5*R2\n", + "R2 = 2 # # M ohm\n", + "# then\n", + "R4 = 1 # #M ohm\n", + "R5 = 4 # # M ohm\n", + "Af = (1+(R2/R1))*(1+(R5/R4))#\n", + "print 'The desire pass band gain of filter is = %0.2f'%Af,' '\n", + "\n", + "# the magnitude of gain of band pass filter is given as\n", + "A = Af*(f**2/(fL*fH))/((sqrt(1+(f/fL)**2))*(sqrt(1+(f/fH)**2)))#\n", + "print 'The magnitude of gain of band pass filter is = %0.2f'%A,' ' # Round Off Error\n", + "\n", + "#the phase angle of the filter\n", + "from numpy import inf\n", + "Angle = degrees(2*atan(inf)-atan(f/fL)-atan(f/fH))\n", + "print 'The phase angle of gain of band pass filter is = %0.f'%Angle,'degree' # Round Off Error" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 7.13 Pg 247" + ] + }, + { + "cell_type": "code", + "execution_count": 24, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "The output of the half wave precision rectifier Vo is = -20.00 V \n" + ] + } + ], + "source": [ + " # to determine the output voltage of the precision rectifier circuit\n", + "Vi = 10 # #V i/p volt\n", + "R1 = 20 # # K ohm\n", + "R2 = 40 # # K ohm\n", + "Vd = 0.7 # # V the diode voltage drop\n", + "\n", + "# the output of the half wave precision rectifier is defined as\n", + "# Vo = -(R2/R1)*Vi # for Vi < 0\n", + "# = 0 otherwise\n", + "# i.e for Vi > 0\n", + "# Vo = 0\n", + "# for Vi < 0\n", + "Vo = -(R2/R1)*Vi\n", + "print 'The output of the half wave precision rectifier Vo is = %0.2f'%Vo,' V '" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 7.14 Pg 247" + ] + }, + { + "cell_type": "code", + "execution_count": 25, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "The output of the half wave precision rectifier Vo is = -15.00 V \n", + "The output of the half wave precision rectifier Vo is = 15.00 V \n" + ] + } + ], + "source": [ + "# to determine the output voltage of the precision rectifier circuit for i/p voltage a) Vi = 5 b) Vi = -5\n", + "Vi = 5 # #V i/p volt\n", + "R1 = 5 # # K ohm\n", + "R2 = 15 # # K ohm\n", + "Vd = 0.7 # # V the diode voltage drop\n", + "\n", + "# the output of the half wave precision rectifier is defined as\n", + "# Vo = -(R2/R1)*Vi # for Vi < 0\n", + "# = 0 otherwise\n", + "\n", + "# for Vi = 5 V\n", + "# i.e for Vi > 0\n", + "# Vo = 0\n", + "# for Vi < 0\n", + "Vo = -(R2/R1)*Vi#\n", + "print 'The output of the half wave precision rectifier Vo is = %0.2f'%Vo,' V '\n", + "\n", + "# for Vi = -5 V\n", + "# i.e for Vi > 0\n", + "# Vo = 0\n", + "# for Vi < 0\n", + "Vi =-5 # # V\n", + "Vo = -(R2/R1)*Vi#\n", + "print 'The output of the half wave precision rectifier Vo is = %0.2f'%Vo,' V '" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 7.15 Pg 248" + ] + }, + { + "cell_type": "code", + "execution_count": 26, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "The gain of precision full wave rectifier A is = 6.00 \n", + "The output voltage Vo is = 42.00 V \n", + "The output voltage Vo is = 42.00 V \n" + ] + } + ], + "source": [ + " # to determine the output voltage of the precision rectifier circuit for i/p voltage a) Vi = 7 b) Vi = -7\n", + "Vi = 7 # #V i/p volt\n", + "R1 = 5 # # K ohm\n", + "R3 = 5 # # K ohm\n", + "R4 = 5 # # K ohm\n", + "R2 = 15 # # K ohm\n", + "R5 = 15 # # K ohm\n", + "Vd = 0.7 # # V the diode voltage drop\n", + "\n", + "# the output of the full wave precision rectifier is defined as\n", + "# Vo = -A*Vi # for Vi < 0 equation 1\n", + "# = A*Vi # otherwise equation 2\n", + "\n", + "# or Vo = abs(A*Vi) #\n", + "\n", + "# The gain of precision full wave rectifier\n", + "A = (((R2*R5)/(R1*R3))-(R5/R4)) #\n", + "print 'The gain of precision full wave rectifier A is = %0.2f'%A,' '\n", + "\n", + "\n", + "# for Vi = 7 V the output voltage is\n", + "Vi = 7 #\n", + "Vo = -A*Vi # # from equation 1\n", + "Vo = A*Vi # # from equation 2\n", + "Vo = abs(A*Vi) #\n", + "print 'The output voltage Vo is = %0.2f'%Vo,' V '\n", + "\n", + "# for Vi = -7 V the output voltage is\n", + "Vi = -7 #\n", + "Vo = -A*Vi # # from equation 1\n", + "Vo = A*Vi # # from equation 2\n", + "Vo = abs(A*Vi) #\n", + "print 'The output voltage Vo is = %0.2f'%Vo,' V '" + ] + } + ], + "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 +} diff --git a/Linear_Integrated_Circuit_by_M._S._Sivakumar/Ch8.ipynb b/Linear_Integrated_Circuit_by_M._S._Sivakumar/Ch8.ipynb new file mode 100644 index 00000000..df35b96e --- /dev/null +++ b/Linear_Integrated_Circuit_by_M._S._Sivakumar/Ch8.ipynb @@ -0,0 +1,180 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 8 Analog Multiplier" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 8.1 Pg 267" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "the output voltage of inverting amplifier (V2) is = 3.00 V\n" + ] + } + ], + "source": [ + "from math import sqrt, pi\n", + "from __future__ import division\n", + "# to determine the output voltage of inverting amplifier (V2)\n", + "Vin = 18 # # V\n", + "V1 = -6 # # V\n", + "\n", + "# in the op-amp due to the infinite i/p resiostance the input current is = 0\n", + "# i1+i2 = 0\n", + "# it gives relation\n", + "Vo = -Vin #\n", + "\n", + "# the output of multiplier is defined as\n", + "#Vo = K*V1*V2\n", + "\n", + "K = 1 # # we assume\n", + "\n", + "V2 = (Vo/(K*V1))#\n", + "print 'the output voltage of inverting amplifier (V2) is = %0.2f'%(V2),'V'" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 8.2 Pg 267" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "the output voltage of multiplier is = 225.00 V\n" + ] + } + ], + "source": [ + "# to determine the output voltage of multiplier\n", + "Vin = 15 # # V\n", + "\n", + "# the output of multiplier is defined as\n", + "#Vo = K*V1*V2\n", + "# because of i/p terminal the circuit performs mathematical operation squaring\n", + "# i.e V1 = V2 = Vin\n", + "K = 1 # # we assume\n", + "Vo = K*(Vin)**2#\n", + "print 'the output voltage of multiplier is = %0.2f'%(Vo),'V' " + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 8.3 Pg 268" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "the output voltage of inverting amplifier is = 4.00 V \n", + "the output voltage of multiplier is = 16.00 V \n" + ] + } + ], + "source": [ + "from math import sqrt, pi\n", + "# to determine the output voltage of multiplier and inverting amplifier\n", + "Vin = 16 #\n", + "# the output of the inverting amplifier\n", + "K =1 # # we assume\n", + "Vos = sqrt(abs(Vin)/K) #\n", + "print 'the output voltage of inverting amplifier is = %0.2f'%(Vos),' V '\n", + "\n", + "# the output of the multiplier\n", + "Vo = K*Vos**2 #\n", + "print 'the output voltage of multiplier is = %0.2f'%(Vo),' V '" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 8.5 Pg 269" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "output voltage of RMS detector is = 10.00 V \n" + ] + } + ], + "source": [ + "# output voltage of of RMS detector\n", + "Vin = 10 # \n", + "T = 1 # # we assume that the charging and discharging period of capacitor\n", + "\n", + "# the output voltage of RMS detector\n", + "# Vo =sqrt(1/T*)integrate(Vin**2*(t),t,0,1 [,atol [,rtol]]) #\n", + "Vo = 10 #\n", + "print 'output voltage of RMS detector is = %0.2f'%(Vo),'V '" + ] + } + ], + "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 +} diff --git a/Linear_Integrated_Circuit_by_M._S._Sivakumar/Ch9.ipynb b/Linear_Integrated_Circuit_by_M._S._Sivakumar/Ch9.ipynb new file mode 100644 index 00000000..5ae5cfbe --- /dev/null +++ b/Linear_Integrated_Circuit_by_M._S._Sivakumar/Ch9.ipynb @@ -0,0 +1,404 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter 9 Phase Locked Loop" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 9.1 Pg 284" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "The output voltage of switching regulator circuit is = -0.30 V \n", + "The output voltage of switching regulator circuit is = 1.50 V \n" + ] + } + ], + "source": [ + "from __future__ import division\n", + "from math import sqrt, pi\n", + "# to find output voltage for a constant input signal frequency of 200 KHz\n", + "fo = 2*pi*1*10**3 # # KHz/V # VCO sensitivity range 4.1\n", + "fc = 500 # # Hz a free running frequency\n", + "f1 = 200 # # Hz input frequency\n", + "f2 = 2*10**3 # # Hz input frequency\n", + "\n", + "# the output voltage of PLL is defined as\n", + "#Vo = (wo-wc)/ko\n", + "ko = fo #\n", + "# when i/p locked with o/p wo=wi\n", + "# Vo = (wi-wc)/ko #\n", + "\n", + "#for the i/p frequency fi = 200 Hz\n", + "fi = 200 # # Hz\n", + "Vo = (((2*pi*fi)-(2*pi*fc))/ko)#\n", + "print 'The output voltage of switching regulator circuit is = %0.2f'%Vo,' V '\n", + "\n", + "#for the i/p frequency fi = 200 Hz\n", + "fi = 2*10**3 # # Hz\n", + "Vo = (((2*pi*fi)-(2*pi*fc))/ko)#\n", + "print 'The output voltage of switching regulator circuit is = %0.2f'%Vo,' V '" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 9.2 Pg 285" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "The sum frequency produce by phase detector is = 900.00 KHz \n", + "The difference frequency produce by phase detector is = 100.00 KHz \n", + "The phase detector frequencies are outside of the low pass filter\n", + "The VCO will be in its free running frequency \n" + ] + } + ], + "source": [ + " # to find VCO output frequency\n", + "fc = 400 # # KHz a free running frequency\n", + "f = 10 # # KHz low pass filter bandwidth\n", + "fi = 500 # # KHz input frequency\n", + "\n", + "# In PLL a phase detector produces the sum and difference frequencies are defined as\n", + "\n", + "sum = fi+fc #\n", + "print 'The sum frequency produce by phase detector is = %0.2f'%sum,' KHz '\n", + "\n", + "difference = fi-fc #\n", + "print 'The difference frequency produce by phase detector is = %0.2f'%difference,' KHz '\n", + "\n", + "print 'The phase detector frequencies are outside of the low pass filter'#\n", + "\n", + "print 'The VCO will be in its free running frequency '" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 9.3 Pg 286" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "The sensitivity of phase detector Kd is = 0.45 \n", + "The maximum control voltage of VCO Vfmax = 1.40 V\n", + "The maximum frequency swing of VCO = 35.00 KHz\n", + "The maximum range of frequency which lock a PLL is = 15.00 KHz \n", + "The maximum range of frequency which lock a PLL is = 85.00 KHz \n", + "The maximum and minimum rage between 15 KHz to 85 KHZ \n", + "The lock range is = 70.00 KHz \n" + ] + } + ], + "source": [ + "# to determine the lock range of PLL\n", + "Ko = 25 # # KHz\n", + "fo = 50 # # KHz\n", + "A = 2 #\n", + "Vd = 0.7 #\n", + "AL = 1 #\n", + "\n", + "# the amximum output swing of phase detector \n", + "# Vd = Kd*(pi/2) #\n", + "\n", + "# the sensitivity of phase detector Kd is\n", + "Kd = Vd*(2/pi) #\n", + "print 'The sensitivity of phase detector Kd is = %0.2f'%Kd,''\n", + "\n", + "# The maximum control voltage of VCO Vfmax\n", + "Vfmax = (pi/2)*Kd*A #\n", + "print 'The maximum control voltage of VCO Vfmax = %0.2f'%Vfmax,' V'\n", + "\n", + "# the maximum frequency swing of VCO\n", + "fL = (Ko*Vfmax)#\n", + "print 'The maximum frequency swing of VCO = %0.2f'%fL,' KHz'\n", + "\n", + "# The maximum range of frequency which lock a PLL are\n", + "fi = fo-fL #\n", + "print 'The maximum range of frequency which lock a PLL is = %0.2f'%fi,' KHz '\n", + "\n", + "fi = fo+fL #\n", + "print 'The maximum range of frequency which lock a PLL is = %0.2f'%fi,' KHz '\n", + "\n", + "print 'The maximum and minimum rage between 15 KHz to 85 KHZ '\n", + "\n", + "\n", + "# the lock range is\n", + "fLock = 2*fL #\n", + "print 'The lock range is = %0.2f'%fLock,' KHz '" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 9.4 Pg 286" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "The current through the control resistor R is = 0.60 mA \n", + "The charging time of capacitor is = 5.00 msec \n", + "The total time period of tringular and square wave is = 10.00 msec \n", + "The output frequency of VCO is = 0.10 KHz \n" + ] + } + ], + "source": [ + "# to determine the output frequency capacitor charging time of VCO\n", + "Vcc = 12 #\n", + "Vcs = 6\n", + "R = 10 # # K ohm\n", + "C = 1 # # uF\n", + "\n", + "# the current through the control resistor R\n", + "i =(Vcc-Vcs)/R #\n", + "print 'The current through the control resistor R is = %0.2f'%i, ' mA '\n", + "\n", + "# The charging time of capacitor \n", + "t = (0.25*Vcc*C)/i #\n", + "print 'The charging time of capacitor is = %0.2f'%t, ' msec '\n", + "\n", + "# In VCO the capacitor charging and discharging time period are equal ,so the total time period of tringular and square wave forms can be written as 2*t #\n", + "t = ((0.5*Vcc*C)/i)#\n", + "print 'The total time period of tringular and square wave is = %0.2f'%t, ' msec '\n", + "\n", + "# the output frequency of VCO is\n", + "fo = 1/t #\n", + "print 'The output frequency of VCO is = %0.2f'%fo, ' KHz '" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 9.5 Pg 287" + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "The charging or discharging time of capacitor is = 25.00 msec \n", + "The output frequency of VCO is is = 20.00 Hz \n", + "The output frequency of VCO is = 625.00 Kohm\n", + "The current through the control resistor R is = 1.60 uA \n", + "The capacitor charging current is = 2000.00 V = 0.33Vcc \n" + ] + } + ], + "source": [ + "# to design VCO with output square wave pulse time of 50 msec\n", + "Vcc =6 #\n", + "Vcs = 5 #\n", + "R = 22 # #K ohm\n", + "C = 0.02 # # uF\n", + "t = 50*10**-3 # # sec output square wave pluse\n", + "\n", + "# In VCO the capacitor charging and discharging time period are equal ,so the total time period of tringular and square wave forms can be written as 2*t #\n", + "\n", + "\n", + "# the charging or discharging time of capacitor \n", + "tcap = t/2*1e3 #\n", + "print 'The charging or discharging time of capacitor is = %0.2f'%tcap, ' msec '\n", + "\n", + "# the output frequency of VCO is\n", + "fo = 1/t #\n", + "print 'The output frequency of VCO is is = %0.2f'%fo, ' Hz '\n", + "\n", + "# the output frequency of VCO\n", + " # fo = (1/4*R*C)#\n", + "R = 1/(4*fo*1e3*C*1e-9)/1e3 # Kohm\n", + "print 'The output frequency of VCO is = %0.2f'%R, ' Kohm'\n", + "\n", + "# the current through the control resistor R\n", + "i =(Vcc-Vcs)/R*1e3 #\n", + "print 'The current through the control resistor R is = %0.2f'%i, ' uA '\n", + "\n", + "# the capacitor charging current \n", + "# (V/t)=(i/C) #\n", + "V = (i/C)*tcap #\n", + "print 'The capacitor charging current is = %0.2f'%V, ' V = 0.33Vcc '" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 9.6 Pg 289" + ] + }, + { + "cell_type": "code", + "execution_count": 21, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "The center frequency of VCO is is = 0.17 kHz \n", + "The lock range of PLL is = 2.67 KHz/V \n", + "The lock range of PLL is = 25.59 k Hz/V \n" + ] + } + ], + "source": [ + "from __future__ import division\n", + "# to determine the center frequency of VCO lock and capture range of PLL\n", + "R = 15 # # K ohm\n", + "C = 0.12 # # uF\n", + "Vcc = 12 #\n", + "\n", + "# the center frequency of VCO fo\n", + "fo = (1.2/4/(R*1e3)/(C*1e-6))/1e3#\n", + "print 'The center frequency of VCO is is = %0.2f'%fo, ' kHz '\n", + "\n", + "fo = 4 # # KHz\n", + "# the lock range of PLL\n", + "fL = (8*fo/Vcc) #\n", + "print 'The lock range of PLL is = %0.2f'%fL, ' KHz/V '\n", + "\n", + "# the capture range of PLL\n", + "fc = ((fo-fL)/(2*pi*3.6*10**3*C*1e-6)**(1/2)) #\n", + "print 'The lock range of PLL is = %0.2f'%fc, 'k Hz/V '\n", + "# ans wrong in the textbook." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example 9.7 Pg 290" + ] + }, + { + "cell_type": "code", + "execution_count": 27, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "The total time period of VCO is = 5.00 usec \n", + "The charging or discharging time of capacitor is = 2.50 usec \n", + "The voltage swing of VCO for 12 V supply is = 3.00 V \n", + "The lock range of PLL FL is = 0.955 Hz \n", + "The capture range is = 437.02 Hz \n" + ] + } + ], + "source": [ + "# determine the lock range of the FSK demodulator\n", + "Vcc = 12 #\n", + "Fvco = 0.25*Vcc #\n", + "f = 200*10**3 # # Hz\n", + "\n", + "\n", + "# the total time period of VCO \n", + "t = 1/f*1e6 #\n", + "print 'The total time period of VCO is = %0.2f'%t, ' usec '\n", + "\n", + "# In VCO the capacitor charging and discharging time period are equal ,so the total time period of tringular and square wave forms can be written as 2*t #\n", + "\n", + "\n", + "# the charging or discharging time of capacitor \n", + "tcap = t/2 #\n", + "print 'The charging or discharging time of capacitor is = %0.2f'%tcap, ' usec '\n", + "\n", + "# the voltage swing of VCO for 12 V supply\n", + "Fvco = 0.25*Vcc #\n", + "print 'The voltage swing of VCO for 12 V supply is = %0.2f'%Fvco, ' V '\n", + "\n", + "# The lock range of PLL \n", + "#FL = (1/2*pi*f)*(Fvco/tcap)#\n", + "FL = (3/(2*pi*f*tcap*1e-6))#\n", + "print 'The lock range of PLL FL is = %0.3f'%FL, ' Hz '\n", + "\n", + "# the capture range \n", + "fcap = sqrt(f*FL)#\n", + "print 'The capture range is = %0.2f'%fcap, ' Hz '" + ] + } + ], + "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 +} diff --git a/Linear_Integrated_Circuit_by_M._S._Sivakumar/screenshots/BiasingVoltage.png b/Linear_Integrated_Circuit_by_M._S._Sivakumar/screenshots/BiasingVoltage.png Binary files differnew file mode 100644 index 00000000..3079217b --- /dev/null +++ b/Linear_Integrated_Circuit_by_M._S._Sivakumar/screenshots/BiasingVoltage.png diff --git a/Linear_Integrated_Circuit_by_M._S._Sivakumar/screenshots/InOutCrrnt.png b/Linear_Integrated_Circuit_by_M._S._Sivakumar/screenshots/InOutCrrnt.png Binary files differnew file mode 100644 index 00000000..ebf45d77 --- /dev/null +++ b/Linear_Integrated_Circuit_by_M._S._Sivakumar/screenshots/InOutCrrnt.png diff --git a/Linear_Integrated_Circuit_by_M._S._Sivakumar/screenshots/inAndOutCurrnt.png b/Linear_Integrated_Circuit_by_M._S._Sivakumar/screenshots/inAndOutCurrnt.png Binary files differnew file mode 100644 index 00000000..a6158aa6 --- /dev/null +++ b/Linear_Integrated_Circuit_by_M._S._Sivakumar/screenshots/inAndOutCurrnt.png |