in fact.. it's not good because my result matrix needs to be like this: 
    
    a b r
    0 0 1  
    0 1 1  
    1 0 0  
    1 1 1 

and there is no bitwise operation that looks like that