Gates and Circuits
By: Giovannie Sanchez
Important to know…
• Inheritance - is the ability for one class to be
related to another class.
• The structure relationship is called inheritance
• Lists, tuples, and strings are all types of
• They all inherit common data and
organization and operands
•Everyone Inherits the class.
What is Heriarchy? &
What are we using?
Heriarchy is used to simplify and to
understand the relationship between
Its more organized.
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.
Gate • Method
The operand or…
• Not – has a single input and the output is
always the opposite of the input.
Gate • Method
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.
Let’s get started…
• 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
• 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
Let’s look at the code…
• 7 Classes
• Each one inherit except the
LogicGate and Connector
Connector 3 NO