/QuineMcCluskey

A powerful tool for minimizing Boolean functions

Primary LanguagePythonGNU General Public License v3.0GPL-3.0

QuineMcCluskey

Table of Contents

Introduction
Requirements
Usage
Resources
License

Quine–McCluskey Algorithm Python Library

Welcome to the Quine–McCluskey Python library – a powerful tool for minimizing Boolean functions with ease! Developed by Willard V. Quine and extended by Edward J. McCluskey, this algorithm is your go-to method for simplifying Boolean expressions efficiently.

Installation

Now you can install the Quine–McCluskey Python library using pip. Just run the following command:

pip install simpliqm

Getting Started

Once installed, you can leverage the library's public API directly from Python. Two essential functions are at your disposal:

  1. minimize: Minimize Boolean functions with the provided minterms and optional don't care terms.
  2. format_minimized_expression: Format the minimized expression for clearer representation.

Command Line Interface

Additionally, the library provides a convenient command-line interface. After installation, you can use the 'qm' entry point directly from the terminal:

qm

Requirements

Ensure you have Python version 3.6 or higher installed to use this library.

Usage

From Python:

from simpliqm import minimize, format_minimized_expression

n_bits = 4
minterms = [0, 1, 2, 4, 8, 10, 12, 15]
xterms = [5, 6]

minimized_result = minimize(n_bits, minterms, xterms)
formatted_result = format_minimized_expression(minimized_result)

print(f"Minimized Expression: {formatted_result}")

From the Terminal:

qm

Follow the prompts to input your Boolean function details.

Minimization Gif

Resources

License

This project is licensed under the GNU General Public License v3.0.