0% found this document useful (0 votes)
8 views

Module4_ Lecture 3 & 4

Uploaded by

buzzobaby
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views

Module4_ Lecture 3 & 4

Uploaded by

buzzobaby
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 57

15B11CI212 Theoretical Foundations of

Computer Science

Module 4: Algebric Structures


Outline- Algebraic Structures

Binary Operations: semi-group, group; Subgroup: Cosets; Ring; Field; Boolean algebra; Binary
Arithmetic.
Module 4:
Topic : Boolean
Algebra
• 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 mostly used three operations in Boolean algebra are

• complementation,

• Boolean sum, and

• Boolean product.
• The complement of an element, denoted with a
bar, is defined by

0=1 and 1=0.

• The Boolean sum, denoted by+or byOR, has the


following values:

1+1=1, 1+0=1, 0+1=1,


0+0=0.

• The Boolean product, denoted by·or byAND, has


the following values:
EXAMPLE 1

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.

EXAMPLE 2
Show that(1·1)+((0·1)’+0)=1.
Boolean Expressions and Boolean
Functions
• LetB={0,1}.
Then Bn={(x1,x2,...,xn)|xi ∈ B for 1≤i≤n}is the set of all
possiblen-tuples of 0s and 1s.

• The variable x is called a Boolean variable if it assumes


values only from B, that is, if its only possible values are 0
and 1.

• A function from Bn to B is called a Boolean function of degree


n.
EXAMPLE

The function F(x, y)=xy’ from the set of ordered pairs of Boolean
variables to the set{0,1} is a Boolean function of degree 2 with F(1,1)=0,
F(1,0)=1, F(0,1)=0, and F(0,0)=0. We display these values of F in Table 1
EXAMPLE

Find the values of the Boolean function represented by F(x, y,


z)=xy+z’
• A Boolean function of degree two is a function from a set with four elements,
namely , pairs of elements from B={0,1},to B, a set with two elements. Hence,
there are 16 different Boolean functions of degree two. In Table we display the
values of the 16 different Boolean functions of degree two, labeled F1,F2,...,F16.
Name of the Boolean
Boolean Function Meaning
Function
Null \(0 \) Always 0
Identity \(1 \) Always 1
\(A \) Pass value of A
Transfer
\(B \) Pass value of B
\(\bar{A}\) Pass negated value of A
NOT
\(\bar{B}\) Pass negated value of B
AND \(A \bullet B\) 1 only if A and B both are 1
NAND \(\overline {A \bullet B}\) 0 only if A and B both are 1
OR \( A + B \) 0 only if A and B both are 0
NOR \(\overline {A + B}\) 1 only if A and B both are 0
\(A + \bar {B}\) If B, then A
Implication
\(\bar {A} + B\) If A, then B
\(A \bullet \bar {B}\) A but not B
Inhibition
\(\bar {A} \bullet B\) B but not A
EX-OR \(A \oplus B\) A or B, but not both
EX-NOR \(\overline {A \oplus B}\) 1 if A equals B
EXAMPLE

• How many different Boolean functions of


degree n are there?

the product rule shows that there


are 22n different Boolean functions
of degree n.
Identities of Boolean
Algebra
EXAMPLE
• Show that the distributive law
x(y+z)=xy+xz is valid.
Problems
• Verify the law of the double complement
• Verify the idempotent laws.
• Verify the identity laws.
• Verify the domination laws.
• Verify the commutative laws.
• Verify the associative laws.
• Verify De Morgan’s laws.
• Verify the unit property.
• Verify the zero property.
Representing Boolean
Functions
Minimum SOP and POS Representations

• The minimum sum of products (MSOP) of a function, f, is a SOP representation of f


that contains the fewest number of product terms and fewest number of literals of any
SOP representation of f.
• Example -- f(a,b,c,d) = ∑m(3,7,11,12,13,14,15)
= ab + a′cd + acd
= ab + cd

• The minimum product of sums (MPOS) of a function, f, is a POS representation of f


that contains the fewest number of sum terms and the fewest number of literals of
any POS representation of f.
• Example -- f(a,b,c,d) = ∏M(0,1,2,4,5,6,8,9,10)

= (a + c)(a + d)(a′ + b + d)(b + c′ + d)


