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
import itertools | |
N_BITS = 8 | |
MASK = (1 << N_BITS) - 1 | |
# Bit class, which stores values as a truth table of up to two variables | |
class Bit: | |
def __init__(self, op, bit_a=None, bit_b=None): | |
self.op = op | |
# Remove variables when the truth table doesn't depend on them |