diff --git a/bitutilities.py b/bitutilities.py index 35bc7a3..1676435 100644 --- a/bitutilities.py +++ b/bitutilities.py @@ -35,7 +35,7 @@ class BasicRegister: [False] * max(resulting_size - current_memory_size, 0) + list(self.memory)[-resulting_size:] ) - def reverse(self): + def negate(self): """ Performs a logical negation on the register. """ @@ -136,7 +136,7 @@ def binary_subtraction(minuend: BasicRegister, subtrahend: BasicRegister) -> Bas :return: Register containing the difference. :rtype: BasicRegister """ - subtrahend.reverse() + subtrahend.negate() difference: BasicRegister final_carry: bool @@ -145,7 +145,7 @@ def binary_subtraction(minuend: BasicRegister, subtrahend: BasicRegister) -> Bas if final_carry: return binary_sum(difference, BasicRegister([False] * (len(difference) - 1) + [True])) else: - difference.reverse() + difference.negate() return difference