You are on page 1of 36

Boolean Algebra & Logic Gates

By : Ali Mustafa
Digital Logic Gates

• There are three fundamental logical


operations, from which all other functions, no
matter how complex, can be derived. These
Basic functions are named:
–AND
–OR
–NOT (INVERTER)
AND Gate
• Represented by any of the following notations:
– X AND Y
–X.Y
–XY

• Function definition:
Z = 1 only if X=Y=1
0 otherwise
OR Gate
• Represented by any of the following
notations:
– X OR Y
–X+Y
• Function definition:
Z = 1 if X=1 or Y =1 or both X=Y=1
0 if X=Y=0
NOT (Inverter) Gate
• Represented by a bar over the variable

• Function definition:
It is also called complement operation , as it
changes 1’s to 0’s and 0’s to 1’s.
Logic gates timing Diagram
• Timing diagrams illustrate the response of any gate to all
possible input signal combinations.
• The horizontal axis of the timing diagram represents time
and the vertical axis represents the signal as it changes
between the two possible voltage levels 1 or 0
Other Gates
Others Gates
Digital Logic

• How to describe Digital logic system?

We have two methods:


• Truth Table
• Boolean Expression
TRUTH TABLE
• A Truth Table is a table of combinations of the binary variables
showing the relationship between the different values that the
input variables take and the result of the operation (output).
• The number of rows in the Truth Table is where n = number
of input variables in the function.
• The binary combinations are obtained from the binary number
by counting from 0 to

• Example: AND gate with 2 inputs


– n=2
– The truth table has 2 rows = 4
– The binary combinations is from
0 to (22-1=(3)) [00,01,10,11]
BOOLEAN EXPRESSIONS
• We can use these basic operations to form more
complex expressions:

• Some terminology and notation:


– f is the name of the function.
– (x,y,z) are the input variables, each representing 1 or
0. Listing the inputs is optional, but sometimes
helpful.
– A literalis any occurrence of an input variable or its
complement. The function above has four literals: x,
y’, z, and x’.
How to get the Boolean Expression
from the truth table?
Boolean Expressions From Truth Tables
• Each 1 in the output of a truth table specifies
one term in the corresponding boolean
expression.
Example
• Find boolean expression?
Example Solution
Basic Logic gates
• We have defined three basic logic gates and operators

• Also, we could build any digital circuit from those basic


logic gates.
• In digital Logic, we are not using normal mathematics we
are using Boolean algebra

So, we need to know the laws & rules of Boolean Algebra


Boolean Algebra
• What’s the difference between the Boolean Algebra and
arithmetic algebra?

The First obvious difference that in Boolean


algebra we have only (+) and (.) operators we
don’t have subtraction(-) or division(/) like math.
Binary Logic
• You should distinguish between binary logic
and binary arithmetic.
– Arithmetic variables are numbers that consist of
many digits.

Arithmetic
• A binary logic variable is always either 1 or 0.
Binary
Laws & Rules of Boolean Algebra
• The basic laws of Boolean algebra:

–The commutative law


–The associative law
–The distributive law
Commutative Law
• The commutative law of addition for two
variables is written as: A+B = B+A

• The commutative law of multiplication for two


variables is written as: AB = BA
Associative Law
• The associative law of addition for 3 variables
is written as: A+(B+C) = (A+B)+C

• The associative law of multiplication for 3


variables is written as: A(BC) = (AB)C
Distributive Law
• The distributive law for multiplication as
follows: A(B+C) = AB + AC

• The distributive law for addition is as follows


A+(B.C) = (A+B)(A+C)
Basic Theorems of Boolean Algebra
Basic Theorems of Boolean Algebra

OR Laws AND Laws

Inversion Law
Theorem 1(a)

Proof X+X=X
Solution
X+X = (X + X ) . 1 X.1=1
=(X + X)(X + X’) X + X’=1
=X + XX’ Dist X + YZ= (X+Y)(X+Z)
=X + 0 X.X’=0
=X
Theorem 1(b)

Prove X.X = X
Solution:
X.X = XX + 0 X + 0 =X
=XX + XX’ XX’= 0
=X(X + X’)
=X(1) X + X’ =1
=X
Self Tasks (Theorems)

– X+1=1
– X.0 = 0
– X + XY= X
Duality Principle
• A Boolean equation remains valid if we take
the dual of the expressions on both sides of
the equals sign
• Dual of expression it means,
– Interchange 1’s with 0’s (and Vice-versa)
– Interchange AND (.) with OR (+) (and Vice-versa)
DeMorgan’s Law
Theorem 1: NAND = Bubbled OR Complement of
product is equal to addition of the compliments.

Theorem 2: NOR = Bubbled AND Complement of sum


is equal to product of the compliments.
Truth Tables for DeMorgan’s
Example
• Get the logic function from the following truth table
and implement it using basic logic gates (AND, OR, NOT)
Simplification of the logic function
• A´B´ + A´B + AB´
Solution:
A´(B´ + B) + AB´
A’(1) + AB´
(A’ + A)(A’ + B’) Hint A+AB Dist

1 (A’ + B’)
(AB)’ DeMorgan Law(1 NAND Gate only)

From 7 gates using simplification rule can be optimized to 1 gate


Home Task: Simplify the following Expressions
• Find the dual of the following expressions

1. A + AB = A
2. A + A’B = A + B
3. A + A’ = 1
4. (A + B)(A + C) = A + BC
Home Task: Simplify the following Expressions
• Prove the following binary expressions ( Using
Postulates)
1. A + AB = A
2. (A + B)(A + C) = A + BC
3. (A + B’ + AB)(A + B’)(A’B) = 0
4. AB + ABC + AB’ = A
5. AB’ + A’B + A’B’
Fewer Gates

F  XY  XZ
Algebraic Manipulation

F  XYZ  XYZ  XZ

You might also like