Created
July 24, 2015 10:31
-
-
Save Arachnid/82d48e56fd9ff231c747 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def manipulate_signals(a, b): | |
sum = Signal(0) | |
product = Signal(0) | |
@logic | |
def add(): | |
sum.value = a.value + b.value | |
@logic | |
def multiply(): | |
product.value = sum.value * a.value | |
return product | |
def test_signals(): | |
a = Signal(0) | |
b = Signal(0) | |
result = manipulate_signals(a, b) | |
a.value = 10 | |
b.value = 20 | |
assert result.value == 300 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment