1
0
mirror of https://github.com/myhdl/myhdl.git synced 2024-12-14 07:44:38 +08:00
myhdl/example/arith_lib/arith_utils.py
2003-01-23 22:33:19 +00:00

13 lines
194 B
Python

SLOW, MEDIUM, FAST = range(3)
BEHAVIOR, STRUCTURE = range(2)
def log2ceil(n):
m = 0
p = 1
for i in range(n+1):
if p < n:
m += 1
p *= 2
return m