Bitwise operation question with shifting involved I am trying to find a value of X (32 bits) such that ((X XOR a)+b)&lt;&lt;3 = (X+c) XOR d. &lt;&lt;3 means shift left 3 bits. a,b,c and d are all constants which have been determined elsewhere.

However, I don't want to brute force the full 2^32 combinations. I was told solving it 3 bits by 3 bits from the MSB on the left hand side would help however this feels off to me. 

Say I fix the first 3 MSB. This with the left shift that means that the 3 LSB will be fixed, leading to the next 3 bits and so on. It seems to me that fixing any 3 straight bits will end up with all of X being solved. Are 8 tries really all I need to solve this equation? 

There's also the possibility that the values of a,b,c and d at the time might create an unsolvable equation too. If I don't find it within the 8 (or more tries if my above paragraph is wrong) it's safe to ditch this and try new values of a,b,c,d right?
Actually, you want to solve it from the LSB side.

First, solve for the 3 LSBs of X; we can see that the 3 LSBits of the left hand side of ((X XOR a)+b)&lt;&lt;3 = (X+c) XOR d doesn't actually depend on X (and there's no propogation anywhere from the higher order bits of X, so they can be ignored for now), so it's effectively a simple equation, easily solved.

Then, solve for the next 3 LSBs of X; again the 6 LSBits left hand side doesn't depend on those bits (it does depend on the 3 LSBits of X, but we already know those); again, that portion of X is easily solved.

So, just keep on iteration until we have all the bits of X.

One thing we can see from this process is that there is always exactly one solution for X for any (a, b, c, d) values.