upgrade
upgrade

๐ŸŸฐAlgebraic Logic

Basic Logic Gates

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 in Algebraic Logic. When you're tested on this material, you're not just being asked to recall truth tablesโ€”you're being evaluated on your understanding of Boolean algebra, functional completeness, and how simple operations combine to create complex logical behavior. These gates translate abstract algebraic expressions into physical circuit behavior, making them the bridge between theory and application.

The key insight here is that all digital computationโ€”from simple calculators to supercomputersโ€”reduces to combinations of these seven gates. Don't just memorize input-output pairs; know which gates are universal, which are complements of each other, and how each gate's algebraic representation connects to its truth table. This conceptual understanding is what separates strong exam performance from mere memorization.


Primary Gates: The Foundational Three

These three gates form the conceptual foundation of Boolean algebra. Every other gate can be expressed as a combination of AND, OR, and NOT operations.

AND Gate

  • Outputs 1 only when ALL inputs are 1โ€”this is logical conjunction, the most restrictive basic operation
  • Algebraic notation: Aโ‹…BA \cdot B or ABABโ€”multiplication symbolism reflects that any zero input "zeroes out" the result
  • Circuit application: ensures multiple conditions are simultaneously satisfied before triggering an output

OR Gate

  • Outputs 1 when AT LEAST ONE input is 1โ€”this is logical disjunction, the most permissive basic operation
  • Algebraic notation: A+BA + Bโ€”addition symbolism reflects that any true input contributes to a true output
  • Circuit application: triggers output when any qualifying condition is met, forming the basis for inclusive logic

NOT Gate

  • Inverts the inputโ€”1 becomes 0, 0 becomes 1, making this the only single-input gate
  • Algebraic notation: Aโ€พ\overline{A} or ยฌA\neg Aโ€”the complement operation in Boolean algebra
  • Building block role: essential for constructing negated expressions and deriving all other gates from AND/OR

Compare: AND vs. ORโ€”both are binary operations combining two inputs, but AND requires all conditions true (outputs 0 in three of four cases) while OR requires any condition true (outputs 1 in three of four cases). If an exam asks about "restrictive" vs. "permissive" logic, this is your go-to contrast.


Universal Gates: Build Anything

A universal gate can implement any Boolean function using only copies of itself. This property makes NAND and NOR extraordinarily important in circuit design and exam questions about functional completeness.

NAND Gate

  • Outputs 0 only when BOTH inputs are 1โ€”it's an AND gate followed by a NOT gate
  • Algebraic notation: Aโ‹…Bโ€พ\overline{A \cdot B} or (AB)โ€ฒ(AB)'โ€”the complement of conjunction
  • Universal property: any logic circuit can be built using only NAND gates, making it the most common gate in integrated circuits

NOR Gate

  • Outputs 1 only when BOTH inputs are 0โ€”it's an OR gate followed by a NOT gate
  • Algebraic notation: A+Bโ€พ\overline{A + B} or (A+B)โ€ฒ(A + B)'โ€”the complement of disjunction
  • Universal property: like NAND, any Boolean function is achievable with NOR gates alone, often preferred in certain manufacturing processes

Compare: NAND vs. NORโ€”both are universal gates and both are negations of primary gates, but NAND negates AND (false only when both true) while NOR negates OR (true only when both false). FRQs about circuit minimization often ask you to implement functions using only one universal gate type.


Exclusive Gates: Detecting Difference and Equality

These gates focus on whether inputs match or differ. The XOR operation is fundamental to binary arithmetic, while XNOR serves as an equality comparator.

XOR Gate

  • Outputs 1 when inputs DIFFERโ€”exactly one input must be true, not both
  • Algebraic notation: AโŠ•BA \oplus Bโ€”equivalent to (Aโ‹…Bโ€พ)+(Aโ€พโ‹…B)(A \cdot \overline{B}) + (\overline{A} \cdot B)
  • Key applications: binary addition (half-adders), parity checking, and error detection circuits

XNOR Gate

  • Outputs 1 when inputs MATCHโ€”both must be the same value (both 0 or both 1)
  • Algebraic notation: AโŠ•Bโ€พ\overline{A \oplus B}โ€”the complement of XOR, equivalent to (Aโ‹…B)+(Aโ€พโ‹…Bโ€พ)(A \cdot B) + (\overline{A} \cdot \overline{B})
  • Key applications: digital comparators, equality testing, and bit-matching circuits

Compare: XOR vs. XNORโ€”these are exact complements. XOR detects difference (useful for addition and error detection), while XNOR detects sameness (useful for comparison operations). Remember: XOR is sometimes called the "inequality gate" and XNOR the "equality gate."


Quick Reference Table

ConceptBest Examples
Primary/Foundational GatesAND, OR, NOT
Universal GatesNAND, NOR
Complement PairsAND/NAND, OR/NOR, XOR/XNOR
Single-Input OperationNOT
Exclusive/Difference DetectionXOR
Equality DetectionXNOR
Used in Binary ArithmeticXOR, AND
Most Common in IC ManufacturingNAND

Self-Check Questions

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

  2. Compare AND and NAND: how do their truth tables relate, and what algebraic operation transforms one into the other?

  3. If you need to detect whether two binary inputs are equal, which gate would you use? Which gate detects when they differ?

  4. Explain why AโŠ•BA \oplus B can be rewritten as (Aโ‹…Bโ€พ)+(Aโ€พโ‹…B)(A \cdot \overline{B}) + (\overline{A} \cdot B). What does this tell you about XOR's relationship to the primary gates?

  5. An FRQ asks you to implement the expression Aโ€พ+B\overline{A} + B using only NAND gates. Which property of NAND makes this possible, and what's your first step in the conversion?