def performGateLogic(self): sum = XorGate.performGateLogic(self) carry = AndGate.performGateLogic(self) return (sum, carry)
def performGateLogic(self): if AndGate.performGateLogic(self) == 1: return 0 else: return 1
def halfader(self, a, b): s = XorGate(a, b) c = AndGate(a, b) return (s,c)