Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Python - Logic Gates


Published on

Python Inheritance Logic Gates And Circuits.

  • I think you need a perfect and 100% unique academic essays papers have a look once this site i hope you will get valuable papers, ⇒ ⇐
    Are you sure you want to  Yes  No
    Your message goes here

Python - Logic Gates

  1. 1. Inheritance: Logic Gates and Circuits By: Giovannie Sanchez Kevin Flores
  2. 2. Important to know… • Inheritance - is the ability for one class to be related to another class. • The structure relationship is called inheritance hierarchy. • Lists, tuples, and strings are all types of sequential collections. • They all inherit common data and organization and operands Super Class •Logic Gate •Everyone Inherits the class. Class One •Binary Gate •Unary Gate Class Two •And Gate •Or Gate •Not Gate
  3. 3. What is Heriarchy? & What are we using? Heriarchy is used to simplify and to understand the relationship between inheritable classes. Its more organized.
  4. 4. The operands and, or… • And – has two inputs, and one output which can be either 0 (false) or 1(true). • Or – has two inputs and its output is either true (1) if a veritable solution is present out of the two inputs or its completely false. Or Gate Binary Gate Logic Gate • Method • Parameter And Gate Binary Gate • Method • Method • Parameter • Parameter Logic Gate
  5. 5. The operand or… • Not – has a single input and the output is always the opposite of the input. • Method • Parameter Not Gate Unary Gate • Method • Method • Parameter • Parameter Logic Gate
  6. 6. The Circuit… The output lines from the two AND gates feed directly into the OR gate, and the resulting output from the OR gate is given to the NOT gate. If we apply a set of input values to the four input lines (two for each AND gate), the values are processed and a result appears at the output of the NOT gate.
  7. 7. Let’s get started… LogicGate • At the top of the hierarchy, the LogicGate class represents the most general characteristics of logic gates: namely, a label for the gate and an output line. • The next level of subclasses breaks the logic gates into two families, those that have one input line and those that have two. Below that, the specific logic functions of each appear.
  8. 8. The Connectors…are… Connector Class • The Connector class will not reside in the gate hierarchy. • It will, however, use the gate hierarchy in that each connector will have two gates, one on either end. • This relationship is very important in object-oriented programming. It is called the HAS-A Relationship
  9. 9. Let’s look at the code… Source Code • 7 Classes • Each one inherit except the LogicGate and Connector Method Inherit Logic Gate 3 NO Binary Gate 4 YES Unary Gate 3 YES And Gate 2 YES Or Gate 2 YES Not Gate 2 YES Connector 3 NO