Simplify boolean expression algorithm

后端 未结 6 1004
无人及你
无人及你 2020-12-18 20:59

Anybody knows of an algorithm to simplify boolean expressions?

I remember the boolean algebra and Karnaught maps, but this is meant for digital hardware where EVERIT

6条回答
  •  青春惊慌失措
    2020-12-18 21:08

    Is the number of possible distinct values finite and known? If so you could convert each expression into a boolean expression. For instance if a has 3 distinct values then you could have variables a1, a2, and a3 where a1 being true means that a == 1, etc. Once you did that you could rely on the Quine-McCluskey algorithm (which is probably better for larger examples than Karnaugh maps). Here is some Java code for Quine-McCluskey.

    I can't speak to whether this design would actually simplify things or make them more complicated, but you might want to consider it at least.

提交回复
热议问题