0% found this document useful (0 votes)
46 views72 pages

K Map

1. 32 minterms 2. d) F' (A,B,C) = m(1,2,3) 3. F(x,y,z) = (y+x')(y+z')(x'+z) = ∏(1,2,4)

Uploaded by

masum35-1180
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)
46 views72 pages

K Map

1. 32 minterms 2. d) F' (A,B,C) = m(1,2,3) 3. F(x,y,z) = (y+x')(y+z')(x'+z) = ∏(1,2,4)

Uploaded by

masum35-1180
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/ 72

CSE 215

Boolean Functions (Solve ?)


x y z F1 F2 F3 F4
▪ Examples: 0 0 0 0 0 0 0
0 0 1 0 1 1 1
SOP, F1= xyz' 0 1 0 0 0 0 0
minte
-rm F2= x + y'z 0 1 1 0 0 1 1
1 0 0 0 1 1 1
F4=xy'+x'z 1 0 1 0 1 1 1
F3=(x'y'z)+(x'yz)+(xy') 1 1 0 1 1 0 0
1 1 1 0 1 0 0

From the truth table, F3=F4.


Can you also prove by algebraic manipulation
that F3=F4?
Try it yourself: simplify the
following equations
1. f(a,b,c,d) = abc + abd + a'bc' + cd
+ bd'
Drawing Logic Circuit
(ii) F2 = x + y'z (can assume that variables
and their complements are available)
x
F2
y'
z y'z

(iii) F3 = xy' + x'z x xy'


y'
F3
x'
z x'z
Analysing Logic Circuit
▪ When a logic circuit is provided, we can
analyse the circuit to obtain the logic
expression.
▪ Example: What is the Boolean expression
of F4?
A' A'B'
A'B'+C (A'B'+C)'
B'
F4
C

F4 = (A'B'+C)'
Review
◼ If expression F2= x + y'z is given, below is its truth
table (obtained by “AND”ing y’ with z and then
“OR”ing the product with x.) X Y Z F2
◼ So from truth tabe, considering the 1’s
0 0 0 0
we can say,
0 0 1 1
F2=x’y’z+xy’z’ + xy’z + xyz’ + xyz
0 1 0 0
which when simplified using postulates,
0 1 1 0
will result to,
1 0 0 1
F2=x+y’z
1 0 1 1
1 1 0 1
so x+y’z = x’y’z+xy’z’ + xy’z + xyz’ + xyz
1 1 1 1
Simplified
expression SOP Canonical Format of the
expression
Review: Solve it yourself

Q1. Draw a logic circuit for BD + BE + D’F

Q2. Draw a logic circuit for


A’BC + B’CD + BC’D + ABD’
Review: Solve it yourself

▪ What is Boolean expression of F5?

y F5

z
Review: Solve it yourself

▪ What is Boolean expression of F2?

F2=zy’+x
Review: Solve it yourself

▪ What is Boolean expression of F3?

