code wiki / _hdl_build / nx_boolsynth4.nx
nx_boolsynth4.nx
buildroot/runtime/_hdl_build/nx_boolsynth4.nx
about
nx_boolsynth4.nx -- L8 gate-level synthesis, 4-input (extends the team's proven 3-input superopt up
the hardware rung). The team AUTHORS a minimal straight-line circuit for any 4-input boolean function
by SEARCH, and the result is verified EXACTLY and FREE by the truth-table-as-bitmask trick: drive the
four inputs with the columns 0xAAAA / 0xCCCC / 0xF0F0 / 0xFF00, and the 16-bit output word IS the
function's truth table -- so circuit==target is one integer compare, all 16 rows at once, no execution.
Gate count is a DETERMINISTIC counted invariant (nx_cost_oracle), so the win vs a naive sum-of-products
baseline is judged objectively, not by wall-clock or self-assessment.
Honest scope: the search is the chain class (each gate combines the running value with a PRIMARY input)
-- a real straight-line subclass that captures reduce/parity/threshold forms; the full DAG search +
real gcc/clang race (the existing 71-win 3-input standing) is the triangulation rung above this.
license_tier: ORIGINAL
dependencies 2 imports · 1 importers
imports: nx_cost_oracle.nxnx_syscalls.nx
imported by: nx_team_synth_ability.nx
structs
| none |
consts
| none |
functions
| 17 | func bs4_in(k: i64) -> i64 |
| 25 | func bs4_op(op: i64, a: i64, b: i64) -> i64 called by 1: bs4_search |
| 35 | func bs4_search(cur: i64, used: i64, target: i64, maxg: i64) -> i64 |
| 54 | func bs4_synth(target: i64, maxg: i64) -> i64 |
| 65 | func bs4_popcount(x: i64) -> i64 called by 1: bs4_naive_sop_gates |
| 73 | func bs4_naive_sop_gates(target: i64) -> i64 |