#include "addition.h" #include void full_adder (num* sum, num* nextcarry, num number1, num number2, num carry) { sum[0] = (number1 % 2) ^ (number2 % 2) ^ (carry % 2); nextcarry[0] = ((number1 % 2) & (number2 % 2)) | ((number1 % 2) & (carry % 2)) | ((number2 % 2) & (carry % 2)); } unsigned int addition(num number1, num number2) { unsigned int result = 0; num sum[1] = {0}; num nextcarry[1] = {0}; for (int i = 0; i < 8 * sizeof(num); i++) { full_adder(sum, nextcarry, number1, number2, nextcarry[0]); result ^= (sum[0] << i); number1 >>= 1; number2 >>= 1; } return result; } float addition_float(float a, float b) { return 0.0; }