Icas 2008 11
Icas 2008 11
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
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.
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