摘要 |
A method and apparatus for a modulo N operation are provided. The method for a modulo N operation on a positive integer X includes converting the positive integer X into a binary number, determining whether a modulo N is expressed by a product of 2 to the mth power and a value obtained by adding or subtracting one to or from 2 to the nth power, calculating the positive integers m and n, if the modulo N is expressed by the product of 2 to the mth power and the value obtained by adding or subtracting one to or from 2 to the nth power, and grouping the binary number of the positive integer X into bit units varying according to the positive integers m and n to perform operation on the binary number of the positive integer X. Accordingly, it is possible to reduce complexity of a modulo operation using a simple adder and logic circuit.
|