KR101318992B1 - Modulo n calculation method and apparatus thereof - Google Patents
Modulo n calculation method and apparatus thereof Download PDFInfo
- Publication number
- KR101318992B1 KR101318992B1 KR1020100063896A KR20100063896A KR101318992B1 KR 101318992 B1 KR101318992 B1 KR 101318992B1 KR 1020100063896 A KR1020100063896 A KR 1020100063896A KR 20100063896 A KR20100063896 A KR 20100063896A KR 101318992 B1 KR101318992 B1 KR 101318992B1
- Authority
- KR
- South Korea
- Prior art keywords
- bit
- unit
- bits
- modulo
- value
- Prior art date
Links
Images
Landscapes
- Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- Computational Mathematics (AREA)
- Mathematical Analysis (AREA)
- Pure & Applied Mathematics (AREA)
- Mathematical Optimization (AREA)
- Computing Systems (AREA)
- General Engineering & Computer Science (AREA)
- Compression, Expansion, Code Conversion, And Decoders (AREA)
Abstract
The present invention relates to a modulo N operation, which is a data operation, wherein a modulo N operation method of any positive integer X according to an embodiment converts X into a binary number, and then a positive integer N is 2 Calculate the positive integers m and n to be equal to the product of n powers of 1 plus or minus 2 times powers of m, then divide by bit units that vary according to the values of m and n. By computing binary numbers, the complexity of modulo operations can be reduced by using simple adders and logic circuits.
Description
The present invention relates to a data operation method, and more particularly, to a modulo N operation.
The present invention is derived from the research conducted as part of the IT growth engine technology development project of the Ministry of Knowledge Economy. [Task Management Number: 2008-S-002-02, Title: Development of 3GPP LTE Terminal Modem Chipset]
3GPP 3rd Generation Partnership Project Long Term Evolution (LTE) is an evolution of Wideband Code Division Multiple Access (WCDMA), a third-generation mobile communication method, and is one of the technology candidates for 4G (4G, IMT-Advanced) mobile communication. This is a technology based on cellular among the existing mobile communication system methods, which is close to the 4th generation (4G) mobile communication which can provide multimedia services even during high-speed moving in the future. It is distinguished from this technology in terms of high-speed mobile service from existing WiBRO (Wireless Broadband) service and 3G-class wireless transmission technology (NoLA: New Nomadic Local Area Wireless Access) technology.
The 3GPP LTE technology enables interworking with existing 2nd generation cellular networks as well as global roaming supporting interworking with Global System for Mobile communications (GSM) or WCDMA networks. Computational technologies such as modulo 3, modulo 6, modulo 12, modulo 30, modulo 31, and modulo 65537 are the 3GPP LTE Essentially used in the specification. Therefore, the following techniques have been proposed for efficient modulo operation.
In a conventional modulo 3 operation method using a counter, the second counter counts in order of 0, 1, 2, 0, 1, 2 while the first counter counts the input integer N one by one. When one counter has counted all the input integers N, the value of the second counter is checked and the value is output as a result value. Since the modular arithmetic unit needs to count both counters by a corresponding integer, the larger the input integer N, the greater the computation time.
Another conventional technique is a modulo 3 operation method using a counter and an AND operation. It performs four AND operations on the four bits of the input binary with a specific binary, determines the result of the operation, and adds the output register value accordingly. Such a calculation method can calculate a result value faster than a modulo calculation method using a counter. However, the structure may need to be changed according to the input value, and at least one counter is used, which is a complicated operation.
Modulo operation without counter is used to reduce the complexity, quickly obtain the result of the operation, and to provide modulo operation so that the operation circuit can be easily expanded according to the input value. .
The modulo N operation method of any positive integer X according to one embodiment converts X to binary, and then the positive integer N is the power of 2 to the power of 2 plus or
In a modulo N operation method of any positive integer X according to one embodiment, calculating the binary integer of the transformed X calculates a modified n bit unit in which the upper bits are added for each n bit unit. Next, the final n bits may be calculated by using a multiplexer and an adder, and a modulo operation value may be generated by adding m bits as the least significant bits to the last n bits.
In a modulo N operation method of any positive integer X according to one embodiment, the calculation of the last n bits is n bits if the value of the unit of n bits is less than the value of 2 plus n or 1 The unit value is output as the first bit unit value, and when the value is large, the unit is output as the first bit unit value by subtracting the value of n bit unit by adding or subtracting 1 to n power of 2, and then the first bit unit is In the case of plural numbers, the second bit units may be calculated by adding the output first bit unit values. In addition, this may be repeated until the second bit unit is the last n bits.
Modulo N arithmetic unit of any positive integer X according to an embodiment of the present invention, a binary conversion unit for converting a positive integer X to a binary number and the value of the positive integer N plus or
In the modulo N arithmetic unit of any positive integer X according to an embodiment, the binary arithmetic unit of X is a modified n-bit unit calculation unit that calculates a modified n-bit unit in which upper bits are added to n bits. And a modulo n-value unit that calculates the last n bits using a multiplexer and an adder, and adds m bits as least significant bits to the calculated last n bits to generate a binary modulo operation value. It may include a bit coupling unit.
In a modulo N arithmetic unit of any positive integer X according to one embodiment, the final n-bit calculator is n bits if each n-bit unit value is less than or equal to 2's n power plus or minus one. A first bit unit calculation unit and a first bit unit calculation unit for outputting a unit value as a first bit unit value, and subtracting a value of n bit unit by adding or subtracting 1 to n power of 2 and outputting the unit unit value as a first bit unit value When there are a plurality of 1 bit units, the second bit unit calculator may include a second bit unit calculator that calculates a second bit unit by adding each output first bit unit value. The result generator may repeat the calculation until the second bit unit becomes the last n bits.
Modulo operation can be performed using only an adder and a logic circuit, so hardware can be easily configured and the processing speed of modulo operation can be improved.
1 is a flowchart of a modulo N operation method according to an embodiment;
2 is an exemplary diagram for dividing binary X by bits in a modulo N operation method according to an embodiment;
3A illustrates an example Modulo 6 operation, according to an embodiment;
3B illustrates a modulo 10 operation, according to an embodiment.
4 is a block diagram of a modulo N operation apparatus according to an embodiment;
5 is a block diagram illustrating a first bit unit calculator in a modulo N operation apparatus according to an exemplary embodiment.
Hereinafter, embodiments of the present invention will be described in detail with reference to the accompanying drawings. The terms used are terms selected in consideration of the functions in the embodiments, and the meaning of the terms may vary depending on the user, the intention or the precedent of the operator, and the like. Therefore, the meaning of the terms used in the following embodiments is defined according to the definition when specifically defined in this specification, and unless otherwise defined, it should be interpreted in a sense generally recognized by those skilled in the art.
1 is a flowchart of a modulo N operation method, according to an exemplary embodiment.
Referring to FIG. 1, first, data X for modulo N operation is input (100). The input data X is any positive integer X. Next, the input data X is converted into a binary number (110). Binary numbers can be used for modulo operations using a computer. Next, m and n values are calculated using modulo N (120). This is a step of determining a modulo N to which the method proposed in the present invention can be applied.
In
N, m
Next, using m, n, the binary number of X is divided by bit unit (130). This will be described with reference to FIG. 4.
FIG. 2 illustrates an example of dividing binary X by bits in a modulo N operation method according to an exemplary embodiment. Referring to FIG. 2, X converted to a binary number may be classified according to bit units that are variable according to m and n values. The total number of bits of X converted to binary can be expressed as the sum of the X 'bits and the m bits. The X 'bit may be divided into several n bit units.
Referring to
In FIG. 2, a represents a value of each n bit unit. This can be expressed as follows.
Referring to Equation 3, the positive integer X is equal to the product of multiplying X 'by the power of 2 and b 0 . In other words, this is the same as the result of performing a
Referring back to FIG. 3, it is determined whether each of the r number of n bit units is smaller than the value of (2 n ± 1) (140). Modulo N = (2 n ± 1) · 2 m can be seen as a modulo operation with modulo (2 n ± 1) and another modulo 2 m have. In Equation 3, X 'is equal to the result of performing a
The first bit unit refers to a bit unit in which the quotient does not occur even if a modulo operation is performed only by the value of the n bit unit itself. If the n-bit value is greater than (2 n ± 1), then a quotient occurs, so subtract (2 n ± 1) and then again determine whether it is less than (2 n ± 1). The first bit unit is output (145). If the value of the n bit unit is smaller than the value of (2 n ± 1), the modulo (2 n ± 1) operation is no longer performed, and this is output in the first bit unit (150).
Referring to Equation 4, a represents a value of each n bit unit. When a modulo (2 n- 1) operation is performed on a, a first bit unit is generated. One or two bits may be added to the first bit unit than the n bit unit. This takes into account the overflow caused by the summation between the first bit units to be described later and the sign bit added in the calculation of the negative number.
Referring back to FIG. 1, after the first bit unit is output, it is determined whether the first bit unit is the last n bits (160). The last n bits refer to n-bit units finally generated for X '. Initially, X 'is divided into n n-bit units, but finally, one n-bit unit is generated by combining each n-bit unit.
If the first bit unit is not the last n bits, two first bit units are added (165). Thus, the number of n bit units is reduced by half, and the value of n bit units is increased. Using the generated bit unit as the second bit unit, the steps of determining whether the second bit unit is smaller than the value of (2 n ± 1) and whether or not it is the last bit are repeated (140, 150, 160). ).
If the first bit unit is the last n bits, it is combined with the least significant m bits (170). In other words, since the least significant bit is determined initially, the least significant bit of the last n bits is not the least significant bit of the binary-converted X. The least significant m bits are combined with the last n bits and output as modulo operations (180).
3A illustrates an example Modulo 6 operation, according to an embodiment.
Referring to FIG. 3A, input X is 435 and is represented by 110110011 2 in binary. Next, since modulo is 6, m = 1 and n = 2. Therefore, the least significant bit becomes one bit, and the remaining eight bits can be divided into four in 2 bit units. Each two-bit value is equivalent to a modulo two operation. Next, 1 bit is added to each 2 bit unit to make a total of 3 bits. This is an additional bit for overflow.
Next, a modulo 3 operation is performed on the modified n bits of 3 bits to generate a first bit. If the first bit is not the last 3 bits, it is added with another first bit and modulo 3 operation is performed again to generate the first bit. After this process, the last two bits become 0,1. Since the least significant bit is 1, the modulo 6 operation value is 011, which is 3 in decimal. Accordingly, three adders yield a modulo 6 operation value of 435.
3B is an example of modulo 10 operation according to one embodiment.
Referring to FIG. 3B, input X is 435 and is represented by 110110011 2 in binary. Next, m is 1 and n is 2 because the modulo is 10. Therefore, the least significant number of bits is one, and the remaining eight bits can be divided into four bit units by two bit units. Each two-bit value is equivalent to a modulo two operation. Next, 1 bit is added to each 2 bit unit to make a total of 3 bits. This is an additional bit for overflow. In addition, a bit may be added to some bit units to make 4 bits.
Referring to
In the following process, three bits are finally generated using the first unit bits in the same manner as in FIG. 3A. Since the last 3 bits generated are 010 2 and the least significant bit is 1 2 , the result of modulo 10 operation is 0101 2 . This is 5, the remainder of 435 divided by 10.
4 is a block diagram of a modulo N operation apparatus according to an exemplary embodiment.
Referring to FIG. 4, the
The binary
The final n-
The
FIG. 5 is a block diagram illustrating a first
Referring to FIG. 5, the first
The modulo N arithmetic unit of the present invention may be composed of only the
While the present invention has been particularly shown and described with reference to exemplary embodiments thereof, Therefore, the present invention should be construed as a description of the claims which are intended to cover obvious variations that can be derived from the described embodiments.
200: modulo N arithmetic unit
210: binary conversion unit
230: variable calculation unit
250: binary operation unit
260: correction n bit unit calculation unit
270: final n-bit calculator
271: first bit unit calculation unit
273: second bit unit calculation unit
280: bit coupling unit
281: multiplexer
283: adder
285 addition value
287: comparison value
Claims (10)
Converting the X to a binary number;
Calculating a positive integer m, n such that the positive integer N is equal to the product of m powers of 2 multiplied by 1 plus or minus 1 of 2; And
Calculating a binary number of the converted X by dividing the data into bit units which vary according to the m and n values;
Modulo N operation method comprising a.
All bits of the binary number of the converted X,
A modulo N operation method in which n bit units are r (r is a positive integer) and the least significant bit is m bits.
Computing the binary number of the converted X,
Calculating a modified n bit unit in which an upper bit is added for each n bit unit;
Calculating a final n bits of the modified n-bit unit using a multiplexer and an adder; And
Generating a binary modulo operation value by adding the m bits as least significant bits to the last n bits;
Modulo N operation method comprising a.
Computing the last n bits,
If the value of each n bit unit is smaller than the value of plus or minus 1 in n powers of 2, the value of the n bit unit is output as the first bit unit value, and when the value of the n bit unit is large, n of 2 Subtracting a value obtained by adding or subtracting 1 to a power and outputting the result in a first bit unit value; And
Calculating a second bit unit by adding each of the output first bit unit values when there are a plurality of first bit units;
Modulo N operation method comprising a.
Computing the last n bits,
And repeating the step until the second bit unit is the last n bits.
A variable calculation unit for calculating a positive integer m, n such that a modulo positive integer N is equal to a product of n powers of 2 plus or minus 1 multiplied by m powers of 2; And
A bit unit operation unit that calculates the binary number of the converted X for each bit unit that varies according to the m and n values;
Modulo N operation apparatus comprising a.
All bits of the binary number of X converted by the binary conversion unit,
A modulo N arithmetic unit in which n bit units are r (r is a positive integer) and the least significant bit is m bits.
The bit unit calculation unit of X,
A modified n-bit unit calculator for calculating a modified n-bit unit by adding an upper bit to the n-bit unit;
A final n-bit calculator for calculating the last n bits of the modified n-bit unit using a multiplexer and an adder; And
A bit combiner for adding m bits as least significant bits to the last n bits calculated by the last n bits calculator;
Modulo N operation apparatus comprising a.
The last n bit calculator,
If the value of each n bit unit is smaller than the value of plus or minus 1 in n powers of 2, the value of the n bit unit is output as the first bit unit value, and when the value of the n bit unit is large, n of 2 A first bit unit calculator for outputting a value obtained by adding or subtracting 1 to a power as a first bit unit value; And
A second bit unit calculator configured to calculate a second bit unit by adding each of the output first bit unit values when there are a plurality of first bit units;
Modulo N operation apparatus comprising a.
The bit coupling unit,
And modulo N computing device repeating the calculation until the second bit unit is the last n bits.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
US12/967,712 US20110145311A1 (en) | 2009-12-16 | 2010-12-14 | Method and apparatus for modulo n operation |
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
KR1020090125665 | 2009-12-16 | ||
KR20090125665 | 2009-12-16 |
Publications (2)
Publication Number | Publication Date |
---|---|
KR20110068801A KR20110068801A (en) | 2011-06-22 |
KR101318992B1 true KR101318992B1 (en) | 2013-10-16 |
Family
ID=44400975
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
KR1020100063896A KR101318992B1 (en) | 2009-12-16 | 2010-07-02 | Modulo n calculation method and apparatus thereof |
Country Status (1)
Country | Link |
---|---|
KR (1) | KR101318992B1 (en) |
Families Citing this family (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104461450A (en) * | 2014-12-29 | 2015-03-25 | 东南大学 | IAPWS-IF97 physical property power calculation method applied to embedded monitoring device |
GB2576536B (en) * | 2018-08-22 | 2021-05-05 | Imagination Tech Ltd | Float division by constant integer |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
KR20020030193A (en) * | 2000-10-16 | 2002-04-24 | 구자홍 | Modulo operation circuit |
US20050004967A1 (en) | 2002-01-04 | 2005-01-06 | Burkhard Becker | Method and device for calculating modulo operations |
KR20050041567A (en) * | 2003-10-31 | 2005-05-04 | 매그나칩 반도체 유한회사 | Binary integral numbers modulo calculation method |
US20060010191A1 (en) | 2001-06-13 | 2006-01-12 | Takahashi Richard J | Circuit and method for performing multiple modulo mathematic operations |
-
2010
- 2010-07-02 KR KR1020100063896A patent/KR101318992B1/en not_active IP Right Cessation
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
KR20020030193A (en) * | 2000-10-16 | 2002-04-24 | 구자홍 | Modulo operation circuit |
US20060010191A1 (en) | 2001-06-13 | 2006-01-12 | Takahashi Richard J | Circuit and method for performing multiple modulo mathematic operations |
US20050004967A1 (en) | 2002-01-04 | 2005-01-06 | Burkhard Becker | Method and device for calculating modulo operations |
KR20050041567A (en) * | 2003-10-31 | 2005-05-04 | 매그나칩 반도체 유한회사 | Binary integral numbers modulo calculation method |
Also Published As
Publication number | Publication date |
---|---|
KR20110068801A (en) | 2011-06-22 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
Esmaeildoust et al. | Efficient RNS Implementation of Elliptic Curve Point Multiplication Over ${\rm GF}(p) $ | |
Pettenghi et al. | RNS reverse converters for moduli sets with dynamic ranges up to $(8n+ 1) $-bit | |
KR101603471B1 (en) | System and method for signal processing in digital signal processors | |
Oudjida et al. | Multiple constant multiplication algorithm for high-speed and low-power design | |
Matutino et al. | Arithmetic-Based Binary-to-RNS Converter Modulo ${\{2^{n}{\pm} k\}} $ for $ jn $-bit Dynamic Range | |
KR20100123361A (en) | Modular multiplier with reduced operating critical path and the method for reducing the operating critical path | |
Wong et al. | High-speed RLWE-oriented polynomial multiplier utilizing Karatsuba algorithm | |
KR101318992B1 (en) | Modulo n calculation method and apparatus thereof | |
CN109379191B (en) | Dot multiplication operation circuit and method based on elliptic curve base point | |
Haritha et al. | Design of an enhanced array based approximate arithmetic computing model for multipliers and squarers | |
Matutino et al. | An efficient scalable RNS architecture for large dynamic ranges | |
KR20080050226A (en) | Modular multiplication device and method for designing modular multiplication device | |
US20110145311A1 (en) | Method and apparatus for modulo n operation | |
CN114594925A (en) | Efficient modular multiplication circuit suitable for SM2 encryption operation and operation method thereof | |
Verma et al. | FPGA implementation of RSA based on carry save Montgomery modular multiplication | |
Esmaeildoust et al. | Efficient RNS to binary converters for the new 4-moduli set {2n, 2n+ 1-1, 2n-1, 2n-1-1} | |
US9344118B2 (en) | Apparatus and method for generating interleaver index | |
Vergos et al. | Fast modulo 2n+ 1 multi-operand adders and residue generators | |
Esmaeildoust et al. | High speed reverse converter for new five-moduli set {2n, 22n+ 1-1, 2n/2-1, 2n/2+ 1, 2n+ 1} | |
JP2011015159A (en) | Correlation calculation device | |
US8417756B2 (en) | Method and apparatus for efficient modulo multiplication | |
KR20070061166A (en) | Memory address counter and memory control unit for radix-2-square sdf fft | |
US7213043B2 (en) | Sparce-redundant fixed point arithmetic modules | |
CN116009818A (en) | Forward conversion device based on arbitrary residual number base | |
CN110598172B (en) | Convolution operation method and circuit based on CSA adder |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A201 | Request for examination | ||
E701 | Decision to grant or registration of patent right | ||
GRNT | Written decision to grant | ||
FPAY | Annual fee payment |
Payment date: 20160927 Year of fee payment: 4 |
|
LAPS | Lapse due to unpaid annual fee |