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.
Claims21
An operation apparatus for calculating a remainder R of data Z having Bz bits divided by data I represented by a following equation:
- 9 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:
- 10 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:
- 11 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.
An operation apparatus for calculating a remainder R of data Z having Bz bits divided by data I represented by a following equation:
- I=CQn±1
- (M is a number of bits of a basic operational unit;
- Q is a natural number equal to or more than 2;
- n is n≧M;
- and C is 1<C<QM) the operation apparatus comprising:
- (1) a data Zl storing region for storing data Zl of lower n bits of the data Z;
- (2) a data Zh storing region for storing data Zh of higher Bz−n bits of the data Z;
- (3) a quotient calculating unit for calculating a quotient q and a remainder r by dividing the data Zh with the data C;
- and
- (4) an addition/subtraction unit for calculating the remainder R by adding the remainder r as a basic operational unit higher than the data Zl to the data Zl, and adding/subtracting the quotient q to/from an added result.
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=CQn±1
- (M is a number of bits of a basic operational unit;
- Q is a natural number equal to or more than 2;
- n is n≧M;
- and C is 1<C<QM) the operation method comprising:
- (1) a data Zl storing step of storing data Zl of lower n bits of the data Z;
- (2) a data Zh storing step of storing data Zh of higher Bz−n bits of the data Z;
- (3) a quotient calculating step of calculating a quotient q and a remainder r by dividing the data Zh with the data C;
- and
- (4) an adding/subtracting step of calculating the remainder R by adding the remainder r as a basic operational unit higher than the data Zl to the data Zl, and adding/subtracting the quotient q to/from an added result.
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=CQn±1
- (M is a number of bits of a basic operational unit;
- Q is a natural number equal to or more than 2;
- n is n≧M;
- and C is 1<C<QM)
- wherein the operation process comprises:
- (1) a data Zl storing process for storing data Zl of lower n bits of the data Z;
- (2) a data Zh storing process for storing data Zh of higher Bz−n bits of the data Z;
- (3) a quotient calculating process for calculating a quotient q and a remainder r by dividing the data Zh with the data C;
- and
- (4) an adding/subtracting process for calculating the remainder R by adding the remainder r as a basic operational unit higher than the data Zl to the data Zl, and adding/subtracting the quotient q to/from an added result.
An operation apparatus for calculating a remainder R of data Z divided by data P comprising a data I judging unit for judging if the data P equals a predetermined data I.
An operation method for calculating a remainder R of data Z divided by data P comprising a data I judging step of judging if the data P equals a predetermined data I.
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 divided by data P, wherein the operation process comprises a data I judging process for judging if the data P equals to a predetermined data I.
Dependencies are inferred from the claim text.