Quote:
>>I am trying to use the mod operator in my VHDL code, but my synthesis tool
>>only supports X MOD Y; where Y is a power of 2; X an integer.
>>What would be the equivalency between X MOD 255 and X MOD 256 ?
>>I would also like to find the equivalency between X MOD (2**m - 1) and
>>X MOD (2**m); where m is an integer.
There's not really any equivalency; knowing X mod 256 doesn't
help you compute X mod 255 in the general case.
However your problem is simpler if the range of X is restricted.
For example, If as I suspect you're doing Galois-field
operations, you might need to take X mod 255 where X is in
the range 0 through 509. In that case
X mod 255 = X (if X < 255)
X-255 (otherwise)
Hope this helps a bit --
Steve