0% found this document useful (0 votes)
16 views56 pages

Lec8 - Boolean Algebra

The document provides an overview of Boolean algebra, focusing on Boolean functions, operations, and identities. It explains key concepts such as complementation, Boolean sum, and Boolean product, along with examples and applications in electronic and optical switches. Additionally, it discusses the abstract definition of Boolean algebras and their properties, including duality and representation of Boolean functions.

Uploaded by

ainurayess
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views56 pages

Lec8 - Boolean Algebra

The document provides an overview of Boolean algebra, focusing on Boolean functions, operations, and identities. It explains key concepts such as complementation, Boolean sum, and Boolean product, along with examples and applications in electronic and optical switches. Additionally, it discusses the abstract definition of Boolean algebras and their properties, including duality and representation of Boolean functions.

Uploaded by

ainurayess
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 56

Boolean Algebra

Assylbek Issakhov,
Ph.D., professor
Boolean Functions

▪ Boolean algebra provides the operations and


the rules for working with the set {0, 1}.
Electronic and optical switches can be studied
using this set and the rules of Boolean algebra.
The three operations in Boolean algebra that
we will use most are complementation, the
Boolean sum, and the Boolean product. The
complement of an element, denoted with a bar,
is defined by 0 = 1 and 1 = 0.
Boolean Functions

▪ The Boolean sum, denoted by + or by OR, has


the following values:
1 + 1 = 1, 1 + 0 = 1, 0 + 1 = 1, 0 + 0 = 0.
▪ The Boolean product, denoted by ⋅ or by AND,
has the following values:
1 ⋅ 1 = 1, 1 ⋅ 0 = 0, 0 ⋅ 1 = 0, 0 ⋅ 0 = 0.
Boolean Functions

▪ When there is no danger of confusion, the


symbol ⋅ can be deleted, just as in writing
algebraic products. Unless parentheses are
used, the rules of precedence for Boolean
operators are: first, all complements are
computed, followed by all Boolean products,
followed by all Boolean sums.
Boolean Functions: Example

▪ Find the value of 1 ⋅ 0 + (0 + 1).


▪ Solution: Using the definitions of
complementation, the Boolean sum, and the
Boolean product, it follows that
1 ⋅ 0 + 0 + 1 = 0 + 1 = 0 + 0 = 0.
Boolean Functions

▪ The complement, Boolean sum, and Boolean


product correspond to the logical operators,
¬,∨, and ∧, respectively, where 0 corresponds
to 𝑭 (false) and 1 corresponds to 𝑻 (true).
Equalities in Boolean algebra can be directly
translated into equivalences of compound
propositions. Conversely, equivalences of
compound propositions can be translated into
equalities in Boolean algebra.
Boolean Functions: Example
▪ Translate 1 ⋅ 0 + 0 + 1 = 0, the equality
found in previous Example, into a logical
equivalence.
▪ Solution: We obtain a logical equivalence when
we translate each 1 into a 𝑻, each 0 into an 𝑭,
each Boolean sum into a disjunction, each
Boolean product into a conjunction, and each
complementation into a negation. We obtain
𝑻 ∧ 𝑭 ∨ ¬(𝑻 ∨ 𝑭) ≡ 𝑭.
Boolean Functions: Example
▪ Translate the logical equivalence 𝑻 ∧ 𝑻 ∨
¬𝑭 ≡ 𝑻 into an identity in Boolean algebra.
▪ Solution: We obtain an identity in Boolean
algebra when we translate each 𝑻 into a 1, each
𝑭 into a 0, each disjunction into a Boolean sum,
each conjunction into a Boolean product, and
each negation into a complementation. We
obtain
(1 ⋅ 1) + 0 = 1.
Boolean Expressions and
Boolean Functions

▪ Let 𝐵 = {0, 1}. Then


