Boolean Algebra & Logic Gates: By: Ali Mustafa
Boolean Algebra & Logic Gates: By: Ali Mustafa
By : Ali Mustafa
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
Function definition:
It is also called complement operation , as it
changes 1s to 0s and 0s to 1s.
Other Gates
Others Gates
Digital Logic
How to describe Digital logic system?
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.
Example
Find boolean expression?
Example Solution
Boolean Algebra
Whats the difference between the Boolean Algebra and
arithmetic algebra?
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
Commutative Law
The commutative law of addition for two
variables is written as: A+B = B+A
Associative Law
The associative law of addition for 3 variables
is written as: A+(B+C) = (A+B)+C
Distributive Law
The distributive law for multiplication as
follows: A(B+C) = AB + AC
OR Laws
Inversion Law
AND Laws
Theorem 1(a)
Proof
Solution
X+X
X+X=X
= (X + X ) . 1
=(X + X)(X + X)
=X + XX
=X + 0
=X
X.1=1
X + X=1
Dist X + YZ= (X+Y)(X+Z)
X.X=0
Theorem 1(b)
Prove
X.X = X
Solution:
X.X = XX + 0
=XX + XX
=X(X + X)
=X(1)
=X
X + 0 =X
XX= 0
X + X =1
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 1s with 0s (and Vice-versa)
Interchange AND (.) with OR (+) (and Vice-versa)
DeMorgans Law
Theorem 1: NAND = Bubbled OR
Complement of
product is equal to addition of the compliments.
Complement of sum
Example
Get the logic function from the following truth table
and implement it using basic logic gates (AND, OR, NOT)
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
1.
2.
3.
4.
A + AB = A
A + AB = A + B
A + A = 1
(A + B)(A + C) = A + BC
1.
2.
3.
4.
5.
A + AB = A
(A + B)(A + C) = A + BC
(A + B + AB)(A + B)(AB) = 0
AB + ABC + AB = A
AB + AB + AB
Fewer Gates
F XY XZ
Algebraic Manipulation
F XYZ XYZ XZ