Sorry I only did the JS version of The Introduction to Bitwise Operators, but I believe it's pretty much the same thing.
This is not correct, I believe, because you did not put the same about of binaries in there.
There are 1-bits, 2-bits, 4-bits, and 8-bits in these. But in one of them, you have only put until 4-bits, which does not match. Putting another 0 at the front would make it work.
This would be the correct way to make it equal 0b1111, or even:
There are lots of combinations of this, but the one requirement in this is that you have to have a 1 in the 2-bit.
I say that there isn't a bug because there is an error, in your code, and I suggest you think about the XOR part later.