DLD Lab6 Stmu
DLD Lab6 Stmu
DLD Lab6 Stmu
Lab Title:
Minimization of the equation
using K-maps
DEPARTMENT OF COMPUTING
64
Experiment No 6
6.1 Objectives
After completing this experiment, student will be able to:
Karnaugh maps or K-maps for short provide another means of simplifying and optimizing
logical expressions. This is a graphical technique that utilizes a sum of product (SOP) form.
SOP forms combine terms that have been ANDed together that then get ORed together. This
format lends itself to the use of De Morgan's law which allows the final result to be built with
only NAND gates. The K-map is best used with logical functions with four or less input
variables. One of the advantages of using K-maps for reduction is that it is easier to see when
65
a circuit has been fully simplified. Another advantage is that using K-maps leads to a more
structured process for minimization.
In order to use a K-map, the truth table for a logical expression is transferred to a K-map grid.
The grid for two, three, and four input expressions are shown in figure 2. Each cell corresponds
to one row in a truth table or one given state in the logical expression. The order of the items
in the grid is not random at all; they are set so that any adjacent cell differs in value by the
change in only one variable. Because of this, items can be grouped together easily in rectangular
blocks of two, four, and eight to find the minimal number of groupings that can cover the entire
expression. Note that diagonal cells require that the value of more than two inputs change, and
that they also do not form rectangles.
66
Now we get the following truth table and we want to simplify it.
Table 1: Truth Table
Sr. No X Y Z Output
1 0 0 0 1
2 0 0 1 0
3 0 1 0 1
4 0 1 1 0
5 1 0 0 1
6 1 0 1 0
7 1 1 0 1
8 1 1 1 1
F=Z'+XY
b) Find POS (Product of Sum)
Solution:
By circling the zeros
67
F' = X'Z+ Y'Z
F = (X'Z+ Y’Z)'
F = (X+Z')(Y+Z')
6.2.2 Overview of 4 variables K-Map
Four Variables Karnaugh's Map often known as 4 variables K-Map. It's an alternate method to
solve or minimize the Boolean expressions based on AND, OR & NOT gates logical
expressions or truth tables. The four variables A, B, C & D are the binary numbers which are
used to address the min-term SOP of the Boolean expressions. The gray code conversion
method is used to address the cells of K-Map table.
F = A’B’CD+A'BCD +ABCD+AB'CD+ABC'D'+ABC'D+ABCD'
68
6.2.3 Don’t Care Condition
One of the very significant and useful concepts in simplifying the output expression using K-
Map is the concept of “Don’t Cares”. The “Don’t Care” conditions allow us to replace the
empty cell of a K-Map to form a grouping of the variables which is larger than that of forming
groups without don’t cares. While forming groups of cells, we can consider a “Don’t Care”
cell as 1 or 0 or we can also ignore that cell. Therefore, “Don’t Care” condition can help us to
form a larger group of cells.
A standard SOP function having don’t cares can be converted into a POS expression by keeping
don’t cares as they are, and writing the missing minterms of the SOP form as the maxterm of
POS form. Similarly, a POS function having don’t cares can be converted to SOP form keeping
the don’t cares as they are and writing the missing maxterms of the POS expression as the
minterms of SOP expression.
For Example:
69
Writing the given expression in POS form:
F (A, B, C, D) = m (6, 7, 8, 9) + d (12, 13, 14, 15)
The POS K-map for the given expression is:
70
Represent Invalid States in Code Converters
These are used in code converters. For example- In design of 4-bit BCD-to-XS-3 code
converter, the input combinations 1010, 1011, 1100, 1101, 1110, and 1111 are don’t cares.
71
6.3.2 Task-2: Simplify given logic expression using don’t care condition
and 4 variable K-Map
Implement the resulting logic circuit and perform truth table-based verification.
F (A, B, C) = Σ m (1, 5, 6, 12, 13, 14) + d (2, 4)
72
6.3.3 Task-3: Design a 4-bit even parity generator
Simplify the circuit using K-Map and Implement the resulting logic circuit. Perform truth
table-based verification.
73
Lab Exercise and Summary
74
Student’s Signature: ________________ Date: ________________
75
Evaluation Criteria
Method of Evaluation: Viva, File submitted on LMS.
Assignment All tasks Most tasks Some tasks Most tasks All tasks were
completed were were were incomplete or
correctly in completed completed incomplete or incorrect.
given time correctly. correctly and incorrect and
and have a Tasks could have an have no Didn’t
complete be improved incomplete understanding perform tasks
understanding further and understanding and have no
have a understanding
complete
understanding
Total
76