A Suggestion for a Fast Residue Multiplier for a Family of Moduli of the Form (2 n (2 p ± 1))

Similar documents
A High-Speed Realization of Chinese Remainder Theorem

Novel Modulo 2 n +1Multipliers

An Effective New CRT Based Reverse Converter for a Novel Moduli Set { 2 2n+1 1, 2 2n+1, 2 2n 1 }

On Equivalences and Fair Comparisons Among Residue Number Systems with Special Moduli

Volume 3, No. 1, January 2012 Journal of Global Research in Computer Science RESEARCH PAPER Available Online at

KEYWORDS: Multiple Valued Logic (MVL), Residue Number System (RNS), Quinary Logic (Q uin), Quinary Full Adder, QFA, Quinary Half Adder, QHA.

International Association of Scientific Innovation and Research (IASIR) (An Association Unifying the Sciences, Engineering, and Applied Research)

International Journal of Advanced Research in Computer Science and Software Engineering

Implementation Of Digital Fir Filter Using Improved Table Look Up Scheme For Residue Number System

GENERALIZED ARYABHATA REMAINDER THEOREM

Lecture 8: Sequential Multipliers

AREA EFFICIENT MODULAR ADDER/SUBTRACTOR FOR RESIDUE MODULI

A COMBINED 16-BIT BINARY AND DUAL GALOIS FIELD MULTIPLIER. Jesus Garcia and Michael J. Schulte

