Simplify boolean expression i.t.o variable occurrence

半城伤御伤魂 提交于 2019-12-07 14:16:20

问题


How to simplify a given boolean expression with many variables (>10) so that the number of occurrences of each variable is minimized?

In my scenario, the value of a variable has to be considered ephemeral, that is, has to recomputed for each access (while still being static of course). I therefor need to minimize the number of times a variable has to be evaluated before trying to solve the function.

Consider the function

f(A,B,C,D,E,F) = (ABC)+(ABCD)+(ABEF)

Recursively using the distributive and absorption law one comes up with

f'(A,B,C,E,F) = AB(C+(EF))

I'm now wondering if there is an algorithm or method to solve this task in minimal runtime.

Using only Quine-McCluskey in the example above gives

f'(A,B,C,E,F) = (ABEF) + (ABC)

which is not optimal for my case. Is it save to assume that simplifying with QM first and then use algebra like above to reduce further is optimal?


回答1:


Try Logic Friday 1

It features multi-level design of boolean circuits.

For your example, input and output look as follows:




回答2:


I usually use Wolfram Alpha for this sort of thing.




回答3:


You can use an online boolean expression calculator like https://www.dcode.fr/boolean-expressions-calculator

You can refer to Any good boolean expression simplifiers out there? it will definitely help.



来源:https://stackoverflow.com/questions/18474607/simplify-boolean-expression-i-t-o-variable-occurrence

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!