Logic Gates and Truth Tables
AND, OR, NOT, NAND, NOR, XOR
Related Labs
Related Worksheets
Related Cheat Sheets
Logic gates are the basic building blocks of digital computers, calculators, phones, and many electronic control systems. Each gate takes one or more binary inputs, usually 0 or 1, and produces a binary output. By combining simple gates, engineers build circuits that add numbers, store data, compare values, and make decisions. Truth tables matter because they show every possible input combination and the exact output for each case.
A digital circuit can be understood as a flow of logical conditions through connected gates. AND requires all inputs to be 1, OR requires at least one input to be 1, and NOT flips a value from 0 to 1 or from 1 to 0. NAND, NOR, and XOR are especially important because they can simplify circuit designs or create useful behaviors like comparison. Reading a truth table helps you predict a circuit's output before building or programming it.
Key Facts
- Binary logic uses only two values: 0 means false or off, and 1 means true or on.
- AND gate: A AND B = 1 only when A = 1 and B = 1.
- OR gate: A OR B = 1 when A = 1, B = 1, or both are 1.
- NOT gate: NOT A = 1 when A = 0, and NOT A = 0 when A = 1.
- NAND is the opposite of AND: A NAND B = NOT(A AND B).
- XOR gate: A XOR B = 1 when A and B are different, and 0 when they are the same.
Vocabulary
- Logic gate
- A logic gate is a digital circuit element that applies a logical rule to binary inputs to produce one binary output.
- Truth table
- A truth table is a chart that lists every possible input combination and the output produced by a logic expression or circuit.
- Binary
- Binary is a number and signal system that uses only two values, 0 and 1.
- Input
- An input is a binary value sent into a logic gate or circuit for processing.
- Output
- An output is the binary value produced after a logic gate or circuit applies its rule.
Common Mistakes to Avoid
- Treating XOR like OR is wrong because XOR outputs 1 only when the inputs are different, not when both inputs are 1.
- Forgetting that NAND and NOR are inverted gates is wrong because NAND is NOT AND and NOR is NOT OR, so their outputs are the opposite of the basic gate results.
- Skipping input combinations in a truth table is wrong because a complete table must include every possible row, which is 2^n rows for n inputs.
- Reading a circuit only from left to right without following connections is wrong because outputs from one gate may feed into several later gates or loop through labeled paths.
Practice Questions
- 1 Complete the truth table for A AND B using all four input pairs: 00, 01, 10, and 11.
- 2 For inputs A = 1, B = 0, and C = 1, find the output of the circuit (A OR B) AND C.
- 3 A security light turns on only when motion is detected and the room is dark. Which logic gate best models this situation, and why?