From 4d7ac5d3522e632c95c58f5739c80c46f018ef2e Mon Sep 17 00:00:00 2001 From: Dennis Sperzel Date: Mon, 29 Jan 2024 21:29:24 +0100 Subject: [PATCH] addition full adder complete sum with carry --- src/addition.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/addition.c b/src/addition.c index 753d77d..6d7ca86 100644 --- a/src/addition.c +++ b/src/addition.c @@ -3,4 +3,6 @@ void full_adder (int* sum, int* nextcarry, int number1, int number2, int carry) { sum[0] = number1 ^ number2 ^ carry; + + nextcarry[0] = (number1 & number2) | (number1 & carry) | (number2 & carry); } \ No newline at end of file