Logic Gates:
Top set is p
Bottom set is q
Bottom switches turn p and q FALSE to TRUE or vice-versa
Top switches are used to NEGATE p and / or q or both.
Gates are:
p AND q - TRUE if both p and q are true
p OR q - TRUE if one or more switches are TRUE
p XOR q - TRUE if and only if p or q are TRUE
p NAND q - Negation of p AND q
p NOR q - Negation of p OR q
p NXOR q - Negation of p XOR q