You are on page 1of 126

Discrete Structures & Theory of

Logic

Subject Code- KCS - 303

Unit-3.1
Lattices
Let L be a non-empty set closed under two binary
operations called meet and join, denoted by ∧ and ∨.
Then L is called a lattice if the following axioms hold
where a, b, c are elements in L:
1) Commutative Law: -
(a) a ∧ b = b ∧ a, (b) a ∨ b = b ∨ a
2) Associative Law:-
(a) (a ∧ b)∧ c = a ∧(b∧ c), (b) (a ∨ b) ∨ c = a ∨ (b ∨ c)
3) Absorption Law: -
(a) a ∧ ( a ∨ b) = a, (b) a ∨ ( a ∧ b) = a
Or
• A poset, in which every pair {a,b} of two
elements of L has a Least upper bound (LUB)
and a greatest lower bound (GLB), is called a
Lattice.
• LUB denoted by a ∨ b and known as join.
• GLB denoted by a ∧ b and known as meet.
• A totally ordered set is trivially a lattice, but
not all partially ordered set are lattice.
Posets and Hasse Diagram
• POSET: The set A together with the partial order
relation R is called a partially ordered set or poset
and is generally denoted by (A, R) where A
denotes the set and R denotes the relation.
• Partially ordered relation is nothing but a relation
R which is
– Reflexive
– Antisymmetric
– Transitive
• Eg. A=({1,2,3,4,12},/)
aRb if a divides b. denoted by a/b.
R={(1,1), (2,2), (3,3), (4,4), (12,12), (1,2), (1,3), (1,4),
(1,12), (2,4), (2,12), (3,12), (4,12)}.
draw hasse diagram and show that (A,R) is a poset.

12

3
2

1
• Step1: remove all loops. 12

3
2

• Step2: remove transitivity. 1

12

3
2

1
• Step3: remove directions.
• Hasse diagram.
12

3
2

1
Lattice Example
• Let L={1, 2, 3, 5, 30} and R be the relation ‘is
divide by’. Prove that L is lattice.
• The relation matrix and hasse diagram:
1 2 3 5 30
30
1 1 1 1 1 1
2 0 1 0 0 1
2 3 5
3 0 0 1 0 1
5 0 0 0 1 1
30 0 0 0 0 1 1
• Operation tables:
(LUB): ∨
1 2 3 5 30
30
1 1 2 3 5 30
2 2 2 30 30 30 2 3 5
3 3 30 3 30 30
5 5 30 30 5 30 1
30 30 30 30 30 30
• (GLB): ∧
1 2 3 5 30
1 1 1 1 1 1
30
2 1 2 1 1 2
3 1 1 3 1 3 2 3 5
5 1 1 1 5 5
30 1 2 3 5 30 1
Since (L, R) is a poset and every pair of elements
of L has an LUB and a GLB, it is a Lattice.
Example: show that A=({1,2,4,8},/) is
lattice?
The relation / on the set A is given by pairs:
R = {{1,1}, {2,2}, {4,4}, {8,8}, {1, 2}, {1, 4}, {1, 8}, {2, 4}, {2, 8}, {4, 8}}
Sets UB LUB LB GLB LCM GCD
{1,1} 1,2,4,8 1 1 1 1 1
{2,2} 2,4,8 2 1,2 2 2 2
{4,4} 4,8 4 1,2,4 4 4 4
{8,8} 8 8 1,2,4,8 8 8 8
{1,2} 2,4,8 2 1 1 2 1
{1,4} 4,8 4 1 1 4 1
{1,8} 8 8 1 1 8 1
{2,4} 4,8 4 1,2 2 4 2
{2,8} 8 8 1,2 2 8 2
{4,8} 8 8 1,2,4 4 8 4
R = {{1,1}, {2,2}, {4,4}, {8,8}, {1, 2}, {1,
4}, {1, 8}, {2, 4}, {2, 8}, {4, 8}}
LUB GLB 8

{1,1}=1∨1=1 {1,1}=1∧1=1
{2,2} =2∨2=2 {2,2} =2∧2=2 4

{4,4} =4∨4=4 {4,4} =4∧4=4


{8,8} =8∨8=8 {8,8} =8∧8=8 2

{1,2} =1∨2=2 {1,2} =1∧2=1


{1,4} =1∨4=4 {1,4} =1∧4=1 1

{1,8} =1∨8=8 {1,8} =1∧8=1


{2,4} =2∨4=4 {2,4} =2∧4=2
{2,8} =2∨8=8 {2,8} =2∧8=2
{4,8} =4∨8=8 {4,8} =4∧8=4
e Examples f

d
c d e

b c

a
a b

f
e f

d e
d

b c
c b
a

a
e d

b c d b c

a a

d
d e

c
c

a b b

a
Example
• Determine whether the poset with this hesse
diagram is lattice or not.
h

f g

d e

b c

• Step1: prepare LUB and GLB tables for both sets.


Properties of Lattice
• Theorem(A): If L be a lattice, then for a, b in L
i. a ∨ b=b iff a<=b
ii. a ∧ b=a iff a<=b
iii. a ∧ b=a iff a ∨ b=b d

b c

