0% found this document useful (0 votes)
7 views4 pages

Icas 2008 11

The document discusses the optimization of the Quine-McCluskey method for minimizing Boolean expressions, highlighting its advantages over traditional methods like Karnaugh Maps. It introduces a new approach that reduces runtime complexity by utilizing a concept called Reduced Mask, allowing for more efficient comparisons. The results demonstrate significant reductions in runtime as the number of literals increases.

Uploaded by

Minh Phuong
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)
7 views4 pages

Icas 2008 11

The document discusses the optimization of the Quine-McCluskey method for minimizing Boolean expressions, highlighting its advantages over traditional methods like Karnaugh Maps. It introduces a new approach that reduces runtime complexity by utilizing a concept called Reduced Mask, allowing for more efficient comparisons. The results demonstrate significant reductions in runtime as the number of literals increases.

Uploaded by

Minh Phuong
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/ 4

Fourth International Conference on Autonomic and Autonomous Systems

Optimization of the Quine-McCluskey Method for the Minimization of the


Boolean Expressions

Tarun Kumar Jain D. S. Kushwaha A. K. Misra


M.N.N.I.T., Allahabad M.N.N.I.T., Allahabad M.N.N.I.T., Allahabad
[email protected] [email protected] [email protected]

Abstract corresponding bit of the decimal equivalent of the


binary number is 1 and unprimed if a 0.
The basic principle in designing digital circuit The sum of products is a Boolean expression
hovers around reducing the required hardware thus containing AND terms, called products terms of one or
reducing the cost too. To achieve this, we use Boolean more literals each. The sum denotes the ORing of these
expression that helps in obtaining minimum number of terms. A product of sums is a Boolean expression
terms and does not contain any redundant pairs. The containing OR terms, called sum terms. Each term may
conventional methods for the minimization of the have any number of literals. The product denotes the
Boolean expressions are K-Map method and the ANDing of these terms. Boolean functions are
Tabulation method. The minimized expressions are represented as a sum of minterms or a product of
used to design digital circuits. Since K-Map method maxterms are said to be canonical form. [1]
gets exceedingly complex when the number of the
variable exceed six, hence Quine-McCluskey 2. Conventional methods of Minimization
tabulation method scores over this and is widely used of Boolean Expressions
.In the following paper we present optimized Quine-
McCluskey method that reduces the run time There are two methods for simplification of Boolean
complexity of the algorithm by proposing an efficient functions:-
algorithm for determination of Prime Implicants 1) Karnaugh Map Method. [2]
2) Quine-McCluskey Method [3]

1. Introduction 2.1. Karnaugh Map Method

A binary variable may appear either in the normal The map is a diagram made up of squares. Each
form (x) or in its complement form (x’). If we have two square represents one minterm / maxterm. Since any
binary variables x and y combined with AND Boolean expression can be represented as sum of
operation. Since each variable can appear in either products or product of sums, it follows that a Boolean
form, there are four possible combinations: x’y’, x’y, expression is recognized graphically in the map from
xy’ and xy. Each of these represents a minterm or a the area enclosed by those squares whose minterm /
standard product. In a similar manner, ’n’ variables can maxterm are included in the function. In fact, the map
be combined to from 2n minterms. Each minterm is represents a visual diagram of all possible ways a
obtained from an AND term of the n variables, with function may be expressed in a standard form. By
each variable being primed if the corresponding bit of recognizing various patterns, the user can derive
the decimal equivalent of the binary number is a 0 and alternative algebraic expressions for the same function,
unprimed if 1. from which we can select the simplest one. The
Similarly, n variables form an OR term, with each simplest one is assumed to be the expression with
variable being primed or unprimed providing 2n minimum number of literals involved in the expression.
possible combinations, called maxterms or standard
sums. Each maxterms is obtained from an OR term of 2.2. Limitations of Karnaugh Map Method
the n variables, with each variable being primed if the

0-7695-3093-1/08 $25.00 © 2008 IEEE 165


