1

I have the following bitwise expression and was wondering if it could be simplified or if there is a general way of interpreting the output.

(x & y) | (~x & ~y) 
2
  • 1
    What operations can you use? Logically it's the same as NOT(XOR(x, y)) Commented Oct 4, 2019 at 3:08
  • Thank you, that's what I was looking for Commented Oct 4, 2019 at 3:14

1 Answer 1

1

The only "simpler" version is ~(x^y) (where ^ is the XOR operator).

However, It's not going to make a significant difference computationally, and is harder to read for most people (XOR is not as natural as AND and OR). There's not a simpler version using just AND and OR operators, so I would suggest you just leave it as-is.

if there is a general way of interpreting the output.

"Either both are true or both are false" is a natural interpretation.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.