wire / wire-format / logic-gates

Logic gates (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.

wire-format kind wire-format status standard verification verified tier B wire-format@1

aka: Logic gates (Boolean algebra)

wire format

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.

fieldsizemeaning
AND2+ inputsOutput = 1 iff all inputs are 1. Truth table: 00->0, 01->0, 10->0, 11->1.
OR2+ inputsOutput = 1 iff any input is 1. Truth table: 00->0, 01->1, 10->1, 11->1.
NOT1 inputOutput = NOT input. Truth table: 0->1, 1->0.
NAND2+ inputsOutput = NOT (A AND B). Universal gate. Truth table: 00->1, 01->1, 10->1, 11->0.
NOR2+ inputsOutput = NOT (A OR B). Universal gate. Truth table: 00->1, 01->0, 10->0, 11->0.
XOR2 inputsOutput = 1 iff inputs differ. Truth table: 00->0, 01->1, 10->1, 11->0. (A XOR B = A'B + AB')
XNOR2 inputsOutput = 1 iff inputs same (equivalence). Truth table: 00->1, 01->0, 10->0, 11->1.
De Morgan's lawsidentityNOT(A AND B) = NOT A OR NOT B. NOT(A OR B) = NOT A AND NOT B.
AbsorptionidentityA AND (A OR B) = A. A OR (A AND B) = A.
DistributiveidentityA 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)


provenance

agent: curl -H 'accept: application/json' wire.phall.io/wire-format/logic-gates or /wire-format/logic-gates.json