Boolean Basics

The Quine-McCluskey method

The Quine McCluskey method is preferable for boolean expressions with a large number of variables, beyond five variables other method becomes very unwieldy and difficult to manage.

Although the k-map or karnaugh map is by far the simpler method for obtaining an optimal boolean expression and the Quine McCluskey technique, in comparison, is really quite unwieldy involving the use of several tables and a process of mathematical deduction, never the less, as a systematic procedure it greatly reduces the complexity of the process of finding an optimal boolean expression, and it is far more effective than the karnaugh method when dealing with more complicated logic.

Our expression is a boolean function in four variables, which evaluate to 1 on the values 0,1,2,3,6,7,8,9,14,15. Our variables will be expressed in their binary form for succinctness. This expression effectively says that the output function f will be 1 for the given minterms.

f(a,b,c,d) = Σ m(0,1,2,3,6,7,8,9,14,15)

Our first step is to write out a table of our minterms and count the 1's required for each binary representation:

mintermbinary№ of 1's
000000
100011
200101
300112
601102
701113
810001
910012
1411103
1511114
Groupmintermabcd№ 1's
0000000
11
2
8
0001
0010
1000
1
23
6
9
0011
0110
1001
2
37
14
0111
1110
3
41511114
a green tick check mark a green tick check mark a green tick check mark a green tick check mark a green tick check mark a green tick check mark a green tick check mark a green tick check mark a green tick check mark a green tick check mark

The next table will be generated by matching the minterms in group n with the minterms in group n+1, whilst following some simple rules for when to negate a term and how to formulate the new resultant expression. The two terms should not differ in any more than one position. In comparing terms if there is one difference between the two values, only then do we transfer that term to our new table, the digit that differed will now be represented by a dash. The reason for this will become clear as we explore how this allows us to remove variables from each logical term that is transferred.

For our first comparison we have 0000 compared to 0001, which in boolean algebra appears as follows:

a·b·c·d + a·b·c·d = a·b·c·(d+d) = a·b·c

Which we write into the table as 000_ seen in the third cell of the first row of our next table. Moving onto the second row in the comparison between minterm 1 and 6 we find our first instance of a term that can not be transferred, there are three digits that differ between these expressions, as such we must ignore them and we will not include (1,6) in the new table. It can be useful whilst making these tables to tick off terms as they are used as we will need to insure that every term is used at some point.

Groupmintermabcd
0(0,1)
(0,2)
(0,8)
000_
00_0
_000
1(1,3)
(1,9)
(2,3)
(2,6)
(8,9)
00_1
_001
001_
0_10
100_
2(3,7)
(6,7)
(6,14)
0_11
011_
_110
3(7,15)
(14,15)
_111
111_
a green tick check mark a green tick check mark a green tick check mark a green tick check mark a green tick check mark a green tick check mark a green tick check mark a green tick check mark a green tick check mark a green tick check mark a green tick check mark a green tick check mark a green tick check mark

Once the table is complete we can check off all of our terms by ticking them to see that none have been missed, if a term has not been checked off, then it will need to be kept aside as it will be required in our final table.

Again we make a new table, performing the same operations to generate each term excepting that this time we must also check the position of the dash, representing a previously coupled pair of digits, therefore the dash must also be in the same position in both terms, for it not to be counted as a difference. Once again we look for expressions in which only one digit differs between the two.

Groupmintermabcd
0(0,1,2,3)
(0,1,8,9)
00__
_00_
1(2,3,6,7)
0_1_
2(6,7,14,15)_11_

Whilst making this table we might observe that the grouping (0,2,1,3) does generate a term, however as it is the case that all of the variables within this term have already been used, we have no need to write it down, but we can tick the term off of our list; The same goes for (0,8,1,9). This completes our table and there are no further reduction by the grouping of temrs that can be made so no other table is required. There may be cases where another table could have been used here.

Prime Implicant Table

Moving on to the next step, this next table is known as the prime implicant table. The first thing that we need to add to this final table are any of the groups from any of the previous tables that have not yet been ticked. As in our example we do not have any un-ticked terms in any of our previous tables, and all of the terms in the last table are as expected, irreducible; we will now move these over to our prime implicant table.

The next step is to mark any of the variables which appear in the table in only one term thus only one single appearance, we will put a tick next to the term and a ring around the X, these particular prime implicants are essential and will be used in the final expression. We can now go on to mark any of the variables contained within these terms by putting a red dash through them in the table header, these have already been included in the expressoin and as such are no longer expressly required.

