Coder Social home page Coder Social logo

quine-mccluskey-algorithm's People

Contributors

simsso avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

ideahat tubbz-alt

quine-mccluskey-algorithm's Issues

Minification of truth table with many don't-care fields

Issue Description

For the appended input the output is correct, but not fully minified. Right now it seems like the bug is within the Quine-McCluskey implementation, more specifically in the way it deals with don't-care fields (X) and the number of different columns between two rows that of which at least one contains a don't-care field.

E.g. the two rows

I7 I6 I5 I4 I3 I2 I1 I0 O1
0 1 X X X X X X 1
1 X X X X X X X 1

should result in I7 + I6 not in !I7 * I6 + I7.

Input

I7 I6 I5 I4 I3 I2 I1 I0 O1
0 0 0 0 0 0 0 0 0 
0 0 0 0 0 0 0 1 0
0 0 0 0 0 0 1 X 0
0 0 0 0 0 1 X X 1
0 0 0 0 1 X X X 1
0 0 0 1 X X X X 0
0 0 1 X X X X X 0
0 1 X X X X X X 1
1 X X X X X X X 1

Output

Current Version

O1 = !I7 * !I6 * !I5 * !I4 * !I3 * I2 + !I7 * !I6 * !I5 * !I4 * I3 + !I7 * I6 + I7

Table format

I7 I6 I5 I4 I3 I2 I1 I0 O1
0 0 0 0 0 1 X X 1
0 0 0 0 1 X X X 1
0 1 X X X X X X 1
1 X X X X X X X 1

Desired

O1 = I7 + I6 + !I5 * !I4 * I3 + !I5 * !I4 * I2

Removal of non-essential prime implicants

Issue description

The current implementation does not remove non-essential prime implicants. A final processing of the output table with the Petrick's method (https://en.wikipedia.org/wiki/Petrick%27s_method) would minify all remaining prime implicants properly.

Example input

Example input resulting in an output that is not entirely minified.

D C B A X
0 0 0 0 0
0 0 0 1 1
0 0 1 0 1
0 0 1 1 1
0 1 0 0 0
0 1 0 1 1
0 1 1 0 0
0 1 1 1 0
1 0 0 0 0
1 0 0 1 0
1 0 1 0 1
1 0 1 1 1
1 1 0 0 0
1 1 0 1 1
1 1 1 0 0
1 1 1 1 0

Output comparison

Original output After implementing Petrick's method
D C B A X D C B A X
0 0 X 1 1 0 0 X 1 1
0 X 0 1 1 not necessary
X 0 1 X 1 X 0 1 X 1
X 1 0 1 1 X 1 0 1 1

Screenshot

image

Second example (from Wikipedia)

C B A X
0 0 0 1
0 0 1 1
0 1 0 1
0 1 1 0
1 0 0 0
1 0 1 1
1 1 0 1
1 1 1 1

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.