It's easy to see when a number is divisible by 2 in binary,
just like in decimal: 70 is divisible by 10, 500 is divisible by 100,
so in binary 10 is divisible by 2 10100 is divisible by 4 101010111000 is divisible by 8 etc. (We also know 101010111001 can't be divisible by 8, cause it's only 1 more than a number divisible by 8)
Knowing this we can look at the question backwards
take 24 and -24, because 24 is divisible by 8 it must end with a 1 and 3 0s ...0011000
when we take the compliment we get 1100111 which for the same reason must end in a 0 and a run of 1s,
now when we add one to this, all the ones will roll over and we end up with the same tail "1000" as in 24, and since this anything to the left of the tail is a compliment of the corresponding bit in x a bitwise and will just be the tail.
just like in decimal: 70 is divisible by 10, 500 is divisible by 100,
so in binary 10 is divisible by 2 10100 is divisible by 4 101010111000 is divisible by 8 etc. (We also know 101010111001 can't be divisible by 8, cause it's only 1 more than a number divisible by 8)
Knowing this we can look at the question backwards take 24 and -24, because 24 is divisible by 8 it must end with a 1 and 3 0s ...0011000
when we take the compliment we get 1100111 which for the same reason must end in a 0 and a run of 1s,
now when we add one to this, all the ones will roll over and we end up with the same tail "1000" as in 24, and since this anything to the left of the tail is a compliment of the corresponding bit in x a bitwise and will just be the tail.