Skip to content

Quine-McCluskeyJS is a Javascript version of the Quine Mccluskey method for Boolean algebra reduction.

Notifications You must be signed in to change notification settings

PlNG/quine-mccluskeyjs

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

quine-mccluskeyjs

Quine-McCluskeyJS is a Javascript version of the Quine Mccluskey method for Boolean algebra reduction.

In otherwords, this helps you reduce your logical expressions(boolean algebra).

Version

0.9.3

Browser Support

Chrome 12+, IE 8+, Firefox 12+ and Opera 11+

Example

Suppose we have the following if condition.

if( !needsApproval || ( needsApproval && !approvalHasBeenGranted ) ){
	// do something
}

Let A = needsApproval and B = approvalHasBeenGranted. Then the if condition can be expressed as A* + AB*, where * and + represents not and or respectively.

We can use the Quine McCluskey Algorithm to simplify the condition statement.

Convert the condition to a SOP, Sum of Products, form, then to minterms as an object literal.

var userInput = {
	inputs: "A,B",
	minterms:"0,1,2"
};

Next invoke qm.getLeastPrimeImplicants with the user input to get the final form of the SOP.

qm.getLeastPrimeImplicants( userInput ); // returns "A* + B*"

Thus A* + AB* can be simplified to A* + B*, which is the same as (AB)*.

if( !( needsApproval && approvalHasBeenGranted ) ){
	// do something.
}

##Please provide feedback!!##

About

Quine-McCluskeyJS is a Javascript version of the Quine Mccluskey method for Boolean algebra reduction.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%