Shifted partial products of unsigned words #
One circuit layer selects the shifted first word by one bit of the second word. Bits shifted past the output width are discarded; this computes a modular partial product on every input.
Main definitions #
Cslib.Circuits.Boolean.Modular.partialProduct: a shifted partial-product word.
Main results #
Cslib.Circuits.Boolean.Modular.val_eval_partialProduct: its exact unsigned modular value.Cslib.Circuits.Boolean.Modular.depth_partialProduct_le: one circuit layer suffices.
References #
The carry-save multiplication construction is standard binary partial-product arithmetic; see Vollmer, Chapter 1.
theorem Cslib.Circuits.Boolean.Modular.val_eval_partialProduct {w : ℕ} (i : Fin w) (a b : BitString w) :
↑((BitString.equivFin w) ((partialProduct w i).eval interpretation (Fin.append a b))) = if b i = true then ↑((BitString.equivFin w) a) * 2 ^ ↑i % 2 ^ w else 0
Unsigned value of one shifted partial product, including overflow truncation.
@[simp]
Exactly one gate per output bit, including the false low positions.
All product digits are produced in parallel at depth one.