𝐵𝑛 = {(𝑥1 , 𝑥2 , . . . , 𝑥𝑛 )|𝑥𝑖 ∈ 𝐵 𝑓𝑜𝑟 1 ≤ 𝑖 ≤ 𝑛}
▪ is the set of all possible 𝑛-tuples of 0s and 1s.
The variable 𝑥 is called a Boolean variable if it
assumes values only from 𝐵, that is, if its only
possible values are 0 and 1. A function from 𝐵𝑛
to 𝐵 is called a Boolean function of degree 𝒏.
Boolean Expressions and
Boolean Functions: Example
▪ The function 𝐹 𝑥, 𝑦 = 𝑥𝑦 from the set of
ordered pairs of Boolean variables to the set
{0, 1} is a Boolean function of degree 2 with
𝐹(1, 1) = 0, 𝐹(1, 0) = 1, 𝐹(0, 1) = 0,
and 𝐹(0, 0) = 0. We display these values of 𝐹 in
Table 1.
Boolean Expressions and
Boolean Functions
▪ Boolean functions can be represented using
expressions made up from variables and
Boolean operations. The Boolean expressions in
the variables 𝑥1 , 𝑥2 , . . . , 𝑥𝑛 are defined
recursively as
▪ 0, 1, 𝑥1 , 𝑥2 , . . . , 𝑥𝑛 are Boolean expressions;
▪ if 𝐸1 and 𝐸2 are Boolean expressions, then 𝐸1 ,
(𝐸1 𝐸2 ), and (𝐸1 + 𝐸2 ) are Boolean expressions.
Boolean Expressions and
Boolean Functions: Example

▪ Each Boolean expression represents a Boolean


function. The values of this function are
obtained by substituting 0 and 1 for the
variables in the expression.
▪ Example. Find the values of the Boolean
function represented by 𝐹(𝑥, 𝑦, 𝑧) = 𝑥𝑦 + 𝑧.
Boolean Expressions and
Boolean Functions: Example
▪ Solution: The values of this function are
displayed in Table 2.
Boolean Expressions and
Boolean Functions

▪ Note that we can represent a Boolean function


graphically by distinguishing the vertices of the
𝑛-cube that correspond to the 𝑛-tuples of bits
where the function has value 1.
Boolean Expressions and
Boolean Functions: Example
▪ The function 𝐹(𝑥, 𝑦, 𝑧) = 𝑥𝑦 + 𝑧 from 𝐵3 to 𝐵
from previous Example can be represented by
distinguishing the vertices that correspond to the
five 3-tuples (1, 1, 1), (1, 1, 0), (1, 0, 0), (0, 1, 0),
and (0, 0, 0), where 𝐹(𝑥, 𝑦, 𝑧) = 1, as shown in
Figure. These vertices are displayed using solid
black circles.
Boolean Expressions and
Boolean Functions
▪ Boolean functions 𝐹 and 𝐺 of 𝑛 variables are
equal if and only if
𝐹(𝑏1 , 𝑏2 , . . . , 𝑏𝑛 ) = 𝐺(𝑏1 , 𝑏2 , . . . , 𝑏𝑛 )
▪ whenever 𝑏1 , 𝑏2 , . . . , 𝑏𝑛 belong to 𝐵. Two
different Boolean expressions that represent the
same function are called equivalent. For
instance, the Boolean expressions 𝑥𝑦, 𝑥𝑦 + 0,
and 𝑥𝑦 ⋅ 1 are equivalent. The complement of
the Boolean function 𝐹 is the function 𝐹, where
𝐹 𝑥1 , . . . , 𝑥𝑛 = 𝐹 𝑥1 , . . . , 𝑥𝑛 .
Boolean Expressions and
Boolean Functions
▪ Let 𝐹 and 𝐺 be Boolean functions of degree 𝑛.
The Boolean sum 𝐹 + 𝐺 and the Boolean
product 𝐹𝐺 are defined by
(𝐹 + 𝐺)(𝑥1 , . . . , 𝑥𝑛 ) = 𝐹(𝑥1 , . . . , 𝑥𝑛 ) +
𝐺(𝑥1 , . . . , 𝑥𝑛 ),
(𝐹𝐺)(𝑥1 , . . . , 𝑥𝑛 ) = 𝐹(𝑥1 , . . . , 𝑥𝑛 )𝐺(𝑥1 , . . . , 𝑥𝑛 ).
Boolean Expressions and
Boolean Functions
▪ A Boolean function of degree two is a function
from a set with four elements, namely, pairs of
elements from 𝐵 = {0, 1}, to 𝐵, a set with two
elements. Hence, there are 16 different
Boolean functions of degree two. In Table 3 we
display the values of the 16 different Boolean
functions of degree two, labeled 𝐹1 , 𝐹2 , . . . , 𝐹16 .
Boolean Expressions and
Boolean Functions
Boolean Expressions and
Boolean Functions: Example
▪ How many different Boolean functions of
degree 𝑛 are there?
▪ Solution: From the product rule for counting, it
follows that there are 2𝑛 different 𝑛-tuples of
0s and 1s. Because a Boolean function is an
assignment of 0 or 1 to each of these 2𝑛
different 𝑛-tuples, the product rule shows that
2𝑛
there are 2 different Boolean functions of
degree 𝑛.
Identities of Boolean Algebra

