
1
Towards the Multiple Constant Multiplication at
Minimal Hardware Cost
R´
emi Garcia and Anastasia Volkova
Abstract—Multiple Constant Multiplication (MCM) over inte-
gers is a frequent operation arising in embedded systems that
require highly optimized hardware. An efficient way is to replace
costly generic multiplication by bit-shifts and additions, i. e. a
multiplierless circuit. In this work, we improve the state-of-
the-art optimal approach for MCM, based on Integer Linear
Programming (ILP). We introduce a new lower-level hardware
cost, based on counting the number of one-bit adders and
demonstrate that it is strongly correlated with the LUT count.
This new model for the multiplierless MCM circuits permitted us
to consider intermediate truncations that permit to significantly
save resources when a full output precision is not required. We
incorporate the error propagation rules into our ILP model
to guarantee a user-given error bound on the MCM results.
The proposed ILP models for multiple flavors of MCM are
implemented as an open-source tool and, combined with the
FloPoCo code generator, provide a complete coefficient-to-VHDL
flow. We evaluate our models in extensive experiments, and
propose an in-depth analysis of the impact that design metrics
have on actually synthesized hardware.
Index Terms—multiple constant multiplication, multiplierless
hardware, ILP, datapath optimization
I. INTRODUCTION
Multiplications by integer constants arise in many numerical
algorithms and applications. In particular, algorithms that tar-
get embedded systems often involve Fixed-Point (FxP) num-
bers which can be assimilated to integers. These algorithms
range from dot-product evaluation for deep neural networks
to more complex algorithms such as digital filters.
In order to save hardware resources, the knowledge on the
constants to multiply with can be used in dedicated multipli-
erless architectures, instead of costly generic multipliers [1].
The shift-and-add approach is the privileged method to reduce
hardware cost, it consists in replacing multiplications by
additions/subtractions and bit-shifts, which are multiplications
of the data by a power of two that can be hardwired for a
negligible cost. For example, multiplying an integer variable
xby the constant 7can be rewritten as 7x= 23x−x, reducing
the cost to a single bit-shift by three positions to the left and
a subtraction, instead of a multiplication.
Given a set of target constants to multiply with, finding
the implementation with the lowest cost is called the Multiple
Constant Multiplication (MCM) problem. Typical way to
tackle the problem is to find shift-and-add implementations
represented using adder graphs, as in Fig. 1, that describe the
multiplierless solutions with the minimum number of adders.
In the following, this problem will be referred to as the MCM-
Adders. The main objective of this work is to first improve
R. Garcia and A. Volkova were with Nantes Universit´
e, CNRS, LS2N,
44000 Nantes. Email: firstname.lastname@univ-nantes.fr
the existing approaches for the MCM-Adders problem, then
push towards finer-grained hardware cost metrics counting
number of one-bit adders (the MCM-Bits problem), and
finally, use truncations in internal data paths to considerably
save resources (the tMCM problem).
It is straightforward to obtain a first shift-and-add solution
from the binary representation of the constant. A greedy
algorithm based on the Canonical Signed Digit (CSD) rep-
resentation permits to reduce the number of adders [2], [3].
Many heuristics enhance the results obtained with the CSD
method [4]–[8], but heuristics do not provide any guarantee on
the solution quality. Optimal approaches for the MCM-Adders
can be roughly divided into two categories: (i) first approaches
based on hypergraphs [9] and Integer Linear Programming
(ILP) model [10], which can be solved by generic solvers;
(ii) dedicated optimal algorithms based on branch and bound
technique proposed and further developed by Aksoy et al. [11].
In this work, we improve and extend the results of the first
category of approaches, since ILP-based modeling offers a
better versatility for extensions than dedicated algorithms, and
permits to rely on the efficiency of generic solvers.
The state-of-the-art ILP-based model for the MCM-Adders
was proposed by Kumm in [12]. This method finds optimal
solutions in terms of the number of adders in reasonable time,
and has been adapted to SAT/SMT solvers [13] for single
constant multiplication. However, we found an error in the
model which makes it miss some optimal solutions.
In this work, we use [12] as basis, correct the modeling
error for the MCM-Adders problem and build upon it to
solve other flavors of the MCM. In particular, the number
of cascaded adders, called the adder depth (AD), directly
impacts the delay of the circuit, and is hence desired to be
bounded. We first encode the AD count in our ILP model,
and secondly propose, for the first time, a new bi-objective
formulation called MCMAD, which minimizes the number of
adders and the AD simultaneously.
One of the main contributions of this paper is solving the
MCM for a low-level hardware metric based on counting the
one-bit adders, when the word length of the input xis known
a priori. Assume adder graphs in Fig. 1 taking a 3-bit input x.
While both require only three adders, the solution in Fig. 1a
requires 22 one-bit adders and the other in Fig. 1b uses only 9.
While classical bit-level optimization approaches are iterative
and require synthesis and simulations [4], [14], solving the
MCM with a fine-grained cost model is done only once. By
one-bit adders, we gather both half and full adders as logic
elements having roughly the same cost. This low-level metric
has been discussed for decades, see [4] in which a heuristic
for fixing the topology was presented. To our knowledge, we
arXiv:2210.02742v2 [cs.AR] 10 Oct 2022