Course contentsShow
← Computer Science
Lesson 15 of 2,8721. Digital FoundationsFree lesson

The AND Gate

Understanding the AND operation that outputs TRUE only when all inputs are TRUE.

The AND Gate

What you'll learn: How the AND gate combines two or more inputs and only outputs TRUE when every single input is TRUE.

The Core Idea

The AND gate is one of the fundamental building blocks of digital logic. Think of it like a security system that only grants access when all conditions are met. For example, a vault door might require both the correct key AND the correct fingerprint to open. If either is missing, the door stays locked.

In digital circuits, an AND gate takes two or more Boolean inputs (remember: TRUE or FALSE, 1 or 0) and produces a single output. The output is TRUE (1) only when all inputs are TRUE. If even one input is FALSE (0), the entire output becomes FALSE.

The Truth Table

Here's the complete truth table for a 2-input AND gate:

Input AInput BOutput
000
010
100
111

Notice that the output is 1 (TRUE) in only one case: when both A AND B are 1.

Real-World Analogy

Imagine a simple circuit controlling a car's interior light. The light turns on only when:

  • The door is open (Input A = TRUE)
  • AND it's nighttime (Input B = TRUE)

If it's daytime, the light stays off even with the door open. If the door is closed at night, the light also stays off. Both conditions must be satisfied simultaneously.

Symbol

The AND gate is typically represented by a D-shaped symbol with two input lines on the left and one output line on the right.

Key Takeaway: The AND gate outputs TRUE only when all its inputs are TRUE—it's an "all or nothing" operation that requires complete agreement among inputs.