Design and Analysis of RNS-based Sign Detector For
Design and Analysis of RNS-based Sign Detector For
Corresponding Author:
Raj Kumar
Electronics and Communication Engineering Department
Motilal Nehru National Institute of Technology Allahabad
Prayagraj-211004, India
Email: [email protected]
1. INTRODUCTION
Unlike the binary number system (BNS), the residue number system (RNS) is a non-weighted and
non-conventional representation. RNS has some properties that can be used in many mathematical operations
that give better results when compared to BNS. In RNS, a large positive integer X is represented using a set
of smaller integers known as residues {x1, x2,…, xN} and a set of co-prime integers known as moduli set {m1,
m2,…, mN}. Addition [1-3] and multiplication [4-6] are two main basic arithmetic operations in RNS.
Remarkably, RNS has non-weighted representation, such that the addition and multiplication operations can
be performed simultaneously and independently in each residue channel. Therefore, no carry propagation
occurs from one residue channel to another. Hence it is also known as carry free number system. Due to this
nature of RNS, it is used in applications that require low power dissipation and high speed, such as digital
communications systems [7], digital signal processing [8-12], and cryptography [13-14]. For all such
applications, RNS provides outstanding performance with high computational speed, lesser area, and low
power dissipation, which are the major objective of today’s real-time processors. Additionally, the reverse
conversion [15-17], division [18-19], scalar [20], magnitude comparison [21-22], overflow detection [23-25]
and sign detection [26-37] are also the essential operation of RNS. These operations are not easy to perform
in RNS. Therefore, an improvement in such areas may lead to advanced DSP architectures using RNS. As,
sign detection plays an important role in DSP applications.
In addition, a sign detection circuit is also used in division and comparison operations. So, the sign
detection is an important arithmetic operation of RNS. The reverse converter can be used as a sign detector as
the most significant bit (MSB) of the reverse converter represents the sign of residue number. However, this
process is very complex. So, in order to avoid the complexity of the circuit, a truncated version of the reverse
converter is used as a sign detector. Recently numerous efforts have been made in the area of sign detector,
which presents different architectures of sign detector for different moduli sets. Some of them are designed
for universal moduli set [26-29], 3-moduli set [30-34] and extended moduli set [35-37]. The 3-moduli set {2n
–1, 2n, 2n+1} is very popular as this results in less complex arithmetic circuits due to the availability of the
number of modulo properties. Also, the forward and reverse converter circuits require fewer components than
other moduli sets.
Initially, the sign detector was implemented using the look-up-table concept that requires some
memories to store the look-up-table data [26]. These types of sign detectors were suitable only for small
word-length and practically, it is not realizable for larger word-length as it requires huge memories. To
overcome this problem, VLSI component based sign detector is proposed in [27] without using any look-up-
table. However, the sign detector presented in [27] is very complex as it was implemented using modulo
multipliers. Moreover, the sign detection circuit for modulo {2 n-1, 2n, 2n+1} using CRT-II was presented in
[30] that was implemented using two carry generation circuits, a carry-save adder (CSA), and some basic
gates. Again, a new sign detector was presented in [31], in which a comparator is used in place of the carry
generation circuit to improve the performance of [30]. The recent sign detection circuit using CRT-II and
scaling technique is proposed in [33], which was implemented using a carry-generator, a CSA for the
accumulation of three numbers, and a adder structure for the calculation of the most significant bit. This
paper presents a sign detection circuit for modulo {2 n-1, 2n, 2n+1} which is based on a mixed radix
conversion theorem that requires less circuit as compared to the previous one.
Section 1 itself describes the overview and applications of RNS, and also it consists of a brief
overview of sign detection. The remaining paper is ordered in the following sequence: The representation of
a number in RNS and some essential properties used to simplify the proposed algorithm are explained in
Section 2. The introduced algorithm of sign detector and their circuit implementation are discussed in Section
3. The analysis and comparison of proposed and existing designs for the same moduli set are described in
Section 4. At last, a brief summary of the proposed work is drawn in conclusion Section 5.
2. PRELIMINARIES
As per the previous discussion, a positive integer X is denoted by its residues {x1, x2,…, xN} and a
set of co-prime integers known as moduli set {m1, m2, . . . , mN}. The integer X should follow the condition
N
0 X M , where M represents the dynamic range of X, M m . The residues x is the remainder when
i 1
i i
0,if X M / 2
sign( X s )
1,if M / 2 X M (1)
M M
Xs X
2 M 2
(2)
Where, . and . are the smallest and greatest integer function, respectively, i.e. 5.2 6 and
5.2 5 .
Some of the essential properties of RNS used to design efficient sign detector circuits are discussed
here.
Property 1: The modulo of a negative integer X can be obtained by,
Design and Analysis of RNS-based Sign Detector for Moduli Set {2n, 2n-1, 2n+1} (Raj Kumar)
64 ISSN: 2502-4752
X if m 2 1
n
X
X 1if m 2
m n
2p X CLS ( X , p)
2n 1
X Y 2n 1 X Y Co 2n
in this paper, the MRC theorem is used to determine integer X from its residues (x1, x2, x3) and moduli set
{m1, m2, m3}. According to the MRC theorem,
X z3 m3 m1 z2 m3 z1
(3)
where, 0 ≤ z1 < m3, 0 ≤ z2 < m1 and 0 ≤ z3 < m2. The MSB of (3) represents the sign bit of X which is equal to
the MSB of z3. Therefore, our aim is to determine the MSB of z3.
To determine the value of z1, apply modulo m3 in (3), it gives,
z1 x3 (4)
X m1
z2 m3 z1 m
1
(5)
x1 2 z2 x3 m1
(6)
x1 km1 2 z2 x3
(7)
Indonesian J Elec Eng & Comp Sci, Vol. 22, No. 1, April 2021 : 62 - 70
Indonesian J Elec Eng & Comp Sci ISSN: 2502-4752 65
where, k is the scalar integer. Multiplying (7) by 2n-1 and rearranging the equation for z2 and take modulo m1,
z2 2n1 ( x1 x3 )
2n 1 (8)
Now, x3 2n 1
2n x3,n x3,n 1:0
2n 1
substitute the (9) and (10) into (8) and also applying properties 1 and 3, we have,
x2 z3 (22n 1) z2 (2n 1) z1
2n (12)
x2 z3 z2 x3 2n
(13)
z3 ( x3 x2 ) z2 km2 (14)
applying modulo m2 on both side of (14) and also substitute the value of z2 from (11),
z3 ( x3 x2 ) xˆ1 xˆ3 Co
2n (15)
the term x3 2n
can be written as x3, n 1:0 and applying property 1 in (15),
the term x3,n 1:0 xˆ3 of (16) can be further simplified as,
2n
the MSB of z3 can be determined from the simplified (18) that can be used as sign bit, i.e., sign (X)=sign (z3).
There are two cases of z3: when MSB of z3 is 0, i.e., 0 z3 2n 1 , in this case, the integer X is a positive
number. In other cases, when MSB of z3 is 1, i.e., 2n 1 z3 2n , that means the integer X is a negative
number.
Design and Analysis of RNS-based Sign Detector for Moduli Set {2n, 2n-1, 2n+1} (Raj Kumar)
66 ISSN: 2502-4752
Now, the proposed design of the sign detector can be implemented from (18) using a CSA, carry
generator, and a modified parallel-prefix adder (MPPA) as shown in Figure 1. Here, the CSA is used to
accumulate the three numbers, which is used to obtain the sum S sn 1 : 0 and carry C cn 1 : 1 0 in (18).
As in (18) modulo 2n is taken; therefore, the carry generation in the CSA circuit is not required, so it can now
be neglected. For the more significant architecture of sign detector, replace the bit c0=0 of carry C by x3,0 of
(18). The new carry vector will be C cn 1 : 1 x3,0 . The carry Co of (11) can be generated using PPA
structure with some modification as depicted in Figure 2. Figure 3 shows the circuit diagram of the modified
parallel-prefix adder structure for n=8. This circuit is a modification of the parallel prefix adder structure,
which is intentionally designed to generate only MSB bit, i.e. MSB (z3).
Example: For n=8, {m1, m2, m3}={255, 256, 257} and the dynamic range, M=16776960. Let a
signed integer Xs=-440 which is equals to the integer X=16776520 in the given RNS. The residue of X is {x1,
x2, x3}={70, 72, 74}. The integers x1, x2 and x3 can be written as (01000110)2, (01001000)2 and (001001010)2,
respectively. To determine the values of z3 of (18), some intermediate terms are required that can be
determined using (9) and (10): xˆ1 00100011 and xˆ3 00100101 . Also, x2 and x3,0 can be written directly
from x2 and x3, i.e., x2 10110111 and x3,0=0. The term Co can be determine from (11), xˆ1 xˆ3 (72)10
which is less than 255 (28-1), so from property 3, Co=0. Now, substitute all these values in (18),
z3 00100011 10110111 00100101 0 0 11111111 . Since, the MSB of z3 is 1, the integer Xs represented
by {70, 72, 74} is negative number.
C x3,0
S
C
Co
Modified parallel prefix adder
X MSB
x̂1,7 x̂3,7 ...
x̂1,0 x̂3,0
pi, gi
Co gi pi
g p
Indonesian J Elec Eng & Comp Sci, Vol. 22, No. 1, April 2021 : 62 - 70
Indonesian J Elec Eng & Comp Sci ISSN: 2502-4752 67
s6 c6 s5 c5 s4 c4 s3 c3 s2 c2 s1 c1 s0 x3,0
g6:0
p6:0 Co
s7 c7
XMSB
Figure 4. Delay of sign detectors based on UGM Figure 5. Area of sign detectors based on UGM
Design and Analysis of RNS-based Sign Detector for Moduli Set {2n, 2n-1, 2n+1} (Raj Kumar)
68 ISSN: 2502-4752
Figure 6. Synthesized area (μm2) of sign detectors Figure 7. Synthesized delay (ns) of sign detectors
Figure 8. Total power dissipation of sign detectors Figure 9. Power-delay product (PDP) of sign
detectors
5. CONCLUSION
In this paper, a new sign detector based on the MRC theorem for RNS {2n-1, 2n, 2n+1} is described.
Furthermore, the proposed design is validated using the numerical example and compared with the recent
sign detectors. All the considered designs are synthesized using the Synopsys tool; the synthesized result
states that the analyzed architecture requires lesser area and power dissipation than others. Also, it has the
lowest ADP and PDP that are the prime objectives for real-time processing in portable devices. The analysis
reveals that the proposed design saves upto 52% area, 77% delay and 63% power dissipation when compared
to the other sign detection circuit for the same moduli set. So, the described sign detector using RNS can give
better performance for high-speed and low power applications.
Indonesian J Elec Eng & Comp Sci, Vol. 22, No. 1, April 2021 : 62 - 70
Indonesian J Elec Eng & Comp Sci ISSN: 2502-4752 69
REFERENCES
[1] L. Kalampoukas, D. Nikolos, C. Efstathiou, H. T. Vergos, and J. Kalamatianos, “High-speed parallel-prefix module
2^n-1 adders,” IEEE Trans. Comput., vol. 49, no. 7, pp. 673-680, 2000, doi: 10.1109/12.863036.
[2] H. T. Vergos and D. Bakalis, “Area-time efficient multi-modulus adders and their applications,” Microprocess.
Microsyst., vol. 36, no. 5, pp. 409-419, 2012, doi: 10.1016/j.micpro.2012.02.004.
[3] S. K. Singhal, B. K. Mohanty, S. K. Patel, and G. Saxena, “Efficient Diminished-1 Modulo (2n+1) Adder Using
Parallel Prefix Adder,” J. Circuits, Syst. Comput., p. 2050186, 2020, doi: 10.1142/S0218126620501868.
[4] R. Zimmermann, “Efficient VLSI implementation of modulo (2 n ± 1) addition and multiplication,” Proc. 14th IEEE
Symp. Comput. Arith. (Cat. No.99CB36336), no. 4, pp. 158-167, 1999, doi: 10.1109/ARITH.1999.762841.
[5] R. Muralidharan and C.-H. H. Chang, “Radix-4 and Radix-8 booth encoded multi-modulus multipliers,” IEEE
Trans. Circuits Syst. I Regul. Pap., vol. 60, no. 11, pp. 2940-2952, 2013, doi: 10.1109/TCSI.2013.2252642.
[6] R. Kumar, R. K. Jaiswal, and R. A. Mishra, “Perspective and Opportunities of Modulo 2 n-1 Multipliers in Residue
Number System: A Review,” J. Circuits, Syst. Comput., vol. 29, no. 11, p. 2030008, 2020, doi:
10.1142/S0218126620300081.
[7] A. S. Madhukumar and F. Chin, “Enhanced architecture for residue number system-based CDMA for high-rate data
transmission,” IEEE Trans. Wirel. Commun., vol. 3, no. 5, pp. 1363-1368, 2004, doi: 10.1109/TWC.2004.833509.
[8] P. V. A. Mohan, "Residue number systems: algorithms and architectures," Springer Science and Business Media,
vol. 677, 2012.
[9] R. Conway and J. Nelson, “Improved RNS FIR filter architectures,” IEEE Trans. Circuits Syst. II Express Briefs,
vol. 51, no. 1, pp. 26-28, 2004, doi: 10.1109/TCSII.2003.821524.
[10] J. Ramirez, U. Meyer-Base, A. Garcia, and A. Lloris, “Design and implementation of RNS-based adaptive filters,”
Proc. 13th Int. Conf. F. Program. Log. Appl. Lisbon, Spain, pp. 1135-1138, 2003, doi: 10.1007/978-3-540-45234-
8_138.
[11] C. B. Dutta, P. Garai, and A. Sinha, “Design of a reconfigurable DSP processor with bit efficient residue number
system,” Int. J. VLSI Des. Commun. Syst., vol. 3, no. 5, pp. 175-189, 2012, doi: 10.1109/TETC.2020.2997067.
[12] G. carlo Cardarilli, L. Di Nunzio, R. Fazzolari, A. Nannarelli, M. Petricca, and M. Re, “Design Space Exploration
based Methodology for Residue Number System Digital Filters Implementation,” IEEE Trans. Emerg. Top.
Comput., 2020, doi: 10.1109/TETC.2020.2997067.
[13] J.-C. C. Bajard and L. Imbert, “A Full RNS Implementation of RSA,” IEEE Trans. Comput., vol. 53, no. 6, pp.
769-774, 2004, doi: 10.1109/TC.2004.2.
[14] J. Schwemmlein, K. C. Posch, and R. Posch, “RNS-modulo reduction upon a restricted base value set and its
applicability to RSA cryptography,” Comput. Secur., vol. 17, no. 7, pp. 637-650, 1998, doi: 10.1016/S0167-
4048(99)80061-3.
[15] S. Andraos and H. Ahmad, “A New efficient memoryless residue to binary converter,” IEEE Trans. circuits Syst.,
vol. 35, no. 11, pp. 1441-1444, 1988, doi: 10.1109/31.14470.
[16] P. Patronik and S. J. Piestrak, “Design of reverse converters for general RNS moduli Sets {2 k, 2n-1, 2n+1, 2n+1-1}
and {2k, 2n-1, 2n+1, 2n-1-1} (n even),” IEEE Trans. Circuits Syst. I Regul. Pap., vol. 61, no. 6, pp. 1687-1700, 2014,
doi: 10.1109/TCSI.2013.2290843.
[17] R. K. Jaiswal, R. Kumar, and R. A. Mishra, “Area Efficient Memoryless Reverse Converter for New Four Moduli
Set {2n−1, 2n − 1, 2n+1, 22n+1 − 1},” J. Circuits, Syst. Comput., no. 26, p. 1850075, 2017, doi:
10.1142/S0218126618500755.
[18] M. A. Hitz and E. Kaltofen, “Integer division in residue number systems,” IEEE Trans. Comput., vol. 44, no. 8, pp.
983-989, 1995, doi: 10.1109/12.403714.
[19] Z. Torabi, G. Jaberipur, and A. Belghadr, “Fast division in the residue number system {2n+1, 2n, 2n-1} based on
shortcut mixed radix conversion,” Comput. Electr. Eng., vol. 83, p. 106571, 2020, doi:
10.1016/j.compeleceng.2020.106571.
[20] A. Hiasat, “A New Scaler for the Expanded 4-Moduli Set {2k-1, 2k+ 1, 22k+ 1, 22k},” in 2020 11th International
Conference on Information and Communication Systems (ICICS), pp. 429-433, 2020, doi:
10.1109/ICICS49469.2020.239547.
[21] G. Dimauro, S. Impedovo, and G. Pirlo, “A new technique for fast number comparison in the residue number
system,” IEEE Trans. Comput., vol. 42, no. 5, pp. 608-612, 1993, doi: 10.1109/12.223680.
[22] L. Sousa, “Efficient method for magnitude comparison in RNS based on two pairs of conjugate moduli,” Proc.-
Symp. Comput. Arith., pp. 240-247, 2007, doi: 10.1109/ARITH.2007.16.
[23] M. Askarzadeh, M. Hosseinzadeh, and K. Navi, “A New approach to overflow detection in moduli set {2n-3, 2n-1,
2n+ 1, 2n+ 3},” in 2009 Second International Conference on Computer and Electrical Engineering, vol. 1, pp. 439-
442, 2009, doi: 10.1109/ICCEE.2009.197.
[24] M. Rouhifar, M. Hosseinzadeh, S. Bahanfar, and M. Teshnehlab, “Fast Overflow Detection in Moduli Set {2n-1, 2n,
2n+1},” Int. J. Comput. Sci., vol. 8, no. 3, pp. 407-414, 2011.
[25] H. Siewobr and K. A. Gbolagade, “RNS Overflow Detection by Operands Examination,” Int. J. Comput. Appl., vol,
85, no. 18, pp. 1-5, 2014, doi: 10.5120/14938-2906.
[26] T. Van Vu, “Efficient Implementations of the Chinese Remainder Theorem for Sign Detection and Residue
Decoding,” IEEE Trans. Comput., vol. c-34, no. 7, pp. 646-651, 1985, doi: 10.1109/TC.1985.1676602.
[27] G. Alia and E. Martinelli, “Sign detection in residue arithmetic units,” J. Syst. Archit., vol. 45, no. 3, pp. 251-258,
1998, doi: 10.1016/S1383-7621(97)00085-4.
[28] E. Al-Radadi and P. Siy, “RNS sign detector based on Chinese remainder theorem II (CRT II),” Comput. Math.
with Appl., vol. 46, no. 10-11, pp. 1559-1570, 2003, doi: 10.1016/S0898-1221(03)90191-X.
Design and Analysis of RNS-based Sign Detector for Moduli Set {2n, 2n-1, 2n+1} (Raj Kumar)
70 ISSN: 2502-4752
[29] M. Akkal and P. Siy, “Optimum RNS sign detection algorithm using MRC-II with special moduli set,” J. Syst.
Archit., vol. 54, no. 10, pp. 911-918, 2008, doi: 10.1016/j.sysarc.2008.03.003.
[30] T. Tomczak, “Fast Sign Detection for RNS {2n-1, 2n, 2n+1},” IEEE Trans. Circuits Syst. I Regul. Pap., vol. 55, no.
6, pp. 1502-1511, 2008, doi: 10.1109/TCSI.2008.917994.
[31] M. Xu, R. Yao, and F. Luo, “Low-Complexity Sign Detection Algorithm for RNS {2n-1, 2n, 2n+1},” IEICE Trans.
Electron., vol. E95.C, no. 9, pp. 1552-1556, 2012, DOI: 10.1587/transele.E95.C.1552.
[32] S. Kumar and C.-H. Chang, “A high-speed and area-efficient sign detector for three moduli set RNS {2n, 2n-1,
2n+1},” in 2015 IEEE 11th International Conference on ASIC (ASICON), pp. 1-4, 2015, doi:
10.1109/ASICON.2015.7516929.
[33] R. Kumar and R. A. Mishra, “Design of Efficient Sign Detector for Moduli Set {2n-1, 2n, 2n+1} in Residue Number
System,” Proc.-2019 Int. Conf. Electr. Electron. Comput. Eng. UPCON 2019, pp. 1-5, 2019, doi:
10.1109/UPCON47278.2019.8980093.
[34] S. Kumar and C.-H. Chang, “A New Fast and Area-Efficient Adder-Based Sign Detector for RNS {2n-1, 2n, 2n+
1},” IEEE Trans. Very Large Scale Integr. Syst., vol. 24, no. 7, pp. 2608-2612, 2016, doi:
10.1109/TVLSI.2016.2516522.
[35] C.-H. Chang and S. Kumar, “Area-efficient and fast sign detection for four-moduli set RNS {2n-1, 2n, 2n+ 1, 22n+
1},” in 2014 IEEE International Symposium on Circuits and Systems (ISCAS), pp. 1540-1543, 2014, doi:
10.1109/ISCAS.2014.6865441.
[36] C.-H. C. and Sachin Kumar, “New Algorithm for Signed Integer Comparison in {2n+k, 2n −1, 2n+1, 2n ± 1 −1} and
Its Efficient Hardware Implementation,” IEEE Trans. CIRCUITS Syst., vol. 64, no. 6, pp. 1481-1493, 2017, doi:
10.1109/TCSI.2016.2561718.
[37] A. Hiasat, “Sign detector for the extended four-moduli set {2n − 1, 2n+1, 22n+1, 2n+k },” IET Comput. Digit. Tech.,
vol. 12, no. 2, pp. 39-43, 2018, doi: 10.1049/iet-cdt.2017.0088.
BIOGRAPHIES OF AUTHORS
Raj Kumar was born in Prayagraj, India. He received his B.Tech degree in Electronics and
Communication from GBTU, Lucknow, India in 2011 and M.Tech degree in Digital Systems
from MNNIT Allahabad, India in 2015. Currently he is pursuing Ph.D. degree in Electronics and
Communication Engineering at MNNIT Allahabad, India. His research interests are in Residue
number arithmetic and VLSI design.
Ram Awadh Mishra was born in Balia, India. He received the B.Tech. degree in Electronics
Engineering from Kamla Nehru Institute of Technology, Sultanpur, India in 1989, the M.S.
degree in Electronics and Control from Birla Institute of Technology and Science, Pilani, India in
1996 and the Ph.D. degree in Engineering from Jadavpur University, Kolkata, India in 2006. He
is currently an Professor in Electronics and Communication Engineering Department at Motilal
Nehru National Institute of Technology Allahabad, India. His area of research is on the subject of
Device Modeling, Residue Number System based Signal Processing and Low Power VLSI
Design. He has published various research papers in reputed journals and conferences.
Indonesian J Elec Eng & Comp Sci, Vol. 22, No. 1, April 2021 : 62 - 70