Skip to main content

emit_bigint_div_verilog

Function emit_bigint_div_verilog 

Source
pub fn emit_bigint_div_verilog() -> String
Expand description

Emit the BigInt divide block — a sequential 256-bit UNSIGNED long divider (1 bit/cycle restoring, W cycles) computing q = a / b, r = a % b over magnitudes, b==0 -> q=r=0. The wide analogue of shared_divider’s magnitude core (no signed fixup — BigInt carries its sign separately); it feeds the numeric-tower BigInt divide the way shared_divider feeds the 32-bit ALU. 4,340 LUT / 1,548 FF on the ECP5-85K. Proven == the reference magnitude division by iverilog (tb_bigint_div) and == numeric::mag_div’s algorithm by the Rust model test below.