T-n-T: Adding two 16-bit numbers

The problem

It is required to perform the addition of two 16-bit numbers, the sum of which exceeds the maximum value of a 16-bit number (more than 65535).

The solution

The built-in function block “Addition” cannot ensure the correct execution of such an operation - as a result of overflow, part of the sum value will be lost .

The solution (diagram).

The solution is a diagram developed in CannyLab 2.x. The algorithm is combined in a composite block.

The initial values are decomposed into summands, the result of addition of which does not exceed the maximum allowable 16-bit value, with subsequent merging of the results of intermediate operations.

SEE ALSO