diff --git a/bitutilities.py b/bitutilities.py index 052163e..c586d9d 100644 --- a/bitutilities.py +++ b/bitutilities.py @@ -82,12 +82,12 @@ def binary_sum(a_original: BasicRegister, b_original: BasicRegister) -> BasicReg required_size = max(size_a, size_b) + a = a_original + b = b_original + if size_a != size_b: - a = a_original.adjusted_by_size(required_size) - b = b_original.adjusted_by_size(required_size) - else: - a = a_original - b = b_original + a = a.adjusted_by_size(required_size) + b = b.adjusted_by_size(required_size) c = BasicRegister([False] * required_size)