Performance Evaluation of Signed-Digit Architecture for Weighted-to-Residue and Residue-to-Weighted Number Converters with Moduli Set (2 n 1, 2 n,

Arithmetic in Integer Rings and Prime Fields

What s the Deal? MULTIPLICATION. Time to multiply

Chapter 5 Arithmetic Circuits

Design and Implementation of Efficient Modulo 2 n +1 Adder

Midterm Exam Two is scheduled on April 8 in class. On March 27 I will help you prepare Midterm Exam Two.

Logic and Computer Design Fundamentals. Chapter 5 Arithmetic Functions and Circuits

CS 140 Lecture 14 Standard Combinational Modules

VLSI Arithmetic. Lecture 9: Carry-Save and Multi-Operand Addition. Prof. Vojin G. Oklobdzija University of California

A VLSI Algorithm for Modular Multiplication/Division

Svoboda-Tung Division With No Compensation

National Taiwan University Taipei, 106 Taiwan 2 Department of Computer Science and Information Engineering

The equivalence of twos-complement addition and the conversion of redundant-binary to twos-complement numbers

ARITHMETIC COMBINATIONAL MODULES AND NETWORKS

Chinese Remainder Algorithms. Çetin Kaya Koç Spring / 22

Hardware Design I Chap. 4 Representative combinational logic

assume that the message itself is considered the RNS representation of a number, thus mapping in and out of the RNS system is not necessary. This is p

A Bit-Serial Unified Multiplier Architecture for Finite Fields GF(p) and GF(2 m )

Proposal to Improve Data Format Conversions for a Hybrid Number System Processor

Forward and Reverse Converters and Moduli Set Selection in Signed-Digit Residue Number Systems

Class Website:

Chinese Remainder Theorem

Design and FPGA Implementation of Radix-10 Algorithm for Division with Limited Precision Primitives

AN IMPROVED LOW LATENCY SYSTOLIC STRUCTURED GALOIS FIELD MULTIPLIER

Efficient Hardware Implementation of Finite Fields with Applications to Cryptography

SUFFIX PROPERTY OF INVERSE MOD

Computer Architecture 10. Residue Number Systems

DIGITAL TECHNICS. Dr. Bálint Pődör. Óbuda University, Microelectronics and Technology Institute

Binary addition by hand. Adding two bits

Chapter 5. Digital Design and Computer Architecture, 2 nd Edition. David Money Harris and Sarah L. Harris. Chapter 5 <1>

Lecture 8. Sequential Multipliers

Tree and Array Multipliers Ivor Page 1

Residue Number Systems Ivor Page 1

Computer Architecture 10. Fast Adders

Cost/Performance Tradeoff of n-select Square Root Implementations

Proposal to Improve Data Format Conversions for a Hybrid Number System Processor

Information encoding and decoding using Residue Number System for {2 2n -1, 2 2n, 2 2n +1} moduli sets

ISSN (PRINT): , (ONLINE): , VOLUME-5, ISSUE-7,

9. Datapath Design. Jacob Abraham. Department of Electrical and Computer Engineering The University of Texas at Austin VLSI Design Fall 2017

ECE380 Digital Logic. Positional representation

Subquadratic space complexity multiplier for a class of binary fields using Toeplitz matrix approach

ISSN (PRINT): , (ONLINE): , VOLUME-4, ISSUE-10,

Chapter 9 Mathematics of Cryptography Part III: Primes and Related Congruence Equations

GF(2 m ) arithmetic: summary

Optimization of new Chinese Remainder theorems using special moduli sets

Low Power, High Speed Parallel Architecture For Cyclic Convolution Based On Fermat Number Transform (FNT)

THE discrete sine transform (DST) and the discrete cosine

High Performance GHASH Function for Long Messages

A fast modular multiplication algorithm for calculating the product AB modulo N

A Low-Error Statistical Fixed-Width Multiplier and Its Applications

Modular Multiplication in GF (p k ) using Lagrange Representation

Chapter 6: Solutions to Exercises

GALOP : A Generalized VLSI Architecture for Ultrafast Carry Originate-Propagate adders

On the Complexity of Error Detection Functions for Redundant Residue Number Systems

Combinational Logic Design Arithmetic Functions and Circuits

EECS150 - Digital Design Lecture 24 - Arithmetic Blocks, Part 2 + Shifters

Residue systems efficiency for modular products summation: Application to Elliptic Curves Cryptography

Analysis and Synthesis of Weighted-Sum Functions


A Digit-Serial Systolic Multiplier for Finite Fields GF(2 m )

Number representation

ECE 545 Digital System Design with VHDL Lecture 1. Digital Logic Refresher Part A Combinational Logic Building Blocks

Carry Look Ahead Adders

Design and Comparison of Wallace Multiplier Based on Symmetric Stacking and High speed counters

Chapter 1: Solutions to Exercises

Frequency Domain Finite Field Arithmetic for Elliptic Curve Cryptography

Subquadratic Computational Complexity Schemes for Extended Binary Field Multiplication Using Optimal Normal Bases

Représentation RNS des nombres et calcul de couplages

EFFICIENT MULTIOUTPUT CARRY LOOK-AHEAD ADDERS

On-Line Hardware Implementation for Complex Exponential and Logarithm

14:332:231 DIGITAL LOGIC DESIGN. Why Binary Number System?

Numbers. Çetin Kaya Koç Winter / 18

Factoring Algorithms Pollard s p 1 Method. This method discovers a prime factor p of an integer n whenever p 1 has only small prime factors.

Low-Weight Polynomial Form Integers for Efficient Modular Multiplication

NEW SELF-CHECKING BOOTH MULTIPLIERS

The goal differs from prime factorization. Prime factorization would initialize all divisors to be prime numbers instead of integers*

FPGA accelerated multipliers over binary composite fields constructed via low hamming weight irreducible polynomials

On A Large-scale Multiplier for Public Key Cryptographic Hardware

This is a recursive algorithm. The procedure is guaranteed to terminate, since the second argument decreases each time.

Reduced-Error Constant Correction Truncated Multiplier

3. Combinational Circuit Design

Residue Number Systems. Alternative number representations. TSTE 8 Digital Arithmetic Seminar 2. Residue Number Systems.

Novel Bit Adder Using Arithmetic Logic Unit of QCA Technology

RSA Implementation. Oregon State University

Tunable Floating-Point for Energy Efficient Accelerators

Review for Test 1 : Ch1 5

Part II Addition / Subtraction

Transcription:

The Computer Journal, 47(1), The British Computer Society; all rights reserved A Suggestion for a Fast Residue Multiplier for a Family of Moduli of the Form ( n ( p ± 1)) Ahmad A. Hiasat Electronics Engineering Department, Princess Sumaya University, PO Box 1438, Amman 11941, Jordan Email: aahiasat@psut.edu.jo The family of moduli that has the form ( n ( p ± 1)) is considered in this paper. A suggestion for a fast residue multiplier for this family of moduli is introduced. The multiplication algorithm proposed in this paper generates (n+p ) partial products; however, it compresses the magnitude of each partial product to be less than n. Although it requires an additional integrated circuit area compared with the most recent published study, the new proposed modular multiplier has a logarithmic delay, which makes it faster than any other modular multiplier. Moreover, it is even faster than binarybased iterative array multipliers with a final CLA addition. The proposed modular multiplier is very suitable for medium and large dynamic ranges. Received 8 August 00; revised 10 March 003 1. INTRODUCTION Residue Number System (RNS) is an arithmetic system that has the merit of carry-free arithmetic operations. The use of RNS increases the speed of computations. Addition, subtraction and multiplication can be conducted on residue digits concurrently and independently [1, ]. Moreover, RNS demonstrated an efficiency in realizing different types of applications using the above operations. Specifically, RNS has been realized in applications involving the design of adaptive coded multicarrier modulation systems [3], delta sigma modulators [4], Discrete Fourier Transform, Number Theoretic Transform and many other applications [1, ]. This implies that designing efficient modular components like adders and multipliers is a very essential issue in implementing different RNS-based applications and processors [5, 6, 7, 8, 9, 10, 11, 1, 13, 14, 15, 16, 17, 18, 19, 0, 1,, 3, 4, 5, 6]. Many researchers have addressed the modular multiplication. Ramnarayan [5] introduced a modular multiplier for moduli of the form ( n k 1), k < n. Soderstrand and Vernia [6] presented the square-law modular multiplier. The design consisted of ROMs only, which imposed limitations on the size of the moduli and the speed performance. Jullien [7] introduced a technique for multiplying numbers modulo a prime number. However, this approach has the same cons of the approach in [6]. Taylor [8] proposed different structures for modular multipliers for the moduli set ( n 1, n, n + 1). Hiasat [9] suggested a residue multiplier modulo ( n ± 1) using a binary-based multiplier followed by an adder. Dugdale [10] introduced a residue multiplier using decomposition of factors, where the moduli are assumed to be non-prime. The multiplication is performed with an index calculus technique applied to the prime factors of each modulus. Radhakrishnan and Yuan [11] introduced two approaches for the design of a modular multiplier. The first approach uses additive index, while the other one uses pseudo-primitive root as the generator for the elements of multiplicative group. Although their design has considerable savings over that proposed by Jullien [7], the size of the ROMs used make it unsuitable for large moduli. Alia and Martinelli [1] proposed a modular multiply structure. It requires binary adders and multipliers. The algorithm is based on an approximate non-integer binary multiplication, in which the error is then corrected. Their architecture has been shown to be optimal compared with ROM-based structures. Walter [13] introduced an implementation of a modular multiplier tailored for cryptographic applications, where multiplication is implemented via repeated addition. Parker and Benaissa [14] introduced a serial modular multiplier. Elleithy and Bayoumi [15] proposed a systolic architecture for modulo multiplication which consists, mainly, of modular adders. Di Claudio et al. [16] presented also a multiplier based on a new pseudo-rns and utilized, basically, arithmetic components. Bajard et al. [17] presented an RNS Montgomery modular multiplier for very large operands. The algorithm is based on an adapted mixed-radix approach. Hiasat [18] also proposed a modular multiplier using tow cascaded binary multipliers and two binary adders. Paliouras et al. [19] proposed a combinatorial RNS multiplier suitable for small dynamic ranges. Savas and Koc [0] introduced an algorithm for computing the Montgomery modular multiplication inverse. Curiger et al. [1] proposed a ( n + 1) modular multiplier without using memory. Wrzyszcz and Milford [] also proposed a modulo ( n + 1) multiplier which does not use a special binary representation of numbers. Ma [3]

94 A. A. Hiasat presented modulo ( n + 1) multiplier using a carry-save adder and two other modular adders. Zimmermann [4] presented modulo ( n ± 1) adders and multipliers using end-around-carry modular adders based on parallel-prefix concepts. In the remaining part of this section, the family of moduli that has the form ( n ( p ± 1)) is explored, briefly. In Section, the proposed algorithm for the modular multiplier is presented. Its hardware implementation is introduced in Section 3. Section 4 compares the new multiplier with other existing ones. The modulus m can take any value. However, in RNS, a moduli set consists of r moduli defined as: {m 1,m,m 3,...,m r }, where any pair within this moduli set needs to be prime or relatively prime. For a particular positive integer n, some of the prime integers or relatively prime integers, m, have the form: m = n ( p ± 1) (1) The positive integer p can assume values in the range: p [,(n )]. However, p cannot assume the value n because this would lead to a trivial case. A value of p = n 1 puts m into the form of m = n ± 1. This particular value of m has been covered extensively in the literature [1,, 3, 4, 5]. In fact, Rader [5] was the first to propose the use of carrysave adders to build modulo Mersenne or Fermat numbers to compute error-free convolutions of real integer sequences. Table 1 shows typical values of integers resulting from the formula given in (1). Values of p and the corresponding values of m are listed for n [8, 1]. Nevertheless, n can assume any positive value outside the given interval. The prime integers are in boldface. Examining Table 1 for any particular n reveals that just a few of the shown integers are prime. Nevertheless, a considerable number of these integers are relatively prime. Thus, the form given in (1) can be thought of as a modulus generator that can form many moduli sets. Smaller values of n are suitable in residue-based digital signal processing applications [1,, 3, 4], for moduli sets of the form ( k 4, k 1 1, k 1 +1, k 1 k +1, k 1 + k + 1), where n = k 1 and p = k. Residue-based modular multiplier (like the one proposed in this paper) is realized by parallel addition of small wordlengths [7, 8]. On the other hand, cryptographic applications use larger values of n(n > 51 bits). The heart of most cryptosystem-based modular multipliers in the RSA case is an adder that realizes modulo multiplication of such huge operands by repeated addition [17, 0]. When compared with residue-based modular multipliers, the cryptosystem-based modular multipliers require much more time and area, due to their huge wordlength and implementation architecture. The basic goal of this paper is to design a modular arithmetic multiplier. Specifically, it is intended to evaluate: T = Z m = XY m () where X, Y, T [0, m), X = n 1 j=0 x j j,x j is the jth bit of X, Y = n 1 j=0 y j j,y j is the jth bit of Y, T is the least TABLE 1. Integers in the form of ( n ( p ± 1) ). p n = 8 n = 9 n = 10 n = 11 n = 1 191, 193 383, 385 1019, 101 043, 045 4091, 4093 3 3, 5 447, 449 1015, 1017 039, 041 4087, 4089 4 39, 41 479, 481 1007, 1009 031, 033 4079, 4081 5 47, 49 495, 497 991, 993 015, 017 4063, 4065 6 51, 53 503, 505 959, 961 1983, 1985 4031, 4033 7 507, 509 895, 897 1919, 191 3967, 3969 8 767, 769 1791, 1793 3839, 3841 9 1535, 1537 3583, 3585 10 3071, 3073 non-negative remainder when dividing the product XY by m, n = log m and. is the ceiling value of ( ) (i.e. the next integer greater than or equal to ( )).. THE NEW PROPOSED MODULAR MULTIPLIER ALGORITHM The product Z = XY can be expressed as: n 1 n 1 Z = z ij i+j (3) i=0 j=0 where z ij refers to the bit resulting from ANDing the bits x i and y j. Figure 1 shows the layout of all bits in Z. Thus, Z can be viewed as a summation of n rows where the ith row is defined as: n 1 j=0 z ij i+j. However, the magnitude range of each row is different. For instance, the very last row, n 1 j=0 z (n 1)j n 1+j, has a magnitude range: 0 n 1 j=0 z (n 1)j n 1+j < n 1. Evaluating T, defined in (), implies subjecting Z to modulus m. In the following analysis, it is intended to compress the magnitude of each row in Z, using the modulus m to be less than n. The expression for Z, given in (3), can be rewritten as: Z = R 1 + L 1 (4) where R 1 refers to the right part of Z, shown in Figure 1. Equivalently, n 1 n 1 R 1 = z ij i+j, 0 (i + j)<n (5) i=0 j=0 The ith row in R 1 refers to n 1 j=0 z ij i+j, where (i + j) < n. Obviously, each ith row in R 1 is bounded by: 0 n 1 j=0 z ij i+j < n. Similarly, L 1 refers to the left part of Z, shown in Figure 1. Equivalently, n 1 n 1 L 1 = z ij i+j, (n 1) >(i+ j) n (6) Since the objective is to compress the magnitude of each row in Z (and consequently in L 1 ) to be less than n, (6) can

Suggestion for a Fast Residue Modular Multiplier 95 Each ith row in R is bounded by: 0 n 1 j=1 z ij i+j n < n 1. However, this is not the case with the other summation on the RHS of (10), L, where, L = z ij i+j n+p, p i+j n+p <n+p (1) where Figure 1 shows L 1, R and L. Equivalently, L can be decomposed into two summations: L = z ij i+j n+p + z ij i+j n+p p (i+j n+p)<n n+p>(i+j n+p) n (13) Referring to the first summation on the RHS of (13) as R 3, then: R 3 = z ij i+j n+p, p (i + j n + p)<n (14) FIGURE 1. Splitting Z = XY into R 1 and L 1, and replacing L 1 with R and L. be rewritten as: L 1 = n z ij i+j n, n (i + j)<(n 1) (7) Taking modulus m of (1) and considering ( n ( p + 1)) rather than ( n ( p 1)) at this stage, then n m can be written as: n m = ( p + 1) (8) Thus, (8) can be substituted into (7), where L 1 expressed as: L 1 = ( p + 1) z ij i+j n, n (i + j)<(n 1) (9) The value of L 1 in (9) can be split into: L 1 = z ij i+j n + z ij i+j n+p 0 i+j n<n is p i+j n+p<n+p (10) Consider the first summation on the right-hand side (RHS) of (10) to be R, namely, R = z ij i+j n, 0 (i+j n)<n (11) Each ith row in R 3 is bounded by: 0 n 1 j=1 z ij i+j n+p < n. Similarly, consider the last summation in the RHS of (13) to be L 3. If there are no terms in L 3 for which (i+j n+p) n then analysis and simplification stop right here. However, if this is not the case, L 3 can be rewritten in the form: L 3 = n z ij i+j n+p, n + p>(i+ j n + p) n (15) Substituting (8) into (15) leads to: L 3 = z ij i+j n+p + z ij i+j n+p 0 (i+j n+p)<p p>(i+j n+p) p (16) Referring to the first summation on the RHS of (16) as R 4, then: R 4 = z ij i+j n+p, 0 (i+j n+p)<p (17) where each row in R 4 is less than n. Similarly, referring to the other summation on the RHS of the same equation as L 4, then: L 4 = z ij i+j n+p, p >(i+ j n + p) p (18)

96 A. A. Hiasat If there are no terms in L 4 for which (i+j (n p)) n, analysis stops. If this is not the case, L 4 in (18) can be decomposed into two summations, namely, R 5 and L 5 : L 4 = z ij i+j n+p + z ij i+j n+p p (i+j n+p)<n p>(i+j n+p) n (19) where and R 5 = z ij i+j n+p p (i+j n+p)<n L 5 = z ij i+j n+p p>(i+j n+p)) n (0) (1) Figure shows how each L i is replaced with R i+1 and L i+1. The analysis continues in that sense until each row in any summation is less than n. Generally speaking, R k, where k, can be expressed as: n 1 n 1 R k = z ij E () where E { }} { k 1 0 i + j n (n p) < p, k even E = k 1 i + j (n p) <n, kodd }{{} E and. is the floor value of ( ), (i.e. the largest integer less than or equal to ( )). Moreover, it has to be observed in all cases of R k, k, that i + j n. Similarly, L k, where k 1, can be expressed as: FIGURE. Splitting L for the case q = 3. Similarly, it has to be observed in all cases of L k, that i + j n. In the approach followed above, each time n m is replaced by ( p + 1), L k is reduced in size by (n p) bits. Consequently, R k+1 and R k+ summations are produced. Starting with L 1 with a bit width of (n 1), the total number of summations resulting is q, where q = (n 1)/(n p). These summations are: R,R 3,R 4,...,R q,r q+1. However, in evaluating T, the summation R 1 has to be taken into consideration. Thus, q+1 T = k=1 R k (4) m where n 1 n 1 L k = z ij E (3) E { }} { k n i + j (n p), k odd E = k p i + j (n p), k even }{{} E The following is a simplified algorithm for computing T : Input: X and Y [0,m), m = n p 1 Output: T, where T = XY m Procedure: begin Initialize T = 0; Compute Z = XY, q = n p n 1 ; For each i, 1 i (q + 1) Compute R i Compute T = (T + R i )mod m; end

Suggestion for a Fast Residue Modular Multiplier 97 FIGURE 4. The new proposed modular multiplier. FIGURE 3. Layout of all R i, i = 1,...,(q + 1), for the case q = 3. 3. HARDWARE IMPLEMENTATION Figure 3 shows the layout of different R i, i = 1,,..., (q + 1), for the case q = 3. In each summation R k, k = 3, 5, 7,...,(q + 1), there are v k rows, where v k is given by: ( ( ) ) k v k = (n 1) 1 (n p) (5) Each row in R k has (n p) bits, where the weight of the LSB is p while that of the MSB is n 1. The magnitude range of any row is [ p, n ), unless the bits of a row are all zeros. Similarly, for each R k,k =, 4, 8,...,q, there are v k rows, where v k is given in (5). Thus, the ith row (i = 1,,...,v k ) in R k has i bits. The weight of the LSB is 0 while that of the MSB is i 1. The magnitude range of any row is less than i. This leads to the fact that the pair (R k,r k+1 ), where k is an even integer larger than or equal to 4, do not overlap in their magnitudes. Thus, they can be combined to form v k vectors, each of n bits. For instance the pair (R 4,R 5 ) forms ((n 1) (n p)) vectors, while the pair (R 6,R 7 ) forms ((n 1) (n p)) vectors. Generally speaking, the pair (R k,r k+1 ), where k is even, forms ((n 1) ( k/ 1) (n p)) vectors. The pair (R 1,R ) can be combined to form n vectors. The summation R 3 will stand by itself, containing (n 1) vectors each with (n p) bits. Thus, the number of vectors associated with each pair is: R 1 + R n R 3 (n 1) R 4 + R 5 (n 1) (n p).. R q + R q+1 (n 1) (q 1)(n p) Denoting v to be the total number of vectors resulting from all pairs, then q(q 1) v = n + q(n 1) (n p) (6) If p is selected such that p n/, then q = and v reduces to: v = n + p (7) 3.1. Design details Based on the analysis given in this section, the modular multiplication problem has been converted into a multioperand addition of v vectors, each of n bits or less. The structure proposed to realize the modular multiplier algorithm of this paper is shown in Figure 4. It can be described as follows: (i) A Carry-Save Adder (CSA) tree adds all the v vectors and expresses its output as a Sum, S, and a Carry, C. The corresponding binary representations are: S = n+l 1 i=0 s i i and C = n+l 1 i=0 c i i, where: L = log v,s i is the ith bit of S and c i is the ith bit of C. S can be expressed as: S = S n + S 1, where S 1 = n 1 i=0 s i i and S = n+l 1 i=n s i i n. Similarly, C can be expressed as: C = C n + C 1, where C 1 = n 1 i=0 c i i and C = n+l 1 i=n c i i n. Therefore, T = S + C m.

98 A. A. Hiasat Equivalently, T = S 1 + C 1 + n (S + C ) m. Substituting n m = ( p + 1), then T = S 1 + ( p + 1)S + C 1 + ( p + 1)C ) m.( Clearly, ) if p is selected such that p n/, then L log 5 n. By simple mathematical inspection, this leads to L n/, when n 10. Accordingly, the binary representation of ( p + 1)S is given by, ( p + 1)S binary (n p) bits 0 0 p bits 0 0s n+l 1 s n+l s n+1 s n p bits 0 0s n+l 1 s n+l s n+1 s n (8) Similarly, the binary representation of ( p + 1)C, is given by, ( p + 1)C binary (n p) bits 0 0 p bits 0 0c n+l 1 c n+l c n+1 c n p bits 0 0c n+l 1 c n+l c n+1 c n (9) Since S and C are an indication of multiples of n resulting from accumulating a total of v vectors, then the maximum value of S or C is less than v (each vector has a value less than n ). Thus, ( p + 1)S <( p + 1)v ( ) ( p + 1)S <( n/ + 1) 5 n < 5 n(n/ + 1) ( p + 1) 5 but n(n/ + 1)< n, for n 10 then ( p + 1)S < n ( p + 1) <m ( p + 1) Since ( p +1)S <m ( p +1), then following a similar approach, ( p + 1)C <m ( p + 1). Accordingly, T can be rewritten as: T = T 1 + T m (30) where T 1 = S1 + ( p + 1)S m (31) T = C1 + ( p + 1)C m (3) Since 0 S 1 < n, then 0 S 1 +( p +1)S <m. Similarly, since 0 C 1 < n, then 0 C 1 + ( p + 1)C < m. An n-bit modular adder (modular adder 1 in Figure 4) accepts S 1 and S and evaluates T 1. Another modular adder (modular adder in Figure 4) accepts C 1 and C and evaluates T. (ii) An n-bit modular adder (modular adder 3 in Figure 4), evaluates T 1 + T m. The output of which is T. Therefore, a CSA tree along with three modular adders are needed to realize the proposed multiplier. The design of the modular adder proposed in [6] is very suitable for this application. 3.. Dealing with modulus ( n ( p 1)) The analysis introduced in Sections and 3 so far has dealt with the modulus ( n ( p + 1)). The same results in these sections are applicable for the case ( n ( p 1)). The only difference is that each L i is now multiplied with ( p 1) rather than ( p + 1). The value of each R i, for which i is even, is multiplied by 1. This implies that (4) can be rewritten for the case of ( n ( p 1)) as, T = R 1 R + R 3 R 4 R q + R q+1 m (33) Each R k, for which i is even, can be expressed in two s complement notation as: R k = R k + v k, where R k is the ones complement of R k. Thus, (33) can be rewritten as: T = R1 + R + R 3 + R 4 + +R q + R q+1 + Q + G m m (34) where G is a precomputed operand whose numerical value depends on the ones complement of each R i, where i is an even integer (the value is to be determined later on in this section); however, Q = q k= v k (k is even) is the total number of ones added. For a value of p n/, Q = n + p. Therefore, all it takes to realize a modulo ( n ( p 1)) multiplier is to invert each even R k, before applying it to the CSA tree and having an additional vector of value Q + G m. The value of this additional vector is explained in the next subsection. 3.3. Study case Evaluating T is a function of both values n and p. To have modulus-specific analysis, we choose m = 991. Thus, m = 10 ( 5 + 1). Obviously, n = 10, while p = 5. Furthermore, considering the case in which X = 66 = (1010010110) and Y = 650 = (1010001010), then Z = z 09 z 08 z 07 z 06 z 05 z 04 z 03 z 0 z 01 z 00 z 19 z 18 z 17 z 16 z 15 z 14 z 13 z 1 z 11 z 10 z 9 z 8 z 7 z 6 z 5 z 4 z 3 z z 1 z 0 z 39 z 38 z 37 z 36 z 35 z 34 z 33 z 3 z 31 z 30 z 49 z 48 z 47 z 46 z 45 z 44 z 43 z 4 z 41 z 40 z 59 z 58 z 57 z 56 z 55 z 54 z 53 z 5 z 51 z 50 z 69 z 68 z 67 z 66 z 65 z 64 z 63 z 6 z 61 z 60 z 79 z 78 z 77 z 76 z 75 z 74 z 73 z 7 z 71 z 70 z 89 z 88 z 87 z 86 z 85 z 84 z 83 z 8 z 81 z 80 z 99 z 98 z 97 z 96 z 95 z 94 z 93 z 9 z 91 z 90

