Content deleted Content added
Made the syntax of the pseudo code more consistent. Also fixed the psudeocode of the algorithm |
|||
Line 196:
The pseudocode below recursively computes the prime implicants given the list of minterms of a boolean function. It does this by trying to merge all possible minterms and filtering out minterms that have been merged until no more merges of the minterms can be performed and hence, the prime implicants of the function have been found.
// Computes the prime implicants from a list of minterms.
// each minterm is of the form "1001", "1010", etc and can be represented with a string.
'''function''' getPrimeImplicants(list minterms) '''is'''
primeImplicants ← empty list
Line 227:
'''else'''
'''return''' getPrimeImplicants(primeImplicants)
In this example the <code>CheckDashesAlign</code> and <code>CheckMintermDifference</code> functions perform the necessary checks for determining whether two minterms can be merged. The function <code>MergeMinterms</code> merges the minterms and adds the dashes where necessary. The utility functions below assume that each minterm will be represented using strings.
'''function''' MergeMinterms(minterm1, minterm2) '''is'''
mergedMinterm ← empty string
|