Wether you performa logical operation with a binary or a hex or a decimal number format doesn't matter because the output will be the same. However, if you use hex represetation it has the advantage that you can more easily read the binary value in the source code then with dec. Reason is, because hexadimzmal has a a bas which is a multiple of base 2, thus you can easily visually identify a four digit binrary ina hex number, while this is not so easy in decimal format.
As an example:
3ab9h -> 3 A B 9
0011 1010 1011 0101
So each digit in Hex is a four digit binary, which is easy enough to handle.