Is there a bit operation or a series of bit operations that would give me the following result?
I’ll show what I want by using examples. Note that the length of each bit string is irrelevant:
1)
100000
100000
------
011111
2)
000000
000000
------
000000
3)
100000
000000
------
000000
4)
000100
000100
------
111011
5)
100100
100100
------
011011
6)
100100
000100
------
111011
7)
010101
101010
------
000000
8)
111111
111111
------
000000
So, the idea is that if anywhere in the first string, a 1 overlaps with a 1 in the second string, then in the result, 1s appear everywhere except the position where the 1s overlap.
Pseudo code: