I want to simplify this expression:
BooleanMinimize[(A ∧ ¬ B ∧ C ∧ ¬ D) ∨ (A ∧ B ∧ ¬ C ∧ ¬ D) ∨ (A ∧ B ∧ C ∧ ¬ D)]
And I get this:
(A ∧ B ∧ ¬ D) ∨ (A ∧ C ∧ ¬ D)
But using a Karnaugh Map and "don't cares" I get ¬ D
. Is there anyway that I can get similar answer in Mathematica?
Answer
An arbitrary function with "don't cares" can be defined using either BooleanFunction
or BooleanConvert
, but in those cases, Mathematica makes no effort to find the minimal representation of such a function.
Instead, use BooleanMinimize
with the optional third argument: an assumed condition on the variables. In your case, you can specify that your "don't cares" are 0-9 by making the condition be A ∧ (B ∨ C)
.
Then the calculation
BooleanMinimize[
(A ∧ ¬ B ∧ C ∧ ¬ D) ∨ (A ∧ B ∧ ¬ C ∧ ¬ D) ∨ (A ∧ B ∧ C ∧ ¬ D),
"DNF",
A ∧ (B ∨ C)]
will produce the desired output of !D
.
Comments
Post a Comment