upgrade
upgrade

Electrical Circuits and Systems I

Logic Gate Truth Tables

Study smarter with Fiveable

Get study guides, practice questions, and cheatsheets for all your subjects. Join 500,000+ students with a 96% pass rate.

Get Started

Why This Matters

Logic gates are the fundamental building blocks of every digital system you'll encounter—from simple circuits to complex processors. When you're tested on this material, you're not just being asked to memorize which input combinations produce which outputs. You're being evaluated on your understanding of Boolean algebra principles, gate universality, and how gates combine to perform logical operations. These concepts form the foundation for everything from circuit simplification to sequential logic design.

The truth tables themselves encode the logical behavior that makes digital electronics predictable and designable. Understanding the relationships between gates—how NAND is the inverse of AND, how XOR detects differences—lets you analyze circuits quickly and choose the right gate for any application. Don't just memorize the tables; know why each gate behaves the way it does and when you'd use one gate over another.


Basic Logic Operations

These three gates represent the fundamental Boolean operations. Every other gate can be understood as a combination or inversion of these core functions.

AND Gate

  • Outputs 1 only when ALL inputs are 1—this "both must be true" behavior makes it essential for condition-checking circuits
  • Boolean expression: ABA \cdot B or ABAB; the multiplication analogy helps you remember that any zero input "zeros out" the result
  • Applications include enable signals and masking operations where multiple conditions must be satisfied simultaneously
ABABA \cdot B
000
010
100
111

OR Gate

  • Outputs 1 when ANY input is 1—the "at least one true" behavior makes it ideal for combining multiple trigger conditions
  • Boolean expression: A+BA + B; think of addition where any nonzero term produces a nonzero result (though 1+1 still equals 1 in Boolean algebra)
  • Common uses include interrupt handling and any scenario where multiple events should trigger the same response
ABA+BA + B
000
011
101
111

NOT Gate (Inverter)

  • Outputs the complement of its single input—the only basic gate with just one input
  • Boolean expression: A\overline{A} or AA'; creates the logical opposite of any signal
  • Essential for generating complementary signals and implementing De Morgan's theorem in circuit simplification
AA\overline{A}
01
10

Compare: AND vs. OR—both require two inputs, but AND needs all inputs high while OR needs any input high. Remember: AND outputs three 0s and one 1; OR outputs three 1s and one 0. If asked to implement a "both conditions required" scenario, AND is your gate.


Universal Gates

These gates can individually implement any Boolean function, making them crucial for integrated circuit design. A single gate type simplifies manufacturing and reduces component variety.

NAND Gate

  • Outputs 0 only when ALL inputs are 1—it's an AND gate followed by a NOT gate, hence "NOT-AND"
  • Boolean expression: AB\overline{A \cdot B}; the output is the inverse of AND for every input combination
  • Universal gate status means you can build AND, OR, NOT, and any other gate using only NAND gates—a favorite exam topic
ABAB\overline{A \cdot B}
001
011
101
110

NOR Gate

  • Outputs 1 only when ALL inputs are 0—it's an OR gate followed by a NOT gate, hence "NOT-OR"
  • Boolean expression: A+B\overline{A + B}; produces the complement of OR for every input combination
  • Also a universal gate, capable of implementing any logic function; historically used in early computer systems like the Apollo Guidance Computer
ABA+B\overline{A + B}
001
010
100
110

Compare: NAND vs. NOR—both are universal gates with inverted outputs, but their truth tables are complements of each other. NAND outputs three 1s and one 0; NOR outputs one 1 and three 0s. Know how to construct a NOT gate from each: tie both inputs together.


Exclusive Gates

These gates focus on whether inputs match or differ, making them essential for comparison operations, arithmetic circuits, and error detection.

XOR Gate (Exclusive OR)

  • Outputs 1 when inputs are DIFFERENT—unlike OR, it outputs 0 when both inputs are 1
  • Boolean expression: ABA \oplus B or AB+ABA\overline{B} + \overline{A}B; the expanded form shows it detects "one or the other, but not both"
  • Critical applications include binary addition (XOR produces the sum bit), parity generators, and comparator circuits
ABABA \oplus B
000
011
101
110

XNOR Gate (Exclusive NOR)

  • Outputs 1 when inputs are THE SAME—functions as an equality detector
  • Boolean expression: AB\overline{A \oplus B} or AB+ABAB + \overline{A}\overline{B}; outputs 1 for matching inputs (both 0 or both 1)
  • Used in error detection, digital comparators, and anywhere you need to verify that two signals match
ABAB\overline{A \oplus B}
001
010
100
111

Compare: XOR vs. XNOR—these are exact complements. XOR asks "are they different?" while XNOR asks "are they the same?" For binary addition, XOR gives you the sum bit; for equality checking, XNOR is your gate. Both output two 1s and two 0s, just in opposite positions.


Quick Reference Table

ConceptBest Examples
Outputs 1 for single conditionAND (all inputs 1), NOR (all inputs 0)
Outputs 0 for single conditionOR (all inputs 0), NAND (all inputs 1)
Universal gatesNAND, NOR
Inverted versionsNAND (inverted AND), NOR (inverted OR), XNOR (inverted XOR)
Difference detectionXOR
Equality detectionXNOR
Single-input operationNOT
Used in binary additionXOR (sum bit), AND (carry bit)

Self-Check Questions

  1. Which two gates are considered universal, and what does "universal" mean in this context?

  2. Compare the truth tables of AND and NAND—how many output values differ between them, and why?

  3. If you need a gate that outputs 1 only when two input signals are different, which gate would you choose? What if you needed the opposite behavior?

  4. Using Boolean expressions, explain why A+B\overline{A + B} and AB\overline{A} \cdot \overline{B} produce the same truth table. Which theorem does this demonstrate?

  5. You're designing a circuit that should activate an alarm when either sensor A or sensor B detects motion, but not when both detect motion simultaneously. Which single gate implements this logic? Write out the truth table to verify your answer.