From 6413927d706970b75d7139cbf91e6be8c9ce0e4e Mon Sep 17 00:00:00 2001 From: dymik739 Date: Tue, 27 Jun 2023 15:00:10 +0300 Subject: [PATCH] fix wrong carry bit output --- bitutilities.py | 1 + 1 file changed, 1 insertion(+) diff --git a/bitutilities.py b/bitutilities.py index e8179fe..30a16aa 100644 --- a/bitutilities.py +++ b/bitutilities.py @@ -100,6 +100,7 @@ def binary_sum(first_term: BasicRegister, second_term: BasicRegister, return_rem c.memory[i] = bool(current_bit_sum & 1) final_bit_sum = a.memory[0] + b.memory[0] + carry + carry = bool(final_bit_sum & 2) c.memory[0] = bool(final_bit_sum & 1) if return_remainder: