One-liner picture quiz

Here's an exercise for logical minds.

In one-liner pictures, x and y go from -128 to 127 and they are represented in twos-complement format.

So which piece of code generates which picture? In the following table the expressions and pictures have been mixed up. Try to straighten them out without running the program. Then you can check your answers via the third column if you wish.

x ^ y

x ^ y

x | y

x | y

x >> y

x >> y

~(x & y)

~(x & y)

(x & y) >> (x & y)

(x & y) >> (x & y)

John Robinson