F2=x’y’z+x’yz+xy’
Standard Forms
▪ Two Standard Forms:
Sum-of-Products and Product-of-Sums
▪ Literals: a variable on its own or in its
complemented form. Examples: x, x' , y, y'
▪ Product Term: a single literal or a logical
product (AND) of several literals.
Examples: x, xyz', A'B, AB
Standard Forms
▪ Sum Term: a single literal or a logical sum (OR) of several literals.
Examples: x, x+y+z', A'+B, A+B
▪ Sum-of-Products (SOP) Expression: a product term or a logical sum
(OR) of several product terms.
Examples: x, x+yz', xy'+x'yz, AB+A'B'
▪ Product-of-Sums (POS) Expression: a sum term or a logical product
(AND) of several sum terms.
Examples: x, x(y+z'), (x+y')(x'+y+z), (A+B)(A'+B')
▪ Every boolean expression can either be expressed as sum-of-products or
product-of-sums expression.
Examples:
SOP: xy + xy + xyz Note: SOP and POS are
complements
POS: (x + y)(x + y)(x + z)
Minterm
▪ Consider two binary variables x, y.
▪ Each variable may appear as itself or in
complemented form as literals (i.e. x, x' & y, y' )
▪ For two variables, there are four possible
combinations with the AND operator, namely:
x'y', x'y, xy', xy
▪ These product terms are called the minterms.
▪ A minterm of n variables is the product of n literals
from the different variables.
▪ In general, n variables can give 2n minterms.
Maxterm

▪ In a similar fashion, a maxterm of n


variables is the sum of n literals from
the different variables.
Examples: x'+y', x'+y, x+y',x+y
▪ In general, n variables can give 2n
maxterms.
Minterm & Maxterm
▪ The minterms and maxterms of 2 variables are
denoted by m0 to m3 and M0 to M3 respectively:
Note: Minterms Maxterms
m0=x’y’z’ x y term notation term notation
0 0 x'y' m0 x+y M0
m0’=xyz 0 1 x'y m1 x+y' M1
M0=(x+y+z) 1 0 xy' m2 x'+y M2
m0’= M0 1 1 xy m3 x'+y' M3

Minterm number is the decimal representation

Each minterm is the complement of the corresponding


maxterm:
Example: m2 = xy'
m2' = (xy')' = x' + (y')' = x'+y = M2
Minterms and Maxterms
Canonical Form: Sum of Minterms
Obtain Sum-of-Minterms by gathering/summing the
minterms of the function (where result is a 1)
F1 = xyz' = (m6)
F2 = x'y'z+xy'z'+xy'z+xyz'+xyz =
(m1,m4,m5,m6,m7)
x y z F1 F2 F3
F3 = x'y'z+x'yz+xy'z' 0 0 0 0 0 0
+xy'z 0 0 1 0 1 1
0 1 0 0 0 0
= (m1,m3,m4,m5) 0 1 1 0 0 1
1 0 0 0 1 1
1 0 1 0 1 1
1 1 0 1 1 0
1 1 1 0 1 0
Canonical Form: Product of Maxterms

▪ Maxterms are sum terms.


▪ For Boolean functions, the maxterms of a
function are the terms for which the result is 0.
▪ Boolean functions can be expressed as Products-of-
Maxterms.
Canonical Form: Product of Maxterms

E.g.: F2 = (M0,M2,M3) = (x+y+z)(x+y'+z)(x+y'+z')


F3 = (M0,M2,M6,M7)
= (x+y+z)(x+y'+z)(x'+y'+z)(x'+y'+z')
x y z F1 F2 F3
0 0 0 0 0 0
0 0 1 0 1 1
0 1 0 0 0 0
0 1 1 0 0 1
1 0 0 0 1 1
1 0 1 0 1 1
1 1 0 1 1 0
1 1 1 0 1 0
SOP
->POS

◼ Considering the 1’s-> f1=x’y’z+xy’z’+xyz’=m1+m4+m7


=∑ (m1,m4,m7 )
◼ Considering the 0’s ->
f1’=x’y’z’+x’yz’+x’yz+xy’z+xyz’=m0+m2+m3+m5+m6
◼ (f1’)’=f1=(x+y+z)(x+y’+z)(x+y’+z’)(x’+y+z’)(x’+y’+z)

◼ f1=M0M1M2M5M6 =∏(M0,M2,M3,M5,M6)

Try writing f2 in (i) SOP and (ii) POS


Solution

◼ SOP: F2 =x’yz+xy’z+xyz’+xyz
◼ POS: F2=(x+y+z)(x+y+z’) (x+y’+z)(x’+y+z)
Canonical Form: Product of Maxterms

▪ Why is this so? Take F2 as an example.


F2 = (m1,m4,m5,m6,m7)
▪ The complement function of F2 is: x y z F2 F2'
F2' = (m0,m2,m3) 0 0 0 0 1
= m0 + m2 + m3 0 0 1 1 0
Therefore: 0 1 0 0 1
F2 = (m0 + m2 + m3 )' 0 1 1 0 1
= m0' . m2' . m3' DeMorgan 1 0 0 1 0
= M0 . M2 . M3 mx' = Mx 1 0 1 1 0
1 1 0 1 0
= (M0,M2,M3)
1 1 1 1 0
▪ Every Boolean function can be expressed as
either Sum-of-Minterms or Product-of-
Maxterms.
Comparison between SOP
and POS

◼ Complement of a function
= original function-minterms
=missing miniterms
◼ mj’=Mj
◼ If f(x,y,z)=∑(1,3,6,7)=∏(0,2,4,5)

Function can be expressed in both SOP and POS.


Step 1: interchange ∑ with ∏
Step 2: list missing numbers from the original
Expressing Boolean Function
in terms of Canonical SOP
Check if each term contains all variable, if not
AND (x+x’) if x is the missing term
F=A+B’C
=A(B+B’)(C+C’)+B’C(A+A’)
=(AB+AB’)(C+C’)+B’C(A+A’)
=AB(C+C’)+AB’(C+C’)+B’C(A+A’)
=ABC+ABC’+AB’C+AB’C’+AB’C+A’B’C
=ABC+ABC’+AB’C+AB’C’+A’B’C
=∑(1,4,5,6,7) Try using Truth Table
Expressing Boolean function
in terms of Canonical POS
1.Often distributive law (x+yz)=(x+y)(x+z)) is used
2.If then terms, like x, are missing, OR xx’
F=xy+x’z=(xy+x’)(xy+z)=(x+x’)(y+x’)(x+z)(y+z)
=(1)(y+x’)(x+z)(y+z)=)(y+x’)(x+z)(y+z)
Each POS is missing a term so OR missing terms
=(y+x’+zz’)(x+z+yy’)(y+z+xx’)
Again applying distributive law
=(x+y+z)(x+y’+z)(x’+y+z)(x’+y+z’)=∏(0,2,4,5)

