An AND gate is a logic gate that implements logical conjunction: its output is 1 if and only if every input is 1. If any input is 0, the output is 0. It is a basic component of combinational logic, used in digital circuits to combine conditions, enable signals, and perform arithmetic operations. The logical function is independent of its physical implementation, which may use transistors, diodes, relays, or other switching devices.
Logical definition
For two inputs and , the output is written as
Here, denotes logical conjunction. A centered dot, or simply juxtaposition as in , is common in Boolean algebra. The multiplication notation reflects the fact that AND on values 0 and 1 has the same results as ordinary multiplication.
The two-input truth table is:
| Input | Input | Output |
|---|---|---|
| 0 | 0 | 0 |
| 0 | 1 | 0 |
| 1 | 0 | 0 |
| 1 | 1 | 1 |
For inputs,
The output is therefore 1 for exactly one of the possible input combinations: the combination in which every input is 1.
An ideal AND gate has no memory. Its output depends only on its current inputs, unlike a flip-flop, which stores a state. A physical gate nevertheless takes a finite time to respond to input changes.
Algebraic properties and related gates
AND obeys several identities that allow circuits to be simplified or rearranged:
| Property | Identity |
|---|---|
| Commutativity | |
| Associativity | |
| Idempotence | |
| Identity | |
| Domination | |
| Complementation |
Associativity means that a multi-input AND function can be implemented by a network of two-input AND gates. Although different arrangements are logically equivalent, their propagation delays can differ.
A NAND gate produces the complement of AND:
Following a NAND gate with a NOT gate, or inverter, produces an AND function. Alternatively, a second NAND gate can serve as the inverter by having its inputs connected together.
De Morgan’s law relates AND to an OR gate:
AND gates alone are not functionally complete: they cannot express every Boolean function. AND together with NOT is functionally complete, as is NAND alone.
Symbols and signal interpretation
Two common graphical conventions represent an AND gate:
- Distinctive-shape notation: a D-shaped outline with a flat input side and a curved output side.
- Rectangular notation: a rectangular block containing an ampersand, “&”.
Inputs are normally drawn on the left and the output on the right. A small circle, called an inversion bubble, indicates logical negation. Adding a bubble at the output of an AND symbol denotes NAND.
Logical values must be distinguished from physical signal levels. Under positive logic, a higher voltage range represents 1 and a lower range represents 0. A positive-logic AND gate therefore produces a high output only when all inputs are high. Under negative logic, the assignment is reversed; the same physical voltage behavior can consequently receive a different logical interpretation.
Real digital inputs recognize specified voltage ranges rather than exact voltages. Voltages between the guaranteed low and high ranges do not have a guaranteed logical interpretation.
Physical implementation
Switches and diodes
Two normally open switches connected in series illustrate the AND condition: current can flow through the path only when both switches are closed.
A basic positive-logic diode AND circuit uses a pull-up resistor and diodes arranged so that any low input pulls the output low. When every input is high, the resistor pulls the output high. Such circuits have limitations, including diode voltage drops, loading effects, and the absence of active signal restoration.
Transistor circuits
Modern gates are usually implemented with transistors inside an integrated circuit. In conventional static CMOS, a two-input AND function is commonly realized as a NAND stage followed by an inverter.
The NAND stage contains two n-channel MOSFETs in series in its pull-down network and two p-channel MOSFETs in parallel in its pull-up network. Both inputs must be high for the series pull-down path to conduct and produce a low NAND output. The following inverter converts that low level into the high output required by AND.
This conventional implementation uses six transistors: four for NAND and two for the inverter. Other circuit styles and optimized library cells may use different structures, so this is not a universal transistor count.
Applications
Enabling and masking
An AND gate can pass or suppress a signal according to an enable input:
When , the output follows ; when , the output is forced to 0.
The same principle extends to bitwise AND, which applies the operation independently to corresponding positions in two binary words. A mask preserves selected bits while clearing others. For example,
Arithmetic
In a half adder, the carry output is
because adding two single binary digits produces a carry only when both are 1. The sum output uses an exclusive-OR gate. AND functions also generate partial products in binary multiplication and contribute to carry-generation logic in larger adders.
Decoding and control
AND gates combine conditions in address decoding, instruction control, and other digital control circuits. A particular input pattern can be detected by ANDing selected inputs and complements of the remaining inputs. This produces a Boolean minterm, which is true for exactly one complete assignment of its variables.
Timing and implementation limits
A physical gate has a nonzero propagation delay. Rising and falling outputs may have different delays, and the delay depends on factors such as supply voltage, temperature, input transition speed, and output load.
Fan-in is the number of inputs to a gate. Increasing fan-in can increase delay; in a conventional CMOS NAND-based implementation, more inputs require more series devices in the pull-down path. Large AND functions may therefore be implemented as trees of smaller gates. A balanced tree of two-input gates has logarithmic depth, whereas a simple chain has linear depth.
Fan-out concerns the load an output can drive while meeting electrical and timing requirements. Excessive loading slows transitions and can compromise reliable operation.
Input changes can also produce transient pulses. For example, a transition between input states and may briefly pass through if the rising input arrives first, momentarily asserting the output. The truth table describes stable-state behavior, not every intermediate event.
This distinction matters in clock control. Directly ANDing a clock with an enable signal that changes at an unsuitable time can create shortened or unintended pulses. Dedicated clock-gating circuits use additional storage or timing constraints to control when the enable may affect the clock.