Dynamic topology on static hardware
GNG continually creates, ages, reconnects, and removes graph edges. These data-dependent operations are simple in software, but they create irregular memory access and control-flow pressure on a small FPGA.
Edge robots and micro-UAVs need unsupervised learning close to the sensor, where communication links, payload, and energy are limited. GNG is a strong candidate because it learns both prototypes and topology online, but its graph operations are not naturally matched to a small FPGA fabric.
GNG continually creates, ages, reconnects, and removes graph edges. These data-dependent operations are simple in software, but they create irregular memory access and control-flow pressure on a small FPGA.
A conventional Nmax by Nmax adjacency matrix stores both halves of an undirected graph. At Nmax = 40, the dense edge table alone consumes 1,600 B before any node coordinate or error state is stored.
Winner search, distance evaluation, and learning-rate updates are repeated for every input sample. Floating-point datapaths increase area and latency, limiting their usefulness on a sub-10K-LUT FPGA.
The design target is a bounded-memory, integer-only GNG accelerator that keeps the dynamic topology behavior of the algorithm while fitting the Tang Nano 9K resource envelope.
Motivation: convert continuous, sensor-like spatial observations into a compact GNG graph directly on a small FPGA, without floating-point hardware or dynamic memory.
Growing Neural Gas (GNG) is a self-organizing clustering algorithm that incrementally learns a graph representation from unlabeled data. Its dynamic topology is attractive for edge robotics and field systems, but conventional implementations rely on dense adjacency structures, floating-point arithmetic, and dynamic memory patterns that do not map cleanly to small FPGAs.
This project implements GNG on a Sipeed Tang Nano 9K FPGA using a bounded-memory datapath. Edge-cell graph encoding stores only the upper triangle of the adjacency as 8-bit age+1 values, while Q8/Q16 fixed-point updates replace floating-point learning rates. The design fits within the GW1NR-9C resource budget and preserves topology quality on Two Moons and Concentric Circles benchmarks.
Error decay, edge aging, neighbor movement, and over-age pruning are combined inside one NB_SCAN sweep. Per-node degree counters support isolated-node monitoring without scanning the full edge array.
The graph stores one byte per undirected node pair. A zero value means no edge; a nonzero value stores edge age plus one. At Nmax = 40, edge storage drops from 1,600 B to 780 B.
Node coordinates are signed integers normalized to [-1000, 1000]. Winner and neighbor adaptation use Q8/Q16 shift-scaled learning rates with DSP-friendly multiply-and-shift operations.
In the paper, the current implementation is a sequential single-clock FSM. UPDATE handles the winner first: accumulate errs1, apply winner error decay, and move s1 with the Q8 learning rate.
The fused part is the NB_SCAN pass. While scanning each active
node slot n ≠ s1, the FSM decays that node's error,
probes edge_cell[idx(s1,n)], and only for active winner-incident
edges performs aging, neighbor movement, and old-edge pruning inline.
one Nmax scan replaces separate decay + neighbor-edge passes
Each BRAM read-modify-write takes at least three cycles, so the implemented loop remains deterministic and bounded per sample even before wider parallel datapaths are introduced.
Edges are undirected, so the FPGA stores only the upper triangle of the adjacency matrix. Each one-byte cell codes presence and age together.
Flatten the 2D upper triangle into one 1D array, row by row.
| Implementation | Node | Edge | Total |
|---|---|---|---|
| Dense adjacency (baseline) | 400 B | 1,600 B | 2,000 B |
| Edge-cells (proposed) | 400 B | 780 B | 1,180 B |
-51.25% edge storage and -41% total graph state at Nmax = 40.
Integer-only datapath - no floating-point unit. The whole engine runs on a Tang Nano 9K at 27 MHz as a single FSM with 3 BRAMs and 1 Mbit/s UART streaming.
Coordinate representation - 16-bit signed integers in
[-1000, 1000] after min-max normalization:
80-bit node word - one BRAM entry per node:
Squared-distance unit - maps directly onto a 9x9 DSP multiplier, overflow-free:
Parametric learning rates - one multiply + shift each (single DSP cycle):
Fused update: winner move, edge aging, neighbor move, error decay, and pruning all run in one NB_SCAN sweep, so per-edge operations remain regular and FPGA-friendly.
| Parameter | Value | Hardware mapping |
|---|---|---|
| Nmax (max nodes) | 40 | node BRAM depth |
| Amax (max edge age) | 50 | A_MAX_STORED = 51 |
| λ (insertion period) | 100 | lambda counter |
| εw (winner lr) | 0.301 | EPS_WIN_Q8 = 77, >> 8 |
| εn (neighbor lr) | 0.001 | EPS_N_Q16 = 66, >> 16 |
| α (error split) | 0.5 | INS_ALPHA_SHIFT = 1 |
| β (error decay) | 0.9961 | ERR_DECAY_SHIFT = 8 |
| ERR_SHIFT (acc. scale) | 4 | d2 >> 4 before accumulation |
The prototype is evaluated on two 2D topology-learning benchmarks using FPGA snapshots and an on-chip cycle counter. The measured latency remains near-identical across datasets because execution is bounded by O(Nmax) BRAM scans.
Integer-only GNG learns dynamic topology on a sub-10K-LUT FPGA.
The FPGA streams node and edge snapshots through UART. The host reconstructs the learned topology and evaluates quantization error, topological error, and runtime.
Takeaway & Future Work
Self-organizing clustering with dynamic topology is feasible on a sub-10K-LUT FPGA, making it relevant for robots and embedded devices with strict power, weight, physical-size, compute, and memory limits.
Robots for pipe inspection, exploration, long-term deployment, and distributed sensing cannot assume large batteries, high-end processors, or abundant memory. A bounded-memory FPGA GNG module can keep learning local topology while staying lightweight, low power, and physically compact.
Pipe inspection image source: JET Manufacturing, accessed June 2026.
Map local topology on tiny aerial platforms where payload and compute budget are minimal.
Support compact robots whose body shape, actuator layout, and memory budget are tightly limited.
Let many small robots learn local structure with distributed intelligence and limited communication.
Keep exploration robots adapting over long deployments without high-power processors or large RAM.
The paper, poster, slide deck, source code, and reproducibility report are available from the links below.