1. De Morgan's Laws
De Morgan's laws transform logic expressions that negate a group of conditions. For the AND operation, the first law is:
NOT(A AND B) = NOT A OR NOT BIn other words, “A and B are not both true” is equivalent to “A is not true or B is not true.”
The second De Morgan law is:
NOT(A OR B) = NOT A AND NOT BWhen negation moves through a group, AND changes to OR, OR changes to AND, and each individual condition is negated.
2. Verification with a Truth Table
The first law can be checked for all four combinations of inputs A and B.
| A | B | A AND B | Y1 = NOT(A AND B) | NOT A | NOT B | Y2 = NOT A OR NOT B |
|---|---|---|---|---|---|---|
| 0 | 0 | 0 | 1 | 1 | 1 | 1 |
| 0 | 1 | 0 | 1 | 1 | 0 | 1 |
| 1 | 0 | 0 | 1 | 0 | 1 | 1 |
| 1 | 1 | 1 | 0 | 0 | 0 | 0 |
Y1 and Y2 match in every row, so the two expressions and their FBD branches are logically equivalent.
3. Practical Example
Suppose a machine may run only when both of these conditions are true:
- A — the safety door is closed;
- B — air pressure is within the permitted range.
The run permission can be written as:
RunPermit = DoorClosed AND PressureOKA blocking signal can be obtained by negating the whole permission:
Block = NOT(DoorClosed AND PressureOK)De Morgan's law gives the equivalent expression:
Block = NOT DoorClosed OR NOT PressureOKThe second form is often easier to diagnose because it shows directly that the machine is blocked by an open door or insufficient pressure.
4. Verifying the Law in the FBD Simulator
The lesson program implements both equivalent branches. The upper branch calculates Y1 = NOT(A AND B), while the lower branch calculates Y2 = NOT A OR NOT B. The EQ block compares them and writes the Y_EQUAL output.
1. Open the program in the simulator. 2. Start simulation mode. 3. Set A = FALSE and B = FALSE, then execute a scan. 4. Repeat the check for FALSE/TRUE, TRUE/FALSE, and TRUE/TRUE. 5. Compare Y1 and Y2 with the truth table. 6. Confirm that Y_EQUAL remains TRUE for all four combinations.
If Y_EQUAL becomes FALSE, the branches are no longer equivalent. Check the connections and the positions of the NOT blocks.
5. Applications in Larger Logic Diagrams
Permissive and Interlock Chains
Starting a mechanism in an industrial program often depends on several conditions:
Permit = SafetyOK AND DriveReady AND PressureOK AND ProductPresentNegating the combined permission produces an OR expression of individual failures:
NotPermit =
NOT SafetyOK
OR NOT DriveReady
OR NOT PressureOK
OR NOT ProductPresentThis form is easier to reuse for a common fault and for individual diagnostic messages.
Normally Closed Signals
Emergency-stop circuits, safety doors, and some sensors are commonly wired with normally closed contacts. Their PLC programs therefore contain many inverted signals. De Morgan's laws help move negation through AND and OR groups without changing the algorithm.
Common Fault Generation
For example, system readiness can be written as:
SystemReady = Drive1Ready AND Drive2Ready AND RobotReadyThe common fault state is:
CommonFault = NOT SystemReadywhich is equivalent to:
CommonFault =
NOT Drive1Ready
OR NOT Drive2Ready
OR NOT RobotReady6. Simplification and Normalization
De Morgan's laws are used for:
- simplifying complex logic expressions;
- converting algorithms between FBD and LD;
- analyzing truth tables;
- constructing Karnaugh maps;
- compiling logic diagrams automatically;
- removing unnecessary inversions.
Equivalent branches are useful for learning and testing, but they do not provide safety-rated redundancy. Both branches use the same input data and are logically dependent on one another.
7. Summary
De Morgan's laws move negation through a group of conditions without changing the result:
NOT(A AND B) = NOT A OR NOT B
NOT(A OR B) = NOT A AND NOT BIn FBD, these transformations help convert permissives into diagnostic blocking conditions, handle inverted signals, and verify equivalent representations of the same logic.
Practice block
Open the related example in the editor, run the simulation, and repeat the exercise from the article. The JSON is also available as a direct download.