Efficient Implementations of Residue Generators Mod 2n + 1 Providing Diminished-1 Representation
Stanisław J. Piestrak, Piotr Patronik
TL;DR
This paper addresses efficient input conversion for residue number systems whose moduli include the odd form $2^n+1$, focusing on delivering operands in the diminished-1 (D1) representation. The authors propose a universal residue generator architecture for mod $2^n+1$ that accepts a $p$-bit input and, for $p \ge 4n$, partitions it into $q=\lceil p/(2n) \rceil$ blocks, processes them with a $q$-operand carry-save adder (CSA) with end-around carry, and yields a residue in D1 form via a final 4-operand adder modulo $2^n+1$ (where COR$_{2^n+1}=0$). They also extend the design to bi-residue generators for conjugate moduli $2^n \pm 1$ by sharing the same hardware to produce residues for both moduli directly in D1 form. The approach provides scalable, low-cost input converters suitable for RNS implementations in DSP, cryptography, and communications, with hardware sharing across conjugate moduli and preserved D1 efficiency.
Abstract
The moduli of the form 2n + 1 belong to a class of low-cost odd moduli, which have been frequently selected to form the basis of various residue number systems (RNS). The most efficient computations modulo (mod) 2n + 1 are performed using the so-called diminished-1 (D1) representation. Therefore, it is desirable that the input converter from the positional number system to RNS (composed of a set of residue generators) could generate the residues mod 2n + 1 in D1 form. In this paper, we propose the basic architecture of the residue generator mod 2n + 1 with D1 output. It is universal, because its initial part can be easily designed for an arbitrary p >= 4n, whereas its final block-the 4-operand adder mod 2n + 1-preserves the same structure for any p. If a pair of conjugate moduli 2n +/- 1 belongs to the RNS moduli set, the latter architecture can be easily extended to build p-input bi-residue generators mod 2n+/-1, which not only save hardware by sharing p - 4n full-adders, but also generate the residue mod 2n + 1 directly in D1 form.
