Download as pdf or txt
Download as pdf or txt
You are on page 1of 34

Chapter2: Boolean Algebra and Logic

Gates
Lecture1- Introduction to Boolean Algebra, Boolean
Function and its different Representations
Engr. Arshad Nazir, Asst Prof
Dept of Electrical Engineering
EE-223 Digital Logic Design Spring 2024 SEECS 1
EE-223 Digital Logic Design Spring 2024 2
Chapter Contents
Definition of Boolean Algebra
Basic Theorems and Properties of Boolean Algebra
Boolean Functions
Canonical and Standard Forms
Other Logic Operations
Digital Logic Gates
Integrated Circuits

EE-223 Digital Logic Design Spring 2024 3


Objectives
• Introduction to Boolean algebra
• Basic rules and theorems of Boolean algebra and their
applications in digital circuits
• Boolean Functions and different representations
• Complement of a function

EE-223 Digital Logic Design Spring 2024 4


Boolean algebra
• Boolean algebra is the basic mathematics
needed for the study of logic design of digital
systems.
• In 1854, George Boole an English
mathematician in his famous book “An
Investigation on the Laws of Thought” gave
the concept of logical algebra today known as
Boolean algebra.
• Boolean algebra is a convenient and
systematic way of expressing and analyzing
the operation of logic circuits.

EE-223 Digital Logic Design Spring 2024 5


Boolean algebra

• Claude Shannon was the first to


apply Boole’s work to the analysis
of relays and switching circuits in
1938. Shannon introduced two-
valued Boolean algebra called
switching algebra, in which he
demonstrated that the properties
of bi-stable electrical circuits can be
• Master Thesis 1938: A demonstrated by this algebra.
Symbolic Analysis of • In 1904, Huntington gave a set of
Relays and Switching postulates that form the basis of
Circuits formal definition of Boolean
• Realized Boole’s algebra algebra.
could be used to simplify
telephone relay networks
EE-223 Digital Logic Design Spring 2024 6
Set Notations
• Mathematical systems can be defined with:
➢ A set of elements; A set of elements is any collection of objects
having a common property.
➢ A set of logical operators; A binary operator defined on a set S of
elements is a rule that assigns to each pair of elements from S a
unique element from S.
➢ A number of unproved axioms or postulates that form the basic
assumptions from which it is possible to deduce the rules,
theorems and properties of the system.
• The following notations are being used in this class:
➢ x  S indicates that x is an element of the set S.
➢ y  S indicates that y is not an element of the set S.
➢ A = {1, 2, 3, 4} indicates that set A exists with a finite number of
elements (1, 2, 3, 4).
EE-223 Digital Logic Design Spring 2024 7
Basic Postulates
• The postulates of a mathematical system form the basic assumptions from which it is
possible to deduce the rules, theorems, and properties of the systems. Some common
postulates to formulate various algebraic structures are:
➢ Closure. A set S is closed w.r.t a binary operator if, for every pair of elements of S, the
binary operator specifies a rule for obtaining a unique element of S.
For example, the set of natural numbers N={1, 2, 3, 4,…..} is closed w.r.t binary operator
+ by the rules of arithmetic addition, but not closed w.r.t binary operator – by the rules
of arithmetic subtraction.
➢ Associative Law. A binary operator * on a set S is said to be associative when:
(x * y) * z = x * (y * z)
➢ Commutative Law. A binary operator * on set S is said to be commutative when:
x*y=y*x
➢ Identity Element. A set is said to have an identity element with respect to a binary
operation * on S if there exists an element e ϵ S with the property that
e * x = x * e = x for every x ϵ S
For example, the element 0 is an identity element w.r.t the binary operator + on
the set of integers I ={ˑˑˑ, -3, -2, -1, 0, 1, 2, 3,ˑˑˑ}, since
x + 0 = 0 + x = x for any x ϵ I
The set of natural numbers N, has
EE-223 noLogic
Digital identity element,
Design Spring 2024 since 0 is excluded. 8
Basic Postulates
➢ Inverse. A set S having the identity element e w.r.t a binary operator * is said to
have an inverse whenever, for every x ϵ S, there exists an element y ϵ S such
that
x*y=e
Example: In the set of integers I ={ˑˑˑ, -3, -2, -1, 0, 1, 2, 3,ˑˑˑ}, and the binary
operator +, with e = 0, the inverse of an element a is (-a), a +(-a) = 0.
o The additive inverse of element a is –a and it defines subtraction, since
a + (–a) = 0. Multiplicative inverse of a is 1/a and defines division, since
a.1/a = 1
➢ Distributive Law. If * and · are two binary operators on a set S, * is said to be
distributive over · when
x * ( y · z) = (x * y) · (x * z)
Note: + and · are binary operators. Binary operator + defines addition and
binary operator · defines multiplication
Two-value Boolean algebra is defined by the ,the set of two elements B={0, 1},
the operators of AND (·) and OR (+) and Huntington Postulates are satisfied
EE-223 Digital Logic Design Spring 2024 9
Huntington Postulates
• In 1904 E. V. Huntington formulated a number of postulates that give us
formal definition of Boolean algebra. Boolean algebra is an algebraic
structure defined by a set of elements, B , together with two binary
operators, + and · , provided that the following (Huntington) postulates are
satisfied:
1. Closure.
a) with respect to the binary operation OR (+); c=x + y
b) with respect to the binary operation AND (·); c=x · y
2. Identity.
a) with respect to OR (+) is 0:
x + 0 = 0 + x = x, for x = 1 or x = 0
b) with respect to AND (·) is 1:
x · 1 = 1 · x = x, for x = 1 or x =0
3. Commutative Law.
a) With respect to OR (+):
x+y=y+x
b) With respect to AND (·):
x·y=y·x EE-223 Digital Logic Design Spring 2024 10
Huntington Postulates Continued…
4. Distributive Law.
a) with respect to the binary operation OR (+):
x + (y · z) = (x + y) · (x + z) + is distributive over ·
b) with respect to the binary operation AND (·):
x · (y + z) = (x · y) + (x · z) · is distributive over +
5. Complement. For every element x, that belongs to B, there also exists an
element x´ (complement of x) such that:
a) x + x´ = 1, for x = 1 or x = 0
b) x · x´ = 0 , for x = 1 or x = 0
6. Membership.
There exists at least two elements, x and y, of the set such that
x ≠ y.
0≠1

