R
Richard Damon
Guest
On 12/21/15 1:57 PM, rickman wrote:
All ones (the alternate to 0 = 2^32-1) plus All ones will give us the
result of All ones due to the end around carry (in effect the second
carry was remembered by leaving the result as all ones).
On 12/21/2015 11:26 AM, Gabor Szakacs wrote:
I have always heard this method referred to as "end around carry,"
however if you are using this as an accumulator, i.e. A is the next
data input and B is the result of the previous sum, then it is in
effect the same as taking the sum of inputs modulo 2**32 - 1, with
the only difference being that the final result can be equal to
2**32 - 1 where it would normally be zero. Intermediate results
equal to 2**32-1 do not change the final outcome vs. doing a true
modulo operator.
I guess I see what you are saying, even if this only applies to an
accumulator rather than taking a sum of two arbitrary numbers. When a
sum is equal to 2**N-1 the carry is essentially delayed until the next
cycle. But... if the next value to be added is 2**n-1 (don't know if
this is possible) a carry will happen, but there should be a second
carry which will be missed. So as long as the input domain is
restricted to number from 0 to 2**N-2 this will work if the final result
is adjusted to zero when equal to 2**N-1.
All ones (the alternate to 0 = 2^32-1) plus All ones will give us the
result of All ones due to the end around carry (in effect the second
carry was remembered by leaving the result as all ones).