projects
/
nmigen.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
fe84014
)
hdl.ast: add Value.implies.
author
whitequark
<cz@m-labs.hk>
Sat, 19 Jan 2019 08:56:44 +0000
(08:56 +0000)
committer
whitequark
<cz@m-labs.hk>
Sat, 19 Jan 2019 08:56:44 +0000
(08:56 +0000)
nmigen/hdl/ast.py
patch
|
blob
|
history
diff --git
a/nmigen/hdl/ast.py
b/nmigen/hdl/ast.py
index bd66d45fbba8bc663c4f20dd72989f3ed5df88dc..b330cb332a070f68c18f6113c9ae518d5e4d4e47 100644
(file)
--- a/
nmigen/hdl/ast.py
+++ b/
nmigen/hdl/ast.py
@@
-134,6
+134,16
@@
class Value(metaclass=ABCMeta):
"""
return Operator("b", [self])
+ def implies(premise, conclusion):
+ """Implication.
+
+ Returns
+ -------
+ Value, out
+ ``0`` if ``premise`` is true and ``conclusion`` is not, ``1`` otherwise.
+ """
+ return ~premise | conclusion
+
def part(self, offset, width):
"""Indexed part-select.