Professional Logic Simulator & Circuit Synthesizer
An industrial-grade Boolean Analyzer. Features Logic Synthesis (create logic by clicking K-Map cells), Hazard Detection, true Circuit Diagram Generation, and multi-dialect PLC Code Export (AB, Siemens, IEC).
Logic Definition
Timing Diagram (Clock Cycle)
Interactive Mode: Click any cell to toggle logic state (0/1). The Expression and Circuit will update instantly.
Automation Engineering Reference Manual
1. Boolean Algebra in Industrial Automation
Programmable Logic Controllers (PLCs) rely fundamentally on Boolean Algebra to control machinery. Every sensor input (Limit Switch, Photocell, E-Stop) is treated as a binary variable (0 or 1). The logic combines these inputs to determine the state of outputs (Motors, Solenoids, Lamps).
Operator Precedence & SyntaxStandard order of operations in logic design is: NOT (Highest) → AND → XOR → OR (Lowest). Parentheses always override this order.
- AND (Product): Output is TRUE only if ALL inputs are TRUE. Used for series safety interlocks (e.g., Guard Closed AND Reset Pressed).
- OR (Sum): Output is TRUE if ANY input is TRUE. Used for parallel start conditions (e.g., Auto Start OR Manual Jog).
- XOR (Exclusive OR): Output is TRUE if inputs are different. Used for alternation logic (e.g., toggling between two pumps).
2. Logic Minimization & Quine-McCluskey
Writing logic is easy; optimizing it is engineering. Unoptimized logic wastes PLC memory and increases Scan Time. In complex safety systems, redundant terms can also obscure the true function of the code, making debugging harder.
The Quine-McCluskey algorithm is a systematic method for minimization of boolean functions. Unlike Karnaugh Maps, which rely on visual pattern recognition (limited to 4-5 variables), Quine-McCluskey is tabular and algorithmic, making it suitable for computer implementation with any number of variables.
The Process:
- List all minterms (input combinations resulting in TRUE).
- Group minterms by the number of 1s in their binary representation.
- Compare adjacent groups. If two terms differ by exactly one bit (e.g., 0010 and 0011), combine them by replacing the differing bit with a dash (001-).
- Repeat until no more combinations are possible. These are "Prime Implicants".
- Use a Prime Implicant Chart to select the minimum set of implicants that cover all original minterms.
3. Logic Hazards (Static & Dynamic)
In the ideal world of boolean algebra, signals change instantly. In the real physical world, gates have propagation delays. A Hazard is a potential glitch in the output waveform caused by different path delays.
- Static-1 Hazard: The output is meant to stay HIGH (1), but momentarily drops to LOW (0) during an input transition. This happens when adjacent groupings in a K-Map do not overlap.
- Static-0 Hazard: The output is meant to stay LOW (0), but momentarily spikes HIGH (1).
Impact on PLCs: While standard PLC scans are often slow enough to mask nanosecond glitches, high-speed counter modules (HSC) or interrupt routines can falsely trigger on these hazards. In safety circuits, a static hazard could cause a relay to chatter or a safety latch to drop out unexpectedly.
4. IEC 61131-3 Programming Standards
The International Electrotechnical Commission (IEC) standard 61131-3 unifies PLC programming across vendors. This tool supports code generation for the most common dialects.
Structured Text (ST)A high-level textual language similar to Pascal or C. It is the most powerful language for complex algorithms, math, and data handling.
Example: IF (Start_Btn AND NOT E_Stop) THEN Motor := TRUE; END_IF;
A graphical language mimicking relay logic schematics. It is preferred for boolean interlocks because it visually represents power flow, making it easy for electricians to troubleshoot.
Logic: Contacts (-| |-) represent inputs, Coils (-( )-) represent outputs.
An assembly-like language. Although deprecated in the latest IEC standard, it remains prevalent in legacy Siemens S7-300/400 systems.
Example: A I0.0 (And Input 0.0) / = Q0.0 (Assign Output 0.0).
5. Safety Logic Patterns (Fail-Safe Design)
Designing for safety requires inverting standard logic thinking. We design for the "Loss of Signal".
- Stop Buttons: Always wired Normally Closed (NC). In normal operation, the input is TRUE (1). Logic:
IF NOT Stop_Input THEN Shutdown;. If the wire breaks, the input becomes FALSE (0), triggering the stop automatically. - Permissives: Logic that must be TRUE to allow an action.
Run_Cmd := Start AND Hydraulic_Pressure_OK AND Guard_Closed; - De Morgan's Theorem in Safety: Often used to simplify NOT logic.
NOT (A OR B)is equivalent to(NOT A) AND (NOT B).
This transforms a parallel "Fault OR Fault" condition into a series "Healthy AND Healthy" chain, which is safer and easier to read.