▪ There are many identities in Boolean algebra.


The most important of these are displayed in
Table 5. These identities are particularly useful
in simplifying the design of circuits. Each of the
identities in Table 5 can be proved using a table.
Identities of Boolean Algebra
Identities of Boolean Algebra
Identities of Boolean
Algebra: Example
▪ Show that the distributive law 𝑥(𝑦 + 𝑧) = 𝑥𝑦 +
𝑥𝑧 is valid.
Identities of Boolean
Algebra: Example
▪ Prove the absorption law 𝑥(𝑥 + 𝑦) = 𝑥 using the
other identities of Boolean algebra shown in
Table 5.
▪ Solution:
Duality

▪ The identities in Table 5 come in pairs (except


for the law of the double complement and the
unit and zero properties). To explain the
relationship between the two identities in each
pair we use the concept of a dual. The dual of a
Boolean expression is obtained by interchanging
Boolean sums and Boolean products and
interchanging 0s and 1s.
Duality
▪ The dual of a Boolean function 𝐹 represented
by a Boolean expression is the function
represented by the dual of this expression. This
dual function, denoted by 𝐹 𝑑 , does not depend
on the particular Boolean expression used to
represent 𝐹. An identity between functions
represented by Boolean expressions remains
valid when the duals of both sides of the
identity are taken. This result, called the duality
principle, is useful for obtaining new identities.
Duality: Example

▪ Construct an identity from the absorption law


𝑥(𝑥 + 𝑦) = 𝑥 by taking duals.
▪ Solution: Taking the duals of both sides of this
identity produces the identity 𝑥 + 𝑥𝑦 = 𝑥,
which is also called an absorption law and is
shown in Table 5.
The Abstract Definition of a
Boolean Algebra
▪ Here we have focused on Boolean functions
and expressions. However, the results we have
established can be translated into results about
propositions or results about sets. Because of
this, it is useful to define Boolean algebras
abstractly. Once it is shown that a particular
structure is a Boolean algebra, then all results
established about Boolean algebras in general
apply to this particular structure.
The Abstract Definition of a
Boolean Algebra

▪ Boolean algebras can be defined in several


ways. The most common way is to specify the
properties that operations must satisfy, as is
done in the next Definition.
The Abstract Definition of a
Boolean Algebra
The Abstract Definition of a
Boolean Algebra
▪ Using the laws given in Definition, it is possible to
prove many other laws that hold for every
Boolean algebra, such as idempotent and
domination laws.
▪ From our previous discussion, 𝐵 = {0, 1} with
the OR and AND operations and the complement
operator, satisfies all these properties. The set of
propositions in 𝑛 variables, with the ∨ and ∧
operators, 𝑭 and 𝑻, and the negation operator,
also satisfies all the properties of a Boolean
algebra.
The Abstract Definition of a
Boolean Algebra
▪ Boolean algebras may also be defined using the
notion of a lattice. A lattice 𝐿 is a partially
ordered set in which every pair of elements 𝑥, 𝑦
has a least upper bound, denoted by 𝑙𝑢𝑏(𝑥, 𝑦)
and a greatest lower bound denoted by
𝑔𝑙𝑏(𝑥, 𝑦). Given two elements 𝑥 and 𝑦 of 𝐿, we
can define two operations ∨ and ∧ on pairs of
elements of 𝐿 by
𝑥 ∨ 𝑦 = 𝑙𝑢𝑏(𝑥, 𝑦) and 𝑥 ∧ 𝑦 = 𝑔𝑙𝑏(𝑥, 𝑦).
The Abstract Definition of a
Boolean Algebra
▪ For a lattice 𝐿 to be a Boolean algebra as specified
in Definition, it must have two properties. First, it
must be complemented. For a lattice to be
complemented it must have a least element 0 and
a greatest element 1 and for every element 𝑥 of
the lattice there must exist an element 𝑥 such that
𝑥 ∨ 𝑥 = 1 and 𝑥 ∧ 𝑥 = 0. Second, it must be
distributive. This means that for every 𝑥, 𝑦, and 𝑧
in 𝐿, 𝑥 ∨ (𝑦 ∧ 𝑧) = (𝑥 ∨ 𝑦) ∧ (𝑥 ∨ 𝑧) and
𝑥 ∧ (𝑦 ∨ 𝑧) = (𝑥 ∧ 𝑦) ∨ (𝑥 ∧ 𝑧). Showing that a
complemented, distributive lattice is a Boolean
algebra has been left as Supplementary Exercise.
HOMEWORK: Exercises 2, 4, 6, 8, 12, 24,
28 on p. 818
Representing Boolean Functions
▪ Two important problems of Boolean algebra will
be considered here. The first problem is: Given
the values of a Boolean function, how can a
Boolean expression that represents this function
be found? This problem will be solved by
showing that any Boolean function can be
represented by a Boolean sum of Boolean
products of the variables and their complements.
The solution of this problem shows that every
Boolean function can be represented using the
three Boolean operators ⋅, +, and .
Representing Boolean Functions