Try using Truth Table


Expressing Boolean function
in terms of Canonical SOP
• F(w,x,y,z)=wy+x’z
Expressing Boolean function in terms of
Canonical POS
• F(w,x,y,z)=wy+x’z
Solving it yourself
1. A Boolean function of 5 variables can have up to ___
minterms.
2. Given a Boolean function F (A,B,C) =  m(0, 5, 7).
Which of the following is correct?
a) F' (A,B,C) = m(0,5,7) b) F (A,B,C) = M(1,2,3,4,6)
c) F (A,B,C) = M(0,5,7) d) F' (A,B,C) = m(1,2,3)
e) None above
3. Given a Boolean function F (x,y,z) = y'.(x + z') + x'.z.
Which of the following is correct?
a) F (x,y,z) = m(0,1) b) F (x,y,z) = m(0,1,4,5)
c) F (x,y,z) = m(0,1,2,3,4) d) F (x,y,z) = m(0,1,3,4,5)
e) F (x,y,z) = m(1,2,3,4,5)
Solution

◼ 1. 2^5=32
◼ 2. (b)

◼ 3.(d)

Working:
F (x,y,z) = y'.(x + z') + x'.z=y’x+x’z
=y’x(z+z’)+x’z(y+y’)
=x’y’z’+x’y’z+x’yz+xy’z’+xy’z
=m0+m1+m3+m4+m5
= F (x,y,z) = m(0,1,3,4,5)
CSE215 Digital Logic Design

Karnaugh
Maps

CSE215 Digital Logic Design


The map method
◼ The map method provides a simple procedure for minimizing
Boolean functions.
◼ The map is made up of squares where each square represent a
minterm.
◼ We represent each minterm of an equation by ‘1’s
◼ We groups the adjacent ‘1’s in groups of 2, groups of 4 or groups of
8 and so on.
◼ In those grouping try to find the common literal.
◼ The map method is often known as Karnaugh Map or Veitech
Diagram. In short we will call it K-map
Two variable map

◼ There are 4 minterm of 2 variable;


