Q:

Equality of term and codeline

Can anyone explain me please step-by-step, how this equality can hold?
((a^b)&~b)|(~(a^b)&b)  == a

What is the best way to do it? 

A:

(X&~Y)|(~X&Y) == X^Y //by definition of XOR
Substituting X=a^b and Y=b:
((a^b)&~b)|(~(a^b)&b) == (a^b)^b
Then, the rest is simple:
(a^b)^b == a^(b^b) == a^0 == a

