Add multi-level synthesis module with multi-input gates
Adds bcd_optimization/multi_level.py with:
- Gate and Circuit dataclasses for multi-level representation
- Support for arbitrary gate types (AND, OR, NAND, NOR, XOR, XNOR)
- Support for multi-input gates (3+)
- Circuit verification against truth tables
- Optimized synthesis using verified SOP expressions
Results comparison:
SOP (2-input gates): 52 total gate inputs
Multi-level (2-input): 22 total gate inputs (11 gates) <- BEST
Multi-input SOP: 52 total gate inputs (same structure)
The 2-input exact synthesis wins because it uses XOR/XNOR to exploit
segment relationships (a≈d, c≈f, d≈g differ by only 1-2 minterms).
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>