# Negated Gates¶

Finally, it is useful sometimes to think about the opposites of the three basic logical rules (AND, OR and XOR). These opposite, or “Not” rules, do the exact opposite of the regular versions. For instance, AND gives an output of 1 only if both inputs are 1. NAND (Not AND) gives an output of 0 only if both inputs are 1.

Below are the truth tables for the negated gates shown next to the gate they negate.

### OR vs NOR Gates

Truth table for OR
Input 1 Input 2 Output
0 0 0
0 1 1
1 0 1
1 1 1
Truth table for NOR
Input 1 Input 2 Output
0 0 1
0 1 0
1 0 0
1 1 0

OR reports 1 if either input is 1. NOR is the exact opposite - it reports 0 if either input is 1 (and only gives 1 if both inputs are 0).

### AND vs NAND Gates

Truth table for AND
Input 1 Input 2 Output
0 0 0
0 1 0
1 0 0
1 1 1
Truth table for NAND
Input 1 Input 2 Output
0 0 1
0 1 1
1 0 1
1 1 0

AND gives a 1 only if both inputs are 1. NAND does the opposite - that is the only time it gives a 0.

### XOR vs XNOR Gates (Also known as ENOR)

Truth table for XOR
Input 1 Input 2 Output
0 0 0
0 1 1
1 0 1
1 1 0
Truth table for XNOR
Input 1 Input 2 Output
0 0 1
0 1 0
1 0 0
1 1 1

XOR gives a 1 if the two inputs are different (0 1 or 1 0). XNOR gives a 1 only if they are the same!

#### Self Check

What is the result of applying NOR to:
1101
1001?

What is the result of applying XNOR to:
1101
1001?