Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Quine–McCluskey algorithm
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
===Step 1: Finding the prime implicants=== First, we write the function as a table (where 'x' stands for don't care): :{| class="wikitable" |- ! !! A !! B !! C !! D !! f |- | m0 || 0 || 0 || 0 || 0 || 0 |- | m1 || 0 || 0 || 0 || 1 || 0 |- | m2 || 0 || 0 || 1 || 0 || 0 |- | m3 || 0 || 0 || 1 || 1 || 0 |- | m4 || 0 || 1 || 0 || 0 || 1 |- | m5 || 0 || 1 || 0 || 1 || 0 |- | m6 || 0 || 1 || 1 || 0 || 0 |- | m7 || 0 || 1 || 1 || 1 || 0 |- | m8 || 1 || 0 || 0 || 0 || 1 |- | m9 || 1 || 0 || 0 || 1 || x |- | m10 || 1 || 0 || 1 || 0 || 1 |- | m11 || 1 || 0 || 1 || 1 || 1 |- | m12 || 1 || 1 || 0 || 0 || 1 |- | m13 || 1 || 1 || 0 || 1 || 0 |- | m14 || 1 || 1 || 1 || 0 || x |- | m15 || 1 || 1 || 1 || 1 || 1 |} One can easily form the canonical [[sum of products]] expression from this table, simply by summing the [[minterm]]s (leaving out [[Don't-care (logic)|don't-care terms]]) where the function evaluates to one: :''f''{{sub|A,B,C,D}} = A'BC'D' + AB'C'D' + AB'CD' + AB'CD + ABC'D' + ABCD. which is not minimal. So to optimize, all minterms that evaluate to one are first placed in a minterm table. Don't-care terms are also added into this table (names in parentheses), so they can be combined with minterms: :{| class="wikitable" |- ! Number<br/>of 1s !! Minterm !! Binary<br/>Representation |- | rowspan="2" | 1 | m4 || {{mono|0100}} |- | m8 || {{mono|1000}} |- | rowspan="3" | 2 | (m9) || {{mono|1001}} |- | m10 || {{mono|1010}} |- | m12 || {{mono|1100}} |- | rowspan="2" | 3 | m11 || {{mono|1011}} |- | (m14) || {{mono|1110}} |- || 4 | m15 || {{mono|1111}} |} At this point, one can start combining minterms with other minterms in adjacent groups; as in, we compare minterms in nth group with (n+1)th group. So for the m4 minterm in with only one Number of 1s, we compare it to m9, m10, and m12 which have two Number of 1s. If two terms differ by only a single digit, that digit is replaced with a dash indicating that the digit doesn't matter. For instance <code>1000</code> and <code>1001</code> can be combined to give <code>100-</code>, indicating that both minterms imply the first digit is <code>1</code> and the next two are <code>0</code>. Terms that can't be combined any more are marked with an asterisk ({{color|red|*}}). :{| class="wikitable" |- ! Number<br/>of 1s !! Minterm !! 0-Cube !! colspan="2" | Size 2 Implicants |- | rowspan="4" | 1 | m4 || {{mono|0100}} || m(4,12) || {{mono|-100 {{color|red|*}}}} |- | m8 || {{mono|1000}} || m(8,9) || {{mono|100-}} |- | colspan="2" {{sdash}} || m(8,10) || {{mono|10-0}} |- | colspan="2" {{sdash}} || m(8,12) || {{mono|1-00}} |- | rowspan="4" | 2 | m9 || {{mono|1001}} || m(9,11) || {{mono|10-1}} |- | m10 || {{mono|1010}} || m(10,11) || {{mono|101-}} |- | colspan="2" {{sdash}} || m(10,14) || {{mono|1-10}} |- | m12 || {{mono|1100}} || m(12,14) || {{mono|11-0}} |- | rowspan="2" | 3 | m11 || {{mono|1011}} || m(11,15) || {{mono|1-11}} |- | m14 || {{mono|1110}} || m(14,15) || {{mono|111-}} |- | rowspan="1" | 4 | m15 || {{mono|1111}} || colspan="2" {{sdash}} |} When going from Size 2 to Size 4, treat <code>-</code> as a third bit value. Match up the <code>-</code>'s first. The terms represent products and to combine two product terms they must have the same variables. One of the variables should be complemented in one term and uncomplemented in the other. The remaining variables present should agree. So to match two terms the <code>-</code>'s must align and all but one of the other digits must be the same. For instance, <code>-110</code> and <code>-100</code> can be combined to give <code>-1-0</code>, as can <code>-110</code> and <code>-010</code> to give <code>--10</code>, but <code>-110</code> and <code>011-</code> cannot since the <code>-</code>'s do not align. <code>-110</code> corresponds to BCD' while <code>011-</code> corresponds to A'BC, and BCD' + A'BC is not equivalent to a product term. :{| class="wikitable" |- ! Number<br/>of 1s !! Minterm !! 0-Cube !! colspan="2" | Size 2 Implicants !! colspan="2" | Size 4 Implicants |- | rowspan="4" | 1 | m4 || {{mono|0100}} || m(4,12) || {{mono|-100 {{color|red|*}}}} ||colspan="2" {{sdash}} |- | m8 || {{mono|1000}} || m(8,9) || {{mono|100-}} || m(8,9,10,11) || {{mono|10-- {{color|red|*}}}} |- | colspan="2" {{sdash}} || m(8,10) || {{mono|10-0}} || m(8,10,12,14) || {{mono|1--0 {{color|red|*}}}} |- | colspan="2" {{sdash}} || m(8,12) || {{mono|1-00}} ||colspan="2" {{sdash}} |- | rowspan="4" | 2 | m9 || {{mono|1001}} || m(9,11) || {{mono|10-1}} ||colspan="2" {{sdash}} |- | m10 || {{mono|1010}} || m(10,11) || {{mono|101-}} || m(10,11,14,15) || {{mono|1-1- {{color|red|*}}}} |- | colspan="2" {{sdash}} || m(10,14) || {{mono|1-10}} ||colspan="2" {{sdash}} |- | m12 || {{mono|1100}} || m(12,14) || {{mono|11-0}} ||colspan="2" {{sdash}} |- | rowspan="2" | 3 | m11 || {{mono|1011}} || m(11,15) || {{mono|1-11}} ||colspan="2" {{sdash}} |- | m14 || {{mono|1110}} || m(14,15) || {{mono|111-}} ||colspan="2" {{sdash}} |- | rowspan="1" | 4 | m15 || {{mono|1111}} || colspan="2" {{sdash}} | colspan="2" {{sdash}} |} Note: In this example, none of the terms in the size 4 implicants table can be combined any further. In general, this process is continued in sizes that are powers of 2 (sizes 8, 16 etc.) until no more terms can be combined.
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)