Skip to content

An implementation of Quine–McCluskey algorithm and Petrick's method with Rust.

License

Notifications You must be signed in to change notification settings

zhcHoward/R-QMC

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

R-QMC

A implementation for simplifying boolean algebra expressions using Quine–McCluskey algorithm and Petrick's method in Rust.

Introduction

This binary takes minterms and not cares as inputs and prints simplified minterms. Sometimes, the result is not unique. So, you may get different results with the same input. For example, for expression f(A,B,C,D) = Σm(4,8,10,11,12,15) + d(9,14), the result can be BC'D' + AB' + AC or BC'D' + AD' + AC'.

Algorithm & Implementation

The details of the 2 main algorithm can be found in the wiki links metioned before.

  • qmc.rs implements Quine–McCluskey algorithm.
  • petrick.rs implements petrick's method.
  • term.rs defines Term which forms minterms.

Example

To simplify boolean algebra expressions of minterms 4,8,10,11,12,15 and not cares 9,14, simply run command:

rqmc --min 4 8 10 11 12 15 --not-care 9 14

The output will be:

Result: [*100, 1**0, 1*1*]

In the output, '*' means the variable on that position has been simplified. So *100 means BC'D' and the result is BC'D' + AD' + AC.

About

An implementation of Quine–McCluskey algorithm and Petrick's method with Rust.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages