one or the other inputs is 1, but not neither and not both. 0 xor 0 -‐-‐> 0 0 xor 1 -‐-‐> 1 1 xor 0 -‐-‐> 1 1 xor 1 -‐-‐> 0 Friday, 4 October 13
to the left 0001 0110 (22) -‐> 0010 1100 (44) • Right-shift - moves all the 1’s across to the right 0001 0110 (22) -‐> 0000 1011 (11) Friday, 4 October 13
a -‐> a -‐> a add a b | a == 0 = b | otherwise = add ((a .&. b) `shiftL` 1) (a `xor` b) https://gist.github.com/IanRandall/6775842 Friday, 4 October 13