EE-223 Digital Logic Design Spring 2024 11


Notes on Huntington Postulates
Comparing Boolean algebra with arithmetic and ordinary algebra, we note
the following differences:
• The associative law is not listed but it can be derived from the existing
postulates for both + and . operations.
• The distributive law of + over . i.e.,
x+(y . z) = (x + y) . (x + z)
is valid for Boolean algebra but not for ordinary algebra.
• Boolean algebra doesn’t have inverses (additive or multiplicative)
therefore there are no operations related to subtraction or division.
• Postulate 5 defines an operator called complement that is not available in
ordinary algebra.
• Ordinary algebra deals with the real numbers, which constitute an infinite
number of elements whereas Boolean algebra deals with only two
elements, 0 and 1
EE-223 Digital Logic Design Spring 2024 12
Operator Tables
• A two-valued Boolean algebra is defined on a set of two elements B={0,1},
with rules for the two binary operators + and . as shown in the following
operator tables:

• AND Operation

• OR Operation

• NOT Operation

EE-223 Digital Logic Design Spring 2024 13


Proving the Distributive Law

EE-223 Digital Logic Design Spring 2024 14


Duality
• The duality principle states that every algebraic expression deducible
from the postulates of Boolean algebra remains valid if the operators and
identity elements are interchanged.
➢ The Huntington postulates have been listed in pairs and designed as
part (a) and part (b).
➢ If the dual of an algebraic equation is required, we interchange the OR
and AND operators and replace 1’s by 0’s and 0’s by 1’s.
➢ Example:

EE-223 Digital Logic Design Spring 2024 15


