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

Computer Codes For Quine-Mcclusky (QM) Minimization Method: Three Variable Problem

The document describes computer source code for implementing the Quine-McCluskey (QM) method for minimizing logic expressions. The code is run through examples of minimizing 3, 4, and 5 variable logic functions. For each example, the steps of the QM algorithm are described, including representing the function as minterms, running the code to find essential prime implicants, substituting variables, and obtaining the minimized expression. The results match what would be obtained through Karnaugh map minimization. Modifications to the code are suggested to display all possible minimized expressions when more than one solution exists.
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)
123 views4 pages

Computer Codes For Quine-Mcclusky (QM) Minimization Method: Three Variable Problem

The document describes computer source code for implementing the Quine-McCluskey (QM) method for minimizing logic expressions. The code is run through examples of minimizing 3, 4, and 5 variable logic functions. For each example, the steps of the QM algorithm are described, including representing the function as minterms, running the code to find essential prime implicants, substituting variables, and obtaining the minimized expression. The results match what would be obtained through Karnaugh map minimization. Modifications to the code are suggested to display all possible minimized expressions when more than one solution exists.
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

Computer Codes for Quine-McClusky(QM)

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.

Three variable problem:


Refer to Truth Table of Fig. 3.36 (page 111) of the above referenced book. The truth
table can be represented by minterms as

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

Hence, minimzed expression is F(A,B,C) = BC’ + AC

Compare this with the result you get by Karnaugh Map minimization. They are same.

The screenshot of the code when executed is given next.


Will the result change if minterms are given in different order, say 6, 2, 5, 7. Of course,
not. Please check yourself by running this code and giving same minterms in various
order.

Four variable problem


For this let us use the truth table given in Table 3.10, page 103 of the same book. Now
the minterms are

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].

On substitution of a[3] = A, a[2] = B, a[1] = C and a[0] = D and combining we get


minimized expression as

F(A,B,C,D) = A’B’ + B’C + AB

The screenshot for this is shown next.


Compare this result with the one explained as example in Section 3.9. The result matches
but this code gives only one set of minimized expression from probable two. Modify this
code so that when there are more no. of solutions i.e. same level of minimization, all of
them are displayed by the computer code.

Five variable problem:


Minimization by Karnaugh Map method is difficult for 5 or more variables. Let us take
one example of a 5 variable minimization problem truth table of which can be
represented by minterms as follows

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.

You might also like