▪ The second problem is: Is there a smaller set


of operators that can be used to represent all
Boolean functions? We will answer this
question by showing that all Boolean functions
can be represented using only one operator.
Both of these problems have practical
importance in circuit design.
Sum-of-Products
Expansions: Example
▪ Find Boolean expressions that represent the
functions 𝐹(𝑥, 𝑦, 𝑧) and 𝐺(𝑥, 𝑦, 𝑧), which are
given in Table 1.
Sum-of-Products
Expansions: Example

▪ Solution: An expression that has the value 1


when 𝑥 = 𝑧 = 1 and 𝑦 = 0, and the value 0
otherwise, is needed to represent 𝐹. Such an
expression can be formed by taking the Boolean
product of 𝑥, 𝑦, and 𝑧. This product, 𝑥𝑦𝑧, has the
value 1 if and only if 𝑥 = 𝑦 = 𝑧 = 1, which holds
if and only if 𝑥 = 𝑧 = 1 and 𝑦 = 0.
Sum-of-Products
Expansions: Example
▪ Solution: To represent 𝐺, we need an expression
that equals 1 when 𝑥 = 𝑦 = 1 and 𝑧 = 0, or
𝑥 = 𝑧 = 0 and 𝑦 = 1. We can form an expression
with these values by taking the Boolean sum of
two different Boolean products. The Boolean
product 𝑥𝑦𝑧 has the value 1 if and only if
𝑥 = 𝑦 = 1 and 𝑧 = 0. Similarly, the product 𝑥𝑦𝑧
has the value 1 if and only if 𝑥 = 𝑧 = 0 and 𝑦 = 1.
The Boolean sum of these two products,
𝑥𝑦𝑧 + 𝑥𝑦𝑧, represents 𝐺, because it has the value
1 if and only if 𝑥 = 𝑦 = 1 and 𝑧 = 0, or 𝑥 = 𝑧 = 0
and 𝑦 = 1.
Sum-of-Products Expansions

▪ This Example illustrates a procedure for


constructing a Boolean expression
representing a function with given values.
Each combination of values of the variables
for which the function has the value 1 leads
to a Boolean product of the variables or their
complements.
Sum-of-Products Expansions

▪ DEFINITION 1. A literal is a Boolean variable


or its complement. A minterm of the Boolean
variables 𝑥1 , 𝑥2 , . . . , 𝑥𝑛 is a Boolean product
𝑦1 𝑦2 … 𝑦𝑛 , where 𝑦𝑖 = 𝑥𝑖 or 𝑦𝑖 = 𝑥𝑖 . Hence,
a minterm is a product of 𝑛 literals, with one
literal for each variable.
Sum-of-Products Expansions

▪ A minterm has the value 1 for one and only


one combination of values of its variables.
More precisely, the minterm 𝑦1 𝑦2 … 𝑦𝑛 is 1 if
and only if each 𝑦𝑖 is 1, and this occurs if and
only if 𝑥𝑖 = 1 when 𝑦𝑖 = 𝑥𝑖 and 𝑥𝑖 = 0 when
𝑦𝑖 = 𝑥𝑖 .
Sum-of-Products
Expansions: Example

▪ Find a minterm that equals 1 if 𝑥1 = 𝑥3 = 0


and 𝑥2 = 𝑥4 = 𝑥5 = 1, and equals 0
otherwise.
▪ Solution: The minterm 𝑥1 𝑥2 𝑥3 𝑥4 𝑥5 has the
correct set of values.
Sum-of-Products Expansions

