Research status
I retain this bench as a teaching archive. Of the four reserved coefficient pairs, one improved estimated routed delay over separate minimum chains. Published methods already optimize adder sharing and its FPGA cost. I keep the designs and certificates so the local comparison can be reproduced. Kumm, Multiple Constant Multiplication Optimizations for Field Programmable Gate Arrays
Share two multiplications
Can two four-bit outputs use the same intermediate result?
I compute ax and bx modulo 16 for the same input x. Left shifts and fan-out are free in the model. Each four-bit addition or subtraction costs one operation. I close each coefficient set under shifts and explore sets by increasing distance. Every edge adds one operation, so the first layer covering both outputs proves optimality in this dictionary. The program also emits both Verilog descriptions.
I checked all 16 inputs for each of 136 unordered pairs, including equal pairs. Sharing saves an operation for 31 pairs against separate calculations. After iCE40 synthesis, (7,11) goes from 10 to 9 LUTs and from 1 to 4 carry cells. Both descriptions of (3,6) give 3 LUTs and 2 carries. After routing (7,11) on HX8K-CT256 I get 2.968 ns and 16 cells for the direct expression, 3.465 ns and 20 cells for sharing, on each of five seeds. Reference values
Multiple constant multiplication has established prior work. I provide a small exhaustive modular oracle and three hardware witnesses synthesized with Yosys. I distinguish estimated post-route delay from a physical board measurement.
Voronenko & Püschel · Multiple constant multiplication · Yosys · synth_ice40
In the field ZIP, I run python experience/graphe18.py. The matching JSON file contains the reference output. To emit the (7,11) Verilog I run python experience/graphe18.py 7 11. cartes18.py accepts the Yosys path, and place18.py the Yosys and nextpnr-ice40 paths.
Change the parameters · AT.EX18.05
APP060 · Atelier
My contribution and its control
I fix two operations, r ↦ 2r+b modulo 5 with b fixed to 0 or 1, on three bits. Codes 5, 6 and 7 are fixed in this pilot. For fixed digits 101101 the same table is obtained with 00. Exhaustive search over 20 reachable tables proves a minimum length of two in this library.
After extracting the ZIP I run python experience/compositions.py.
Limits and next comparison
I want to compare both descriptions and a direct lookup after synthesis for one FPGA family. I will fix the domain, LUT cost, depth and pipeline constraints. Synthesis may already give the same circuit. Runtime-variable digits raise a separate problem.
Prior work
Cuccaro et al. · ABC, Berkeley · Yosys
I keep the FPGA dossier here. Hierarchical reliability, numbered APP060 in the XIII deposit, is APP066 on the site.
I connect this field to Clearing the quotient of a block Horner step · Trading auxiliary bits for Toffoli gates.
Yosys 0.71 and ABC9 map words 101101 and 00 and the direct table to the same two LUTs at depth one. I evaluate every input in RTL and in each mapped netlist. Two distinct output columns each require a new function, so two single-output LUTs are minimal in this model. Two LUTs suffice for all three modulo-five descriptions
Further checks
In LUT-only logic I obtain 23 LUTs at depth seven for Horner, 124 at depth seven for lookup and 25 at depth five for signed radix four. I check the 512 inputs of all three RTL descriptions and six netlists, with and without dedicated resources. Three circuits for six runtime digits
Add a staged two-digit lookup implementation, then use multiple place-and-route seeds with a fixed interface. Does the two-level advantage survive routing?
Results and questions
nextpnr gives 5.474 ns for signed pairs and 7.434 ns for Horner on each seed. Staged tables take 9.436 ns. The placed signed core with its harness uses 36 logic cells against 34 for Horner. A two-level reduction measured after routing
The measured advantage covers six bits, four descriptions and LUT-only routing on an HX8K. Standard mappings add two or three carry cells in the arithmetic designs. Do carry chains or block length reverse the ranking?
Further checks
I perform 90 routes across seeds, widths, descriptions and modes. At eight bits in standard mapping I obtain 7.049 ns for signed pairs, 13.692 for Horner and 24.843 for a direct remainder. Signed pairs at six and eight bits with carries enabled
On HX8K I obtain a median of 4.949 ns and 41 placed cells for the match-count tree against 7.042 ns and 128 cells for my unrolled sum. I check all 256 vectors. Two circuits for the same four-neuron binary layer
I have an exact binary-layer baseline. The intended AMD device still needs identification and an AMD run remains to be measured. Does the local gain reach end-to-end inference time?
A trained layer exposes a sharing-cost failure
I train four bipolar thresholds on 160 synthetic inputs. All four bits are correct together on 29 of 96 held-out inputs (304 correct bits out of 384). I verify three circuits on all 256 inputs. Across five HX8K routes each, median delay and cell count are 9.296 ns and 128 for signed sums, 5.593 ns and 43 for balanced popcount, and 7.742 ns and 58 for the partition chosen among 35. Minimising distinct counters fails to beat the reference.
I hard-wire the weights and launch eight input bits for four output bits. With common register banks, a 100 MHz parallel interface can issue one vector per cycle when the selected seed meets timing. The signed sum reaches 10.052 ns on one seed. In a half-duplex scenario that sends eight bits, waits one cycle and reads four bits, all three descriptions take thirteen cycles per vector. This is a calculated interface budget. Board throughput remains unmeasured. After interrupting the default router on the fourth signed-sum seed, I used router2 for all fifteen measurements. From the kit I run python apprendre.py --rebuild YOSYS NEXTPNR --export rebuilt.json to regenerate the reports.
My next test is to route several tied partitions and compare fan-out and depth. AT.H10 · Umuroglu et al., FINN
Seven counters outperform two six-counter partitions on a frozen layer
I route three partitions of one binary layer on HX8K with five seeds each and check all 256 possible inputs. The two six-counter partitions give estimated median delays of 7.742 and 7.623 ns. The seven-counter partition gives 6.405 ns. The specialised reference achieves 5.593 ns and 43 cells against 57 for the seven-counter partition. Ports require eight input and four output bits. In my one-bit serial protocol a transaction takes thirteen cycles. These results describe place-and-route for a synthetic layer.
I plan to commit to a depth-based prediction before routing additional partitions with the same seeds. AT.H11 · Umuroglu et al., FINN
Two partitions reverse the expected ranking
I predict depths eight and seven for six and seven counters. After synthesis I get seven and eight. Across five HX8K routing seeds the median delays are 6.685 and 7.686 ns. The specialised reference remains at 5.593 ns. Output quality is identical.
Test held-out weights and a cost fixed before routing, then measure on a board. AT.H12 · Umuroglu et al., FINN
Changing weights while preserving the function up to symmetry
I complement all eight weight bits, retain thresholds and compare equivalent descriptions on HX8K across five seeds. I check all 256 outputs by conjugating the input. The minimum-counter partition uses six counters, 55 cells and a 7.686 ns median delay against 43 cells and 5.264 ns for popcount. My predicted gain fails. The transported evaluation retains 29/96 exact classes.
I will fix weights outside this symmetry and measure on a physical target when available. AT.H13 · Umuroglu et al., FINN
Testing a prediction on different binary weights
I fix weights 01, 07, 3F, FF and four thresholds of two before five HX8K placements. The pairwise weight distances differ from the previous family. Both descriptions agree on all 256 logical outputs. Popcount wins on delay for all five seeds, median 6.209 ns and 46 cells versus 6.735 ns and 44 cells. These weights classify 9 of 96 held-out inputs correctly. I measure the circuit trade-off here.
Reserve trained weights meeting an accuracy target and measure end-to-end cost. AT.H14 · Umuroglu et al., FINN
Check the gain after FPGA routing
I enumerate minimum chains modulo 16, then synthesize both outputs jointly or from separate minimum chains. I allow synthesis to merge logic, prove combinational equivalence to multiplication by SAT, and hold the HX8K-CT256 target, pins, registers and 100 MHz timing constraint fixed. Of the four reserved pairs, (9,11) goes from 3.465 to 2.562 ns and from 19 to 14 logic cells. The other three pairs tie on delay on all three seeds. I measure the router’s timing estimate.
Change the inputs · AT.EX19.05 · Voronenko & Püschel · Multiple constant multiplication · Yosys · synth_ice40
I reproduce · python place19.py YOSYS NEXTPNR_ICE40
Historical results — D09 · Clearing the correction bit after a modular step, D10 · Clearing the quotient of a block Horner step, D11 · Trading auxiliary bits for Toffoli gates