# Boolean expression to logic gates

Hello I need help with xy xor z, do I do the logic AND first or the XOR, no parenthesis. Thank You

• That would depend on how one chooses the precedence between those two connectives -- this is a convention, not a scientific fact. However, I'd guess it's AND first, since I always found that precedence to be used in my experience.
– chi
May 7, 2017 at 17:08
• Usually AND has priority over OR and XOR like multiplications have priority over additions : AND is a 1 bit binary multiplication, XOR is a 1 bit binary addition. May 7, 2017 at 19:40

Usually, an operator that's written implicitly by just putting the operands next to each other (e.g., "$xy$" for $x\land y$ in logic or $x\times y$ in arithmetic) has precedence over binary operators that are written out explicitly (e.g., $\lor$ or $\oplus$ in logic, or $+$ in arithmetic). Indeed, any author who uses a different convention to that needs a good stern talking to. But note that it is only a convention.
So the expression in the question means $(xy)\oplus z$, unless the person who wrote it hates us. This view is reinforced by the fact that logical and is multiplication modulo 2, and xor is addition modulo 2 and we'd expect multiplication to have precedence over addition.