From 132a0b5659ce9a72b4e560da395868ceab4adf7e Mon Sep 17 00:00:00 2001 From: Rhinemann Date: Tue, 27 Jun 2023 14:09:07 +0300 Subject: [PATCH] Changed the conditions checking register lengths. --- bitutilities.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) 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)