DOI 10.1109/ICAS.2008.11
Karnaugh maps generally become more cluttered and cycle is repeated for the terms formed until a single
hard to interpret when adding more variables. pass through cycle yields no further elimination of
Karnaugh maps are useful for expressions having four, literals. The remaining terms and all the terms that did
or fewer, variables. For more variables the map not match during the process comprise of the prime
effectively becomes three dimensional and is difficult implicants.
to interpret. [4]
Another disadvantage of the map method is the 2.3.2. Selection of Essential Prime Implicants.
trial-and-error procedure which relies on the ability of I. Construct the prime implicant table.
the user to recognize certain patterns. For functions of II. Reduce the prime implicant table by:
more than four variables, it becomes increasingly more (a) Removing the essential prime implicants,
difficult to ensure that best selection has been made. (b) Removing rows that dominate other rows,
(c) Removing columns dominated by other columns,
2.3. Quine-McCluskey method (d) Repeating Steps 2 (a)–(c) until no further
reduction is possible.
The method was formulated by Quine and later III. If necessary, solve the remaining prime implicant
improved by McCluskey, thus known as the Quine- table. [7]
McCluskey method. The Quine-McCluskey method is a
tabulation method. [5] This method overcomes the 2.4 Example: Quine-McCluskey method.
limitation associated with K-Map method. The method
is tedious for hand computation; the intent of the Minterms = Sum(0,1,2,3,9,11,12,13,14,15)
method is to provide
algorithmic procedure for X1 X2 X3 X4 X1 X2 X3 X4 X1 X2 X3 X4
providing prime implicants. (0) 0 0 0 0 * (0, 1) 0 0 0 – * (0, 1, 2, 3) 0 0 – –
[6] (0, 2) 0 0 – 0 *
The tabular method makes (1) 0 0 0 1 * (1, 3, 9, 11) – 0 – 1
repeated use of the law A + (2) 0 0 1 0 * (1, 3) 0 0 – 1 *
A’= 1. The Binary notation is (1, 9) – 0 0 1 * (9, 11, 13, 15) 1 – – 1
used a variable in true form is (3) 0 0 1 1 * (2, 3) 0 0 1 – * (12, 13, 14, 15) 1 1 – –
denoted by 1, in inverted
(9) 1 0 0 1 *
form by 0, and the absence of
a variable by a dash (-). (12) 1 1 0 0 * (3, 11) – 0 1 1 *
Reduction of Boolean (9, 11) 1 0 – 1 *
expressions by tabulation (11) 1 0 1 1 * (9, 13) 1 – 0 1 *
method involves two major (13) 1 1 0 1 * (12, 13) 1 1 0 – *
activities (14) 1 1 1 0 * (12, 14) 1 1 – 0 *
• Determination of
Prime Implicants (15) 1 1 1 1 * (11, 15) 1 – 1 1 *
• Selection of (13, 15) 1 1 – 1 *
Essential Prime (14, 15) 1 1 1 – *
Implicants.
* Is used to mark the elements that have taken part in
combining with some other element.
2.3.1. Determination of Prime Implicants: Prime
Implicants are all the terms that are candidates for
Since each of the rows of the two other tables could
inclusion in the simplified function. The starting point
be combined with at least one other row, only the rows
of the tabulation method is the list of the minterms that
of this final table correspond to the prime implicants.
specify the function. The first tabular operation is to
Hence, the disjunctive normal form consisting of the
find the prime-implicates by using a matching process.
prime implicants is given by
This process compares each minterm / maxterm with
L = A!B!+B!D+AD+AB
every other minterm. If the two minterms / maxterms
In the next step, the set of prime implicants is
differ in only one variable, that variable is removed and
reduced by following the earlier stated procedure:
a term with one less literal is formed. This process is
L = A!B!+B!D+AB
repeated for every minterm / maxterm until the
exhaustive search is complete. The matching process

166
2.5. Limitations Since two terms can combine only when they have
the same literal reduced in the terms combining and as
The Quine-McCluskey algorithm has its practical the Reduced Mask has bits set for the reduced literals
limits too. Both the K-map method and the Quine- only, those terms that have the same value of the
McCluskey algorithm find the guaranteed two-level Reduced Mask can combine. This is the necessary but
minimized form of a function. The Quine-McCluskey not the sufficient condition.
algorithm has its practical limits also because the A’C’D + A’CD= A’D’ (Both will have the reduced
algorithm is NP-Complete. In other words, the runtime mask value 4 as B is reduced in both the terms).
of the Quine-McCluskey algorithm grows Instead of N comparisons (N= Number of literals) we
exponentially with the input size. require only one comparison.
If the terms differ in only one bit, they combine. For
3. Optimized Quine-McCluskey method finding out the number of bits that are different, we
take the X-OR (Exclusive-OR) of the two terms
In our new approach, we introduce the concept of (having the same Reduced Mask) and if it’s a power of
Reduced Mask (R.M.). We use the pair of Reduced two, it implies that the terms differ in only one bit.
Mask and the Term Value. Initially all the Reduced Since the X-OR is implemented in the hardware of the
Masks are initialized to zero. The Reduced Mask has computer, it’s much faster and efficient than comparing
bits set corresponding to the literal reduced. The two literals of the terms, to find out if they differ by only
terms can combine only when the have the same one term. For finding out whether a number is a power
Reduced Mask. If the Reduced Mask is the same, then of 2, we can AND (Logical AND) the (Number) AND
if the X-OR (Exclusive-OR) of the Term Values of the (Number-1). If this is equal to zero, then the number is
two terms is an integral power of two, then the two integral power of two.
terms from a pair. Hence Run Time complexity for determining the
prime implicates is reduced.
3.1. How complexity is reduced
3.2. Example
The Quine-McCluskey method uses three states 0, 1
and – respectively. Since computers Minterms = Sum(0,1,2,3,9,11,12,13,14,15)
have only two states 0 and 1. So we Term Value R. M. Term Value R. M. Term Value R M.
require at least two bits to represent (0) 0 * 0 (0,1) 0 * 1 (0,1,2,3) 0 3
these three states. The computers (0,2) 0 * 2
work on integers (set of bits) rather
on a single bit. The only possible (1) 1 * 0 (1,3,9,11) 1 10
meaning representation for the three (2) 2 * 0 (1,3) 1 * 2
states can be made only by using a (1,9) 1 * 8 (9,11,13,15) 9 6
separate integer for each variable or (3) 3 * 0 (2,3) 2 * 1 (12,13,14,15) 12 3
by using bit fields in integers.
(9) 9 * 0
The first method requires N
integer comparisons one for each (12) 12 * 0 (3,11) 3 * 8
literal. Second method can be (9,11) 9 * 2
implemented programmatically using (11) 11 * 0 (9,13) 9 * 4
masking techniques but there to we (13) 13 * 0 (12,13) 12 * 1
have increased number for the
comparisons because of looping (N (14) 14 * 0 (12,14) 12 * 2
comparisons) and for comparing the
result of masking operation (N (15) 15 * 0 (11,15) 11 * 4
comparisons one for each variable). (13,15) 13 * 2
While, in our method we require
(14,15) 14 * 1
only 2 comparisons each of this is an
integer comparison. One comparison is required for * Is used to mark the elements that have taken part in
comparing Reduced Mask and one for testing the Term combining with some other element.
Values.

167
Don’t care conditions are introduced in the
matching process like the minterms / maxterms. While
determining the essential prime implicants only
minterms / maxterms are considered. The don’t care
terms are not essential, hence not included in the table
for determining the essential prime implicants.
For checking if the two terms can combine, Quine-
McCluskey method requires a minimum of N
comparison whereas the Optimized Quine-McCluskey
method requires only two comparisons. From this
observation we can easily conclude that with the Figure 2. Ratio of Run time for the Quine-
increase in the number of literals involved in the McCluskey method to the Optimized Quine-
expression, the time required for finding out the set of McCluskey method with the Number of Literals
prime implicants is reduced by same factor.
Graph 1 clearly shows that there is manifold
4. Result reduction in the run time for the Quine-McCluskey
method. From Graph 2 it is clear that the ratio of Run
Table 1. Run time for the Quine-McCluskey time for the Quine-McCluskey method to the
method and the Optimized Quine-McCluskey Optimized Quine-McCluskey method increase with the
method with the Number of Literals increase in the number of literals involved.

Number Run Time Quine- Run Time


5. Conclusion
of McCluskey (ms) Optimized Quine-
Literals McCluskey (ms)
An effort has been made to present an optimized
7 109 31
Quine-McCluskey method for determination of prime
8 703 93 implicants that provides an optimal solution for
9 5921 546 reducing Boolean expressions. It is also able to
establish that the proposed optimized Quine-
10 54140 4162 McCluskey method reduces the run time complexity of
11 491250 34796 the algorithm.

Table 1 shows the results obtained when 6. References


optimization of Boolean expression with different
[1] M Morris Mano, Digital Logic and Computer Design,
number of literals was carried out by Quine-McCluskey
Prentice Hall of India 2004 Edition, pp 72-112.
method and our proposed optimized Quine-McCluskey
method. The above algorithms were run on machine [2] M Karnaugh, “The map method for synthesis of
with 3.0 GHz processor and 512 DDR RAM and the combinational logic circuits,” Trans AIEE, Commiin &
operating system was Microsoft Windows XP Electron, vol 72, no 1, pp 593-598, 1953.
Professional Edition.
[3] E J McCluskey, “Minimization of Boolean functions,”
Bell Syst Tech, J , vol 35, no 5, pp 1417-1444, 1956.

[4] Graham Wilson, “Embedded Systems and Computer


Architecture”, Newnes 2001, pp 25.

[5] Sivarama P. Dandamudi, “Fundamentals of Computer


Organization and Design”, Springer 2003 Edition, pp 67.

[6] Donald D. Givone, “Digital Principles and Design”,


McGraw-Hill Professional 2003 Edition, pp 173.

Figure 1. Run time for the Quine-McCluskey [7] Holger Schwender, “Minimization of Boolean
method and the Optimized Quine-McCluskey Expressions Using Matrix Algebra” Collaborative Research
method with the Number of Literals Center SFB 475 University of Dortmund.

168

You might also like