Arduino Based Boolean Calculator With Logic Simplification

In this article, we propose a Boolean Calculator that can minimize Boolean expressions (up to 4 variables) to their simplified logical expression in the Sum of Product (SoP) form. Boolean simplification is vital for reducing the number of literals, which allows much simpler circuitry for practical implementation. The algorithm uses the Karnaugh-Map (K-map) looping approach. This is one of the most essential methods that minimize Boolean algebra. Boolean simplification is highly accepted in chip design.

By reducing logic gates, we can create nanochips very cost-efficiently. This proposed tool will be very useful for such Boolean simplification with its fast, efficient and provides accurate results. Boolean simplification is one of the most important vital facts when designing an Integrated Circuit (IC). It simplifies the logic function, so we can reduce the original number of digital components (gates) required to implement digital circuits. Therefore, by reducing the number of gates, the chip size and the cost is reduced, and the speed is increased.

We implemented an easy-to-use mini tool that can simplify any Boolean function. As a prototype, the Arduino is preferred which contains an Atmega328P chip. Keeping the compact form factor in mind, we picked Arduino Nano which contains a 32KB of a storage system. We used 9 push buttons, and a 128×64 OLED display to display results. All of these components are connected to the Arduino. We declared 9 Arduino digital pins (D2 to D10) as input. All push buttons are also connected to the board. The Arduino and the OLED display are in sync with SDA and SCL pins. These two pins from the OLED display are connected to the A4 and A5 pins of the Arduino to maintain the I2C command between the display and the microcontroller.

For aesthetics, we added 3 LED lights with the digital pins that were used as output pins. For the power supply, we used a 3.7 volts 2200 mAh li-ion battery, which is parallelly connected to the Arduino and OLED pin’s VCC and ground respectively.

Circuit Diagram

Arduino Based Boolean Calculator Circuit Diagram

Components Required

  • Arduino Nano
  • 128×64 OLED Display
  • Push Button (x9)
  • Connection Wire
  • Breadboard
  • 5 Volt Power Supply

PCB Design

After designing the schematic diagram of the Arduino Boolean Calculator System, the assembled components and wiring are too clumsy and looked unprofessional. In fact, the wiring also has a chance of loose connection. To give it a clean and professional look I decided to build its PCB prototype using EasyEDA software as it is so simple to use. Now come to the main part, where we need to order our PCB prototype. I always prefer PCBWay for their quality assurance, fastest delivery and also for 24/7 customer support.

You can view the Gerber file here Gerber File Viewer.

PCB View

Arduino Based Boolean Calculator 2D View
2D View
Arduino Based Boolean Calculator 3D view
3D View

Why I Choose PCBWay as My First Preference?

I’ve done several runs with PCBWay and am happy with the results, it’s good quality. The etching, solder mask, and hole sizes are all done well and that is what matters to me. It takes a few hours for a design to get approved and then a couple of days to finish and ship. With more than a decade in the field of PCB prototypes and fabrication, PCBWay has proved its assurance from time to time. They always look at the customer’s needs from different regions in terms of quality, on-time delivery, cost-effectiveness and any other demanding requests.

PCBWay Gold Finish
PCBWay Thickness

These PCBs were manufactured by PCBWay and the finish quality really impressive, especially with the gold finish path. If you want to finish your product faster you could also ask PCBWay to make a panelized order where you receive multiple PCBs in a single panel. Together with this, you will also receive SMT Stencil from PCBWay which will save you time and effort. All the orders are high quality and could select a lot of settings such as thickness, flexible PCB, the colour of the solder masks, the number of layers, material, surface finish and more.

PCBWay different types of solder masks

Guide for Ordering PCB from PC

Different Types of Methods for Boolean Calculator

First Method

Boolean functions are usually expressed as Sum of Products (SoP) or Product of Sums (PoS) form, where each of their variable combinations is known as minterm and maxterm. Each cell of a K-map creates an entry for a minterm or maxterm. A three-variable K-Map may have as many as 8 cells with 8 entries to fill up from m0 to m7, 4 variable K-Map has 16 cells with 16 entries from m0 to m15 and so on.

By convention, ‘1’ is entered as minterm in the corresponding cells of the K-Map and ‘0’ as maxterm. 1s are divided into possible groups of 8, 4, 2 or 1, known as prime applicants. It simplifies the logic function to its minimal form. With so a high number of variables, the difficulty gets higher in grouping the 1 sin rightly. If the entries are wrong in cells or if the groups of 1s are formed improperly, the Boolean simplification will not be correct, or the result may show redundancy.

Boolean Expression for Boolean Calculator

Second Method

When the user presses any key except OR, the Boolean Calculator gives a value and delivers it to the array if the OR key is selected, the array is used by the processing unit. The microcontroller will generate a decimal value for the array as it uses the binary-to-decimal conversion method. the microcontroller uses the decimal value to fill up all the cells of the K-Map.

After completion, it will wait for the next input until the user activates the “Equal” key. When the user presses the equal key, it will route it to the output unit. The processing unit will group the entries as the rules of K-Mapping says. Finally, it shows the sum of prime implications.

Applications of Arduino Boolean Calculator

  • It proposes a tool that simplifies any Boolean expression of up to 4 variables of complexity in its simplest or minimal Sum of Product. Even if the given equation is in the form of SoP, PoS or a mixed complex form of SoP and PoS, it finds its minimal SoP form accurately and with super optimization speed.
  • The processing speed of this Boolean Calculator is unquestionably swift (on average 0.7 seconds for an accurate result). It solves users’ given equations right without any exceptions. It has extra features that can even solve the most difficult Boolean expressions. If this is included in a scientific calculator.
  • It would be a great help for engineers and professionals in the fields of electrical and computer engineering in reducing the time required.
  • The proposed Boolean Calculator is a fast, extremely efficient, and portable way to check and solve any logic function in digital logic,
    discrete mathematics, and computer architecture courses.

Leave a Comment