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

4055 B84 linesdepth 3pulls 3 transitivereach 0 importersview sourcekind gate/prooftopic alu
docsdependenciesstructsconstsfunctions

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

nx_boolsynth.nx nx_alu_from_gates_test.nx

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

main ag_main ag_puts bl_find sys_mmap bl_enum bl_is_unary bl_eval bl_enum ↻ ag_num ag_ripple_add ag_eval1 bl_eval ↻ tally

structs

none

consts

none

functions

11func 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
12func ag_num(v: i64) -> i64
called by 1: ag_main
20func 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
23func ag_eval1(op: *i64, a: *i64, b: *i64, L: i64, x0: i64, x1: i64, x2: i64) -> i64
called by 1: ag_ripple_add calls 1: bl_eval
32func ag_ripple_add(sop: *i64, sa: *i64, sb: *i64, sL: i64, cop: *i64, ca: *i64, cb: *i64, cL: i64,
called by 1: ag_main calls 1: ag_eval1
49func ag_main(r: *i64) -> i64
78func main() -> i64
calls 2: ag_maintally