wire / wire-format / logic-gates
The fundamental logic gates: AND (output 1 if all inputs 1), OR (output 1 if any input 1), NOT (inverter), NAND (NOT AND), NOR (NOT OR), XOR (exclusive OR, output 1 if inputs differ), XNOR (equivalence, output 1 if inputs same). NAND and NOR are universal gates (can implement any Boolean function). De Morgan's laws: NOT(A AND B) = NOT A OR NOT B; NOT(A OR B) = NOT A AND NOT B.
aka: Logic gates (Boolean algebra)
spec: Boolean algebra
The fundamental logic gates: AND (output 1 if all inputs 1), OR (output 1 if any input 1), NOT (inverter), NAND (NOT AND), NOR (NOT OR), XOR (exclusive OR, output 1 if inputs differ), XNOR (equivalence, output 1 if inputs same). NAND and NOR are universal gates (can implement any Boolean function). De Morgan's laws: NOT(A AND B) = NOT A OR NOT B; NOT(A OR B) = NOT A AND NOT B.
| field | size | meaning |
|---|---|---|
| AND | 2+ inputs | Output = 1 iff all inputs are 1. Truth table: 00->0, 01->0, 10->0, 11->1. |
| OR | 2+ inputs | Output = 1 iff any input is 1. Truth table: 00->0, 01->1, 10->1, 11->1. |
| NOT | 1 input | Output = NOT input. Truth table: 0->1, 1->0. |
| NAND | 2+ inputs | Output = NOT (A AND B). Universal gate. Truth table: 00->1, 01->1, 10->1, 11->0. |
| NOR | 2+ inputs | Output = NOT (A OR B). Universal gate. Truth table: 00->1, 01->0, 10->0, 11->0. |
| XOR | 2 inputs | Output = 1 iff inputs differ. Truth table: 00->0, 01->1, 10->1, 11->0. (A XOR B = A'B + AB') |
| XNOR | 2 inputs | Output = 1 iff inputs same (equivalence). Truth table: 00->1, 01->0, 10->0, 11->1. |
| De Morgan's laws | identity | NOT(A AND B) = NOT A OR NOT B. NOT(A OR B) = NOT A AND NOT B. |
| Absorption | identity | A AND (A OR B) = A. A OR (A AND B) = A. |
| Distributive | identity | A AND (B OR C) = (A AND B) OR (A AND C). A OR (B AND C) = (A OR B) AND (A OR C). |
example:
00 00 00 00
Logic gate truth tables (placeholder)
agent: curl -H 'accept: application/json' wire.phall.io/wire-format/logic-gates
or /wire-format/logic-gates.json