hence the map is four squares, one for
each minterm.
Only 1 bit changes

00 01
Only 1 bit
changes
10 11
Representing function in K-
map
◼ (a) F1=xy;


(b) F2=xy’+xy+x’y
=x(y’+y)+x’y
=x+x’y
=(x+x’)(x+y)
=(1)(x+y)
=x+y
Try it yourself

F=xy’+x’y’+x’y,
Simplify the equation using k-map
Solution

◼ F=xy’+x’y’+x’y=x’+y’

1 1

1
Three variable map
◼ Sequence in 3-variable map is not in binary sequence but in reflected
code. In reflected code, at a time only 1 bit changes from 0 to 1 and 1
to 0.
◼ Numbering of minterms follow binary numbers. Example m5 is at 101
i.e. row 1 and column 01.
Note: Any 2 adjacent
square differ by 1 variable (
which is primed in one and
unprimed in the other )
000 001 011 010

100 101 111 110


If any 2 adjacent square differ by 1 variable ( which is primed in one
and unprimed in the other ) and they are grouped, then any 2
minterms in the adjacent square are ORed, will remove the different
term. As a result , we get a single ANDed term of only 2 common
literals

◼ F1=∑(5,7)=xy’z+xyz=xz(y’+y)=xz
◼ F2=∑(0,2)=x’y’z’+x’yz'=x’z’(y’+y)=x’z’

1 1

1 1
Simplifying functions using k-
map

◼ F=∑(2,3,4,5)=x’yz+x’yz’+xy’z’+xy’z
(note: in other words, F=
x’y
(∑(010,011,100,101) so place ‘1’ in those
positions and group the adjacent ones)
F=x’y+xy’ xy’

◼ Grouping of 1 can be done in groups of


two ‘1’,four ‘1’,eight ‘1’.…2^n ‘1’.
◼ F1=x’yz+xy’z’+xyz+xyz’=xz’+yz
011 100 111 110

yz

Notice even 2
opposite edges of
the map are
xz’
adjacent, thus
they can be
grouped
◼ If F=∑(0,2,4,6), then simplify it
000 010 100 110

1 1

=Z’ 1 1
Try it yourself

◼ F=∑(0,2,4,5,6), Simplify it.


Solution

F= xy’ + z’
Try it yourself:

◼ F=A’C+A’B+AB’C+BC
a) Express it as SOP (i.e. ∑)
b) Simplify it using Kmap
Solution

◼ (a) F= ∑(1,2,3,5,7)
(b)F=C + A’B

To find A’C, coincide A’ (first row) with C( middle 2 column)


To find A’B, coincide A’ (first row) with B( last 2 column)
To find BC, coincide B (last 2 column) with C( middle 2 column)
To find AB’C, is m5( 2nd row 2nd column)
Summary of grouping in 3-
variable map
Four variable map

◼ Adjacent squares can be side by side or lie in 4 corner


or top-bottom or left-right edge condition. Example, m0 -
m2 are adjacent and similarly m3-m11 are adjacent

0000 0001 0011 0010

0100 0101 0111 0110

1100 1101 1111 1110

1000 1001 1011 1010


◼ Simplify F=∑(0,1,2,4,5,6,8,9,12,13,14)
◼ Note: it is allowed to use the same ‘1’
more than once.

1 1 1

1 1 1

1 1 1

1 1

F= xz’+ y’+ w’z’


Try it yourself

◼ F=A’B’C’+B’CD’+A’BCD’+AB’C’
Solution

◼ F=A’B’C’+B’CD’+A’BCD’+AB’C’

F=B’D’+B’C’+A’CD’
Product of Sum (POS)
simplification
◼ F is represented with the ‘1’s
-> F’ is represented with the ‘0’s
-> (F’)’ =F so find F’ and then find it’s
complement using DeMorgan’s law.
◼ In other word, ‘1’s represent the minterms
whereas ‘0’s represent the maxterms.
◼ If Equation is provided in SOP format, mark the
‘1’s and then mark the remaining with ‘0’s. On
the other hand, if Equation is provided in POS
format, mark the ‘0’s and then mark the remaining
with ‘1’s. Once marking is done, function can be
simplified in SOP or POS format.
SOP to POS