Postulates and Theorems of Boolean
Algebra
P2 (a) x+0 =x (b) x.1 = x
P5 (a) x+x´ = 1 (b) x .x´ = 0
T1, idempotent (a) x + x = x (b) x. x = x
T2 (a) x + 1 = 1 (b) x .0 = 0
T3, involution (x´)´ = x
P3, (a) x+y = y+x (b) x.y = y.x
commutative
T4, Associative (a) x+(y+z)=(x+y)+z (b) x.(y.z)
=(x.y).z
P4, distributive (a) x(y+z)=xy+xz (b)
x+yz=(x+y)(x+z)
T5, DeMorgan (a) (x+y)´ =x´.y´ (a)
b (xy)´=x´+y´
T6, absorption (a) x+x.y = x (a)
b x.(x+y) =x

EE-223 Digital Logic Design Spring 2024 16


Operator Precedence
• The operator precedence for evaluating Boolean expressions is:
1. Parentheses
2. NOT
3. AND
4. OR
• In other words, expressions inside the parentheses must be evaluated before
all other operations. The next operation that holds precedence is the
complement, and then follows the AND and, finally, the OR.
• Consider the truth table for one of the DeMorgan’s theorems; (x+y)՛ = x՛ˑ y՛

EE-223 Digital Logic Design Spring 2024 17


Boolean Functions
• A Boolean function is an expression described by:
➢ binary variables
➢ constants 0 and 1
➢ logic operation symbols
• For a given value of the binary variables the result of the function can
either be 0 or 1.
• An example function:
➢ F1 = x + y′z
➢ F1 is equal to 1 if x is equal to 1 or if both y’ and z equal to 1. F1 is
equal to 0 otherwise

EE-223 Digital Logic Design Spring 2024 18


Function as a Truth Table
• A Boolean function can be represented in a truth table.
➢ A truth table is a list of combinations of 1’s and 0’s assigned to
the binary variables and a column that shows the value of the
function for each binary combination

EE-223 Digital Logic Design Spring 2024 19


Function as a Gate Implementation
• A Boolean function can be transformed from an algebraic expression into
circuit diagram composed of logic gates.
➢ F1 = x + y′z
➢ The logic-circuit diagram for this function is shown below:

EE-223 Digital Logic Design Spring 2024 20


Gate Implementation (Examples)
A B C F
A
0 0 0 0
B
0 0 1 0
F
0 1 0 0
A
C F = AB + AC 0 1 1 0
1 0 0 0
B
1 0 1 1
C
1 1 0 1
F
A 1 1 1 1
F = A(B + C)
EE-223 Digital Logic Design Spring 2024 21
Gate Implementation (Examples)

A
A B F
F
0 0 1
B F = A’ B’ 0 1 0

1 0 0
A 1 1 0
F
B
F = (A + B)’

EE-223 Digital Logic Design Spring 2024 22


Functions Minimization
• Functions in algebraic form can be represented in various ways.
➢ Remember the postulates and theorems that allow us to
represent a function in various ways.
• We must keep in mind that the algebraic expression is representative
of the gates and circuitry used in a hardware piece.
➢ We want to be able to minimize circuit design to reduce cost,
power consumption, and package count, and to increase speed.
• By manipulating a function using the postulates and theorems, we
may be able to minimize an expression.

EE-223 Digital Logic Design Spring 2024 23


Non-Minimized Function
• The following is an example of a non-minimized function:
➢ F2 = x′y′z + x′yz + xy′

EE-223 Digital Logic Design Spring 2024 24


Minimization of the F2
• The function can be minimized as follows:
X′y′z + x′yz + xy′ =
= x′z·(y′+ y) + xy′ postulate 4(a)
= x′z ·1 + xy′ 5(a)
= x′z + xy′ 2(b)

EE-223 Digital Logic Design Spring 2024 25


Implementations of Boolean Function F2

• Non-minimized
Function

• Minimized
Function

EE-223 Digital Logic Design Spring 2024 26


Algebraic Manipulation
• By reducing the number of terms, the number of literals (single
variable) or both in a Boolean function, it is possible to obtain a
simpler circuit, as each term requires a gate and each variable within
the term designates an input to the gate .
• For example consider the following function F1
F1 = x′y′z + x′yz + xy′ which contains 3 terms and 8 literals
After simplification the minimized function is F2 = x′z + xy′ and it
contains 2 terms and 4 literals.
• The reduced function contains lesser terms and literals. It can now be
implemented with fewer gates i.e optimized design.

