Exemplo n.º 1
0
Arquivo: table.py Projeto: 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)
Exemplo n.º 2
0
Arquivo: table.py Projeto: 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)
Exemplo n.º 3
0
def test_iter_upoints():
    assert list(iter_upoints([a, b])) == [({aa, bb}, set()), ({bb}, {aa}), ({aa}, {bb}), (set(), {aa, bb})]
Exemplo n.º 4
0
def test_iter_upoints():
    assert list(iter_upoints([a, b])) == [({aa, bb}, set()), ({bb}, {aa}), ({aa}, {bb}), (set(), {aa, bb})]