3.2 AND Gate: All Inputs Must Be True

Explain and apply the AND gate's rule that output is 1 only when every input is 1, build and read its truth table, and use it to model 'all conditions must hold' logic in real circuits.

The AND gate is a two-(or more)-input gate whose output is 1 only when every single input is 1; if even one input is 0, the output is 0. It exists because an enormous fraction of real-world control logic is naturally expressed as a conjunction of conditions — a motor should run only if it is both enabled and commanded, a door should unlock only if both a valid badge and a valid PIN are present, an alarm should silence only if every zone reports clear. AND is one of the three foundational primitives (with OR and NOT) from which Boolean algebra and every combinational circuit in this course are built, and it is the direct hardware realization of the word 'and' as used in ordinary logical reasoning.

Core Concept: Conjunction of Inputs

For a two-input AND gate with inputs A and B, the output Y is defined as Y = A · B, where the dot denotes Boolean multiplication (AND), not arithmetic multiplication — though for single-bit values 0 and 1, Boolean AND and arithmetic multiplication happen to produce the same numeric results, which is a useful shortcut for building the truth table by hand. The rule generalizes cleanly to more than two inputs: an n-input AND gate outputs 1 only when all n inputs are simultaneously 1.

The AND gate's truth table has four rows for two inputs, doubling with each additional input variable, and exactly one of those rows produces a 1 — the all-1s row. This 'only one true row' property is a structural signature of AND that becomes important later when minterms (Module 4.6) are introduced: each minterm is itself an AND (product) term that is true for exactly one input combination, which is precisely how the AND gate behaves generalized to n inputs.

• Y = A · B (dot means Boolean AND, sometimes written with no symbol at all: Y = AB). • Output is 1 only for the single row where every input is 1. • Any single 0 input forces the output to 0, regardless of the other inputs' values. • Generalizes directly to 3+ input AND gates using the same all-inputs-must-be-1 rule.

Step-by-Step: Building the Truth Table

To work out an AND gate's output by hand, list every combination of the inputs (four rows for two inputs: 00, 01, 10, 11), and for each row check whether both A and B equal 1. Only the row A=1, B=1 satisfies that check, so only that row's output is 1; every other row — where at least one input is 0 — outputs 0. This row-by-row scan is exactly the method used to construct truth tables for every gate and circuit in this course, and AND's four-row table is the standard reference every learner memorizes first because its structure (one 1, rest 0s) is the simplest non-trivial pattern after NOT.

This 'scan for a violation' framing (does any input fail to be 1?) is also how you reason about AND gates in real circuit debugging: if an AND-gated output is stuck at 0 and you expect 1, the fault-finding procedure is to check each input individually, because a single incorrect or floating-low input is sufficient to explain the whole output.

• Step 1: Enumerate all input combinations (2ⁿ rows for n inputs). • Step 2: For each row, ask 'are all inputs 1?' • Step 3: Output 1 only where the answer is yes; output 0 for every other row. • Spec example row: A=0, B=0 → Y=0; A=0,B=1 → Y=0; A=1,B=0 → Y=0; A=1,B=1 → Y=1.

Practical and Real-World Application: Safety Interlocks

The spec's own example captures the single most common real-world use of AND gates directly: Motor_Enable = Safety_OK AND Command. A motor should spin only when both a safety condition holds (guard closed, no fault detected) and an operator or controller has actually issued a command to run — either condition alone is not enough, and AND is exactly the gate that enforces 'both must hold'. This pattern, called an interlock, is used throughout industrial control, automotive systems, and elevator logic, wherever a hazardous action must be gated behind multiple independent safety checks.

AND gates are also the core building block of enable/gating logic in digital systems generally: a clock signal ANDed with an enable line produces a gated clock that only toggles when the system wants it to; a data bus ANDed with a chip-select line ensures a device only drives the bus when it has been selected. This 'gate a signal with a condition' pattern recurs constantly in larger digital designs.

Common Mistake and the Tricky Concept

The tricky point the spec highlights is worth internalizing as a reflex: if any input is 0, an AND output is 0 — full stop, regardless of how many other inputs are 1. Beginners sometimes reason 'most of the inputs are 1, so the output should probably be 1 too', which is exactly backwards for AND; it takes only a single 0 among any number of inputs to zero out the entire output. This is the opposite failure mode from OR (Module 3.3), where a single 1 is enough to guarantee output 1 — keeping these two rules straight, and not swapping them, is one of the most common early mistakes in digital logic.

A related subtlety: Boolean · (AND) coincides numerically with arithmetic multiplication only because the domain is restricted to {0,1}; the moment you're tempted to reason about AND using multi-bit arithmetic intuition (like 'AND is like multiplying, so bigger inputs give bigger outputs'), you've left the Boolean domain and the analogy breaks down.

AND Gate Notation and Truth Table