a
Theorem (B):
If L be a lattice then for a, b, c in L
i. Idempotency:
a ∨ a=a d
a ∧ a=a
ii. Commutativity:
a ∨ b=b ∨ a
b c
a ∧ b=b ∧ a
iii. Associativity:
a ∨ (b ∨ c)=(a ∨ b) ∨ c
a ∨ d= b ∨ c a
d=d
a ∧ (b ∧ c)=(a ∧ b) ∧ c
a ∧ a= a ∧ c
a=a
iv. Absorption:
a ∨ (a ∧ b)=a
a ∧ (a ∨ b)=a
Theorem (C):
Distributive inequalities in Lattice
i. a ∨ (b ∧ c)<=(a ∨ b) ∧(a ∨ c)
e
a ∨ g <= e ∧ e
a <= e i.e. a precedes e.
b c f
ii. a ∧ (b ∨ c)>=(a ∧ b) ∨(a ∧ c) a

a ∧ g >= e ∨ e
a >= g i.e. a succeeds g. g

Note1: It is clear that distributive inequalities holds in this


case.
Note2: We can say that Distributive law may or may not
holds for Lattice.
Duality
• The dual of any statement in a lattice (L,∧ ,∨ )
is defined to be a statement that is obtained
by interchanging ∧ an ∨.
• For example, the dual of a ∧ (b ∨ a) = a ∨ a is
a ∨ (b ∧ a )= a ∧ a
Bounded Lattices
• A lattice L is called a bounded lattice if it has greatest
element (represented by 1) and a least element
(represented by 0).
• Example:
• 1. The power set P(S) of the set S under the operations
of intersection and union is a bounded lattice since ∅ is
the least element of P(S) and the set S is the greatest
element of P(S).
• 2. The set of +ve integer I+ under the usual order of ≤ is
not a bounded lattice since it has a least element 1 but
the greatest element does not exist.
Properties of Bounded Lattices
• If L is a bounded lattice, then for any element a ∈ L, we have the following
identities: {1, 2}

1. a ∨ 1 = 1
2. a ∧1= a
{1} {2}
3. a ∨0=a
4. a ∧0=0
phi

Theorem: Prove that every finite lattice L = {a1,a2,a3....an} is bounded.


Proof: We have given the finite lattice:
L = {a1,a2,a3....an}
Thus, the greatest element of Lattices L is a1∨ a2∨ a3∨....∨an.
Also, the least element of lattice L is a1 ∧ a2 ∧ a3 ∧....∧an.
Since, the greatest and least elements exist for every finite lattice. Hence, L is
bounded.
Sub-Lattices
Consider a non-empty subset L1 of a lattice L. Then L1 is called a sublattice
of L if L1 itself is a lattice i.e., the operation of L i.e., a ∨ b ∈ L1 and a ∧ b ∈
L 1 whenever a ∈ L1 and b ∈ L1.
Example: Consider the lattice of all +ve integers I+ under the operation of
divisibility.
The lattice Dn of all divisors of n > 1 is a sub-lattice of I+.
Determine all the sub-lattices of D30 that contain at least four elements,
D30={1,2,3,5,6,10,15,30}.
Solution: The sub-lattices of D30 that contain at least four elements are as
follows:
1. {1, 2, 6, 30} 2. {1, 2, 3, 30}
3. {1, 5, 15, 30} 4. {1, 3, 6, 30}
5. {1, 5, 10, 30} 6. {1, 3, 15, 30}
7. {2, 6, 10, 30}
Isomorphic Lattices
• Two lattices L1 and L2 are called isomorphic lattices if
there is a bijection from L1 to L2 i.e., f: L1 ⟶ L2, such
that f (a ∧ b) =f(a)∧ f(b) and f (a ∨ b) = f (a) ∨ f (b)
• Example: Determine whether the lattices shown in fig
are isomorphic.
• Solution: The lattices shown in fig are isomorphic.
Consider the mapping f = {(a, 1), (b, 2), (c, 3), (d, 4)}.
• For example f (b ∧ c) = f (a) = 1. Also, we have f (b) ∧
f(c) = 2 ∧ 3 = 1
Distributive Lattice
• A lattice L is called distributive lattice if for any
elements a, b and c of L, it satisfies following
distributive properties:
• 1. a ∧ (b ∨ c) = (a ∧ b) ∨ (a ∧ c)
• 2. a ∨ (b ∧ c) = (a ∨ b) ∧ (a ∨ c)
• If the lattice L does not satisfies the above
properties, it is called a non-distributive
lattice.
• Example:
1. The power set P (S) of the set S under the
operation of intersection and union is a
distributive function.
Since, a ∩ (b ∪ c) = (a ∩ b) ∪ (a ∩ c)
and, also a ∪ (b ∩ c) = (a ∪ b) ∩ (a ∪c) for any
sets a, b and c of P(S).
2. The lattice shown in fig II is a distributive. Since, it
satisfies the distributive properties for all ordered
triples which are taken from 1, 2, 3, and 4.
Complements and complemented
lattices
• Let L be a bounded lattice with lower bound o
and upper bound I. Let a be an element in L.
An element x in L is called a complement of a
if a ∨ x = I and a ∧ x = 0
• A lattice L is said to be complemented if L is
bounded and every element in L has a
complement.
Example: Determine the complement of a
and c in fig:

• The complement of a is d. Since, a ∨ d = 1 and a ∧


d=0
• The complement of c does not exist. Since, there
does not exist any element c such that c ∨ c'=1
and c ∧ c'= 0.
Modular Lattice
• A lattice (L, ∧,∨) is called a modular lattice if

a ∨ (b ∧ c) = (a ∨ b) ∧ c

whenever a ≤ c.
the Direct Product of Lattices
• Let (L1 ∨1 ∧1)and (L2 ∨2 ∧2) be two lattices.
Then (L, ∧,∨) is the direct product of lattices,
where L = L1 x L2 in which the binary
operation ∨(join) and ∧(meet) on L are such
that for any (a1,b1)and (a2,b2) in L.
(a1,b1)∨( a2,b2 )=(a1 ∨1 a2,b1 ∨2 b2)
and (a1,b1) ∧ ( a2,b2 )=(a1 ∧1 a2,b1 ∧2 b2).
Example: Consider a lattice (L, ≤) as shown in fig. where L = {1, 2}. Determine
the lattices (L2, ≤), where L2 =L x L.

