Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import base
- class ExclusivOderGatter(base.BaseGate):
- def _calc_output_y(self):
- if self.get_input(0) and self.get_input(1) or not self.get_input(0) and not self.get_input(1):
- return False
- return True
- test1 = ExclusivOderGatter(False, False)
- print(test1.get_output())
- test2 = ExclusivOderGatter(True, False)
- print(test2.get_output())
- test3 = ExclusivOderGatter(False, True)
- print(test3.get_output())
- test4 = ExclusivOderGatter(True, True)
- print(test4.get_output())
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement