1
0
mirror of https://github.com/myhdl/myhdl.git synced 2025-01-24 21:52:56 +08:00

Merge from 0.6-maint

This commit is contained in:
Jan Decaluwe 2009-05-10 08:11:23 +02:00
commit 3ee96baf1f

View File

@ -57,7 +57,7 @@ def enum(*names, **kwargs):
raise ValueError("enum literals should be unique")
if encoding == "one_hot":
code = bin(1<<i, nrbits)
elif encoding == "one_code":
elif encoding == "one_cold":
code = bin(~(1<<i), nrbits)
else: # binary as default
code = bin(i, nrbits)