The dot for AND is frequently omitted entirely: AB means the same thing as A · B. For n inputs, only the single all-1s row of the 2ⁿ-row truth table outputs 1.

Boolean expression:
  Y = A · B      (also written Y = AB)

Truth Table:
 A | B | Y
---+---+---
 0 | 0 | 0
 0 | 1 | 0
 1 | 0 | 0
 1 | 1 | 1

Symbol:
  A ──┐
      D──── Y
  B ──┘
  (flat-back, rounded-front "D" shape)

Code Examples

Only when both the safety condition and the operator command are simultaneously true does the AND gate allow the motor to run. Any single missing condition — an open safety guard or no command issued — forces Motor_Enable to 0, which is exactly the fail-safe behavior an interlock is meant to provide. Expected result: 1 only when Safety_OK = 1 AND Command = 1 Motor_Enable = Safety_OK · Command

With three inputs, the all-inputs-must-be-1 rule still applies unchanged: out of the 8 possible input rows, only A=B=C=1 produces Y=1. A single 0 anywhere among the three inputs, as in the first row shown, is enough to zero the output.

Y = 1 only at the single row A=B=C=1

Motor_Enable = Safety_OK AND Command

Safety_OK=0, Command=0  → Motor_Enable = 0
Safety_OK=0, Command=1  → Motor_Enable = 0
Safety_OK=1, Command=0  → Motor_Enable = 0
Safety_OK=1, Command=1  → Motor_Enable = 1
Y = A · B · C

A=1, B=1, C=0  →  Y = 1 · 1 · 0 = 0
A=1, B=1, C=1  →  Y = 1 · 1 · 1 = 1

2-Input AND Gate

Only the bottom row (both inputs 1) produces a 1 output.

A ──┐
       )── Y
  B ──┘

 A | B | Y
---+---+---
 0 | 0 | 0
 0 | 1 | 0
 1 | 0 | 0
 1 | 1 | 1

Important Rules

Y = A · B; generalizes to Y = A · B · C · ... · N for n inputs.

Output is 1 for exactly one row of the truth table: the all-inputs-1 row.

A single 0 input anywhere forces the entire output to 0 (the gate's defining tricky point).

AND coincides with arithmetic multiplication only within the restricted {0,1} domain.

Interlocks and Gated Enables

AND gates implement safety interlocks (a motor, actuator, or hazardous process runs only when every required safety condition and command line reads 1 simultaneously) and gated-enable logic (a clock or data signal ANDed with an enable/select line so it only takes effect when the system intends it to). Both patterns appear throughout industrial control, automotive electronics, and digital system design.

How It's Formed: CMOS Transistor Level

How an AND gate is physically formed: there is no single-stage CMOS 'AND network'. A real AND gate is a NAND core (two PMOS in parallel for the pull-up, two NMOS in series for the pull-down) immediately followed by a CMOS inverter stage — the NAND core's output, labeled N, is A·B inverted, and the inverter flips it back to true A·B.

Assuming that because most inputs to an AND gate are 1, the output is 'probably' 1.

Check every input explicitly — the output is 1 only if literally all inputs are 1; a single 0 among any number of 1s still forces Y = 0.

The spec states this directly: 'If any input is 0, an AND output is 0.' This is an absolute rule with no exceptions, and it is the opposite behavior from OR, so conflating the two is a common source of circuit-design errors.

[tricky-problem] An AND gate has three inputs: A=1, B=1, C=0. What is the output? A. 1, because two out of three inputs are 1 B. 0, because a single 0 input is enough to force the entire output to 0 C. Undefined without knowing the gate's power supply D. 1, because AND only requires a majority of inputs to be 1

B. 0, because a single 0 input is enough to force the entire output to 0 — As the spec states, if any input is 0, an AND output is 0 — regardless of how many other inputs are 1. With C=0 here, the output is forced to 0 even though A and B are both 1.

[interview] Why is AND described as an 'interlock' gate in safety-critical circuit design? A. Because it locks the output permanently once triggered. B. Because it only allows an action to proceed when every required safety and command condition is simultaneously true, so any single failed condition blocks the action. C. Because it requires a physical key to reset. D. Because AND gates consume less power than OR gates.

B. Because it only allows an action to proceed when every required safety and command condition is simultaneously true, so any single failed condition blocks the action. — AND's all-inputs-must-be-1 requirement means a hazardous action (like Motor_Enable in the spec's example) is blocked by default and only proceeds when every independent safety check passes — exactly the fail-safe behavior an interlock needs.

A vending machine should dispense an item only if (a) a valid coin has been inserted AND (b) the selected item is in stock. Write the Boolean expression for Dispense using an AND gate, and build its 4-row truth table.

Dispense = CoinValid · InStock. Truth table: (0,0)=0, (0,1)=0, (1,0)=0, (1,1)=1 — the machine dispenses only on the single row where both conditions are true.

Two independent conditions must both hold — that is exactly the AND relationship.