Don’t waste your time with nested AND, OR, NOT. You can do it indirectly with comparison. XOR A != B XNOR A == B