Initial Commit
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
class And:
|
||||
def __init__(self,a,b) -> None:
|
||||
self.a = a
|
||||
self.b = b
|
||||
self.out=None
|
||||
self()
|
||||
def __call__(self) -> None:
|
||||
self.out = self.a.out and self.b.out
|
||||
@@ -0,0 +1,9 @@
|
||||
class FlipFlop:
|
||||
def __init__(self,a) -> None:
|
||||
self.a=a
|
||||
self.prev_a=None
|
||||
self.out=None
|
||||
self()
|
||||
def __call__(self) -> None:
|
||||
self.out=self.prev_a
|
||||
self.prev_a=self.a.out
|
||||
@@ -0,0 +1,7 @@
|
||||
class Not:
|
||||
def __init__(self,a) -> None:
|
||||
self.a = a
|
||||
self.out=None
|
||||
self()
|
||||
def __call__(self) -> None:
|
||||
self.out = not self.a.out
|
||||
@@ -0,0 +1,8 @@
|
||||
class Or:
|
||||
def __init__(self,a,b) -> None:
|
||||
self.a = a
|
||||
self.b = b
|
||||
self.out=None
|
||||
self()
|
||||
def __call__(self) -> None:
|
||||
self.out = self.a.out or self.b.out
|
||||
@@ -0,0 +1,3 @@
|
||||
class Power:
|
||||
def __init__(self,value) -> None:
|
||||
self.out = value
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user