DSTL Unit 3
DSTL Unit 3
DSTL Unit 3
Logic
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
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
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
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
1. a ∨ 1 = 1
2. a ∧1= a
{1} {2}
3. a ∨0=a
4. a ∧0=0
phi
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.
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)
•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)'.
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.
• 10+ (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
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
• 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)
• 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
1 m4 m5 m7 m6
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
10 m8 m9 m11 m10
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
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
- 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
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.
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: