我正在使用sympy库。我可以用最小项来计算SOP
>>> from sympy.logic import POSform
>>> from sympy import symbols
>>> w, x, y, z = symbols('w x y z')
>>> minterms = [[0, 0, 0, 1], [0, 0, 1, 1], [0, 1, 1, 1], [1, 0, 1, 1], [1, 1, 1, 1]]
>>> dontcares = [[0, 0, 0, 0], [0, 0, 1, 0], [0, 1, 0, 1]]
>>> POSform([w, x, y, z], minterms, dontcares)
And(Or(Not(w), y), z)
我需要帮助从布尔表达式计算最小项。在
检查链接Simplification and equivalence-testing,在
Simplification and equivalence-testing
下可以找到函数simplify()
。我希望它能帮你解决问题。在相关问题 更多 >
编程相关推荐