Logic gates are electronic components that process binary inputs (0 or 1) to produce binary outputs, based on Boolean logic. They are the building blocks of all processors.
AND: output is 1 only if BOTH inputs are 1
OR: output is 1 if AT LEAST ONE input is 1
NOT: output is the OPPOSITE of the input (inverter)
NAND / NOR: AND/OR with output inverted
XOR: output is 1 if inputs are DIFFERENT
Truth Tables: AND and OR
All Possible Input/Output Combinations
AND Gate
A
B
A AND B
0
0
0
0
1
0
1
0
0
1
1
1
OR Gate
A
B
A OR B
0
0
0
0
1
1
1
0
1
1
1
1
NOT, XOR, NAND
More Essential Gates
NOT
A
NOT A
0
1
1
0
XOR
A
B
XOR
0
0
0
0
1
1
1
0
1
1
1
0
NAND
A
B
NAND
0
0
1
0
1
1
1
0
1
1
1
0
Exam Practice
Have a go at this question
Edexcel-style question
Complete the truth table for the expression: Q = (A AND B) OR (NOT C), for all inputs where A=1, B=0, C=1.
3 marks
A AND B = 1 AND 0 = 0 [1] NOT C = NOT 1 = 0 [1] Q = 0 OR 0 = 0 [1]
Key Takeaways
What to Remember
AND: 1 only if both inputs = 1
OR: 1 if at least one input = 1
NOT: inverts; XOR: 1 if inputs are different; NAND/NOR: inverted AND/OR