= (a +c)(a + d)(b + c)(b + d)
• Find the sum-of-products expansion for the function F(x, y, z) = (x + y)z.
• Solution:We will find the sum-of-products expansion of F(x, y, z) in two ways. First,
we will
• use Boolean identities to expand the product and simplify.We find that
• F(x, y, z) = (x + y)z
• = xz + yz Distributive law
• = x1z + 1yz Identity law
• = x(y + y)z + (x + x)yz Unit property
• = xyz + xy z + xyz + xyz Distributive law
• = xyz + xy z + xy z. Idempotent law
• Second, we can construct the sum-of-products expansion by determining the values of F for
• all possible values of the variables x, y, and z. These values are found in Table 2. The sum-
ofproducts
• expansion of F 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
• F(x, y, z) = xyz + xy z + xyz.
Karnaugh Maps

• Karnaugh maps (K-maps) -- convenient tool for representing Boolean


Functions of up to six variables.
• K-maps form the basis of useful heuristics for finding MSOP and MPOS
representations.
• An n-variable K-map has 2n cells with each cell corresponding to a row of an
n-variable truth table.
• K-map cells are labeled with the corresponding truth-table row.
• K-map cells are arranged such that adjacent cells correspond to truth rows
that differ in only one bit position (logical adjacency).
• Boolean Functions are mapped (or plotted) by placing the function’s value
(0,1,d) in each cell of the map.
Figure 1 Venn diagram and equivalent K-map
for two variables
Figure 2 Venn diagram and equivalent K-map
for three variables
Figure 3 (a) -- (d) K-maps for four and five variables
Figure 4 (e) -- (f) K-maps for six variables
Plotting (Mapping) Functions in Canonical Form
on a K-map

• Let f be a switching function of n variables where n ≤ 6.


• Assume that the cells of the K-map are numbered from 0 to 2n
where the numbers correspond to the rows of the truth table of
f.
• If mi is a minterm of f, then place a 1 in cell i of the K-map.
• Example -- f(A,B,C) = ∑m(0,3,5)
• If Mi is a maxterm of f, then place a 0 in cell i.
• Example -- f(A,B,C) = ∏M(1,2,4,6,7)
• If di is a don’t care of f, then place a d in cell i.
Figure 5 Plotting functions on K-maps

f(A,B,C) = ∑m(0,3,5) =
∏M(1,2,4,6,7)
Figure 6 K-maps for f(a,b,Q,G) in Example 3.4
(a) Minterm form. (b) Maxterm form.

f(a,b,Q,G) = ∑m(0,3,5,7,10,11,12,13,14,15) =
∏M(1,2,4,6,8,9)
Figure 7 K-map of Figure 7(a) with variables reordered:
f(Q,G,b,a).

f(Q,G,b,a) = ∑m(0,12,6,14,9,13,3,7,11,15) =
∑m(0,3,6,7,9,11,12,13,14,15)
Plotting Functions in Algebraic Form

• Example 1 -- f(A,B,C) = AB + BC′

• Example 2 -- f(A,B,C,D) = (A + C)(B + C)(B′ + C′ + D)

• Example 3 -- f(A,B,C,D)= (A′+B′)(A′+C+D′)(B′+C′+D′)


Example 1.
(a) Venn diagram form. (b) Sum of minterms. (c) Maxterms.

f(A,B,C) = AB +
BC′
Example 2.
(a) Maxterms, (b) Minterms, (c) Minterms of f ′.

f(A,B,C,D) = (A + C)(B + C)(B′ +


C′ + D)
Example 3.
(a) K-map of f′, (b) K-map of f.

f(A,B,C,D)= (A′+B′)(A′+C+D′)(B′
+C′+D′)
Simplification of Switching Functions
Using K-maps

• K-map cells that are physically adjacent are also logically


adjacent. Also, cells on an edge of a K-map are logically
adjacent to cells on the opposite edge of the map.
• If two logically adjacent cells both contain logical 1s, the two
cells can be combined to eliminate the variable that has value 1
in one cell’s label and value 0 in the other.
• This is equivalent to the algebraic operation, aP + a′P =P where
P is a product term not containing a or a′.
• Example -- f(A,B,C,D) = ∑m(1,2,4,6,9)
K-map for Example

f(A,B,C,D) =
∑m(1,2,4,6,9)
Simplification Guidelines for K-maps

• Each cell of an n-variable K-map has n logically adjacent cells.


• Cells may be combined in groups of 2,4,8,…,2k.
• A group of cells can be combined only if all cells in the group have the same
value for some set of variables.
• Always combine as many cells in a group as possible. This will result in the
fewest number of literals in the term that represents the group.
• Make as few groupings as possible to cover all minterms. This will result in
the fewest product terms.
• Always begin with the “loneliest” cells.
Prime Implicants and Covers

• An implicant is a product term that can cover minterms of a function.


