code wiki / _hdl_build / nx_alu_from_gates_test.nx
nx_alu_from_gates_test.nx
buildroot/runtime/_hdl_build/nx_alu_from_gates_test.nx
about
nx_alu_from_gates_test.nx -- the team builds ARITHMETIC from BITS UP. The same gate-level
superoptimizer that minimizes boolean functions SYNTHESIZES the full adder itself: sum =
a^b^cin (truth table 0x96) and carry = majority(a,b,cin) (0xE8). The team then COMPOSES
those synthesized gates into an N-bit ripple adder and VERIFIES it computes real N-bit
addition over many inputs. Bits -> gates -> full adder -> ALU, every step synthesized and
verified by the team. The autonomous find-minimal-verify loop, operating at the HARDWARE/
gate level, not just machine-code codegen.
dependencies 1 imports · 0 importers
imports: nx_boolsynth.nx
imported by: nobody (leaf or entry point)
call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown
structs
| none |
consts
| none |
functions
| 11 | func ag_puts(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } sys_write(1, s, n); return 0 } called by 1: ag_main |
| 12 | func ag_num(v: i64) -> i64 called by 1: ag_main |
| 20 | func tally(r: *i64, n: i64) -> i64 { var ec: i64 = 0; var i: i64 = 0; while i < n { if r[i] != 1 { if ec == 0 { ec = i + 1 } } i = i + 1 } return ec } called by 1: main |
| 23 | func ag_eval1(op: *i64, a: *i64, b: *i64, L: i64, x0: i64, x1: i64, x2: i64) -> i64 |
| 32 | func ag_ripple_add(sop: *i64, sa: *i64, sb: *i64, sL: i64, cop: *i64, ca: *i64, cb: *i64, cL: i64, |
| 49 | func ag_main(r: *i64) -> i64 |
| 78 | func main() -> i64 |