Threshold Logic Circuits
Collection
Boolean gates, voting functions, modular arithmetic, and adders as threshold networks.
β’
248 items
β’
Updated
β’
1
4-input XOR gate. Cascade of three standard XOR circuits (OR + NAND + AND).
a b c d
β β β β
ββββ΄βββ β β
βΌ β β
βββββββ β β
β XOR β β β
ββββ¬βββ β β
ββββ¬ββ β
βΌ β
βββββββ β
β XOR β β
ββββ¬βββ β
ββββββ¬βββββ
βΌ
βββββββ
β XOR β
ββββ¬βββ
βΌ
XOR4(a,b,c,d)
Each XOR uses the standard OR + NAND + AND structure:
| Neurons | 9 |
| Layers | 6 |
| Parameters | 27 |
| Magnitude | 30 |
See threshold-xor4-mag21 for a 30% magnitude reduction using optimized XOR blocks.
from safetensors.torch import load_file
w = load_file('model.safetensors')
# See model.py for implementation
MIT