Patent attributes
In general, in one aspect, the invention features a circuit, method, and computer-readable media for calculating xmody, wherein x and y are binary numbers, and wherein y is an even number. The circuit comprises a power of two calculator adapted to receive signals representing binary number y and to provide signals representing binary numbers r and m, wherein y=r2m; a vector splitter adapted to receive signals representing binary number x and signals representing the binary number m, and to provide signals representing binary numbers x[w:m] and x[m−1:0], wherein the binary number x[m−1:0] comprises the m least-significant bits of the binary number x and the binary number x[w:m] comprises the w−m+1 most-significant bits of the binary number x; and a remainder calculator adapted to receive the signals representing the binary numbers x[w:m] and r, and to provide a binary number x[w:m]modr, wherein the binary number x[w:m]modr is a remainder of a quotient of the binary number x[w:m] divided by the binary number r; wherein the binary number x[w:m]modr comprises the most-significant bits of a binary number representing xmody and the binary number x[m−1:0] comprises the least-significant bits of the binary number representing xmody.