Only use powers of two masks, for now

This commit is contained in:
Edward Wang
2017-07-21 10:33:29 -07:00
committed by edwardcwang
parent cf0d40f658
commit bb2783994a
2 changed files with 6 additions and 0 deletions

View File

@@ -93,4 +93,7 @@ object Utils {
case Some(ActiveLow) | Some(NegativeEdge) => not(exp)
case _ => exp
}
// Check if a number is a power of two
def isPowerOfTwo(x: Int): Boolean = (x & (x - 1)) == 0
}