Binary Sheffer Stroke
Compute the Sheffer Stroke (NAND) of two binary numbers bit-by-bit. Visualize truth tables, derive all logic gates from NAND, and explore functional completeness.
About
The Sheffer Stroke, denoted A ↑ B (also written A | B or NAND), produces FALSE only when both operands are TRUE. Henry Sheffer proved in 1913 that this single connective is functionally complete: every Boolean function, including NOT, AND, OR, and XOR, can be constructed using only NAND gates. This property makes NAND the foundational building block of modern digital circuits. Errors in NAND-chain derivations propagate through entire combinational networks, so verifying intermediate bit-level results matters during hardware design and formal logic proofs.
This tool computes A ↑ B for arbitrary-length binary strings, zero-padding the shorter operand to match lengths. It also derives all six standard gates from pure NAND composition so you can cross-check equivalences. The computation assumes unsigned binary representation with no overflow semantics. Pro tip: when chaining NAND operations for circuit simulation, track propagation delay per gate level - this tool handles the logical layer, not timing.
Formulas
The Sheffer Stroke is defined by negating the conjunction of two operands:
For each bit position i in binary strings of length n:
Derivation of NOT from NAND:
Derivation of AND from NAND:
Derivation of OR from NAND (De Morgan's):
Derivation of XOR from NAND:
Where A = first binary operand, B = second binary operand, R = result bit string, i = bit index from 0 to n − 1, n = max length of operands after zero-padding.
Reference Data
| Gate | Symbol | NAND Derivation | Gate Count | Expression | Output for 0,0 | Output for 0,1 | Output for 1,0 | Output for 1,1 |
|---|---|---|---|---|---|---|---|---|
| NAND (Sheffer) | ↑ | Native | 1 | A ↑ B | 1 | 1 | 1 | 0 |
| NOT | ¬ | A ↑ A | 1 | ¬A | 1 | 0 | ||
| AND | ∧ | (A ↑ B) ↑ (A ↑ B) | 2 | A ∧ B | 0 | 0 | 0 | 1 |
| OR | ∨ | (A ↑ A) ↑ (B ↑ B) | 3 | A ∨ B | 0 | 1 | 1 | 1 |
| NOR | ↓ | [(A ↑ A) ↑ (B ↑ B)] ↑ [(A ↑ A) ↑ (B ↑ B)] | 4 | ¬(A ∨ B) | 1 | 0 | 0 | 0 |
| XOR | ⊕ | [A ↑ (A ↑ B)] ↑ [B ↑ (A ↑ B)] | 4 | A ⊕ B | 0 | 1 | 1 | 0 |
| XNOR | ⇔ | NOT of XOR chain | 5 | ¬(A ⊕ B) | 1 | 0 | 0 | 1 |
| IMPLIES | ⇒ | (A ↑ A) ↑ (B ↑ B ↑ B)... simplified | 2 | A ⇒ B | 1 | 1 | 0 | 1 |
| Buffer | - | (A ↑ A) ↑ (A ↑ A) | 2 | A | 0 | 1 | ||
| Constant 1 | - | A ↑ (A ↑ A) | 2 | 1 | 1 | |||
| Constant 0 | - | [A ↑ (A ↑ A)] ↑ [A ↑ (A ↑ A)] | 3 | 0 | 0 | |||
| Inhibition | - | A ∧ ¬B via NAND | 3 | A ∧ ¬B | 0 | 0 | 1 | 0 |