• A prime implicant is a product term that is not covered by another implicant
of the function.
• An essential prime implicant is a prime implicant that covers at least one
minterm that is not covered by any other prime implicant.
• A set of implicants is said to be a cover of a function if each minterm of the
function is covered by at least one implicant in the set.
• A minimal cover is a cover that contains the smallest number of prime
implicants and the smallest number of literals..
K-map illustrating implicants

Minterms: {A′B′ C, A′ BC′, A′ BC, ABC


′, ABC}
Groups of two minterms: {A′ B, AB, A′ C,
BC′, BC}
Groups of four
minterms: {B}
Prime implicants: {A′ C, B}
Cover = {A′ C,
B}
MSOP = A′ C
+B
Algorithm -- Generating and Selecting
Prime Implicants

1. Count the number of adjacencies for each minterm on the K-map.

2. Select an uncovered minterm with the fewest number of adjacencies. Make


an arbitrary choice if more than one choice is possible.

3. Generate a prime implicant for this minterm and put it in the cover. If this
minterm is covered by more than one prime implicant, select the one that
covers the most uncovered minterms.

4. Repeat steps 2 and 3 until all minterms have been covered.


Example
(Illustrating Algorithm)

f(A,B,C,D) =
∑m(2,3,4,5,7,8,10,13,15)
Algorithm -- Generating and Selecting
Prime Implicants (Revisited)

1. Circle all prime implicants on the K-map.

2. Identify and select all essential prime implicants for the cover.

3. Select a minimum subset of the remaining prime implicants to


complete the cover, that is, to cover those minterms not covered
by the essential prime implicants.
Figure -- Example
(Illustrates Algorithm)

f(A,B,C,D) =
∑m(2,3,4,5,7,8,10,13,15)
Example
f(A,B,C,D) = ∑m(0,5,7,8,10,12,14,15)
Example
f(A,B,C,D) = ∑m(1,2,3,6) = A′C + BC′
Example
f(A,B,C,D) = B′D′ + B′C′ + BCD
Example
Function with no essential prime implicants.

f(A,B,C,D) =
∑m(0,4,5,7,8,10,14,15)
Example
Minimizing a five-variable function.

f(A,B,C,D,E) = ∑m(0,2,4,7,10,12,13,18,23,26,28,29)
Prime Implicates and Covers

• A implicate is a sum term that can cover maxterms of a function.


• A prime implicate is a sum term that is not covered by another implicate of
the function.
• An essential prime implicate is a prime implicate that covers at least one
maxterm that is not covered by any other prime implicate.
• A set of implicate is said to be a cover of a function if each maxterm of the
function is covered by at least one implicate in the set.
• A minimal cover is a cover that contains the smallest number of prime
implicate and the smallest number of literals..
Algorithm -- Generating and Selecting
Prime Implicates

1. Count the number of adjacencies for each maxterm on the K-map.

2. Select an uncovered maxterm with the fewest number of adjacencies. Make


an arbitrary choice if more than one choice is possible.

3. Generate a prime implicate for this maxterm and put it in the cover. If this
maxterm is covered by more than one prime implicate, select the one that
covers the most uncovered maxterms.

4. Repeat steps 2 and 3 until all maxterms have been covered.


Algorithm -- Generating and Selecting
Prime Implicates (Revisited)

1. Circle all prime implicates on the K-map.

2. Identify and select all essential prime implicates for the cover.

3. Select a minimum subset of the remaining prime implicates to


complete the cover, that is, to cover those maxterms not covered
by the essential prime implicates.
Example -- Find the minimum POS form of the function
f(A,B,C,D) = ∏M(0,1,2,3,6,9,14)
Algorithm -- Finding MPOS of f from f′

1. Plot the complement function f′ on the K-map.

2. Use algorithms to produce a MSOP of f′.

3. Complement f′ and use DeMorgan’s theorem to produce a


MSOP of f.
Example -- Find the MPOS of the following function using
Algorithm
f(A,B,C,D) = ∏M(0,1,2,3,6,9,14)

f′ = A′ B′ + B′ C′ D +
BCD′
f = (A + B)(B + C + D′ )(B′ +
C′ + D)
Example -- Minimum covers of
f(A,B,C,D) = ∏ M (3,4,6,8,9,11,12,14) and its complement.

Figure
3.21
Finding a minimal POS expression
for a 5-variable function.
Deriving POS and SOP forms of a function.
Minimizing a Function with Don’t Cares.
f(A,B,C,D) = ∑m(1,3,4,7,11) + d(5,12,13,14,15)
= ∏M(0,2,6,8,9,10) ∙ D(5,12,13,14,15)

SO PO
P S

You might also like