Professional Documents
Culture Documents
ECEG 3201 DLD Lec 05 Karanugh Map
ECEG 3201 DLD Lec 05 Karanugh Map
AAIT, Department of
Electrical and Computer 3 Nebyu Yonas Sutri
Engineering
Definitions
Canonic Sum: is sum of minterms corresponding
to truth-table rows (input combinations) for which
the function produces a 1 output.
Canonic Product: is product of the maxterms
corresponding to input combinations for which the
function produces a 0 output.
Canonic sum
Canonic product
AAIT, Department of
Electrical and Computer 4 Nebyu Yonas Sutri
Engineering
Introduction to K-Map
An alternate approach to represent a
simplified Boolean function.
Similar to a truth table.
Can be used to minimize Boolean functions
graphically.
Each cell‟s position is fixed by a binary value
of the input variables.
Number of cells = 2N where N is the number
of input variables.
AAIT, Department of
Electrical and Computer 5 Nebyu Yonas Sutri
Engineering
2-Variable K-Map
AAIT, Department of
Electrical and Computer 6 Nebyu Yonas Sutri
Engineering
3-Variable K-Map
For a 3 inputs system, 23 = 8 cells.
3 inputs truth table 3-variable K-Map
1 1 1 10 10
AAIT, Department of
Electrical and Computer 7 Nebyu Yonas Sutri
Engineering
3-Variable K-Map
C 0 1
AB
00 A’B’C’ A’B’C
01 A’BC’ A’BC
11 ABC’ ABC
10 AB’C’ AB’C
AAIT, Department of
Electrical and Computer 8 Nebyu Yonas Sutri
Engineering
4-Variable K-Map
For a 4 inputs system, 24 = 16 cells.
A B C D Q
0 0 0 0 4-variable K-Map
0 0 0 1 Grey code form
CD
0 0 1 0
4 inputs truth table
0 0 1 1
AB 00 01 11 10
0 1 0 0
0 1 0 1
00
0 1 1 0
0 1 1 1
1 0 0 0 01
1 0 0 1
1 0 1 0 11
1 0 1 1
1 1 0 0 10
1 1 0 1
Grey code form
1 1 1 0
1 1 1 1
AAIT, Department of
Electrical and Computer 9 Nebyu Yonas Sutri
Engineering
4-Variable K-Map
CD
AB 00 01 11 10
00 A’B’C’D’ A’B’C’D A’B’CD A’B’CD’
AAIT, Department of
Electrical and Computer 10 Nebyu Yonas Sutri
Engineering
Cell Adjacency
The cells are arranged in a way that there is only one
single variable change between adjacent cells.
Cells that are different by only 1 variable “adjacent”.
Cell adjacency rules:
Each cell adjacent to cells immediately next to it, on any
four sides.
A cell is NOT adjacent to the cells that diagonally touch any
of its corners.
Cells in top row adjacent to corresponding cells in bottom
row.
Cells in outer left column adjacent to corresponding cells in
outer right column.
AAIT, Department of
Electrical and Computer 11 Nebyu Yonas Sutri
Engineering
Cell Adjacency
For example, let‟s look at the cell adjacency
of a 3-variable K-map:
C 0 1
AB
00
01
11
10
AAIT, Department of
Electrical and Computer 12 Nebyu Yonas Sutri
Engineering
Filling in the K-Map
From any Boolean expression or a problem
statement, write the truth table first.
Determine how many inputs and outputs, and
therefore how many K-maps cells are
required.
Draw the K-map and label it accordingly.
Do the mapping on the K-map according to
the inputs and outputs condition in the truth
table.
AAIT, Department of
Electrical and Computer 13 Nebyu Yonas Sutri
Engineering
Grouping in K-Map
Group all 1s in the map into group of 2n
where n = 1,2,4,8 ...
The grouping of the 1s must be in adjacent
cell and can overlap.
Every square containing 1 must be
considered at least once.
A square containing 1 can be included in as
many groups as desired.
A group must be as large as possible.
AAIT, Department of
Electrical and Computer 14 Nebyu Yonas Sutri
Engineering
Grouping in K-Map
AAIT, Department of
Electrical and Computer 15 Nebyu Yonas Sutri
Engineering
Karnaugh Map SOP Minimization
AAIT, Department of
Electrical and Computer 16 Nebyu Yonas Sutri
Engineering
Mapping a Standard SOP Expression
A 1 is placed in the cell corresponding to the
binary value of each product term.
E.g. product term A‟BC, a 1 is placed in the cell
corresponding to 011.
The steps are:
Step 1: Determine binary value of each product term.
Step 2: Place a 1 in the cell corresponding to the
binary value of the product term.
AAIT, Department of
Electrical and Computer 17 Nebyu Yonas Sutri
Engineering
Mapping a Standard SOP Expression
011 C 0 1
AB
101
100 00
01 1
11
10 1 1
AAIT, Department of
Electrical and Computer 18 Nebyu Yonas Sutri
Engineering
Mapping a Standard SOP Expression
0111 CD
00 01 11 10
AB
1110
1100 00
1111 01 1
11 1 1 1
10
AAIT, Department of
Electrical and Computer 19 Nebyu Yonas Sutri
Engineering
Mapping a Non Standard SOP
Expression
Convert to standard SOP form and map.
e.g. Map the expression AD+A‟BCD‟ on a K-map
AD AD( B B)(C C )
CD 00
ABCD ABC D ABCD AB C D AB
01 11 10
00
ABCD ABC D ABCD AB C D
01 1
1111
ABC D 1101 11 1 1
1011
1001 10 1
1
0110
AAIT, Department of
Electrical and Computer 20 Nebyu Yonas Sutri
Engineering
Grouping the 1’s
AAIT, Department of
Electrical and Computer 21 Nebyu Yonas Sutri
Engineering
Grouping of two 1’s
There are four ways to group two 1‟s:
CD 00 01 11 10 CD 00 01 11 10
AB AB
00 00 1
01 1 1 01 1
11 11
10 10
CD 00 01 11 10 CD 00 01 11 10
AB AB
00 1 00
01 01 1 1
11 11
10 1 10
AAIT, Department of
Electrical and Computer 22 Nebyu Yonas Sutri
Engineering
Grouping of four 1’s
There are six ways to group four 1‟s:
CD 00 01 11 10 CD 00 01 11 10
AB AB
00 00 1
01 1 1 1 1 01 1
11 11 1
10 10 1
CD 00 01 11 10 CD 00 01 11
11 10
AB AB
00 00 1 1
01 1 1 01
11
11 1 1 11
10 10 1 1
AAIT, Department of
Electrical and Computer 23 Nebyu Yonas Sutri
Engineering
Grouping of four 1’s
CD 00 01 11 10 CD 00 01 11 10
AB AB
00 00 1 1
01 1 1 01
11 1 1 11
10 10 1 1
AAIT, Department of
Electrical and Computer 24 Nebyu Yonas Sutri
Engineering
Grouping of eight 1’s
There are four ways to group eight 1‟s:
CD 00 01 11 10 CD 00 01 11 10
AB AB
00 00 1 1
01 1 1 1 1 01 1 1
11 1 1 1 1 11 1 1
10 10 1 1
CD 00 01 11 10 CD 00 01 11 10
AB AB
00 1 1 1 1 00 1 1
01 01 1 1
11 11 1 1
10 1 1 1 1 10 1 1
AAIT, Department of
Electrical and Computer 25 Nebyu Yonas Sutri
Engineering
Determining the Minimum SOP
Expression from the Map
Each group of cells one product term
composed of all variables that occur in
only one form (either complemented or
uncomplemented) within the group.
Variables that occur both complemented and
uncomplemented within the group are
eliminated.
AAIT, Department of
Electrical and Computer 26 Nebyu Yonas Sutri
Engineering
Examples – (given truth table)
Example: Given the truth table below. Find
the simplified expression using K-map.
Step 1: Fill in the K-map with the respective output values.
B
A B Q
A 0 1
0 0 1
0 1 1 0
1 1
1 0 0
1 1 0 1
0 0
AAIT, Department of
Electrical and Computer 27 Nebyu Yonas Sutri
Engineering
Examples – (given truth table)
AAIT, Department of
Electrical and Computer 28 Nebyu Yonas Sutri
Engineering
Examples – (given truth table)
Example: Given the truth table below. Find
the simplified expression using K-map.
A B C Q
Step 1: Fill in the K-map with the
0 0 0 1 respective output values.
0 0 1 0
0 1 0 0 BC
0 1 1 0 A 00 01 11 10
1 0 0 1 0 0 0
0 1
1 0 1 0
1 1 0 1 1 1 0 1 1
1 1 1 1
AAIT, Department of
Electrical and Computer 29 Nebyu Yonas Sutri
Engineering
Examples – (given truth table)
C
BC
A 00 01 11 10
1 0 0 0
0
Q AB BC
A 1 1 0 1 1
AAIT, Department of
Electrical and Computer 30 Nebyu Yonas Sutri
Engineering
Examples – (given truth table)
Example : Given the truth table below.
A B C D Q
0 0 0 0 0
Find the simplified expression using
0 0 0 1 1 K-map.
0 0 1 0 0
Step 1: Fill in the K-map with the
0 0 1 1 0
respective output values.
0 1 0 0 0
0 1 0 1 1 CD
0 1 1 0 0 AB 00 01 11 10
0 1 1 1 0
1 0 0 0 0 00 0 1 0 0
1 0 0 1 0
1 0 1 0 0 0 1 0 0
1 0 1 1 0
01
1 1 0 0 0
0 1 1 0
1 1 0 1 1 11
1 1 1 0 0
0 0 0 0
1 1 1 1 1 10
AAIT, Department of
Electrical and Computer 31 Nebyu Yonas Sutri
Engineering
Examples – (given truth table)
Step 2: Group the 1s together. Step 3: Derive the Boolean expression
C
CD
AB 00 01 11 10
00 0 1 0 0
0 1 0 0 Q ACD ABD
01
B
0 1 1 0
11
A
0 0 0 0
10
D
AAIT, Department of
Electrical and Computer 32 Nebyu Yonas Sutri
Engineering
Examples – (given expression)
Example: Given the Boolean expression below. Find the
simplified expression using K-map.
Q A B C D A B C D A B C D A B C D A B C D A B C D
CD
AB 00 01 11 10
00 0 1 1 0
0 1 1 0
01
0 0 0 0
11
1 1 0 0
10
Step 1: Fill in the K-map with 1 according to the expression.
AAIT, Department of
Electrical and Computer 33 Nebyu Yonas Sutri
Engineering
Examples – (given expression)
Step 2: Group the 1s together. Step 3: Derive the Boolean expression
C
CD
AB 00 01 11 10
00 0 1 1 0
01
0 1 1 0
B
Q AD ABC
0 0 0 0
11
A
1 1 0 0
10
D
AAIT, Department of
Electrical and Computer 34 Nebyu Yonas Sutri
Engineering
Examples – (given expression)
Example: Given the Boolean expression below. Find the
simplified expression using K-map.
Q A AB ABC
Step 1:
Convert the non standard terms Q A AB ABC
to standard forms! 000 101 110
001 100
Q A( B B )(C C ) AB(C C ) ABC 010
011
Step 2: Fill in the K-map with 1 Step 3: Derive the Boolean expression
where applicable
B
BC
A 00 01 11 10
0 1 1 1 1 Q A B C
A 1 1 1 0 1
AAIT, Department of
Electrical and Computer 36 Nebyu Yonas Sutri
Engineering
Examples – (given circuit)
Example : Given the circuit
below. Find the simplified A
Q
circuit using K-map. B
Step 1:
Find the expression at the output of the circuit.
Q A A B A B C
AAIT, Department of
Electrical and Computer 37 Nebyu Yonas Sutri
Engineering
Examples – (given circuit)
From the expression, derive the truth table.
A B C Q
Q A A B A B C 0 0 0 0
100 110 001 0 0 1 1
111 011 0 1 0 0
101
0 1 1 1
1 0 0 1
1 0 1 1
1 1 0 1
1 1 1 1
AAIT, Department of
Electrical and Computer 38 Nebyu Yonas Sutri
Engineering
Examples – (given circuit)
Step 2: Fill in the K-map with the respective output values.
A B C Q B
0 0 0 0 BC
A 00 01 11 10
0 0 1 1
0 0 1 1 0
0 1 0 0
0 1 1 1 A 1 1 1 1 1
1 0 0 1
1 0 1 1 C
1 1 0 1 Step 3: Derive the Boolean expression
Q A C
1 1 1 1
AAIT, Department of
Electrical and Computer 39 Nebyu Yonas Sutri
Engineering
Examples – (given circuit)
Therefore, simplified circuit is:
A
Q
C
AAIT, Department of
Electrical and Computer 40 Nebyu Yonas Sutri
Engineering
5 Variable K-Map
Boolean functions with 5 variables can be
simplified using a 32-cell K-Map.
Two 4-variable maps are used to construct a 5
variable map.
DE DE
BC 00 01 11 10 BC 00 01 11 10
00 00
01 01
11 11
10 10
A=0 A=1
AAIT, Department of
Electrical and Computer 41 Nebyu Yonas Sutri
Engineering
5 Variable K-Map
To visualize adjacency
imagine as A=0 map is
placed on top of A=1
map.
Solution
Q DE BCE ABD BC DE
AAIT, Department of
Electrical and Computer 42 Nebyu Yonas Sutri
Engineering
Exercise – 5 Variables
Minimize/Simplify the following Boolean expression
F ABC DE ABC DE ABC DE ABC DE ABC DE
ABC DE ABCDE ABC DE ABC DE ABC DE
ABCDE ABCDE
DE DE
BC 00 01 11 10 BC 00 01 11 10
00 1 1 00 1 1
01 1 01 1
11 1 1 1 11 1 1
10 1 10
A=0 A=1
AAIT, Department of
Electrical and Computer 43 Nebyu Yonas Sutri
Engineering
Exercise – 5 Variables
DE DE
BC 00 01 11 10 BC 00 01 11 10
00 1 1 00 1 1
01 1 01 1
11 1 1 1 11 1 1
10 1 10
A=0 A=1
AAIT, Department of
Electrical and Computer 44 Nebyu Yonas Sutri
Engineering
Don’t Care Conditions
Don‟t care conditions are those that have
input conditions for which there are no
specified output levels.
In other words, there are certain input
conditions that may occur that we don‟t care
whether the output is high or low.
In the K Map, we place an „X‟ wherever
output is a Don‟t Care condition.
The „X‟ is used as either a 1 or a 0 in the K
map simplification process to our advantage.
AAIT, Department of
Electrical and Computer 45 Nebyu Yonas Sutri
Engineering
Usage of “Don’t Cares”
AAIT, Department of
Electrical and Computer 46 Nebyu Yonas Sutri
Engineering
Usage of “Don’t Cares”
Example
YZ 00 01 11 10
WX
00 1 0 1 1
01 0 X 1 1
11 1 0 0 0
10 1 1 0 0
AAIT, Department of
Electrical and Computer 47 Nebyu Yonas Sutri
Engineering
Example
A B C D X
CD 00 01 11 10
0 0 0 0 0
AB
0 0 0 1 0 00 0 0 0 0
0 0 1 0 0
0 0 1 1 0 01 0 0 1 0 A’BCD
0 1 0 0 0
0 1 0 1 0 11 X X X X BCD
0 1 1 0 0
10 1 1 X X
0 1 1 1 1
1 0 0 0 1 A
AB’C’
1 0 0 1 1
1 0 1 0 X
Without “don‟t cares”:
1 0 1 1 X AB’C’+A’BCD
1 1 0 0 X
1 1 0 1 X
With “don‟t cares”:
1 1 1 0 X A+BCD
1 1 1 1 X
AAIT, Department of
Electrical and Computer 48 Nebyu Yonas Sutri
Engineering
Don’t Care Conditions
Example : Given the truth table with don’t care condition, find the
simplified expression using K-map.
C C
A B C Q 0 1 AB 0 1
AB
0 0 0 0
00 0 0 00 0 0
0 0 1 0
0 1 0 0
01 0 X 01 0 0
0 1 1 X B
1 0 0 X 11 1 1 11 1 1
1 0 1 1 A
10 X 1 10 1 1
1 1 0 1
1 1 1 1
Q A
AAIT, Department of
Electrical and Computer 49 Nebyu Yonas Sutri
Engineering
Don’t Care Conditions
Example : We are dealing with an elevator in a three floor building.
An indicator is placed at the elevator and is active (ON) when
the elevator stops and one of the floor is aligned with the
indicator. The indicator will be OFF when it is aligned at one of
the floor while it is still moving. Derive the digital controller
expression to control the indicator.
First: simplify the problems and set what are the inputs and output.
AAIT, Department of
Electrical and Computer 50 Nebyu Yonas Sutri
Engineering
Don’t Care Conditions
Second: Derive the truth table
M F1 F2 F3 O
Third: Map into the K-map
0 0 0 0 0
0 0 0 1 1
F2
0 0 1 0 1 F2 F3
0 0 1 1 X
M F1 00 01 11 10
0 1 0 0 1
0 1 0 1 X
00 0 1 X 1
0 1 1 0 X
0 1 1 1 X 1 X X X
01
1 0 0 0 0 F1
X
1 0 0 1 0
0 X X
1 0 1 0 0 11
1 0 1 1 X M
0 0 X 0
1 1 0 0 0 10
1 1 0 1 X
1 1 1 0 X
1 1 1 1 x
F3
AAIT, Department of
Electrical and Computer 51 Nebyu Yonas Sutri
Engineering
Don’t Care Conditions
Forth: Group the 1‟s Fifth: Derive the Boolean expression
F2
F2 F3
M F1 00 01 11 10 O M F1 M F 2 M F 3
00 0 1 X 1
01
1 X X X O M ( F1 F 2 F 3 )
F1
0 X X X
11
M
0 0 X 0
10
F3
AAIT, Department of
Electrical and Computer 52 Nebyu Yonas Sutri
Engineering
Karnaugh Map POS Minimization
AAIT, Department of
Electrical and Computer 53 Nebyu Yonas Sutri
Engineering
Mapping a Standard POS Expression
AAIT, Department of
Electrical and Computer 54 Nebyu Yonas Sutri
Engineering
Mapping a Standard POS Expression
E.g. Map the standard POS expression
(A+B‟+C‟+D)(A+B+C+D‟)(A+B+C+D)
(A‟+B+C‟+D) on a K-map
CD 00 01 11 10
0110 AB
0001 00 0 0
0000 01 0
1010 11
10 0
AAIT, Department of
Electrical and Computer 55 Nebyu Yonas Sutri
Engineering
Mapping a Non Standard POS
Expression
Convert to standard POS form and map.
E.g. Map the expression
(B+C+D)(A+B+C‟+D)(A‟+B+C+D‟)(A+B‟+C+D)(A‟+B‟+C
+D) on a K-map
CD 00 01 11 10
( B C D) ( B C D) A A AB
( A B C D)( A B C D) 0000
00 0 0
1000
( A B C D)( A B C D) 01 0
0010
( A B C D)( A B C D) 1001 11 0
0100
( A B C D)( A B C D) 1100
10 0 0
AAIT, Department of
Electrical and Computer 56 Nebyu Yonas Sutri
Engineering
Simplification of POS Expressions
AAIT, Department of
Electrical and Computer 57 Nebyu Yonas Sutri
Engineering
Example
Use a K-map to minimize
(A+B+C)(A+B+C‟)(A+B‟+C)(A+B‟+C‟)(A‟+B‟+C)
Step 1: Fill in the K-map with the
respective output values.
C 0 1
000 AB
001 00 0 0
010
01 0 0
011
110 11 0
10
AAIT, Department of
Electrical and Computer 58 Nebyu Yonas Sutri
Engineering
Example
C 0 1
AB
00 0 0
01 0 0 F A( B C )
11 0
10
AAIT, Department of
Electrical and Computer 59 Nebyu Yonas Sutri
Engineering
Exercise
Use a K-map to minimize
(B+C+D)(A+B+C’+D)(A’+B+C+D’)(A+B’+C+D)
(A’+B’+C+D)
Step 1: Fill in the K-map with the
respective output values.
CD 00 01 11 10
( B C D) ( B C D) A A AB
( A B C D)( A B C D) 0000
00 0 0
1000
( A B C D)( A B C D) 01 0
0010
( A B C D)( A B C D) 1001 11 0
0100
( A B C D)( A B C D) 1100
10 0 0
AAIT, Department of
Electrical and Computer 60 Nebyu Yonas Sutri
Engineering
Exercise
CD 00 01 11 10
AB
00 0 0
01 0
F (C D )( A B D )( A B C )
11 0
10 0 0
AAIT, Department of
Electrical and Computer 61 Nebyu Yonas Sutri
Engineering
Converting Between POS and SOP
using K-map
Recall that it‟s possible to convert from POS to SOP and
vice-versa.
The Karnaugh map can be used for this purpose.
For a POS expression, all cells that do not contain 0‟s
contain 1‟s, SOP equivalent can be derived.
The reverse can be said about an SOP expression.
Importance? To determine which form can be
implemented using less number of gates.
AAIT, Department of
Electrical and Computer 62 Nebyu Yonas Sutri
Engineering
Example
Use a Karnaugh map to convert the following
POS expression to minimum POS , standard
SOP and minimum SOP expression:
(A‟+B‟+C+D)(A+B‟+C+D)(A+B+C+D‟)(A+B+C‟+D‟)
(A‟+B+C+D‟)(A+B+C‟+D)
CD
AB 00 01 11 10
11 0
10 0
AAIT, Department of
Electrical and Computer 63 Nebyu Yonas Sutri
Engineering
Example
CD
AB 00 01 11 10
Minimum POS
00 0 0 0
01 0
F ( B C D )( B C D )( A B C )
11 0
10 0 CD
AB 00 01 11 10
00 1 0 0 0
Standard SOP 01 0 1 1 1
F= A‟B‟C‟D‟ + A‟BC‟D + A‟BCD+
11 0 1 1 1
A‟BCD‟+ABC‟D+ABCD+ABCD‟+
AB‟C‟D‟+AB‟CD+AB‟CD‟ 10 1 0 1 1
AAIT, Department of
Electrical and Computer 64 Nebyu Yonas Sutri
Engineering
Example
CD
AB 00 01 11 10 Minimum SOP
00 1 0 0 0
F BD BC AC BC D
01 0 1 1 1
11 0 1 1 1
10 1 0 1 1
AAIT, Department of
Electrical and Computer 65 Nebyu Yonas Sutri
Engineering
Homework
Use a Karnaugh map to convert the following
SOP expression to POS form:
A‟B‟C‟+AB‟C‟+A‟BC‟+ABC‟+A‟BC
C 0 1
AB
00
01
11
10
AAIT, Department of
Electrical and Computer 66 Nebyu Yonas Sutri
Engineering
What to do this week?
Reading assignment.
Digital Fundamentals, Thomas L. Floyd, Chapter 4,
Pages 210 – 228.
AAIT, Department of
Electrical and Computer 67 Nebyu Yonas Sutri
Engineering