Boolean Algebra and Logic Gates
Boolean Algebra: is the algebra of logic that deals with binary variables and logic
operations.
Boolean Variable: A Boolean variable is a symbol, usually an alphabet used to
represent a logical quantity. It can have a 0 or 1 value.
Truth table: is a table which represents all the possible values of logical variables along
with all the possible results of the given combinations of values.
Boolean Operators: These are the operators that work on Boolean variables or literals.
AND, OR and NOT operators are known as Boolean operators. These operators when
applied to the variables result in a true or false.
AND operator: The AND is a binary operation that requires two variables as input. The
output of the AND operation is true only if both inputs are TRUE. It is represented by the
. (dot) operator . The truth table for the AND operator is given below. A and B are the
input variables.
A B A.B
0 0 0
0 1 0
1 0 0
1 1 1
OR operator: The ORis a binary operation that requires two variables as input. The
output of the OR operation is true if any or all of the inputs are TRUE. It is represented
by the + (plus) operator . The truth table for the AND operator is given below. A and B
are the input variables.
A B A+B
0 0 0
0 1 1
1 0 1
1 1 1
NOT operator: The NOT operator is a unary operator that requires one variables as
input. It negates or complements a variable. It is represented by the ‘ (dash) operator .
The truth table for the OR operator is given below. Here A is the input variables.
A A'
0 1
1 0
Boolean expressions and Truth Tables
Boolean expressions are made up of Boolean variables and operators. They can
be represented in a graphical form using truth tables.
Examples of Boolean expressions:
’
’
’
0
Logic Gates
Logic gates are the basic building blocks of a digital system. It is basically an electronic
circuit having one or more inputs and generates an output. The relationship between the
input and the output is based on a certain logic. There are three basic logic gates known
as AND gate, OR gate, NOT gate .
And gate
The AND gate gives a high output (1) only if all its inputs are high.
Circuit Diagram Truth Table
A B A.B
0 0 0
0 1 0
1 0 0
1 1 1
OR Gate
The OR gate gives a high output (1) if one or more of its inputs are high.
A B A+B
0 0 0
0 1 1
1 0 1
1 1 1
NOT gate
The NOT gate produces an inverted version of the input as its output. It is also known as
a logical inverter. If the input variable is A, the inverted output is known as NOT A or
A’
A A'
0 1
1 0
NAND gate
This is an AND gate followed by a NOT gate. The outputs of all NAND gates are high if
any of the inputs are low. If both inputs are high, output is low. The symbol is an AND
gate with a small circle on the output.
A B (A.B)’
0 0 1
0 1 1
1 0 1
1 1 0
NOR gate
This is a NOT-OR gate which is equal to an OR gate followed by a NOT gate. The
outputs of all NOR gates are low if any of the inputs are high.The symbol is an OR
gate with a small circle on the output.
A B (A+B)’
0 0 1
0 1 0
1 0 0
1 1 0
XOR gate
The 'Exclusive-OR' gate is a circuit which will give a high output if either, but not both,
of its two inputs are high. An encircled plus sign ( ) is used to show the EOR operation.
A B A+B
0 0 0
0 1 1
1 0 1
1 1 0
The NAND and NOR gates are called universal gates since with either one the AND and
OR functions and NOT can be generated.
Logic gates are used to draw circuit diagrams corresponding to Boolean expressions.
For example:
Z= (A’. A+B )+ (A+ B)
Corresponds to the following logic circuit :
De Morgan’s Laws
These are the fundamental laws of Boolean Algebra.
Theorem 1. States 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.
(A+B)’=A’.B’
Truth Table
A B (A+B) A’ B’ (A+B)’ A’.B’
0 0 0 1 1 1 1
0 1 1 1 0 0 0
1 0 1 0 1 0 0
1 1 1 0 0 0 0
Theorem 2. States that when two (or more) input variables are OR’ed and negated, they
are equivalent to the AND of the complements of the individual variables.
(A.B)’=A’ + B’
The arrows in both the cases indicate that the columns corresponding to the LHS
and RHS of the equations match. Thus the theorems are proved.