hdl.ast: add Value.implies.
This commit is contained in:
parent
c5d67b0461
commit
5e2b46f727
|
@ -134,6 +134,16 @@ class Value(metaclass=ABCMeta):
|
||||||
"""
|
"""
|
||||||
return Operator("b", [self])
|
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):
|
def part(self, offset, width):
|
||||||
"""Indexed part-select.
|
"""Indexed part-select.
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue