You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Current prime implicant finding uses an algorithm that works out to be O(|nonzero miniterms|^2) time.
However, it's possible to get prime implicants in O(|nonzero miniterms|) time using a set instead of explicit comparisons:
current = {"0000", "1001", ...}
primImps = set()
while current:
nxt = set()
for c in current:
added = False
for i, old in enumerate(c):
for new in "01x":
if old == new:
continue
d = c[:i] + new + c[i+1:]
if d in current:
n = "".join(x if x == y else 'x' for x,y in zip(c,d))
nxt.add(n)
added = True
if not added:
primImps.add(c)
current = nxt
(Well, technically there's a O(|miniterm|) factor in there - but that's present regardless.)
This (drastically) speeds up larger problems.
The text was updated successfully, but these errors were encountered:
Current prime implicant finding uses an algorithm that works out to be O(|nonzero miniterms|^2) time.
However, it's possible to get prime implicants in O(|nonzero miniterms|) time using a set instead of explicit comparisons:
(Well, technically there's a O(|miniterm|) factor in there - but that's present regardless.)
This (drastically) speeds up larger problems.
The text was updated successfully, but these errors were encountered: