summaryrefslogtreecommitdiff
path: root/Principles_Of_Electronic_Instrumentation/Pinciples_of_electronic_Instrumentation_Ch3.ipynb
diff options
context:
space:
mode:
authorhardythe12015-06-03 15:27:17 +0530
committerhardythe12015-06-03 15:27:17 +0530
commit47d7279a724246ef7aa0f5359cf417992ed04449 (patch)
treec613e5e4813d846d24d67f46507a6a69d1a42d87 /Principles_Of_Electronic_Instrumentation/Pinciples_of_electronic_Instrumentation_Ch3.ipynb
parent435840cef00c596d9e608f9eb2d96f522ea8505a (diff)
downloadPython-Textbook-Companions-47d7279a724246ef7aa0f5359cf417992ed04449.tar.gz
Python-Textbook-Companions-47d7279a724246ef7aa0f5359cf417992ed04449.tar.bz2
Python-Textbook-Companions-47d7279a724246ef7aa0f5359cf417992ed04449.zip
add books
Diffstat (limited to 'Principles_Of_Electronic_Instrumentation/Pinciples_of_electronic_Instrumentation_Ch3.ipynb')
-rwxr-xr-xPrinciples_Of_Electronic_Instrumentation/Pinciples_of_electronic_Instrumentation_Ch3.ipynb283
1 files changed, 283 insertions, 0 deletions
diff --git a/Principles_Of_Electronic_Instrumentation/Pinciples_of_electronic_Instrumentation_Ch3.ipynb b/Principles_Of_Electronic_Instrumentation/Pinciples_of_electronic_Instrumentation_Ch3.ipynb
new file mode 100755
index 00000000..3eb1f316
--- /dev/null
+++ b/Principles_Of_Electronic_Instrumentation/Pinciples_of_electronic_Instrumentation_Ch3.ipynb
@@ -0,0 +1,283 @@
+{
+ "metadata": {
+ "name": ""
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 3: Digital Elements and Features"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example3_1,pg 487"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# equivalence comparator\n",
+ "\n",
+ "import math\n",
+ "#Variable declaration\n",
+ "in1 = 1 # input-1\n",
+ "in2 = not(in1) # input-2\n",
+ "\n",
+ "\n",
+ "#Calculations\n",
+ "out=((not(in1))*( not(in2)))+(in1*in2)\n",
+ "\n",
+ "#Result\n",
+ "print(\"output of comparator:\")\n",
+ "print(\"out = %d\"% out)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "output of comparator:\n",
+ "out = 0\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example3_2,pg 487"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# antivalence comparator\n",
+ "\n",
+ "import math\n",
+ "#Variable declaration\n",
+ "in1 = 1 # input-1\n",
+ "in2 = not(in1) # input-2\n",
+ "\n",
+ "\n",
+ "\n",
+ "#Calculations\n",
+ "out=((not(in1))+( not(in2)))*(in1+in2)\n",
+ "\n",
+ "#Result\n",
+ "print(\"output of comparator:\")\n",
+ "print(\"out = %d\"%out)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "output of comparator:\n",
+ "out = 1\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example3_3,pg 487"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print(\"Theoretical example\")"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Theoretical example\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example3_4,pg 487"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print(\"Theoretical example\")"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Theoretical example\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example3_5,pg 488"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# simplify Boolean function\n",
+ "\n",
+ "import math\n",
+ "#Variable declaration(Inputs)\n",
+ "#enter binary values only(1bit)\n",
+ "a=input(\"enter value of a\") #input-1\n",
+ "b=input(\"enter value of b\") #input-2\n",
+ "c=input(\"enter value of c\") #input-3\n",
+ " \n",
+ "#Calculations\n",
+ "x=not(a and b)\n",
+ "y=(x or c) #final output\n",
+ "\n",
+ "#Result\n",
+ "print(\"\\noutput:y=%d\\n\"%y)\n",
+ "print(\"verify from truth table\\n\")\n",
+ "print(\"a b c y\\n\")\n",
+ "print(\"0 0 0 1\\n\")\n",
+ "print(\"0 0 1 1\\n\")\n",
+ "print(\"0 1 0 1\\n\")\n",
+ "print(\"0 1 1 1\\n\")\n",
+ "print(\"1 0 0 1\\n\")\n",
+ "print(\"1 0 1 1\\n\")\n",
+ "print(\"1 1 0 0\\n\")\n",
+ "print(\"1 1 1 1\\n\")"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "enter value of a1\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "enter value of b1\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "enter value of c0\n"
+ ]
+ },
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "output:y=0\n",
+ "\n",
+ "verify from truth table\n",
+ "\n",
+ "a b c y\n",
+ "\n",
+ "0 0 0 1\n",
+ "\n",
+ "0 0 1 1\n",
+ "\n",
+ "0 1 0 1\n",
+ "\n",
+ "0 1 1 1\n",
+ "\n",
+ "1 0 0 1\n",
+ "\n",
+ "1 0 1 1\n",
+ "\n",
+ "1 1 0 0\n",
+ "\n",
+ "1 1 1 1\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 18
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example3_6,pg 488"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "print(\"Theoretical example\")"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Theoretical example\n"
+ ]
+ }
+ ],
+ "prompt_number": 19
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file