◼ SOP-> F=∑(0,1,2,5,8,9,10)
◼ Combining ‘1’s we get
F=B’D’+B’C’+A’C’D
◼ Combining ‘0’s we get
F’=AB+CD+BD’
◼ Applying De-morgan
F=(A’+B’)(C’+D’)(B’+D) <-POS
◼ If SOP: ∑(1,3,4,6)
then POS: ∏(0,2,5,7)
So grouping ‘1’s, F=x’z+xz’
Grouping ‘0’s, F’=xz+x’z’
therefore, F= (x’+z’)(x+z)
Don’t Care condition
◼ Don't cares in a Karnaugh map, or truth table, may be
either 1s or 0s, as long as we don't care what the output
is for an input condition we never expect to see.
◼ We plot these cells with a special sign, ‘X’, among the
normal 1s and 0s.
◼ When forming groups of cells, treat the don't care cell as
either a 1 or a 0, or ignore the don't cares. This is helpful
if it allows us to form a larger group than would
otherwise be possible without the don't cares.
◼ There is no requirement to group all or any of the don't
cares. (i.e. do not make any group only consisting the
don’t cares). Only use them in a group if it simplifies the
logic.
Simplify F(w,x,y,z)= ∑(1,3,7,11,15) and don’t care
d(w,x,y,z)= ∑(0,2,5)
Solution: Even though 2 solutions are not same, but either
1 is acceptable. Such scenario only applicable for Don’t
care scenarios!
Complement of the function and POS considering don’t
cares

F’=z’+wy’
F=(z)(w’+y)
APPLICATIONS OF K-MAP
Example 1: Design and draw
the circuit diagram of BCD to
Excess-3 code converter
Q1.Treat each W, X, Y
and Z as a function
and write them as W X
SOP Y Z
Q2. Based on the SOP,
draw the circuit
diagram of BCD to
Excess-3 code
converter
Any value higher
than 9 will result
into don’t care
output
Example 2: 7 segment display
board
Try it by your self

◼ A car garage has a front door and one


window, each of which has a sensor to
detect whether it is open. A third
sensor detects whether it is dark
outside. A security system for the
garage follows this rule: the alarm
rings if the alarm switch is turned on
and either the front door is not
closed or it is dark and the side
window is not closed.
Solution
Switch Door Window Dark AlarmRing
On
0 0 0 0 x
0 0 0 1 x WDk
0 0 1 0 x
0 0 1 1 x SDr X X X X
0 1 0 0 x X X X X
0 1 0 1 x 0 0 1 1
0 1 1 0 x 0 0 1 0
0 1 1 1 x
1 0 0 0 0
AlarmRing=WDk+WDr
1 0 0 1 0
1 0 1 0 0 Assuming
AlarmRing = 1 if Alarm rings, 0 otherwise.
1 0 1 1 1
Switch On = 1 if alarm switch is on, 0 otherwise
1 1 0 0 0
Door = 1 if door is not closed, 0 otherwise.
1 1 0 1 0 Window = 1 if window is not closed.
1 1 1 0 1 Dark = 1 if it is dark outside, 0 otherwise.
1 1 1 1 1
K-Map Example
K-Map Example
K-Map Example
UNIVERSAL LOGIC GATES
NAND NOR
Using NAND
NOT OR
Gate Gate

NOT AND
Gate Gate
Using NOR
NOT OR
Gate Gate

NOT AND
Gate Gate
Use NAND
to
represent
F=A(B+CD)
+BC’
Use NOR
to
represent
F=A(B+CD)
+BC’
A Must Self study from the
book

◼ Morris Mano: Chapter 3.6 (NAND and


NOR implementation )to Chapter 3.7
(Other two level implementation)

You might also like