• The lattice (L2, ≤) is shown in fig:


DSTL
Subject Code- KCS - 303

Unit-3.2
Boolean Algebra
• A complemented distributive lattice is known as a
Boolean Algebra.
• It is denoted by (B, ∧,∨,',0,1), where B is a set on
which two binary operations ∧ (*) and ∨(+) and a
unary operation (complement) are defined. Here
0 and 1 are two distinct elements of B.
• Since (B,∧,∨) is a complemented distributive
lattice, therefore each element of B has a unique
complement.
Properties of Boolean Algebra
1. Commutative Properties:
(i) a+b = b+a
(ii)a*b=b *a
2. Distributive Properties
(i) a+(b*c)=(a+b)*(a+c)
(ii) a*(b+c)=(a*b)+(a*c)
3. Identity Properties
(i) a+0=a
(ii) a *1=a
4. Complemented Laws:
(i) a+a'=1
(ii)a * a'=0
Axioms
• A Boolean Algebra B is defined as a 5-tuple {B, +, *, ’, 0,
1} + and * are binary operators,’ is a unary operator.
• The following axioms must hold for any elements a, b, c 
{0,1}
• Axiom #1: Closure
If a and b are elements of B, (a + b) and (a * b) are in B.
• Axiom #2: Cardinality
There are at least two elements a and b in B such that a != b.
• Axiom #3: Commutative
If a and b are elements of B
(a + b) = (b + a), and (a * b) = (b * a)
• Axiom #4: Associative
If a and b are elements of B (a + b) + c = a + (b + c), and (a * b) * c =
a * (b * c)

• Axiom #5: Identity Element


B has identity elements with respect to + and *
0 is the identity element for +, and 1 is the identity element for *
a + 0 = a and a * 1 = a

• Axiom #6: Distributive


* is distributive over + and + is distributive over *
a * (b + c) = (a * b) + (a * c), and a + (b * c) = (a + b) * (a + c)

• Axiom #7: Complement Element


For every a in B there is an element a' in B such that
a + a' = 1, and a * a' = 0
Sub-Algebra
• Consider a Boolean-Algebra (B, *, +,', 0,1) and let A ⊆ B. Then (A,*,
+,',0,1) is called a sub-algebra or Sub-Boolean Algebra of B if A itself
is a Boolean Algebra i.e., A contains the elements 0 and 1 and is
closed under the operations *, + and '.
• Example: Consider the Boolean algebra D70 whose Hasse diagram
is shown in fig:

•Clearly, A= {1, 7, 10, 70} and B = {1, 2, 35, 70} is a sub-algebra of D70. Since
both A and B are closed under operation ∧,∨and '
•Note: A subset of a Boolean Algebra can be a Boolean algebra, but it may
or may not be sub-algebra as it may not close the operation on B.
Isomorphic-Boolean Algebras
• Two Boolean algebras B and B1 are called isomorphic if there is a
one to one correspondence f: B⟶B1 which preserves the three
operations +,* and ' for any elements a, b in B i.e.,
f (a+b)=f(a)+f(b)
f (a*b)=f(a)*f(b) and f(a')=f(a)'.

• Example: The following are two distinct Boolean algebras with


two elements which are isomorphic.
1.The first one is a Boolean Algebra that is derived from a power set
P(S) under ⊆ (set inclusion),i.e., let S = {a}, then B = {P(S), ∪,∩,'} is a
Boolean algebra with two elements P(S) = {∅,{a}}.
2. The second one is a Boolean algebra {B, ∨,∧,'} with two elements 1
and p {here p is a prime number} under operation divides i.e., let B
= {1, p}. So, we have 1 ∧ p = 1 and 1 ∨ p = p also 1'=p and p'=1.
The table shows all the basic properties of a Boolean algebra (B, *, +, ', 0, 1) for any
elements a, b, c belongs to B. The greatest and least elements of B are denoted by 1
and 0 respectively.
1. a ≤b iff a+b=b 2. a ≤b iff a * b = a
3. Idempotent Laws 4. Commutative Property
(i)a+b=a (i)a+b=b+a
(ii) a * a = a (ii)a*b=b*a
5. Associative Property 6. Absorption Laws
(i)a+(b+c)=(a+b)+c (i)a+(a*b)=a
(ii)a*(b*c)=(a*b)*c (ii)a*(a+b)=a
7. Identity Laws 8. Null Laws
(i) a+0=a (i)a*0=0
(ii) a*1=a (ii)a+1=1
9. Distributive Laws 10. Complement Laws
(i)a*(b+c)=(a*b)+(a*c) (i)0'=1
(ii) a+(b*c) = (a+b)*(a+c) (ii)1'=0
(iii)a+a'=1
(iv)a*a'=0
11. Involution Law 12.De Morgan's Laws
(a')'=a (i)(a *b)'=(a' +b')
(ii) (a+b)'=(a' *b')
Note:
1. 0 ≤ a ≤ 1 for every a ∈ B.
2. Every element b has a unique complement b'
Examples
18
1. [{2,3,4,9,12,18}, /]:poset
+∞ 12

2. [R,<=]:DL 4 9
81

2 3
0
3. [D81,/]:DL 27

-∞
3

1
4. [D18,/]:DL

5. [D110,/]:BA 18
110

6 9 10 22 55

2 5 11
2 3

1
1
5. [D45,/]:?

6. [D64,/]:?

7. [D30,/]:?

8. [D10,/]:?
Boolean function
• Boolean Expression:
Let B ={x1,x2,x3,....,xn} and three operations +,.,’
(x1+x2’.x3)’+x2.x1
or (x1 ∨ (x2’ ∧ x3))’ ∨ (x2 ∧ x1)
• Boolean Algebra:
is a branch of algebra in which value of variables are truth
values T/F usually denoted by 1 or 0.
X1 X1 ‘ X1 X2 X1∨ X2 X1 X2 X1∧ X2
0 1
1 0 0 0 0 0 0 0
0 1 1 0 1 0
1 0 1 1 0 0
1 1 1 1 1 1
Boolean Functions
• A function f: Bn -> B is called a Boolean
function if it can be specified by a Boolean
Expression of ‘n’ variables.
• f: B2 -> B
f(x1,x2) = x1∨ x2
Boolean Functions
• The complement, Boolean sum, and Boolean product
correspond the Logical operators  , , and  respectively,
where 0 corresponds to F , and 1 corresponds to T.
• 10+ (0+1)=0
• Its logical equivalent is
• (T  F)  (F  T)  F
• Example:
i. f(x,y)=x+yfor all x,y B
ii. f(x,y)=x.y
iii. f(x,y)=x+y’+x.y
• Show that Boolean functions
f1 = (x1∨ x2) ∨ x3
f2 = x1∨ (x2 ∨ x3) are equivalent.
23 = 8
x1 X2 x3 x1 ∨ x2 x2 ∨ x3 f1 f2
0 0 0
0 0 1
0 1 0
0 1 1
1 0 0
1 0 1
1 1 0
1 1 1
x1 x2 x3 x1 ∨ x2 x 2 ∨ x3 f1 f2

0 0 0 0

0 0 1 0

0 1 0 1

0 1 1 1

1 0 0 1

1 0 1 1

1 1 0 1

1 1 1 1
x1 x2 x3 x1 ∨ x2 x2 ∨ x3 f1 f2

0 0 0 0 0

0 0 1 0 1

0 1 0 1 1

0 1 1 1 1

1 0 0 1 0

1 0 1 1 1

1 1 0 1 1

1 1 1 1 1
x1 x2 x3 x1 ∨ x2 x2 ∨ x3 f1 f2

0 0 0 0 0 0

0 0 1 0 1 1

0 1 0 1 1 1

0 1 1 1 1 1

1 0 0 1 0 1

1 0 1 1 1 1

1 1 0 1 1 1

1 1 1 1 1 1
x1 x2 x3 x1 ∨ x2 x2 ∨ x3 f1 f2

0 0 0 0 0 0 0

0 0 1 0 1 1 1

0 1 0 1 1 1 1

0 1 1 1 1 1 1

1 0 0 1 0 1 1

1 0 1 1 1 1 1

1 1 0 1 1 1 1

1 1 1 1 1 1 1
Types of Boolean functions
• SOP form (Sum of Product ):
(x1’. x2.x3)+ (x1’. x2’.x3)+(x1. x2.x3)
OR
(x1’∧ x2∧x3) ∨ (x1’∧ x2’∧x3) ∨(x1∧x2∧x3)
• Disjunctive Normal form (DNF):
A Boolean expression is said to be DNF if it is
join of minterms.
• POS form (Product of Sum ):
(x1’+ x2+x3).(x1’+ x2’+x3).(x1+ x2+x3)
OR
(x1’∨x2∨x3)∧(x1’∨x2’∨x3)∧(x1∨x2∨x3)
• Conjunctive Normal form (CNF):
A Boolean expression is said to be CNF if it is
meet of maxterms.
Let, f= (x‘∧ z) ∨ y
Write f in DNF or minterm normal form and
CNF or maxterm normal form.
x y z x’ x‘∧ z f

0 0 0 1

0 0 1 1

0 1 0 1

0 1 1 1

1 0 0 0

1 0 1 0

1 1 0 0

1 1 1 0
x y z x’ x‘∧ z f

0 0 0 1 0 0=m0

0 0 1 1 1 1=m1

0 1 0 1 0 1=m2

0 1 1 1 1 1=m3

1 0 0 0 0 0=m4

1 0 1 0 0 0=m5

1 1 0 0 0 1=m6

1 1 1 0 0 1=m7

• By considering only 1 values of f:


• m1 = x’∧y’∧z , m2 = x’∧y∧z’ , m3 = x’∧y∧z ,
• m6 = x∧ y∧z’ , m7 = x∧ y∧z
• DNF= (x’∧y∧z) ∨ (x’∧y∧z’) ∨(x’∧y∧z) ∨(x∧ y∧z’) ∨ (x∧ y∧z)
x y z x’ x‘∧ z f

0 0 0 1 0 0=m0

0 0 1 1 1 1=m1

0 1 0 1 0 1=m2

0 1 1 1 1 1=m3

1 0 0 0 0 0=m4

1 0 1 0 0 0=m5

1 1 0 0 0 1=m6

1 1 1 0 0 1=m7

• By considering only 0 values of f:


• M0 = x ∨ y ∨ z , M4 = x’ ∨ y ∨ z , M5 = x’ ∨ y ∨ z’ ,
• CNF= (x ∨ y ∨ z ) ∧ (x’ ∨ y ∨ z ) ∧ (x’ ∨ y ∨ z’ )
• For f= (x‘∧ z) ∨ y

• DNF= (x’∧y∧z) ∨ (x’∧y∧z’) ∨(x’∧y∧z) ∨(x∧ y∧z’) ∨ (x∧


y∧z)

• CNF= (x ∨ y ∨ z ) ∧ (x’ ∨ y ∨ z ) ∧ (x’ ∨ y ∨ z’ )


Direct Method
• Let f= x ∨ y’, write f in DNF in two variables x,y.
• f=x + y’
• f= x ∨ y’
• f=(x ∧ 1) ∨ (1 ∧ y’)
• f=(x ∧(y ∨ y’)) ∨ ((x ∨ x’) ∧ y’)
• f=(x ∧ y) ∨(x ∧ y’) ∨ (x ∧ y’) ∨ (x’ ∧ y’)
• f=(x ∧ y) ∨(x ∧ y’) ∨ (x’ ∧ y’)
• Because,
• a+a’=1 or a ∨ a’=1 1
• a.a’=0 or a ∧ a’=0
• a+0=a or a ∨ 0=a a a’
• a.1=a or a ∧ 1=a
• .1 or ∧1
• +0 or ∨0 0
• Let f= x ∧ y’, write f in CNF in two variables x,y.
• f=x . y’
• f= x ∧ y’
• f=(x ∨ 0) ∧ (0 ∨ y’)
• f=(x ∨(y ∧ y’)) ∧ ((x ∧ x’) ∨ y’)
• f=(x ∨ y) ∧(x ∨ y’) ∧ (x ∨ y’) ∧ (x’ ∨ y’)
• f=(x ∨ y) ∧ (x ∨ y’) ∧ (x’ ∨ y’)
• Because,
• a+a’=1 or a ∨ a’=1 1
• a.a’=0 or a ∧ a’=0
• a+0=a or a ∨ 0=a a a’
• a.1=a or a ∧ 1=a
• .1 or ∧1
• +0 or ∨0 0
Canonical SOP form
• The minterm expansion of
f(P, Q,R)=PQ+QR’+PR’ is .....?

• f(P, Q,R)=PQ+QR’+PR’
• f(P, Q,R)=PQ(R’+R)+(P’+P)QR’+P(Q’+Q)R’
• f(P, Q,R)=PQR’+PQR+P’QR’+PQR’+PQ’R’+PQR’
• =110 111 010 110 100 110
• = 6 7 2 6 4 6
• f(P, Q,R)=Σm (2,4,6,7)
• The minterm expansion of
f(P, Q,R)=PQ+QR’+PR’ is .....? (shortcut
method)

• f(P, Q,R)= PQ + QR’ + PR’


• =110 010 100
• 111 110 110
• = 6,7 2,6 4,6
• f(P, Q,R)=Σm (2,4,6,7)
Canonical POS form
• f(a,b,c)= (a’+c)(b+c)
• f(a,b,c)= (a’+ b’b + c)(a’a + b + c)
• f(a,b,c)= (a’+ b’ + c)(a’+ b +c)(a’ +b +c)(a +b+ c)
• = 1 1 0 1 00 1 0 0 0 0 0
• = 6 4 4 0
• f(a,b,c)=πM (0,4,6)
Given the function F(p,q,r)=P’+QR,
consider the following statements.
• S1:F= Σ(4,5,6)
• S2:F= Σ(0,1,2,3,7)
• S3:F= π(4,5,6)
• S4:F= π(0,1,2,3,7), which of the following is true?
• F=P’+QR
• F=P’(Q’+Q)(R’+R)+(P’+P)QR
• F=P’Q’R’+P’Q’R+P’QR’+P’QR+P’QR+PQR
=0 0 0 0 0 1 010 011 011 111
= 0 1 2 3 3 7
F= Σ(0,1,2,3,7) AND F= π(4,5,6)
Hence, statements S2 and S3 both are trues.
The Principle of Duality?
• The dual of any expression E is obtained by interchanging the
operation + and * and also interchanging the corresponding identity
elements 0 and 1, in original expression E.
• Example: Write the dual of following Boolean expressions:
1. (x1*x2) + (x1*x3')
2. (1+x2)*( x1+1)
3. (a ∧(b∧c))
• Solution:
1. ( x1+x2)*( x1+x3')
2. (0*x2)+( x1*0)
3. (a ∨(b∧c))
• Note: The dual of any theorem in a Boolean algebra is also a
theorem.
Simplification of Boolean Expression
• After driving a boolean expression from the
truth table next important step is to minimise
it, so that the cost of implementation into
hardware can be reduced. There are following
methods for simplifying a Boolean expression,
• 1. Using Karnaugh-map
• 2. Using Algebric method (Boolean laws)
• 3. Quine Mccluskey or tabulation method.
Definitions
• Literal: A variable or its complement
• Product term: literals connected by •
• Sum term: literals connected by +
• Minterm: a product term in which all the variables
appear exactly once, either complemented or
uncomplemented
• Maxterm: a sum term in which all the variables
appear exactly once, either complemented or
uncomplemented
Minterm
• Represents exactly one combination in the truth table.
• Denoted by mj, where j is the decimal equivalent of
the minterm’s corresponding binary combination (bj).
• A variable in mj is complemented if its value in bj is 0,
otherwise is uncomplemented.
• Example: Assume 3 variables (A,B,C), and j=3. Then, bj
= 011 and its corresponding minterm is denoted by mj
= A’BC
Maxterm
• Represents exactly one combination in the truth table.
• Denoted by Mj, where j is the decimal equivalent of
the maxterm’s corresponding binary combination (bj).
• A variable in Mj is complemented if its value in bj is 1,
otherwise is uncomplemented.
• Example: Assume 3 variables (A,B,C), and j=3. Then, bj
= 011 and its corresponding maxterm is denoted by
Mj = A+B’+C’
Truth Table notation for Minterms and
Maxterms
• Minterms and x y z Minterm Maxterm
Maxterms are easy 0 0 0 x’y’z’ = m0 x+y+z = M0
to denote using a 0 0 1 x’y’z = m1 x+y+z’ = M1
truth table. 0 1 0 x’yz’ = m2 x+y’+z = M2
• Example: 0 1 1 x’yz = m3 x+y’+z’= M3
Assume 3 variables1 0 0 xy’z’ = m4 x’+y+z = M4
x,y,z 1 0 1 xy’z = m5 x’+y+z’ = M5
(order is fixed) 1 1 0 xyz’ = m6 x’+y’+z = M6
1 1 1 xyz = m7 x’+y’+z’ = M7
Canonical Forms (Unique)
• Any Boolean function F( ) can be expressed as a
unique sum of minterms and a unique product
of maxterms (under a fixed variable ordering).
• In other words, every function F() has two
canonical forms:
– Canonical Sum-Of-Products (sum of minterms)
– Canonical Product-Of-Sums (product of
maxterms)
Canonical Forms (cont.)
• Canonical Sum-Of-Products:
The minterms included are those mj such that
F( ) = 1 in row j of the truth table for F( ).
• Canonical Product-Of-Sums:
The maxterms included are those Mj such that
F( ) = 0 in row j of the truth table for F( ).
Example
• Truth table for f1(a,b,c) at right
a b c f1
• The canonical sum-of-products form for f1
is 0 0 0 0
f1(a,b,c) = m1 + m2 + m4 + m6 0 0 1 1
= a’b’c + a’bc’ + ab’c’ + abc’
• The canonical product-of-sums form for f1
0 1 0 1
is 0 1 1 0
f1(a,b,c) = M0 • M3 • M5 • M7 1 0 0 1
= (a+b+c)•(a+b’+c’)•
(a’+b+c’)•(a’+b’+c’). 1 0 1 0
• Observe that: mj = Mj’ 1 1 0 1
1 1 1 0
Shorthand: ∑ and ∏
• f1(a,b,c) = ∑ m(1,2,4,6), where ∑ indicates that this is
a sum-of-products form, and m(1,2,4,6) indicates
that the minterms to be included are m1, m2, m4, and
m6.
• f1(a,b,c) = ∏ M(0,3,5,7), where ∏ indicates that this
is a product-of-sums form, and M(0,3,5,7) indicates
that the maxterms to be included are M0, M3, M5,
and M7.
• Since mj = Mj’ for any j,
∑ m(1,2,4,6) = ∏ M(0,3,5,7) = f1(a,b,c)
Conversion Between Canonical Forms

• Replace ∑ with ∏ (or vice versa) and replace those j’s that
appeared in the original form with those that do not.
• Example:
f1(a,b,c) = a’b’c + a’bc’ + ab’c’ + abc’
= m1 + m2 + m4 + m6
= ∑(1,2,4,6)
= ∏(0,3,5,7)
= (a+b+c)•(a+b’+c’)•(a’+b+c’)•(a’+b’+c’)
DSTL
Subject Code- KCS - 303

Unit-3.3
Karnaugh-Map
• Problem with other methods:
The algebraic procedure using boolean laws
and rules for minimising boolean expression
becomes difficult when a function becomes
complex,
because we have to identify where is the
scope of minimization based on some boolean
laws and it is difficult to understand where we
reach saturation point or not.
• Solution:
K-map is one of the most extensively used
tool, it is a graphical representation,
represent truth table by pictorial form,
provides a systematic method for simplifying
or minimizing a boolean expression.
For n-variable k-map, there will be 2n cells
addressed by a gray code.
Each cell corresponds to one minterm or
maxterm.
Karnaugh-map
ab a’b’ a’b ab ab’

cd 00 01 11 10

c’d’ 00 0 4 12 8

c’d 01 1 5 1101- 9
13
cd 11 3 7 15 11

cd’ 10 2 6 14 10
• Group forming rules: ab a’b’ a’b ab ab’

Horizontal cd 00 01 11 10
Vertical c’d’ 00 1
Cyclic
c’d 01 D D 1 D
• Form groups in the
form of: cd 11 1 1
20 = 1 cd’ 10 1 1
21 = 2
22 = 4
23 = 8
24 = 16
• ab+bc
• Group forming rules: ab a’b’ a’b ab ab’
Horizontal cd 00 01 11 10
Vertical
c’d’ 00 D D
Cyclic
• Form groups in the c’d 01 1 1 D
form of:
20 = 1 cd 11 D 1 1

21 = 2 cd’ 10 1 D
22 = 4
23 = 8
24 = 16
• a’c’d’+ acd + a’b
• Or
• a’c’d’+ acd + bc
Karnaugh Maps
• Karnaugh maps (K-maps) are graphical
representations of boolean functions.
• One map cell corresponds to a row in the
truth table.
• Also, one map cell corresponds to a minterm
or a maxterm in the boolean expression
• Multiple-cell areas of the map correspond to
standard terms.
Two-Variable Map
x2 x1
x1 0 1 x2 0 1
0 1 0 2
0 m0 m1
OR 0 m0 m2
2 3 1 3
1 m2 m3 1 m1 m3

NOTE: ordering of variables is IMPORTANT for


f(x1,x2), x1 is the row, x2 is the column.
Cell 0 represents x1’x2’; Cell 1 represents x1’x2; etc.
If a minterm is present in the function, then a 1 is
placed in the corresponding cell.
Two-Variable Map (cont.)
• Any two adjacent cells in the map differ by
ONLY one variable, which appears
complemented in one cell and
uncomplemented in the other.
• Example:
m0 (=x1’x2’) is adjacent to m1 (=x1’x2) and m2
(=x1x2’) but NOT m3 (=x1x2)
2-Variable Map -- Example
• f(x1,x2) = x1’x2’+ x1’x2 + x1x2’
= m0 + m1 + m2
= x1’ + x2’
• 1s placed in K-map for specified x2
minterms m0, m1, m2 x1 0 1
• Grouping (ORing) of 1s allows
0 1
simplification
• What (simpler) function is 0 1 1
represented by each dashed
rectangle? 2 3
– x1’ = m0 + m1
– x2’ = m0 + m2 1 1 0
• Note m0 covered twice
Minimization as SOP using K-map
• Enter 1s in the K-map for each product term in
the function
• Group adjacent K-map cells containing 1s to
obtain a product with fewer variables. Group
size must be in power of 2 (2, 4, 8, …)
• Handle “boundary wrap” for K-maps of 3 or
more variables.
• Realize that answer may not be unique
Three-Variable Map
yz
x 00 01 11 10
0 1 3 2
0 m0 m1 m3 m2
4 5 7 6

1 m4 m5 m7 m6

-Note: variable ordering is (x,y,z); yz specifies column, x


specifies row.
-Each cell is adjacent to three other cells (left or right or top
or bottom or edge wrap)
Three-Variable Map (cont.)
minterm

The types of structures that are


either minterms or are
generated by repeated
application of the minimization
theorem on a three variable map
are shown at right.
Groups of 1, 2, 4, 8 are possible.

group of 2 terms

group of 4 terms
Simplification
• Enter minterms of the Boolean function into
the map, then group terms
• Example: f(a,b,c) = a’c + abc + bc’
• Result: f(a,b,c) = a’c+ b
a bc
1 1 1
1 1
1 1 1
1 1
More Examples
yz
X 00 01 11 10

• f1(x, y, z) = ∑ m(2,3,5,7) 0 1 1
1 1 1
◼ f1(x, y, z) = x’y + xz

• f2(x, y, z) = ∑ m (0,1,2,3,6)
1 1 1 1
◼f2(x, y, z) = x’+yz’
1
Four-Variable Maps
YZ

WX 00 01 11 10

00 m0 m1 m3 m2

01 m4 m5 m7 m6

11 m12 m13 m15 m14

10 m8 m9 m11 m10

• Top cells are adjacent to bottom cells. Left-edge cells


are adjacent to right-edge cells.
• Note variable ordering (WXYZ).
Four-variable Map Simplification
• One square represents a minterm of 4 literals.
• A rectangle of 2 adjacent squares represents a
product term of 3 literals.
• A rectangle of 4 squares represents a product term
of 2 literals.
• A rectangle of 8 squares represents a product term
of 1 literal.
• A rectangle of 16 squares produces a function that is
equal to logic 1.
Example
• Simplify the following Boolean function (A,B,C,D) =
∑m(0,1,2,4,5,7,8,9,10,12,13).
• First put the function g( ) into the map, and then
group as many 1s as possible.
cd
ab
1 1 1 1 1 1

1 1 1 1 1 1

1 1 1 1

1 1 1 1 1 1

g(A,B,C,D) = c’+b’d’+a’bd
Don't Care Conditions
• There may be a combination of input values which
– will never occur
– if they do occur, the output is of no concern.
• The function value for such combinations is called a
don't care.
• They are denoted with x or – or d. Each x may be
arbitrarily assigned the value 0 or 1 in an
implementation.
• Don’t cares can be used to further simplify a function
cd
ab 00 01 11 10
Example 00 0 1 0 1
01 1 1 0 1
• Simplify the function f(a,b,c,d) 11 0 0 x x
10 1 1 x x
whose K-map is shown at the
right. 0 1 0 1
• f = a’c’d+ab’+cd’+a’bc’ 1 1 0 1
0 0 x x
or 1 1 x x
• f = a’c’d+ab’+cd’+a’bd’
0 1 0 1
1 1 0 1
0 0 x x
1 1 x x
cd
Another Example ab
x 1 0 0
1 x 0 x
• Simplify the function 1 x x 1
g(a,b,c,d) whose K-map is 0 x x 0

shown at right. x 1 0 0
• g = a’c’+ ab 1 x 0 x
1 x x 1
or
0 x x 0
• g = a’c’+b’d
x 1 0 0
1 x 0 x
1 x x 1
0 x x 0
Example
• Consider the minterm list form of Boolean
function f given below:
F(p,q,r,s)= ∑ m(0,2,5,7,9,11)+d(3,8,10,12,14).
Minimize this given function using K-map?
pq p’q’ p’q pq pq’
rs 00 01 11 10

r’s’ 00 1 d d

r’s 01 1 1

rs 11 d 1 1

rs’ 10 1 d d
Example
F = p’qs+pq’+q’s’
pq
p’q’ p’q pq pq’
rs 00 01 11 10

r’s’ 00 1 d d

r’s 01 1 1

rs 11 d 1 1

rs’ 10 1 d d
pq
p’q’ p’q pq pq’
rs 00 01 11 10

r’s’ 00 1 d d 1

r’s 01 d

rs 11

rs’ 10 1 d
F = q’s’
pq
p’q’ p’q pq pq’
rs 00 01 11 10

r’s’ 00 1 d d 1

r’s 01 d

rs 11

rs’ 10 1 d
pq
p’q’ p’q pq pq’
rs 00 01 11 10

r’s’ 00 d 1

r’s 01 1 d 1

rs 11 1 d d

rs’ 10 1 d d
F = qs+qr+p
pq
p’q’ p’q pq pq’
rs 00 01 11 10

r’s’ 00 d 1

r’s 01 1 d 1

rs 11 1 d d

rs’ 10 1 d d
pq
p’q’ p’q pq pq’
rs 00 01 11 10

r’s’ 00 1 1

d 1
r’s 01

rs 11 d 1

rs’ 10 1 1 d
F = qs’+q’s
pq
p’q’ p’q pq pq’
rs 00 01 11 10

r’s’ 00 1 1

d 1
r’s 01

rs 11 d 1

rs’ 10 1 1 d
pq p’q’ p’q pq pq’
rs 00 01 11 10

r’s’ 00 d 1 1

r’s 01 1 d

rs 11 1 d d

rs’ 10 d d

pq p’q’ p’q pq pq’


rs 00 01 11 10

r’s’ 00 1 1 1

r’s 01 d

rs 11 d

rs’ 10 1 1 d
pq p’q’ p’q pq pq’
rs 00 01 11 10

r’s’ 00 1 d d 1

r’s 01 d 1

rs 11

rs’ 10 1 d
BASIC LOGIC BLOCK - GATE

Binary Binary

Digital Digital
Gate
Input Output
.
Signal Signal
BASIC LOGIC BLOCK - GATE
Types of Basic Logic Blocks

- Combinational Logic Block


Logic Blocks whose output logic value
depends only on the input logic values

- Sequential Logic Block


Logic Blocks whose output logic value
depends on the input values and the
state (stored information) of the blocks

Functions of Gates can be described by

- Truth Table
- Boolean Function
- Karnaugh Map
Logic Gates and Circuits
• Schematic or Graphical Representation of
Boolean Expressions:
• The Boolean expressions can be graphically
represented by using logic circuits.
• These logic circuits can be constructed using
solid-state devices called gates, which are capable
of switching voltage levels.
• In digital electronics, logic gate is physical device
implementing a Boolean function, it performs
logical operation, takes one or more inputs and
produce single binary output signals.
• Logic gates are implemented generally using
diodes, transistors, semiconductor devices etc.
• Basic building blocks from which many kinds
of logic circuits can be constructed.
• If x and y are variables, then the basic
expressions
x ∧ y (AND),
x ∨ y (OR)
and x' (NOT) are shown graphically as follows:
AND Gate
• An AND gate receives inputs x and y and
produces output denoted x ∧ y, as shown in
logic table
OR Gate
• An OR gate receives inputs x and y and
produces output denoted x V y as shown in
the logic table
NOT Gate
• A NOT Gate receives input x and produces output
y denoted x' as shown in the logic table

• We can interconnect these devices to form an


electronic circuit that realizes any given Boolean
Expression.
NOR gate
• Simply a OR gate followed by a NOT gate. So,
the output will be high if and only if all inputs
are low.
x y (x+y)’
x x+y
0 0 1
0 1 0 y
1 0 0
1 1 0
NAND gate
• Simply a AND gate followed by a NOT gate. So,
the output will be low if and only if all the
inputs are high.
x y (x.y)’
x xy
0 0 1
0 1 1 y
1 0 1
1 1 0
Ex-OR gate
• For a binary input Ex-OR gate output will be high
if inputs are different.
• For a general Ex-OR gate output will be high, if
number of input high are odd.
• xy = x’y+xy’
x y xy x xy
0 0 0 y
0 1 1
1 0 1
1 1 0
COMBINATIONAL GATES
LOGIC CIRCUIT DESIGN
Truth x y z F
Table 0 0 0 0
0 0 1 1
0 1 0 0
0 1 1 0
1 0 0 1
1 0 1 1
1 1 0 1
Boolean F = x + y’z 1 1 1 1
Function

Logic
Diagram
EQUIVALENT CIRCUITS
• Many different logic diagrams are possible for
a given Function
• F = ABC + ABC’ + A’C .......…… (1)
• = AB(C + C’) + A’C …...…….. (2)
• = AB • 1 + A’C
• = AB + A’C .....…….. (3)
Applications of Boolean Algebra in
Switching Theory
• The simplest switching device is ON-OFF switch.

• A switch is a device is an electric circuit which lets or


does not let the current to flow through the circuit.

• The switch has two states ON or OFF (closed or open)


If the switch is closed, current will pass through it.
If the switch is open, current will not pass through it.
ON is denoted by 1
• OFF is indicated by 0.

• The electrical circuits containing switches by


Boolean expressions,

• if ON is denoted by true or 1 and OFF is


denoted by False or 0.
Series and Parallel Connection
• There are 2 ways in which switches are
connected with each other.

1. Series Connection

2. Parallel Connection
1. Series Connection
• Two switches x1 and x2 are said to be
connected in series if current can pass only
when both the switches are ON (closed),and
the current does not flow if both the switches
or any one are OFF (open).
• Symbolically, series connection of two
switches x1 and x2 is denoted by
x1 ∧ x2 or x1 * x2.
• It is represented diagrammatically as follows:
2. Parallel Connection
• Two switches x1 and x2 are said to be
connected in parallel if current flows when
both any one of the switches are ON (closed)
and the current does not flow when both are
OFF (open).
• Symbolically, Parallel connection of two
switches x1 and x2 is denoted by
x1 ∨ x2 or x1 + x2.
• It is represented diagrammatically as follows:

You might also like