that the output function f will be 1 for the minterms and (denoted by the 'm' term) and that we don't care about the output for and combinations (denoted by the 'd' term). Step 1: finding 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 minterms (leaving out don't-care terms) where the function evaluates to one: f = 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" |- ! Numberof 1s !! Minterm !! BinaryRepresentation |- | rowspan="2" | 1 | m4 || |- | m8 || |- | rowspan="3" | 2 | (m9) || |- | m10 || |- | m12 || |- | rowspan="2" | 3 | m11 ||