M-tech Blog About me

Circuit generation - a simple solution will do

Bell labs developed LGen (Algen). The goal was to simplify logic circuits to produce next generation logic circuits.

Seeing this idea led me to think how to simplify boolean functions automatically. The interesting part is that we can simplify boolean functions like we simplify equations in mathematics!

Karnaugh map to the rescue

I wrote a short program which takes boolean expressions and attempts to reduce them to a simpler form.

The implementation turned out to be much less sophisticated than I originally expected. I used Karnaugh maps to simplify boolean expressions. There are no complex theorems, just identify all rectangles and validate one edge case, where the rectangles wrap around edges.

People sometimes spend time searching for complex solutions, when the simplest one does the trick.

Bonus chatter

In my original code I wrote very short function names, for example kmap2dnf. One of my friends was amused to see function to run Karnaugh simplification. Following this convention we get runkmap. Unfortunately, this function forms a perfectly valid Swedish word.