A robust tool that simplifies 3-variable Boolean expressions using Karnaugh Map (K-map) logic. This project provides two separate implementations: one for the Arduino platform with a serial interface, and another for an 8051 (AT89S52) microcontroller with a keypad for input and an LCD for output.
This project was developed to provide a practical demonstration of digital logic simplification on embedded systems. It takes a set of minterms for a 3-variable (A, B, C) Boolean function and outputs the minimized Sum-of-Products (SOP) expression.
The core logic is based on the Karnaugh Map method, systematically identifying groups of 4 (quads), 2 (pairs), and 1 (singletons) to find the most simplified logical expression.
- K-Map Logic: Implements the simplification algorithm by finding essential prime implicants.
- Dual Implementations:
- Arduino: Easy-to-use interface via the Serial Monitor. Displays the full truth table, original SOP, and simplified SOP.
- 8051: Standalone embedded system using a 4x3 keypad and a 16x2 LCD.
- Handles All Cases: Correctly simplifies any combination of minterms from 0 to 7, including the edge cases for functions that are always
0or1. - Proteus Simulation: Includes a complete Proteus simulation file for the 8051 circuit, allowing for virtual testing without physical hardware.
This repository contains two versions of the project.
This version is designed for quick testing and detailed output. It communicates with a computer via a USB connection and the Arduino IDE's Serial Monitor.
- An Arduino board (e.g., Arduino Uno, Nano)
- USB Cable
- Open the
Arduino_implementation/boolean_simplifier.cfile in the Arduino IDE. - Select your board and port from the Tools menu.
- Upload the sketch to your Arduino.
- Open the Serial Monitor (Ctrl+Shift+M) and set the baud rate to 9600.
- Enter the minterms you want to simplify, separated by spaces (e.g.,
1 3 4 5 7), and press Enter. - The Arduino will print the truth table, the full SOP expression, and the final simplified expression.
This is a standalone hardware implementation that does not require a computer to operate once programmed. It's ideal for a dedicated lab tool.
- AT89S52 Microcontroller
- 16x2 LCD Display
- 4x3 Matrix Keypad
- 11.0592 MHz Crystal Oscillator with two 33pF capacitors
- Power supply components (capacitors, resistors)
- Keil µVision IDE (for compiling the C code)
- Proteus Design Suite (for running the simulation)
- An 8051 programmer (if building physical hardware)
- Open the
8051_simplifier/proteus_simulation/embedded.pdsprjfile in Proteus. - Double-click the AT89S52 microcontroller component.
- In the properties window, click the folder icon next to "Program File" and navigate to the
8051_simplifier/boolean_simplifier.hexfile. - Click OK to load the hex file.
- Run the simulation (
▶️ button). - Use the virtual keypad to enter minterms (0-7).
- Press the '#' key to calculate. The simplified expression will be displayed on the LCD.
The simplification logic for both versions relies on the same core algorithm:
- Minterm Masking: User inputs (e.g.,
1 3 7) are converted into a single 8-bit integer (a bitmask). For the input1 3 7, the mask would be10001010in binary (bits 1, 3, and 7 are set). - Hierarchical Grouping: The algorithm checks for groups in a specific order to ensure the largest possible groups are found first (as per K-map rules).
- Quads (Groups of 4): It first scans for all possible 4-minterm groups. If a quad is found, its corresponding single-literal term (e.g.,
A,B',C) is added to the result, and its minterms are marked as "covered." - Pairs (Groups of 2): Next, it scans for all possible 2-minterm groups among the remaining uncovered minterms. If a pair is found, its two-literal term (e.g.,
A'B,BC') is added, and its minterms are covered. - Singletons (Individual Minterms): Finally, any minterms that could not be grouped are treated as individuals and their full three-literal term (e.g.,
A'B'C') is added to the result.
- Quads (Groups of 4): It first scans for all possible 4-minterm groups. If a quad is found, its corresponding single-literal term (e.g.,
- Output Formatting: The resulting terms are concatenated with
+signs to form the final Sum-of-Products expression.
This project is licensed under the MIT License. See the LICENSE file for details.

