Search code examples
fpgaxilinxsynthesis

Is number a multiple of 100 using only bit wise operations


Is there an efficient way to know if a given number is a multiple of 100 using only bit wise operations, most definitely no modulo % or divide operators /, just shifts <<, >>, bit wise and &, or |


Solution

  • Checkout Divide by 10 using bit shifts? using 205/2048 we can divide by 10. Using it twice we can divide by 100. If we divide by 100 and multiply by 100 and the result is equal to the number we started with it means the number is a multiple of 100