Computer Codes For Quine-Mcclusky (QM) Minimization Method: Three Variable Problem
Computer Codes For Quine-Mcclusky (QM) Minimization Method: Three Variable Problem
Minimization Method
The QM method is useful in minimizing logic expressions for larger number of variables
when compared with minimization by Karanugh Map or Boolean Algebra. Refer to
Section 3.9 of the book Digital Principles and Applications 6e by Leach, Malvino and
Saha, TMH, 2006 for details. The C source codefor QM algorithm is given in the
adjoining file QMdpa6.c file. The screenshots of execution of this code after compilation
in Windows VC++ are presented here for 3, 4 and 5 variable examples. You can extend it
for any number of variables in a similar manner.
F(A,B,C) = m(2,5,6,7)
The program when executed first asks no. of variables to be minimized. For this example,
since 3 variables A, B, C are present, you have to write ‘3’ and press ENTER. The
program then gives how it designates input variables e.g. A will be represented as a[2], B
as a[1] and C as a[0].
The program then asks the no. of minterms in the truth table which for this problem is to
be given as ‘4’ and then key ENTER pressed. Next, it asks you to give minterms one at a
time. This you do for this problem by giving as ‘2’ then ENTER, ‘5’ then ENTER, ‘6’
then ENTER and ‘7’ followed by ENTER. At this point, the program will not ask any
more minterm to be entered as all 4 are provided and essential prime implicants appear in
terms of a[i] i.e. a[2], a[1] and a[0]. By reverse substitution of these to input variables
A,B,C i.e. a[2] = A, a[1] = B and a[0] = C and combining we get minimized expression.
Now for this problem, essential prime implicants appear as a[1]a[0]’ and a[2]a[0] which
are BC’ and AC
Compare this with the result you get by Karnaugh Map minimization. They are same.
F(A,B,C,D) = m(0,1,2,3,10,11,12,13,14,15)
We follow the steps given for 3-variable problem. No of variables will be ‘4’, no. of
minterms ‘10’ and they are as given above.
After minimization essential prime implicants are given as a[3]’a[2]’, a[2]’a[1] and
a[3]a[2].
F(A,B,C,D,E) = m(0,1,2,3,4,5,6,7,28,29,30,31)
The essential prime implicants by the given code are given as a[4]’a[3]’ and a[4]a[3]a[2].
The minimized expresiion from previous discussion F(A,B,C,D,E) = A’B’ + ABC. The
screenshot for this example is given next.
It is left to the reader to find out if the above relation is correct and also use this code to
minimize truth tables of 6 or more variables.