mirror of
https://github.com/myhdl/myhdl.git
synced 2025-01-24 21:52:56 +08:00
Correction to make a 1 bit "signed" intbv possible
This commit is contained in:
parent
61d779e738
commit
525be5c500
@ -44,10 +44,9 @@ class intbv(object):
|
||||
self._min = min
|
||||
self._max = max
|
||||
if max is not None and min is not None:
|
||||
_nrbits = maxfunc(len(bin(max-1)), len(bin(min)))
|
||||
if min >= 0:
|
||||
_nrbits = len(bin(max-1))
|
||||
elif max <= 0:
|
||||
elif max <= 1:
|
||||
_nrbits = len(bin(min))
|
||||
else:
|
||||
# make sure there is a leading zero bit in positive numbers
|
||||
|
Loading…
x
Reference in New Issue
Block a user