Method and apparatus for modulo operation
09841946 · 2017-12-12
Assignee
Inventors
Cpc classification
G06F7/38
PHYSICS
International classification
Abstract
In some applications, such as randomization and cryptography, remainder computation for a number is required. The remainder computation is also used in modulo arithmetic. The remainder computation can be simplified when the divisor belongs to a certain class of numbers. A method and apparatus are disclosed that enable low complexity implementation of remainder computation of any number when the divisor belongs to a type of numbers that can be represented as 2.sup.k+1.
Claims
1. A method for searching information of a communication signal received at a communication device from a wireless communication network for a predetermined message, in which the searching includes computation, based on the information of the communication signal, of a remainder of dividing a dividend by a divisor, and in which the divisor is equal to any of b.sup.k±1, b and k are integers and b is not a power of another number, the method comprising: controlling, by a processing device, the searching, in which the searching includes, for each bit position of a binary representation of the dividend: subtracting, from a weight of the bit position, an integral multiple of the divisor nearest to the weight of the bit position, to obtain a difference, and multiplying the difference by a value of the bit position to obtain a product; controlling, by the processing device, summing the products respectively for the bit positions to obtain a first sum, in which the remainder is the first sum unless the first sum is (i) negative or (ii) positive and greater than the divisor; and in which the searching includes when the first sum is negative, adding the divisor recursively to the first sum to obtain a second sum until the second sum is positive, in which the remainder is the second sum when the second sum is positive, and when the first sum is positive and greater than the divisor, recursively subtracting the divisor from the first sum to obtain a third sum until the third sum is less than the divisor, in which the remainder is the third sum when the third sum is less than the divisor.
2. An apparatus for searching information of a communication signal received at a communication device from a wireless communication network for a predetermined message, in which the searching includes computation, based on the information of the communication signal, of a remainder of dividing a dividend by a divisor, and in which the divisor is equal to any of b.sup.k±1, b and k are integers and b is not a power of another number, the apparatus comprising: circuitry configured to control the searching, in which the searching includes, for each bit position of a binary representation of the dividend: subtracting, from a weight of the bit position, an integral multiple of the divisor nearest to the weight of the bit position, to obtain a difference, and multiplying the difference by a value of the bit position to obtain a product; in which the searching includes summing the products respectively for the bit positions to obtain a first sum, in which the remainder is the first sum unless the first sum is (i) negative or (ii) positive and greater than the divisor; and in which the searching includes when the first sum is negative, adding the divisor recursively to the first sum to obtain a second sum until the second sum is positive, in which the remainder is the second sum when the second sum is positive, and when the first sum is positive and greater than the divisor, recursively subtracting the divisor from the first sum to obtain a third sum until the third sum is less than the divisor, in which the remainder is the third sum when the third sum is less than the divisor.
3. A wireless communication device comprising: a receiver to receive a communication signal obtained from a wireless communication network; a processing device configured to control searching information of the communication signal for a predetermined message, in which the searching includes computation, based on the information of the communication signal, of a remainder of dividing a dividend by a divisor, and in which the divisor is equal to any of b.sup.k±1, b and k are integers and b is not a power of another number; in which the searching includes, for each bit position of a binary representation of the dividend: subtracting, from a weight of the bit position, an integral multiple of the divisor nearest to the weight of the bit position, to obtain a difference, and multiplying the difference by a value of the bit position to obtain a product; in which the searching includes summing the products respectively for the bit positions to obtain a first sum, in which the remainder is the first sum unless the first sum is (i) negative or (ii) positive and greater than the divisor; and in which the searching includes when the first sum is negative, adding the divisor recursively to the first sum to obtain a second sum until the second sum is positive, in which the remainder is the second sum when the second sum is positive, and when the first sum is positive and greater than the divisor, recursively subtracting the divisor from the first sum to obtain a third sum until the third sum is less than the divisor, in which the remainder is the third sum when the third sum is less than the divisor.
Description
BRIEF DESCRIPTION OF THE DRAWINGS
(1)
(2)
(3)
(4)
(5)
(6)
DETAILED DESCRIPTION
(7) The foregoing aspects, features and advantages of the present invention will be further appreciated when considered with reference to the following description of exemplary embodiments and accompanying drawings, wherein like reference numerals represent like elements. In describing the exemplary embodiments of the invention illustrated in the appended drawings, specific terminology will be used for the sake of clarity. However, the invention is not intended to be limited to the specific terms used.
(8) Two methods and apparatus are described to efficiently compute the remainder of any number when the divisor is a class of Cunningham numbers. The first method is illustrated with an example where the dividend is m=173 and the divisor is n=5=2.sup.2+1. The computation of a remainder according to the aspects of the present invention is illustrated in the table contained
(9) For the 3GPP LTE specific remainder computation specified by EQ. 1, the computation of the remainder may be performed more efficiently as illustrated in
(10) Regardless of the product term that is obtained, it is then split into two parts: upper 16 bits (U16) and lower 16 bits (L16) as shown in
The upper 16 bits (U16) are 0001110101010011 and the lower 16 bits (L16) are 1010101111100110. Therefore, REM=L16−U16=1010101111100110−0001110101010011 =44006−7507 =36499
Since this is a positive number, (492022758 mod 65537)=36499 is the final value of the remainder, i.e., FINAL_REM=REM.
As another example, suppose the product term (A*Y.sub.k-1)=3158323257. The binary representation of this number is: 10111100010000000011000000111001
The upper 16 bits (U16) are 1011110001000000 and the lower 16 bits (L16) are 0011000000111001. Therefore, REM=L16−U16=0011000000111001−1011110001000000 =12345−48192 =−35847
(11) Since this is a negative number, value of D is added to the answer: −35847+D=29690 to obtain the final answer, i.e., FINAL_REM=REM+D. This is the same as the remainder obtained by direct computation, i.e., (3158323257 mod 65537)=29690.
(12) The methods disclosed according to aspects of this invention enable a reduced complexity implementation of remainder computation when the divisor belongs to a class of Cunningham numbers such that they are of the form b.sup.k+1 and where k is even. The disclosed method may reduce the hardware complexity and power consumption of the 3GPP LTE client terminals.
(13) By way of example only, the above described method may be implemented in a user device such as a wireless mobile station (MS).
(14) As shown in
(15) The application processor subsystem 101 as shown in
(16) In
(17) Aspects of the present invention may be implemented in firmware of the controller 108 of the application processor in
(18) The consumer electronics devices that may use the aspects of the invention may include smartphones, tablets, laptops, gaming consoles, cameras, video camcorders, TV, car entertainment systems, etc.
(19) Although aspects of the invention herein have been described with reference to particular embodiments, it is to be understood that these embodiments are merely illustrative of the principles and applications of the aspects of the present invention. It is therefore to be understood that numerous modifications may be made to the illustrative embodiments and that other arrangements may be devised without departing from the spirit and scope of the aspects of the present invention as defined by the appended claims. Aspects of each embodiment may be employed in the other embodiments described herein.