PIminterm012367891415
a·b(0,1,2,3)XXXX
b·c(0,1,8,9)XXXX
a·c(2,3,6,7)XXXX
b·c(6,7,14,15)XXXX
a green tick check mark a green tick check mark red strike through mark red strike through mark red strike through mark red strike through mark red strike through mark red strike through mark red strike through mark red strike through mark green hand drawn circle green hand drawn circle green hand drawn circle green hand drawn circle
P1minterm23
a·b(0,1,2,3)XX
a·c(2,3,6,7)XX

From this table we generate a reduced prime implicant table in which we put only those variables that have not been highlighted in the previous tables' header and transfer over to this any terms that reference any or all of those variables.

The Result

To arrive at our final answer we will take all the essential prime implicate terms previously marked with a tick along with any terms in our final table such that we have include all of the specified variables, in our case we can choose either one of two terms, both cover all of the variables. From these we can construct our final expression; Which could be either one of the following:

b·c+b·c+a·b

or

b·c+b·c+a·c


Karnaugh map

In order to prove that this method has worked, we can also solve this using the k-map method, note that the cells have been numbered with subscript numerals to denote our variables, whereas the order of the k-map is defined using grey code.

cd
ab00011110
001 ₀1 ₁1 ₃1 ₂
010 ₄0 ₅1 ₇1 ₆
110 ₁₂0 ₁₃1 ₁₅1 ₁₄
101 ₈1 ₉0 ₁₁0 ₁₀
A red rectangle that is four cells wide. A green rectangle that is two by two cells. A blue half rectangle that covers two cells that is open at its top edge. A blue half rectangle that has been rotated by 180 degrees to cover two cells that is open at its bottom edge.

b·c + b·c + a·b


Quine-McCluskey ~ `Don't Care` Terms

f(w,x,y,z) = Σm(1,3,13,15) + Σd(8,9,10,11)

We need to know how to deal with expressions when they comprise of variables in which we have no interest, or otherwise said, 'don't care' terms. We will start by laying out our terms for reference again. This time we will clearly separate those minterms in which we have an interest and those about which we do not care, marking each with an asterisk.

mintermwxyz№ of 1's
100011
300112
1311013
1511114
8*10001
9*10012
10*10102
11*10113
Groupmintermwxyz№ of 1's
11
8*
0001
1000
1
23
9*
10*
0011
1001
1010
2
313
11*
1101
1011
3
41511114
a green tick check mark a green tick check mark a green tick check mark a green tick check mark a green tick check mark a green tick check mark a green tick check mark a green tick check mark

Once again we redefine our table using the terms ordered by the number of 1's in each binary word, in increasing order, then we precede to move over to the next table any variables in adjacent groups that differ by no more than one digit.

Groupmintermwxyz
1(1,3)
(1,9*)
(8*,9*)
(8*,10*)
00_1
_001
100_
10_0
2(3,11*)
(9*,13)
(9*,11*)
(10*,11*)
_011
1_01
10_1
101_
3(13,15)
(11*,15)
11_1
1_11
a green tick check mark a green tick check mark a green tick check mark a green tick check mark a green tick check mark a green tick check mark a green tick check mark a green tick check mark a green tick check mark a green tick check mark
Groupmintermwxyz
1(1,3,9*,11*)
(8*,9*,10*,11*)
_0_1
10__
2(9*,13,11*,15)1__1

The expressions (1,9*,3,11*) and (8*,10*,9*,11*) already have all of their terms grouped in our next table, so there is no need for us to rewrite it, but still put a tick beside the terms used, to denote having observed them and any others that similarly have already been covered. Once our table is formed we can then check to see whether any groups of eight terms can be made, for this we would require that two underscores be found in the same place in two expressions.

Prime Implicant Table

From these tables we can now form our first prime implicant table, this time we will not write any of the exclusivly don't care terms. As none of our terms in previous tables priorto the last have not been ticked, we will not need to bring in any terms from those. Our second minterm expression in the last table is comprised of only terms that we do not care about and as such we will ignore it, using only those expressions that contain the terms that we are intersted by.

PIminterm131315
x·z(1,3,9*,11*)XX
w·z(9*,13,11*,15)XX
green hand drawn circle green hand drawn circle green hand drawn circle green hand drawn circle a green tick check mark a green tick check mark

Resulting Expression

f(w,x,y,z) = x·z + w·z


Karnaugh map

Once again to be certain of this method, we will check our result against a k-map. Here 'd' represents variables that we do not care about and _ are simply not in the expression.

yz
wx00011110
00_ ₀1 ₁1 ₃_ ₂
01_ ₄_ ₅_ ₇_ ₆
11_ ₁₂1 ₁₃1 ₁₅_ ₁₄
10d ₈d ₉d ₁₁d ₁₀
A green rectangle that is two by two cells. A blue half rectangle that covers two cells that is open at its top edge. A blue half rectangle that has been rotated by 180 degrees to cover two cells that is open at its bottom edge.

x·z + w·z