Method and apparatus for arithmetic operation and recording medium of method of operation
AssigneeMitsubishi Denki Kabushiki Kaisha
InventorMitsuru Matsui
Life of this patent
Estimating the term…
Abstract
An integer Z101 is divided by an integer I102 to obtain a remainder R109. The integer I102 includes a polynomial of power of a basic operational unit of a computer. In this way, the integer I for divisor is limited based on the basic operational unit of the computer, thus a shift operation, which is required for a conventional operation method, can be eliminated. The remainder can be calculated by only addition and subtraction. Accordingly, a code size becomes compact and the remainder of the integer can be calculated at a high speed.
Claims9
An operation apparatus for calculating a remainder R of data Z having Bz bits divided by data I represented by a following equation:
- I = ∑ N = 0 N = N max A N Q MN
- (M is a number of bits of a basic operational unit;
- N is a natural number being one of 0 through Nmax, A0 is a value whose absolute value is smaller than a value represented by the basic operational unit of M bits;
- each of A1 through ANmax−1 is +1, 0, or −1;
- ANmax is +1, or −1;
- and Q is a natural number equal to or more than 2) the operation apparatus comprising:
- (1) a data Zl storing region for storing data Zl of lower M×Nmax bits of the data Z;
- (2) a data Zh storing region for storing data Zh of higher (Bz−M×Nmax) bits of the data Z;
- (3) a data AN storing region for storing the data AN;
- and
- (4) an addition/subtraction unit for calculating the remainder R by determining an operation between addition and subtraction based on positive/negative of the data AN, and operating addition/subtraction of data stored in at least a part of the data Zl storing region and data stored in at least a part of the data Zh storing region.
An operation method, using an operation apparatus, for calculating a remainder R of data Z having Bz bits divided by data I represented by a following equation:
- I = ∑ N = 0 N = N max A N Q MN
- (M is a number of bits of a basic operational unit;
- N is a natural number being one of 0 through Nmax, A0 is a value whose absolute value is smaller than a value represented by the basic operational unit of M bits;
- each of A1 through ANmax−1 is +1, 0, or −1;
- ANmax is +1, or −1;
- and Q is a natural number equal to or more than 2) the operation method comprising:
- (1) a data Zl storing step of storing data Zl of lower M×Nmax bits of the data Z;
- (2) a data Zh storing step of storing data Zh of higher (Bz−M×Nmax) bits of the data Z;
- (3) a data AN storing step of storing the data AN;
- and
- (4) an adding/subtracting step of calculating the remainder R by determining an operation between addition and subtraction based on positive/negative of the data AN, and operating addition/subtraction of data stored in at least a part of the data Zl storing region and data stored in at least a part of the data Zh storing region.
A computer readable recording medium having a computer readable program stored therein for causing a computer to perform an operation process using an operation apparatus for calculating a remainder R of data Z having Bz bits divided by data I represented by a following equation:
- I = ∑ N = 0 N = N max A N Q MN
- (M is a number of bits of a basic operational unit;
- N is a natural number being one of 0 through Nmax, A0 is a value whose absolute value is smaller than a value represented by the basic operational unit of M bits;
- each of A1 through ANmax−1 is +1, 0, or −1;
- ANmax is +1, or −1;
- and Q is a natural number equal to or more than 2)
- wherein the operation process comprises:
- (1) a data Zl storing process for storing data Zl of lower M×Nmax bits of the data Z;
- (2) a data Zh storing process for storing data Zh of higher (Bz−M×Nmax) bits of the data Z;
- (3) a data AN storing process for storing the data AN;
- and
- (4) an adding/subtracting process for calculating the remainder R by determining an operation between addition and subtraction based on positive/negative of the data AN, and operating addition/subtraction of data stored in at least a part of the data Zl storing region and data stored in at least a part of the data Zh storing region.
Dependencies are inferred from the claim text.