Skip to content

Commit

Permalink
adding "BUF" alias to "BUFF"
Browse files Browse the repository at this point in the history
  • Loading branch information
kanndil committed Sep 29, 2024
1 parent 5f2c0d9 commit 087321b
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/PodemQuest/Gate.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def __init__(self, id, type, input_gates, outputpin):
else:
self.inversion_parity = 0

if type == "BUFF" or type == "NOT":
if type == "BUFF" or type == "BUF" or type == "NOT":
self.non_controlling_value = D_Value.ONE
elif type == "OR" or type == "NOR" or type == "XOR" or type == "XNOR":
self.non_controlling_value = D_Value.ZERO
Expand Down Expand Up @@ -70,7 +70,7 @@ def __init__(self, id, type, input_gates, outputpin):
if self.type in ["AND", "NOR", "XNOR"]:
self.is_one_out_controllable = False
self.is_zero_out_controllable = True
elif ["NOT", "BUFF"]:
elif ["NOT", "BUFF", "BUF"]:
self.is_one_out_controllable = True
self.is_zero_out_controllable = True
else:
Expand Down Expand Up @@ -101,7 +101,7 @@ def evaluate(self):
self.value = self.evaluate_or()
elif self.type == "XOR":
self.value = self.evaluate_xor()
elif self.type == "BUFF":
elif self.type == "BUFF" or self.type == "BUF":
self.value = self.evaluate_buff()
elif self.type == "NOT":
self.value = self.evaluate_not()
Expand Down Expand Up @@ -397,7 +397,7 @@ def calculate_CC0(self):
)
elif self.type == "NOT":
res = self.input_gates[0].CC1 + 1
elif self.type == "BUFF":
elif self.type == "BUFF" or self.type == "BUF":
res = self.input_gates[0].CC0 + 1
elif self.type == "input_pin":
res = 1
Expand Down Expand Up @@ -434,7 +434,7 @@ def calculate_CC1(self):
)
elif self.type == "NOT":
res = self.input_gates[0].CC0 + 1
elif self.type == "BUFF":
elif self.type == "BUFF" or self.type == "BUF":
res = self.input_gates[0].CC1 + 1
elif self.type == "input_pin":
res = 1
Expand Down Expand Up @@ -462,7 +462,7 @@ def calculate_CCb(self):
pass
elif self.type == "NOT":
res = CCb_output + 1
elif self.type == "BUFF":
elif self.type == "BUFF" or self.type == "BUF":
res = CCb_output + 1
elif self.type == "input_pin":
res = CCb_output
Expand Down

0 comments on commit 087321b

Please sign in to comment.