Browse Source

addition full adder complete sum with carry

master
Dennis Sperzel 12 months ago
parent
commit
4d7ac5d352
  1. 2
      src/addition.c

2
src/addition.c

@ -3,4 +3,6 @@
void full_adder (int* sum, int* nextcarry, int number1, int number2, int carry) { void full_adder (int* sum, int* nextcarry, int number1, int number2, int carry) {
sum[0] = number1 ^ number2 ^ carry; sum[0] = number1 ^ number2 ^ carry;
nextcarry[0] = (number1 & number2) | (number1 & carry) | (number2 & carry);
} }
Loading…
Cancel
Save