Laws Catalog

Laws whose pattern matches any part of the current expression are highlighted.

Identity (AND)Constants

P & 1 = P. AND with the constant 1 leaves the operand unchanged.

Identity (OR)Constants

P | 0 = P. OR with the constant 0 leaves the operand unchanged.

Null / domination (AND)Constants

P & 0 = 0. AND with the constant 0 dominates the whole expression.

Null / domination (OR)Constants

P | 1 = 1. OR with the constant 1 dominates the whole expression.

Idempotent (AND)Algebraic

P & P = P.

Idempotent (OR)Algebraic

P | P = P.

Complement (AND)Constants

P & !P = 0.

Complement (OR)Constants

P | !P = 1.

Involution (double negation)Constants

!(!P) = P.

Commutative (AND)Algebraic

P & Q = Q & P.

Commutative (OR)applicable now

P | Q = Q | P.

Commutative (XOR)applicable now

P ^ Q = Q ^ P.

Associative (AND)Algebraic

(P & Q) & R = P & (Q & R). Regroups a left-nested AND.

Associative (OR)applicable now

(P | Q) | R = P | (Q | R). Regroups a left-nested OR.

Distributive (AND over OR)Distributive

P & (Q | R) = (P & Q) | (P & R).

Distributive (OR over AND)Distributive

P | (Q & R) = (P | Q) & (P | R).

Absorption (AND)Algebraic

P & (P | Q) = P.

Absorption (OR)Algebraic

P | (P & Q) = P.

De Morgan (AND)De Morgan

!(P & Q) = !P | !Q.

De Morgan (OR)De Morgan

!(P | Q) = !P & !Q.

Expand NANDGate operators

P NAND Q = !(P & Q).

Expand NORGate operators

P NOR Q = !(P | Q).

Expand XORapplicable now

P ^ Q = (P & !Q) | (!P & Q). Sum of products without XOR.

Expand XNORGate operators

P XNOR Q = (P & Q) | (!P & !Q).

Collapse to NANDGate operators

!(P & Q) = P NAND Q.

Collapse to NORGate operators

!(P | Q) = P NOR Q.

Collapse to XORGate operators

(P & !Q) | (!P & Q) = P ^ Q.

XOR with 1 (complement)Gate operators

P ^ 1 = !P.

Recipe (1 step)

Steps run top to bottom. Reorder with ↑/↓, retarget a step to another subexpression, or bypass it.

Step 1: De Morgan (AND)
Target path: [0] · Subexpression: !(A & B)

✓ !(A & B) → !A | !B

Input Expression

3 variable(s)

Operators: !/NOT, &/AND, |/OR, ^/XOR, and the gate words NAND, NOR, XNOR. Constants 0/1 or false/true. Textbook forms also work: juxtaposition is AND (A B + C means (A & B) | C), postfix ' is NOT of one term (A B' means A & !B), and + is OR.

PARSED EXPRESSION!(A & B) | A ^ CVariables: A, B, C

Pipeline Output

✓ Every step preserves the truth table

Checked on all 8 assignments of A, B, C.

RESULTING EXPRESSION!A | !B | A ^ C

Derived Circuit

8 gates

The gate graph of the current output expression. Toggle an input to trace which wires carry a 1.

ANOTBNOTORCXOROR

Gates are drawn one column per gate layer, sources first, so a wire never runs backwards. Shaded lines carry the value 1 for the current input selection.

Inputs

  • A = 0
  • B = 0
  • C = 0

Outputs

  • F = 1 (gate or-8)

Gate counts

  • input: 3
  • not: 2
  • or: 2
  • xor: 1
Total 8 gates, 8 connections.