We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Ah, fair point for it not really being every possible combination of bits. It's more that you can adjust every bit after that first 1 to not match and thus produce an xor value of 1 for that bit.
Or, more clearly:After that first 1 we can manipulate every non-1 digit by adjusting the values on either side of the xor.
To note, any binary number xor'd with {itself minus one} is not always all bits on, that would only work for a value that is a power of 2.
Maximizing XOR
You are viewing a single comment's thread. Return to all comments →
Ah, fair point for it not really being every possible combination of bits. It's more that you can adjust every bit after that first 1 to not match and thus produce an xor value of 1 for that bit.
Or, more clearly:After that first 1 we can manipulate every non-1 digit by adjusting the values on either side of the xor.
To note, any binary number xor'd with {itself minus one} is not always all bits on, that would only work for a value that is a power of 2.