Example #1
0
File: table.py Project: e42s/pyeda
 def items():
     """Iterate through AND'ed items."""
     for upoint in boolfunc.iter_upoints(inputs):
         ab = self.urestrict(upoint).pcdata[0]
         cd = other.urestrict(upoint).pcdata[0]
         # a & c, b | d
         yield ((ab & cd) & 2) | ((ab | cd) & 1)
Example #2
0
File: table.py Project: e42s/pyeda
 def items():
     """Iterate through XOR'ed items."""
     # pylint: disable=C0103
     for upoint in boolfunc.iter_upoints(inputs):
         ab = self.urestrict(upoint).pcdata[0]
         cd = other.urestrict(upoint).pcdata[0]
         # a & d | b & c, a & c | b & d
         a, b, c, d = ab >> 1, ab & 1, cd >> 1, cd & 1
         yield ((a & d | b & c) << 1) | (a & c | b & d)
Example #3
0
def test_iter_upoints():
    assert list(iter_upoints([a, b])) == [({aa, bb}, set()), ({bb}, {aa}), ({aa}, {bb}), (set(), {aa, bb})]
Example #4
0
def test_iter_upoints():
    assert list(iter_upoints([a, b])) == [({aa, bb}, set()), ({bb}, {aa}), ({aa}, {bb}), (set(), {aa, bb})]