Suggestion for a Fast Residue Modular Multiplier 99 = 1 0 1 0 0 1 0 1 1 0 1 0 1 0 0 1 0 1 1 0 1 0 1 0 0 1 0 1 1 0 1 0 1 0 0 1 0 1 1 0 R 1 + R z 09 z 08 z 07 z 06 z 05 z 04 z 03 z 0 z 01 z 00 z 18 z 17 z 16 z 15 z 14 z 13 z 1 z 11 z 10 z 19 z 7 z 6 z 5 z 4 z 3 z z 1 z 0 z 9 z 8 z 36 z 35 z 34 z 33 z 3 z 31 z 30 z 39 z 38 z 37 = z 45 z 44 z 43 z 4 z 41 z 40 z 49 z 48 z 47 z 46 z 54 z 53 z 5 z 51 z 50 z 59 z 58 z 57 z 56 z 55 z 63 z 6 z 61 z 60 z 69 z 68 z 67 z 66 z 65 z 64 z 7 z 71 z 70 z 79 z 78 z 77 z 76 z 75 z 74 z 73 z 81 z 80 z 89 z 88 z 87 z 86 z 85 z 84 z 83 z 8 z 90 z 99 z 98 z 97 z 96 z 95 z 94 z 93 z 9 z 91 0 1 0 0 1 0 1 1 0 1 0 0 1 0 1 1 0 1 0 1 = 1 1 0 1 0 1 0 0 1 0 0 1 0 1 0 0 1 0 1 1 z 19 z 9 z 8 z 39 z 38 z 37 z 49 z 48 z 47 z 46 R 3 = z 59 z 58 z 57 z 56 z 55 z 68 z 67 z 66 z 65 z 64 z 77 z 76 z 75 z 74 z 73 z 86 z 85 z 84 z 83 z 8 z 95 z 94 z 93 z 9 z 91 1 0 0 1 0 1 0 0 0 0 = 0 0 0 0 0 0 0 0 0 0 1 0 0 1 0 0 0 0 0 0 0 1 0 1 1 R 4 + R 5 z 69 z 69 = z 79 z 78 z 79 z 78 z 89 z 88 z 87 z 89 z 88 z 87 z 99 z 98 z 97 z 96 z 99 z 98 z 97 z 96 0 0 = 1 0 1 0 0 0 0 0 0 0 1 0 1 0 1 0 1 0 The outputs of the CSA tree that adds all the 3 vectors are: S S 1 S = 00000 111101011 C C 1 C = 00010 0010000000 ( 5 + 1)S = 0000000000 ( 5 + 1)C = 0001000010 Accordingly, T 1 = 0000001100 T = 0011000010 T = 0011001110 decimal 06 Consider now the case m = 10 ( 5 1) = 993. Obviously, n = 10, while p = 5, then 1 1 1 1 1 1 1 1 1 z 19 1 1 1 1 1 1 1 1 z 9 z 8 1 1 1 1 1 1 1 z 39 z 38 z 37 1 1 1 1 1 1 z 49 z 48 z 47 z 46 R = 1 1 1 1 1 z 59 z 58 z 57 z 56 z 55 1 1 1 1 z 69 z 68 z 67 z 66 z 65 z 64 1 1 1 z 79 z 78 z 77 z 76 z 75 z 74 z 73 1 1 z 89 z 88 z 87 z 86 z 85 z 84 z 83 z 8 1 z 99 z 98 z 97 z 96 z 95 z 94 z 93 z 9 z 91 1 1 1 1 1 1 1 1 1 z 69 R 4 = 1 1 1 1 1 1 1 1 z 79 z 78 1 1 1 1 1 1 1 z 89 z 88 z 87 1 1 1 1 1 1 z 99 z 98 z 97 z 96

