Thursday, June 25, 2009

Quine-mcCluskey Logic Simplifier

in our fundamentals of logic design course we were required to implement the Quine-mcCluskey tabular method as (a summer project) to simplify boolean function and i was able to implement it using python  so i decided to share it hope it could be useful to some one ...

here is an executabe version for windows..(made using py2exe project)


and here is the python source code files...


it is worth mentioning that the source files consists of :
tabular.py : which the main program is found and u could also execute it from the command line using arguments
gui.py : which is a graphical user interface for the program using tkinter libs
   
features:
  • able to solve Boolean function upto 26 variable (theoretically it can do more but this just a limit that i enforced to be able to represent the variables using A,B,C....Z Notations , of course u can  remove this limit)
  • displaying the prime and essential implicants ( by default the program displays the implicants on letters but u can also change this to display them in numbers )
  • perform petric brute force algorithm to get the best (lowest cost) solution
  • draw the Prime Implicant chart before finding the essential prime implicants and after finding them...
to do :
those are some ideas that may/may not be done...
  • adding column and row dominance simplifying techniques.
  • adding a documentation for tabular.py and more comments to illustrate the algorithms used.
  • adding an interactive mode to solve the problems step by step.
  • adding a karno-map simulation.
  • improving the gui....
  • adding the project to source-forge ?...may be... :)
ScreenShots:
using gui mode



using the command line ( this picture is a part of the output not all of it)



finally... i will really appreciate any feedbacks , bug reports and/or opinions.
please send them to

or here in the comments...
thanks...
           

11 comments:

Douglas Quine said...

A nice item - and posted on what would have been Quine's 101st birthday! www.wvquine.org

Ahmed Kotb said...

what a coincidence :D
thanks for your comment ...

Vivek Thomas said...

Thank you!! Excellent tool!! :)

Anonymous said...

It is useful to try everything in practice anyway and I like that here it's always possible to find something new. :)

Anonymous said...

Hats off to you :)

Anonymous said...

hi, new to the site, thanks.

Anonymous said...

very interesting, thanks

Anonymous said...

tebaek bro..

Anonymous said...

The best Quine-McCluskey software I've found. All others do not have a GUI and requires manual compiling which I do not know how to.

Abhishek said...

In def __getName, i get a compilation error

while n > 0:
name[-1*j]=n%2
n=n/2
j+=1
removeNum = int(math.log(len(group))/math.log(2))

this tries to go to the array location with a negative number, and i dont see how that works

Is this a typo? (i tried to make it just j, but it still had an error

Nicolás da Silva Santamaria said...

This is a very neat tool, simple, powerful and reliable. I would have save myself many hours trying other tools if I had found this before. Awesome.

Did you consider to make the input a bit more flexible? I realized that if there is an empty space after / before the minterms, the system gives me an error (incorrect output). Perhaps triming programatically the leading / trailing spaces of what is left after tokenizing by commas, would help.

Other than that I wouldn't change a "bit" :)

Cheers.

N

5 years of kotbcorp

Two days ago this blog completed its 5th year  :). So congratulations to my self and Thanks for the few followers that have been here for ...