AND Gate: Logic Diagram
AND Gate: Logic Diagram
Logic gates are the basic building blocks of any digital system. It is an electronic circuit
having one or more than one input and only one output. The relationship between the input
and the output is based on a certain logic. Based on this, logic gates are named as AND gate,
OR gate, NOT gate etc.
AND Gate
A circuit which performs an AND operation is shown in figure. It has n input (n >= 2) and
one output.
Logic diagram
Truth Table
OR Gate
A circuit which performs an OR operation is shown in figure. It has n input (n >= 2) and one
output.
Logic diagram
Truth Table
NOT Gate
NOT gate is also known as Inverter. It has one input A and one output Y.
Logic diagram
Truth Table
NAND Gate
A NOT-AND operation is known as NAND operation. It has n input (n >= 2) and one output.
Logic diagram
Truth Table
NOR Gate
A NOT-OR operation is known as NOR operation. It has n input (n >= 2) and one output.
Logic diagram
Truth Table
XOR Gate
XOR or Ex-OR gate is a special type of gate. It can be used in the half adder, full adder and
subtractor. The exclusive-OR gate is abbreviated as EX-OR gate or sometime as X-OR gate.
It has n input (n >= 2) and one output.
Logic diagram
Truth Table
XNOR Gate
XNOR gate is a special type of gate. It can be used in the half adder, full adder and
subtractor. The exclusive-NOR gate is abbreviated as EX-NOR gate or sometime as X-NOR
gate. It has n input (n >= 2) and one output.
Logic diagram
Truth Table
DeMorgan’s Theorem
As we have seen previously, Boolean Algebra uses a set of laws and rules to define the
operation of a digital logic circuit with “0’s” and “1’s” being used to represent a digital input
or output condition. Boolean Algebra uses these zeros and ones to create truth tables and
mathematical expressions to define the digital operation of a logic AND, OR and NOT (or
inversion) operations as well as ways of expressing other logical operations such as the XOR
(Exclusive-OR) function.
While George Boole’s set of laws and rules allows us to analyise and simplify a digital
circuit, there are two laws within his set that are attributed to Augustus DeMorgan (a
nineteenth century English mathematician) which views the logical NAND and NOR
operations as separate NOT AND and NOT OR functions respectively.
But before we look at DeMorgan’s Theory in more detail, let’s remind ourselves of the basic
logical operations where A and B are logic (or Boolean) input binary variables, and whose
values can only be either “0” or “1” producing four possible input combinations, 00, 01, 10,
and 11.
The following table gives a list of the common logic functions and their equivalent Boolean
notation where a “.” (a dot) means an AND (product) operation, a “+” (plus sign) means an
OR (sum) operation, and the complement or inverse of a variable is indicated by a bar over
the variable.
DeMorgan’s Theory
DeMorgan’s Theorems are basically two sets of rules or laws developed from the Boolean
expressions for AND, OR and NOT using two input variables, A and B. These two rules or
theorems allow the input variables to be negated and converted from one form of a Boolean
function into an opposite form.
DeMorgan’s first theorem states that two (or more) variables NOR´ed together is the same as
the two variables inverted (Complement) and AND´ed, while the second theorem states that
two (or more) variables NAND´ed together is the same as the two terms inverted
(Complement) and OR´ed. That is replace all the OR operators with AND operators, or all
the AND operators with an OR operators.
DeMorgan’s First theorem proves that when two (or more) input variables are AND’ed and
negated, they are equivalent to the OR of the complements of the individual variables. Thus
the equivalent of the NAND function will be a negative-OR function, proving that
A.B = A+B. We can show this operation using the following table.
The top logic gate arrangement of: A.B can be implemented using a standard NAND gate
with inputs A and B. The lower logic gate arrangement first inverts the two inputs producing
A and B. These then become the inputs to the OR gate. Therefore the output from the OR
gate becomes: A+B
Then we can see here that a standard OR gate function with inverters (NOT gates) on each of
its inputs is equivalent to a NAND gate function. So an individual NAND gate can be
represented in this way as the equivalency of a NAND gate is a negative-OR.
The top logic gate arrangement of: A+B can be implemented using a standard NOR gate
function using inputs A and B. The lower logic gate arrangement first inverts the two inputs,
thus producing A and B. Thus then become the inputs to the AND gate. Therefore the output
from the AND gate becomes: A.B
Then we can see that a standard AND gate function with inverters (NOT gates) on each of its
inputs produces an equivalent output condition to a standard NOR gate function, and an
individual NOR gate can be represented in this way as the equivalency of a NOR gate is a
negative-AND.
Although we have used DeMorgan’s theorems with only two input variables A and B, they
are equally valid for use with three, four or more input variable expressions, for example:
A.B.C = A+B+C
and also
A+B+C = A.B.C
A.B.C.D = A+B+C+D
and also
A+B+C+D = A.B.C.D
and so on.
DeMorgan’s Equivalent Gates
We have seen here that by using DeMorgan’s Theorems we can replace all of the AND (.)
operators with an OR (+) and vice versa, and then complements each of the terms or variables
in the expression by inverting it, that is 0’s to 1’s and 1’s to 0’s before inverting the entire
function.
Thus to obtain the DeMorgan equivalent for an AND, NAND, OR or NOR gate, we simply
add inverters (NOT-gates) to all inputs and outputs and change an AND symbol to an OR
symbol or change an OR symbol to an AND symbol as shown in the following table.
Then we have seen in this tutorial about DeMorgan’s Thereom that the complement of two
(or more) AND’ed input variables is equivalent to the OR of the complements of these
variables, and that the complement of two (or more) OR’ed variables is equivalent to the
AND of the complements of the variables as defined by DeMorgan.
Sum of Product
The Sum of Product expression is equivalent to the logical AND fuction which Sums two or more
Products to produce an output
Boolean Algebra is a simple and effective way of representing the switching action of
standard logic gates and a set of rules or laws have been invented to help reduce the number
of logic gates needed to perform a particular logical operation. Boolean Algebra is the digital
logic mathematics we use to analyse gates and switching circuits such as those for the AND,
OR and NOT gate functions, also known as a “Full Set” in switching theory.
In mathematics, the number or quantity obtained by multiplying two (or more) numbers
together is called the product. For example, if we multiply the number 2 by 3 the resulting
answer is 6, as 2*3 = 6, so “6” will be the product number.
In Boolean Algebra, the multiplication of two integers is equivalent to the logical AND
operation thereby producing a “Product” term when two or more input variables are
“AND’ed” together. In other words, in Boolean Algebra the AND function is the equivalent
of multiplication and so its output state represents the product of its inputs.
Unlike conventional mathematics which uses a Cross (x), or a Star (*) to represent a
multiplication action, the AND function is represented in Boolean multiplication by a single
“dot” (.). Thus the Boolean equation for a 2-input AND gate is given as: Q = A.B, that is Q
equals both A AND B. For a product term these input variables can be either “true” or
“false”, “1” or “0”, or be of a complemented form, so A.B, A.B or A.B are all classed as
product terms.
A product term can have one or two independant variables, such as A and B, or it can have
one or two fixed constants, again 0 and 1. We can use these variables and constants in a
variety of different combinations and produce a product result as shown in the following lists.
Note that a Boolean “variable” can have one of two values, either “1” or “0”, and can change
its value. For example, A = 0, or A = 1 whereas a Boolean “constant” which can also be in
the form of a “1” or “0”, is a fixed value and therefore cannot change.
Then we can see that any given Boolean product can be simplified to a single constant or
variable with a brief description of the various Boolean Laws given below where “A”
represents a variable input.
Identity Law – A term AND’ed with 1 is always equal to the term (A.1 = A)
Idempotent Law – A term AND’ed with itself is always equal to the term (A.A = A)
Complement Law – A term AND’ed with its complement is always equal to 0 (A.A = 0)
Commutative Law – The order in which two terms are AND’ed is the same (A.1 = 1.A)
OR Gate (Sum)
This logical sum is known commonly as Boolean addition as an OR function produces the
summed term of two or more input variables, or constants. We will look at the OR function
and Boolean addition in more detail in the next tutorial, but for now we will remember that an
OR function represents the Sum Term.
Sum of Products
So we have seen that the AND function produces the logical product of Boolean
multiplication, and that the OR function produces the logical sum of Boolean addition. But
when dealing with combinational logic circuits in which AND gates, OR gates and NOT
gates are connected together, the expressions of Sum-of-Products and Product-of-Sums are
widely used.
The Sum of Product (SOP) expression comes from the fact that two or more products (AND)
are summed (OR) together. That is the outputs from two or more AND gates are connected to
the input of an OR gate so that they are effectively OR’ed together to create the final AND-
OR logical output. For example, the following Boolean function is a typical sum-of-product
expression:
and also
However, Boolean functions can also be expressed in nonstandard sum of products forms like
that shown below but they can be converted to a standard SOP form by expanding the
expression. So:
Q = A.B(C + C) + ABC
Actually this large SOP expression can be reduced further using the laws of Boolean algerbra
to give a reduced SOP expression of:
Q = A.B + A.C
We can now draw up the truth table for the above expression to show a list of all the possible
input combinations for A, B and C which will result in an output “1”.
Then we can clearly see from the truth table that each product row which produces a “1” for
its output corresponds to its Boolean multiplication expression with all of the other rows
having a “0” output as a “1” is always outputted from an OR gate.
Clearly the advantage here is that the truth table gives us a visual indication of the Boolean
expression allowing us to simplify the expression. For example, the above sum-of-product
term can be simplified to: Q = A.(B + B.C) if required.
Sum-of-Product Example
The following Boolean Algebra expression is given as:
2. Use a truth table to show all the possible combinations of input conditions that will
produces an output.
2. Truth Table
Product of Sum
The Product of Sum expression is equivalent to the logical OR-AND fuction which gives the
AND Product of two or more OR Sums to produce an output
Boolean Algebra is a simple and effective way of representing the switching action of
standard logic gates and a set of rules or laws have been invented to help reduce the number
of logic gates needed to perform a particular logical operation. Boolean Algebra is the digital
logic mathematics we use to analyse gates and switching circuits such as those for the AND,
OR and NOT gate functions, also known as a “Full Set” in switching theory.
In mathematics, the number or quantity obtained by multiplying two (or more) numbers
together is called the product. For example, if we multiply the number 2 by 3 the resulting
answer is 6, as 2*3 = 6, so “6” will be the product number.
In Boolean Algebra, the multiplication of two integers is equivalent to the logical AND
operation thereby producing a “Product” term when two or more input variables are
“AND’ed” together. In other words, in Boolean Algebra the AND function is the equivalent
of multiplication and so its output state represents the product of its inputs.
A product term can have one or two independant variables, such as A and B, or it can have
one or two fixed constants, again 0 and 1. We can use these variables and constants in a
variety of different combinations and produce a product result as shown in the following lists.
Product of Sum
So we have seen that the OR function produces the logical sum of Boolean addition, and that
the AND function produces the logical sum of Boolean multiplication. But when dealing with
combinational logic circuits in which AND gates, OR gates and NOT gates are connected
together, the expressions of Product-of-Sum is widely used.
The Product of Sum (POS) expression comes from the fact that two or more sums (OR’s) are
added (AND’ed) together. That is the outputs from two or more OR gates are connected to
the input of an AND gate so that they are effectively AND’ed together to create the final (OR
AND) output. For example, the following Boolean function is a typical product-of-sum
expression:
Q = (A + B).(B + C).(A + 1)
and also
(A + B + C).(A + C).(B + C)
However, Boolean functions can also be expressed in nonstandard product of sum forms like
that shown below but they can be converted to a standard POS form by using the distributive
law to expand the expression with respect to the sum. Therefore:
Q = A + (BC)
Q = (A + B)(A + C)
Q = (A + B) + (A.C)
Q = (A + B + A)(A + B + C)
which can, if required be reduced using distributive law and absorption law too:
Q = (A + B)(A + B + C)
Q=A+B+C
Q=A+B
Q = (A + B + C)(A + B + C)(A + B + C)
We can now draw up the truth table for the above expression to show a list of all the possible
input combinations for A, B and C which will result in an output “0”.
Then we can clearly see from the truth table that each row which produces a “0” for its output
corresponds to its Boolean addition expression with all of the other rows having a “1” output.
The advantage here is that the truth table gives us a visual indication of the Boolean
expression allowing us to simplify the expression remembering that a sum term produces a
“0” output when all of its inputs are equal to “0”. So to make a sum term row equal to “0”,
the we must invert all the inputs which are equal to “1”.
Product-of-Sum Example
The following Boolean Algebra expression is given as:
1. Use a truth table to show all the possible combinations of input conditions that will
produces a “0” output.
1. Truth Table
SOP FORM
1. K-map of 3 variables-
Z= ∑A,B,C(1,3,6,7)
A’C
AB
F(P,Q,R,S)=∑(0,2,5,7,8,10,13,15)
From red group we get product term—
QS
Q’S’
POS FORM
1. K-map of 3 variables-
F(A,B,C)=π(0,3,6,7)
From red group we find terms
A B C’
A’ B’ C
(A’ + B’ + C)
B C
B’ C’
(B’+C’)
A’ B’ C’
Taking complement of these two
ABC
(A + B + C)
We will take product of these three terms :Final expression (A’ + B’ + C) (B’ + C’) (A + B
+ C)
2. K-map of 4 variables-
F(A,B,C,D)=π(3,5,7,8,10,11,12,13)
C’ D B
(C+D’+B’)
C D A’
A C’ D’
(A’+C+D)
A B’ C
(A’+B+C’)