100 A. A. Hiasat In R and R 4, there are a total of 13 rows, thus, Q = 13. The string of ones in R and R 4 can be removed. This allows the formation the two pairs: (R 1, R ) and (R 4,R 5 ). The strings of ones removed form the binary representations of R and R 4 can be precomputed modulo m. Assuming that this precomputed value modulo m is G, then the value Q + G m is applied as an additional input vector to the CSA tree. The computation for this case of m = ( n ( p 1)), is carried afterwards in the same way as the previous case of, m = ( n ( p + 1)). 4. PERFORMANCE AND COMPARATIVE ANALYSIS In order to evaluate the performance of the new proposed modular multiplier, its hardware requirements and time delay have to be evaluated. Thus, the hardware and delay of the CSA tree and the three modular adders are to be determined. In the following analysis, it is assumed that p n/. This would simplify the analysis and give an upper bound for other cases of p<n/. Under this assumption, q =. Accordingly, there are five Right summations, namely, R 1, R, R 3, R 4 and R 5. Three pairs are formed: (R 1,R ), R 3 and (R 4,R 5 ). The vectors of each pair are added in a separate CSA sub-tree, thus, there are three parallel CSA sub-trees. The number of levels on a CSA tree as defined by the Avizienis recursive formula and summarized in Table is given by: d(v) = 3 d(v 1)/ + d(v 1) mod, for v =, 3,..., and initially d(1) = 3 [9]. The pair (R 1 + R ) has a total of nn-bit vectors, thus, a CSA sub-tree adds these vectors and expresses the output as a sum and a carry. A total of (n ) CSAs are needed. Equivalently, this sub-tree has a delay of d(n) FAs. The summation R 3 consisting of (n 1) vectors, where each is (n p) bits wide. Since it is assumed that p n/, then a maximum of (n 3)(n/) FAs are needed for this sub-tree. Similarly, the pair (R 4, R 5 ) has a total of ((n/) 1) vectors each consists of n bits or less. Since R 4 and R 5 are identical, it is enough to compute one of them. The number of bits in each vector in R 4 or R 5 is less than n/. A total of ((n/) 3) CSAs, or equivalently, ((n/) 3)(n/) FAs are needed. The Sums and Carries from the three sub-trees are then added using four CSAs, to obtain the S and C of the CSA tree. This adds the delay of three FAs and the hardware of 4n FAs. Therefore, the total number of FAs needed by the CSA tree is 4 7 n n. The delay of the CSA tree is (d(n) + 3) τ FA, where τ FA is the delay of a singlebit FA. The modular adders used in Figure 4 can be realized using the structure proposed in [6]. It is composed of a binary CLA adder, n Half-adders (HAs), and n( 1) MUXs. Assuming the area and delay of a ( 1) MUX are equivalent to an HA, then the n HAs and n MUXs are equivalent, roughly, to the area and delay of n FAs. The area and delay of an n-bit CLA adder are given by [30]: n log n FA and ( log n +1 ) τ FA respectively. Thus, the area and the delay of the modular adder proposed in [6] are: n ( log n +1 ) FAs and ( log n + ) τ FA TABLE. Avizienis recursive formula. No. of levels, v 1 3 4 5 6 7 8 9 10 No. of vectors, d(v) 3 4 6 9 13 19 8 4 63 94 TABLE 3. Area and delay comparison. Multiplier Area, # of FAs Delay, τ FA Iterative array [31] Di Claudio et al. [16] Hiasat [18] Proposed (n 1) + n log n n + log n +1 5 (n 1) + n + 7 n log n 5 n + 7 log n + 5 4 (n 1) + n + 4 9 n log n 4 5 n + 4 9 log n + 7 4 n + n + 3n log n log n +d(n) + 7 respectively. Adding the delay in the two cascaded n-bit modular adders in Figure 4 would make the delay of the proposed modular multiplier equal to ( log n + d(n) + 7)τ FA. Similarly, adding the area of the three n-bit modular adders makes the total area of the proposed modular multiplier, in terms of the number of full adders, as: 7 4 n + n + 3n log n. In this section, the new design will be compared with modular multipliers available in literature, that have relatively better performance. The performance of the design in [3] is less efficient than that in [4]. However, the performance of the design in [4] is similar to that of [31]. On the other hand, the structure of [19] is more suitable for small moduli. Moreover, the authors of [19] stated explicitly that their design is efficient in terms of area, but it is slower than that in [16]. Therefore, the new design will be compared with [16, 18, 31]. The modular-based multiplier proposed by Di Claudio et al. [16] requires two.5 (n n) binary multipliers and one modular adder. However, the modular-based multiplier proposed by Hiasat [18] requires a 1.5 (n n) binary multiplier, an n-bit CSA binary adder, and an n-bit modular adder. In the following analysis, it is assumed that all the three modular multipliers [16, 18], and the new proposed one use the same modular adder introduced recently in [6]. A binary-based iterative array multiplier [9, 3, 31], realized as carry-save arrays with final CLA addition, requires (n 1) FAs to produce the sum and carry of a CSA array, and an n-bit CLA. Table 3 shows the area and time delay for four multipliers. One of these is the binary-based iterative array multiplier [9, 3, 31], which was assumed to be a building block in realizing the modular multipliers in [16, 18]. The other three are modular-based ones, namely, the one proposed by Di Claudio et al. [16], the one proposed by Hiasat [18] and the one proposed in this paper. In all cases, the n AND gates needed to create the partial product terms have been neglected. Table 4 shows the areas and delays of the four multipliers normalized to the iterative binary multiplier, for values of n = 1, 16, 0 and 4 bits. Although it requires a larger area compared with a binary-based iterative multiplier, the new modular

