I have a truth table for a Boolean expression represented like this
table={{0, 0, 0, 0} -> 0, {0, 0, 0, 1} -> 0, {0, 0, 1, 0} ->
0, {0, 0, 1, 1} -> 0, {0, 1, 0, 0} -> 0, {0, 1, 0, 1} ->
0, {0, 1, 1, 0} -> 0, {0, 1, 1, 1} -> 1, {1, 0, 0, 0} ->
1, {1, 0, 0, 1} -> 1, {1, 0, 1, 0} -> 1, {1, 0, 1, 1} ->
1, {1, 1, 0, 0} -> 1, {1, 1, 0, 1} -> 1, {1, 1, 1, 0} ->
1, {1, 1, 1, 1} -> 0}
(all on one line)
The table contains the values I want at the output given y4,y3,y2,y1 at the input, i.e.
{y4,y3,y2,y1} -> desiredOutput
What is the best way to transform this data into a form that can be then processed in terms of y with functions such as BooleanMinimize?
table
, you could do it as follows:(func[#1] = #2) & @@@ table;
and then you can easily callfunc[{1, 0, 1, 0}]
. Does that help? $\endgroup$