bcd-optimization#
optimizing a gate level bcm to the end of the earth and back
The canonical repo for this is hosted on tangled over at dunkirk.sh/bcd-optimization
© 2026-present Kieran Klukas
For self-hosted knots, clone URLs may differ based on your setup.
Download tar.gz
- Add XNOR to 2-input and 3-input allowed gates
- Add 4-input gate synthesis (AND4, OR4, XOR4, XNOR4, NAND4, NOR4)
- Add _try_general_synthesis() for mixed 2/3/4-input gates
- Add parallel search scripts for optimal circuit finding
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add exact_synthesis_mixed() for circuits with both 2-input and 3-input gates
- Add function restriction to limit to real gates (AND, OR, XOR, NAND, NOR)
- Add _decompose_gate_function() for cleaner DOT visualization
- Found 23-input solution: 7x2-input + 3x3-input gates
- Uses: XOR, OR, AND, NAND, OR3, XOR3
- Ties the 23-input record using only standard purchasable gates
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Fix segment c truth table (was wrong for digits 2, 3)
- Fix segment f truth table (was wrong for digit 7)
- Fix gate function encoding (bit ordering was inverted)
- Add Verilog, C, and DOT export functions for exact synthesis
- Update CLI to use appropriate export based on result type
- Add exported 12-gate circuit files (verified correct for 0-9)
The corrected truth tables require 12 gates minimum (24 inputs)
compared to 11 gates with the buggy tables.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
optimizing a gate level bcm to the end of the earth and back
The canonical repo for this is hosted on tangled over at dunkirk.sh/bcd-optimization
© 2026-present Kieran Klukas