Suggestion for a Fast Residue Modular Multiplier 101 TABLE 4. Normalized areas and delays. n = 1 n = 16 n = 0 n = 4 Multiplier Area Delay Area Delay Area Delay Area Delay Iterative array [31] 1 1 1 1 1 1 1 1 Di Claudio et al. [16].86.71.78.67.76.67.7.65 Hiasat [18] 1.68 1.53 1.58 1.48 1.55 1.47 1.51 1.44 Proposed.48 1.17.33 1.00.6 0.9.18 0.80 multiplier is faster for any n > 16. Comparison results in Table 4 show also that the new multiplier requires a larger area than that in [18], nevertheless, it is much faster. 5. CONCLUSIONS In this paper, a new modulo ( n ( p ± 1)) multiplication algorithm is introduced. The algorithm compresses the magnitude of the partial products to be less than n. The proposed hardware structure utilizes a CSA tree to add (n + p ) partial products. It also utilizes three n-bit modular adders to express the sum in a residue form. Due to the large number of partial products, the area of the multiplier is larger than another residue multiplier reported in literature. Nevertheless, the new residue multiplier has a logarithmic speed which makes it faster than any other similar multiplier. It is also faster than binary-based iterative array multipliers with a final CLA addition. The proposed design is most suitable for values of p n/. REFERENCES [1] Szabo, N. and Tanaka, R. (1967) Residue Arithmetic and Its Applications to Computer Technology. McGraw Hill, New York. [] Soderstrand, M., Jenkins, W., Jullien, G. and Taylor, F. (1986) Residue Number System Arithmetic: Modern Applications in Digital Signal Processing. IEEE Press, New York. [3] Keller, T., Liew, T. and Hanzo, L. (000) Adaptive redundant residue number system coded multicarrier modulation. IEEE J. Selected Areas Commun., C-18, 9 301. [4] Chren, W. (1999) Delta sigma modulator with large OSR using one-hot residue number system. IEEE Trans. Circ. Sys. II, 46, 100 1008. [5] Ramnarayan, A. (1980) Practical realization of mod p, p prime multiplier. Electronic Lett., 16, 466 467. [6] Soderstrand, M. and Vernia, C. (1980) A high-speed low-cost modulo P i multiplier with RNS arithmetic application. Proc. IEEE, 68, 59 53. [7] Jullien, G. (1980) Implementation of multiplication, modulo a prime number, with applications to theoretic transforms. IEEE Trans Comp., C-9, 899 905. [8] Taylor, F. (198) A VLSI residue arithmetic multiplier. IEEE Trans. Comp., C-31, 540 546. [9] Hiasat, A. (1991) A memoryless mod ( n ± 1) residue multiplier. Electronic Lett., 8, 414 415. [10] Dugdale, M. (1994) Residue multipliers using factored decomposition. IEEE Trans. Circ. Sys.-II Analog & Digital Signal Processing, 41, 63 67. [11] Radhakrishnan, D. and Yuan, Y. (199) Novel approaches to the design of VLSI RNS multipliers. IEEE Trans. Circ. & Sys.- II: Analog & Digital Signal Processing, 39, 5 57. [1] Alia, G. and Martinelli, E. (1991) A VLSI modulo m multiplier. IEEE Trans. Comp., C-40, 873 878. [13] Walter, C. (1993) Systolic modular multiplier. IEEE Trans. Comp., C-4, 376 378. [14] Parker, M. and Benaissa, M. (1994) VLSI structures for bit-serial modular multiplication using basis conversion. IEE Proc.-Comput. Digit Tech., 141, 45 51. [15] Elleithy, K. and Bayoumi, M. (1995) A systolic architecture for modulo multiplication. IEEE Trans. Circ. & Sys.-II Analog & Digital Signal Processing, 4, 75 79. [16] Di Claudio, E., Piazza, F. and Orlandi, G. (1995) Fast combinatorial RNS processors for DSP applications. IEEE Trans. Comp., C-44, 64 633. [17] Bajard, J., Didier, L. and Kornerup, P. (1998) An RNS Montgomery modular multiplication algorithm. IEEE Trans. Comp., C-47, 766 776. [18] Hiasat, A. (000) New efficient structure for a modular multiplier for RNS. IEEE Trans Comp., C-49(), 170 174. [19] Paliouras, V., Karagianni, K. and Stouraitis, T. (001) A lowcomplexity combinatorial RNS multiplier. IEEE Trans. Circ. & Sys.-II, 48(7), 675 683. [0] Savas, E. and Koc, C. (000) The Montgomery modular inverse-revisited. IEEE Trans. Comp., 49(7), 763 766. [1] Curiger, A., Bonnenberg, H. and Kaeslin, H. (1991) Regular VLSI architectures for multiplication modulo ( n + 1). IEEE J. Solid-State Circ., 6, 990 994. [] Wrzyszcz, A. and Milford, D. (1993) A new modulo a + 1 multiplier. In Proc. ICCD 93, Cambridge, MA, 1 3 October, pp. 614 617. IEEE Press, NY. [3] Ma, Y. (1998) A simplified architecture for modulo ( n + 1) multiplication. IEEE Trans. Comp., C-47, 333 337. [4] Zimmermann, R. (1999) Efficient VLSI implementation of modulo ( n ± 1) addition and multiplication. In Proc. 14th IEEE Symposium on Computer Arithmetic, Australia, 1 15 August. IEEE Press, NY. [5] Rader, C. (197) Discrete convolutions via Mersenne transforms. IEEE Trans Comp., 1, 169 173. [6] Hiasat, A. (00) High-speed and reduced-area modular adder structures for RNS. IEEE Trans Comp., 51, 84 89. [7] Skavantzos, A. (1998) An efficient residue to weighted converter for a new residue number system. Proc. 8th Great Lakes Symposium on VLSI, Lafayette, LA, 15 17 February, pp. 185 191. IEEE Press, NY. [8] Hiasat, A. (003) Efficient residue to binary converter. IEE Proc. CDT, 150, 11 16.

10 A. A. Hiasat [9] Hwang, H. (1979) Computer Arithmetic: Principles, Architecture and Design. Wiley, New York. [30] Lynch, T. and Swartzlander, E. (199) A spanning tree carry lookahead adder. IEEE Trans Comp., 41, 931 939. [31] Pekmestzi, K. (1999) Multiplexer-based array multipliers. IEEE Trans Comp., 48(1), 15. [3] Waser, F. and Flynn, M. (198) Introduction to Arithmetic for Digital Systems Designers. Holt, Rinehart and Winston, New York.