EE-223 Digital Logic Design Spring 2024 27


Example Manipulations
• The following are some example manipulations:
1. x(x′ + y) = xx′ + xy = 0 + xy = xy
2. x + x′y = (x + x′)(x + y) = 1(x + y) = x + y
3. (x + y)(x + y′) = x + xy + xy′ + yy′ = x(1 + y + y′) = x
4. xy + x′z + yz = xy + x′z + yz(x + x′)
= xy + x′z + xyz + x′yz
= xy(1 + z) + x′z(1 + y)
= xy + x′z
5. (x + y)(x′+z)(y+z) = (x + y)(x′+z)(y+z+x.x′)
= (x + y)(x′+z)(y+z+x)(y+z+x′)
= (x + y)(x+y+z)(x′+z)(x′+z+y)
= (x + y)(x′+z)
EE-223 Digital Logic Design Spring 2024 28
Complement of a Function
• The complement of a function F is F′.
➢ It is obtained by interchanging 0’s for 1’s and 1’s for 0’s in the
value of F.
• The complement of a function may be derived algebraically through
DeMorgan’s theorem.
➢ Theorem 5(a) (DeMorgan): (x + y)′ = (x′ · y′)
➢ Theorem 5(b) (DeMorgan): (x · y)′ = (x′ + y′)
• Example:
➢ F1 = x′yz′ + x′y′z
F1′ = (x′yz′ + x′y′z)′
= (x + y′ + z)(x + y + z′)

EE-223 Digital Logic Design Spring 2024 29


Complement of a Function (Example)
• If F1 = A+B+C
• Then F1'=(A+B+C)'
= (A+X)' let B+C = X
= A'X' by DeMorgan's
= A'(B+C)'
= A'(B'C') by DeMorgan's
= A'B'C' associative
• The generalized expression for DeMorgan’s law for a function with
multiple terms is
(A+B+C+D+….)′=A′.B′.C′.D′…..
(A.B.C.D…..)′= A′+B′+C′+D′+….

EE-223 Digital Logic Design Spring 2024 30


Complement of a Function (More Examples)
• F=x'yz' + x'y′z
F′=(x'yz' + x'y'z)′
F'= (x'yz')' (x′y'z)'
= (x+y'+z) (x+y+z')
• F=[x(y'z'+yz)]
F′=[x(y'z'+yz)]'
F'= x' + ( y'z'+yz)'
= x' + (y'z')′.(yz)'
= x' + (y+z) (y'+z')
• A simpler procedure
➢ take the dual of the function (interchanging AND and OR
operators and 1’s and 0’s) and complement each literal.
{DeMorgan’s Theorem}
➢ x'yz' + x'y'z
The dual of function: FD= (x'+y+z') (x'+y'+z)
Complement of each literal: F' =(x+y'+z)(x+y+z')
EE-223 Digital Logic Design Spring 2024 31
Representation Conversion
• Need to transition between Boolean expression, truth table, and
circuit (symbols).
• Converting between truth table and expression is easy.
• Converting between expression and circuit is easy.
• More difficult to convert to truth table.

Circuit Boolean
Expression

Truth
Table

EE-223 Digital Logic Design Spring 2024 32


Different Representations of a
Boolean Function
• Standard Forms are sum-of-products and product-of-sums
➢ Sum-of-Products (SOP) i.e F(X,Y,Z)=X′+YZ
➢ Product-of-Sums (POS) i.e F(X,Y,Z)=(X′+Y)Z
• Canonical Forms are sum-of-minterms (SSOP)and product-of-maxterms (SPOS)
➢ Standard Sum-of-Products (SSOP) i.e F(X,Y,Z)=X′Y′Z+X′YZ′+XYZ
➢ Standard Product-of-Sums (SPOS) i.e F(X,Y,Z)=(X′+Y′+Z′)(X′+Y′+Z)(X+Y+Z)
• Non-Standard or Mixed Forms are those neither in standard nor canonical forms
i.e F(X,Y,Z)=X′(Y′Z+YZ′)+YZ

EE-223 Digital Logic Design Spring 2024 33


The End

EE-223 Digital Logic Design Spring 2024 34

You might also like