{ "metadata": { "name": "", "signature": "sha256:80f88a972947f3f07c0690a368a00c796fad1cccb9df59741b4a8c03cd1e434e" }, "nbformat": 3, "nbformat_minor": 0, "worksheets": [ { "cells": [ { "cell_type": "heading", "level": 1, "metadata": {}, "source": [ "CHAPTER 1- FUNDAMENTAL CONCEPTS" ] }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "EXAMPLE 1.1- PG NO:4" ] }, { "cell_type": "code", "collapsed": false, "input": [ "#example 1.1#\n", "#clears the screen#\n", "#clears the existing variables#\n", "print('the locker door (Y) can be opened using one key (A) which is with you and the other key (B) which is with the bank executive. When both the keys are used, the locker door opens, i.e. the locker door can be opened (Y=1) only when both the keys are applied(A=B=1).Thus, this can be expressed as an AND operation')\n", "print('Y=A*B')" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "the locker door (Y) can be opened using one key (A) which is with you and the other key (B) which is with the bank executive. When both the keys are used, the locker door opens, i.e. the locker door can be opened (Y=1) only when both the keys are applied(A=B=1).Thus, this can be expressed as an AND operation\n", "Y=A*B\n" ] } ], "prompt_number": 1 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "EXAMPLE 1.3 - PG NO.6" ] }, { "cell_type": "code", "collapsed": false, "input": [ "#example 1.3#\n", "#clears the screen#\n", "#clears already existing variables#\n", "print('Let the temperature and pressure be converted into electrical signals and T=1 if temperature exceeds the specified limit and P=1 if pressure exceeds the specified limit. If T=1 or P=1 or both T and P are 1 then the alarm is required to be activated, i.e., the signal applied to the alarm Y=1. This operation can be expressed as an or operation.')\n", "print('Y=T or P')\n", "print('Y=T+P')" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "Let the temperature and pressure be converted into electrical signals and T=1 if temperature exceeds the specified limit and P=1 if pressure exceeds the specified limit. If T=1 or P=1 or both T and P are 1 then the alarm is required to be activated, i.e., the signal applied to the alarm Y=1. This operation can be expressed as an or operation.\n", "Y=T or P\n", "Y=T+P\n" ] } ], "prompt_number": 2 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "EXAMPLE 1.7.a - PG NO:10" ] }, { "cell_type": "code", "collapsed": false, "input": [ "#example 1.7(a)#\n", "#clears the screen#\n", "#clears already existing variables#\n", "print('when one of the logic input of 2-input NAND gate is 0, then irrespective of the other input, the output comes out to be 1. In fact, a NAND gate is disabled or inhibited if one of its inputs is connected to logic 0')\n", "print('Y=1')" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "when one of the logic input of 2-input NAND gate is 0, then irrespective of the other input, the output comes out to be 1. In fact, a NAND gate is disabled or inhibited if one of its inputs is connected to logic 0\n", "Y=1\n" ] } ], "prompt_number": 3 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "EXAMPLE 1.7.b - PG NO:11" ] }, { "cell_type": "code", "collapsed": false, "input": [ "#example 1.7(b)#\n", "#clears the screen#\n", "#clears already existing variables#\n", "print('when one of the logic input of 2-input NAND gate is 1, then when A=1, Y=0 and if A=0, Y=1')\n", "print('Y= ~A')" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "when one of the logic input of 2-input NAND gate is 1, then when A=1, Y=0 and if A=0, Y=1\n", "Y= ~A\n" ] } ], "prompt_number": 1 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "EXAMPLE 1.9.a - PG NO:12" ] }, { "cell_type": "code", "collapsed": false, "input": [ "#example 1.9(a)#\n", "#clears the screen#\n", "#clears already existing variables#\n", "print('when one of the logic input of 2-input NOR gate is 0, then when A=1, Y=0 and if A=0, Y=1')\n", "print('Y= ~A')" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "when one of the logic input of 2-input NOR gate is 0, then when A=1, Y=0 and if A=0, Y=1\n", "Y= ~A\n" ] } ], "prompt_number": 2 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "EXAMPLE 1.9.b - PG NO:12" ] }, { "cell_type": "code", "collapsed": false, "input": [ "#example 1.9(b)#\n", "#clears the screen#\n", "#clears already existing variables#\n", "print('when one of the logic input of 2-input NOR gate is 1, then irrespective of the other input, the output comes out to be 0. In fact, a NAND gate is disabled or inhibited if one of its inputs is connected to logic 1')\n", "print('Y=0')\n", "print('here the output of Y is 0 irrespective of input of A')" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "when one of the logic input of 2-input NOR gate is 1, then irrespective of the other input, the output comes out to be 0. In fact, a NAND gate is disabled or inhibited if one of its inputs is connected to logic 1\n", "Y=0\n", "here the output of Y is 0 irrespective of input of A\n" ] } ], "prompt_number": 6 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "EXAMPLE 1.11.a - PG NO:14" ] }, { "cell_type": "code", "collapsed": false, "input": [ "#example 1.11(a)#\n", "#clears the screen#\n", "#clears already existing variables#\n", "print('If we connect one input of EX-OR gate to 0 permanently, we observe that Y=A*0+A*0')\n", "print('thus, Y=A')" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "If we connect one input of EX-OR gate to 0 permanently, we observe that Y=A*0+A*0\n", "thus, Y=A\n" ] } ], "prompt_number": 3 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "EXAMPLE 1.11.b- PG NO:14" ] }, { "cell_type": "code", "collapsed": false, "input": [ "#example 1.11(b)#\n", "#clears the screen#\n", "#clears already existing variables#\n", "print('If we connect one input of EX-OR gate to 1 permanently, we observe that Y=A*1+A*1')\n", "print('thus, Y= ~A')" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "If we connect one input of EX-OR gate to 1 permanently, we observe that Y=A*1+A*1\n", "thus, Y= ~A\n" ] } ], "prompt_number": 4 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "EXAMPLE 1.13.a - PG NO:15" ] }, { "cell_type": "code", "collapsed": false, "input": [ "#example 1.13(a)#\n", "#clears the screen#\n", "#clears already existing variables#\n", "print('If we connect one input of EX-NOR gate to 0 permanently, we observe that Y=A*0+A*0')\n", "print('thus, Y= ~A')" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "If we connect one input of EX-NOR gate to 0 permanently, we observe that Y=A*0+A*0\n", "thus, Y= ~A\n" ] } ], "prompt_number": 6 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "EXAMPLE 1.13.b- PG NO:15" ] }, { "cell_type": "code", "collapsed": false, "input": [ "#example 1.13(b)#\n", "#clears the screen#\n", "#clears already existing variables#\n", "print('If we connect one input of EX-NOR gate to 1 permanently, we observe that Y=A*1+A*1')\n", "print('thus, Y=A')" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "If we connect one input of EX-NOR gate to 1 permanently, we observe that Y=A*1+A*1\n", "thus, Y=A\n" ] } ], "prompt_number": 10 } ], "metadata": {} } ] }