Boolean expression

I'm studying for a midterm that i have and one of the questions is to make an xor gate using only nots and and gates. I have the diagram but I'm having trouble doing the Boolean expression could someone please help me?
Here is an example of a NAND gate:
1
2
3
4
bool nand_gate(bool a, bool b)
{
	return !(a && b);
}

Hope that helps.

EDIT:

Here is an equivalent example:
1
2
3
4
bool nand_gate(bool a, bool b)
{
	return not(a and b);
}
Last edited on
i know its a serious of 4 nand gates im just not sure how to right it as a Boolean expression
Last edited on
Topic archived. No new replies allowed.