4 ms·
The fix for the noncontiguous addition puzzle is to change filled = to & mask to filled = to | ^mask In other words, to OR in 1-bits so the carry can tr
by bugfix-66 4y ago
The fix for the noncontiguous addition puzzle is to change
filled = to & mask
to
filled = to | ^mask
In other words, to OR in 1-bits so the carry can travel across the irrelevant part of the register.
Subtraction is similar:
https://bugfix-66.com/adbc40fa7c8c838d8d34bcd35525313dc91dea0149647b701cfb8d99b5aa0f27 https://bugfix-66.com/adbc40fa7c8c838d8d34bcd35525313dc91dea...
But for subtraction you want to AND in 0-bits so the borrow can travel.