{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "#Chapter 5:Digital Instruments" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 5.1,Page No:338" ] }, { "cell_type": "code", "execution_count": 1, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "frequency of the of the system = 4500.00 Hz\n" ] } ], "source": [ "import math\n", "\n", "#variable declaration\n", "N = 45; #reading \n", "t = 10*10**-3; #Gated period in ms\n", "\n", "#calculations\n", "f = N/float(t);\n", "\n", "#result\n", "print'frequency of the of the system = %3.2f'%f,'Hz';" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 5.2,Page No:339" ] }, { "cell_type": "code", "execution_count": 16, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Resolution 0.0010\n", "Resolution for full scale range of 10V = 0.01 V\n", "possible error = 0.015 V\n" ] } ], "source": [ "import math\n", "\n", "#variable declaration\n", "n = 3; #number of full digits on 3 1/2 digit display \n", "fs = 1; #voltage in V\n", "fs1 = 10; #voltage in V\n", "r = 2; #voltage reading in V\n", "fs3 = 5;\n", "\n", "#calculation\n", "R = 1/float((10)**n); #resolution\n", "R1 = R*fs; #resolution for full scale range of 1V\n", "R2 = fs1*R; #resolution for full scale range of 10V\n", "LSD =fs3*R; #digit in the least siginificant digit in V\n", "e = (((0.5)/float(100))*(r))+LSD; #total possible error in V\n", "\n", "#result\n", "print'Resolution %3.4f'%R;\n", "print'Resolution for full scale range of 10V = %3.2f'%R2,'V';\n", "print'possible error = %3.3f'%e,'V';\n", "\n", "\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "##Example 5.3,Page No:340" ] }, { "cell_type": "code", "execution_count": 17, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Resolution = 0.0001 \n", "There are 5 digit faces in 4 1/2 digt display ,so 16.95 would be displayed as 16.950\n", "Resolution = 0.0001 \n", "Hence 0.6564 will be displayed as 0.6564\n", "Resolution = 0.0010 \n", "Hence 0.6564 will be displayed as 0.656\n" ] } ], "source": [ "import math\n", "\n", "#variable declaration\n", "n = 4; #numberof full digits \n", "fs = 1; #full scale range of 1V\n", "fs = 1; #full scale range of 10V\n", "\n", "\n", "#calculation\n", "R = 1/float((10)**n); #resolution\n", "R1 = fs*R; #resolution on 1V in V\n", "R2 = fs1*R; #resolution on 10V in V\n", "\n", "\n", "#result\n", "print'Resolution = %3.4f '%R;\n", "print'There are 5 digit faces in 4 1/2 digt display ,so 16.95 would be displayed as 16.950';\n", "print'Resolution = %3.4f '%R1;\n", "print'Hence 0.6564 will be displayed as 0.6564';\n", "print'Resolution = %3.4f '%R2;\n", "print'Hence 0.6564 will be displayed as 0.656';\n" ] } ], "metadata": { "kernelspec": { "display_name": "Python 2", "language": "python", "name": "python2" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 2 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython2", "version": "2.7.6" } }, "nbformat": 4, "nbformat_minor": 0 }