Beispiel #1
0
    def architecture(self):
        """
        Implement simple xor using a truth table.
        """

        yield If((self.a.shell == False) & (self.b.shell == False)).then(
            self.s.shell.activate()
        )
        yield If((self.a.shell == True) & (self.b.shell == True)).then(
            self.s.shell.activate()
        )
Beispiel #2
0
 def architecture(self):
     yield self.output.shell.set_max_value()
     for a_port, b_port, s_port, in zip(self.input_a.ports,
                                        self.input_b.ports,
                                        self.output.ports):
         yield If((a_port.shell == True) & (b_port.shell == True)).then(
             s_port.shell.deactivate())
Beispiel #3
0
 def architecture(self):
     yield If(self.a.shell == False).then(self.s.shell.activate())
     yield If(self.a.shell == True).then(self.s.shell.deactivate())
Beispiel #4
0
 def architecture(self):
     for index in xrange(self.bits):
         yield If(self.input.ports[index].shell == True).then(
             self.output.ports[self.bits - index - 1].shell.activate())
Beispiel #5
0
 def architecture(self):
     self.event_check.is_repeated = True
     callback_command = self.callback.shell.activate()
     yield If(self.event_check).then(callback_command)
Beispiel #6
0
 def architecture(self):
     yield If((self.a.shell == True) & (self.b.shell == True)).then(
         self.s.shell.activate())