▪ The minterms in this Boolean sum correspond


to those combinations of values for which the
function has the value 1. The sum of minterms
that represents the function is called the sum-
of-products expansion or the disjunctive
normal form (DNF) of the Boolean function.
Sum-of-Products
Expansions: Example
▪ Find the sum-of-products expansion for the
function 𝐹 𝑥, 𝑦, 𝑧 = 𝑥 + 𝑦 𝑧. Solution: We will
find the sum-of-products expansion of 𝐹(𝑥, 𝑦, 𝑧)
in two ways. First, we will use Boolean identities
to expand the product and simplify. We find that
Sum-of-Products
Expansions: Example
▪ Second, we can construct the sum-of-products
expansion by determining the values of 𝐹 for all
possible values of the variables 𝑥, 𝑦, and 𝑧. These
values are found in Table 2.
Sum-of-Products
Expansions: Example

▪ The sum-of products expansion of 𝐹 is the


Boolean sum of three minterms corresponding
to the three rows of this table that give the value
1 for the function. This gives
𝐹(𝑥, 𝑦, 𝑧) = 𝑥𝑦𝑧 + 𝑥𝑦𝑧 + 𝑥𝑦𝑧.
Sum-of-Products Expansions

▪ It is also possible to find a Boolean expression


that represents a Boolean function by taking a
Boolean product of Boolean sums. The resulting
expansion is called the conjunctive normal form
(CNF) or product-of-sums expansion of the
function. These expansions can be found from
sum-of-products expansions by taking duals. To
find such expansions directly we use the same
method as for disjunctive normal form.
Sum-of-Products Expansions
▪ The Boolean sum 𝑦1 + 𝑦2 + ⋯ + 𝑦𝑛 , where
𝑦𝑖 = 𝑥𝑖 or 𝑦𝑖 = 𝑥𝑖 , has the value 0 for exactly
one combination of the values of the variables,
namely, when 𝑥𝑖 = 0 if 𝑦𝑖 = 𝑥𝑖 and 𝑥𝑖 = 1 if
𝑦𝑖 = 𝑥𝑖 . This Boolean sum is called a maxterm.
A Boolean function can be represented as a
Boolean product of maxterms. This
representation is called the product-of-sums
expansion or conjunctive normal form (CNF)
of the function.
Functional Completeness

▪ Every Boolean function can be expressed as a


Boolean sum of minterms. Each minterm is the
Boolean product of Boolean variables or their
complements. This shows that every Boolean
function can be represented using the Boolean
operators ⋅, +, and . Because every Boolean
function can be represented using these
operators we say that the set {⋅, + , } is
functionally complete.
Functional Completeness

▪ Can we find a smaller set of functionally


complete operators? We can do so if one of the
three operators of this set can be expressed in
terms of the other two. This can be done using
one of De Morgan’s laws. We can eliminate all
Boolean sums using the identity
𝑥 + 𝑦 = 𝑥 𝑦,
which is obtained by taking complements of both
sides in the second De Morgan law.
Functional Completeness
▪ This means that the set {⋅, } is functionally
complete.
▪ Similarly, we could eliminate all Boolean products
using the identity
𝑥𝑦 = 𝑥 + 𝑦,
which is obtained by taking complements of both
sides in the first De Morgan law. Consequently {+, }
is functionally complete. Note that the set {+,⋅} is
not functionally complete.
Functional Completeness
▪ We have found sets containing two operators
that are functionally complete. Can we find a
smaller set of functionally complete operators,
namely, a set containing just one operator? Such
sets exist. Define two operators, the | or NAND
operator (or Sheffer stroke), defined by
1|1 = 0 and 1|0 = 0|1 = 0|0 = 1;
▪ and the ↓ or NOR operator (Peirce’s arrow),
1 ↓ 1 = 1 ↓ 0 = 0 ↓ 1 = 0 and 0 ↓ 0 = 1.
Functional Completeness

▪ Both of the sets {|} and {↓} are functionally


complete. To see that {|} is functionally
complete, because {⋅, } is functionally
complete, all that we have to do is show that
both of the operators ⋅ and can be expressed
using just the | operator. This can be done as
𝑥 = 𝑥|𝑥,
𝑥𝑦 = (𝑥|𝑦)|(𝑥|𝑦).
HOMEWORK: Exercises 2, 4, 6, 12, 14,
20 on p. 822

You might also like