You can do bitwise NOT and then AND: a & ~b
Given:
a = 1010111110110001
b = 0101011100010010
Then negation bgives:
~b = 1010100011101101
and execute a & ~b:
a = 1010111110110001
~b = 1010100011101101
-------------------------
a & ~b = 1010100010100001
source
share