ahmed-alllam / AlphaLogos

Boolean Function Analyzer and Synthesis Optimization Tool
http://alpha-logos-1464863388.eu-west-3.elb.amazonaws.com/
MIT License
1 stars 0 forks source link

Implementing a function to return the EPIs (Essential Prime Implicants) #32

Closed Hamdy1337 closed 1 year ago

Hamdy1337 commented 1 year ago

Is your feature request related to a problem? Please describe. Yes, to use the Quine McCluskey method it's necessary to determine Essential Prime Implicants (EPIs) from a set of Prime Implicants (PIs).

Describe the solution you'd like I would like a feature that allows users to input the generated PIs and store them in an array of strings (bits) and compare each string with each other like the way in the method to narrow down and get to those which differ only in a single bit. We do this process recursively to return the EPIs given the PIs.

Describe alternatives you've considered Another alternative is to split the PIs given into different arrays of strings, each array containing strings with the same number of 1 bits, and we do the process mentioned above between each set of possible arrays (strings that have one bit difference from another string). This is not yet tested, but would probably make for a better and more efficient implementation of the function.

ahmed-alllam commented 1 year ago

Just a note regarding your proposed solutions, strings are not used as the data structure for minterms or implicants, instead we are using a separate struct to store the PIs called Implicant. Also, please refer to implicant.h and prime_implicants.cpp for more information about the approach already used throughout the project.


Another alternative is to split the PIs given into different arrays of strings, each array containing strings with the same number of 1 bits, and we do the process mentioned above between each set of possible arrays (strings that have one bit difference from another string)

Compare each string with each other like the way in the method to narrow down and get to those which differ only in a single bit.

I believe what you are mentioning in both of the described solutions is the algorithm to convert minterms to prime implicants (PIs), NOT the Essential Prime Implicants (EPIs). This algorithm is already implemented in the generation of PIs contained in the file mentioned above. However, to get the EPIs, you would typically need to get the list of PIs where each PI has at least one minterm that is only covered by that PI, hence it is essential. Also for more information about the algorithm refer back to Lecture 8 slides of Dr Shalan.