{
  "id": "and-gate",
  "title": "AND Gate",
  "lang": "en",
  "source_lang": "en",
  "summary": "An AND gate is a digital logic gate whose output is 1 if and only if all its inputs are 1.",
  "category": "computer-science",
  "subcategory": "hardware",
  "type": "concept",
  "aliases": [
    "Logical AND gate",
    "conjunction gate"
  ],
  "generated_at": "2026-11-05",
  "model": "pro/gpt-6.1-sol",
  "url": "https://aiwiki.page/en/and-gate/",
  "translations": {
    "zh-Hans": {
      "url": "https://aiwiki.page/zh/and-gate/",
      "json": "https://aiwiki.page/zh/and-gate.json"
    }
  },
  "sections": [
    {
      "heading": "",
      "text": "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."
    },
    {
      "heading": "Logical definition",
      "text": "For two inputs \\(A\\) and \\(B\\), the output \\(Y\\) is written as\n\n\\[Y=A\\land B=A\\cdot B.\\]\n\nHere, \\(\\land\\) denotes logical conjunction. A centered dot, or simply juxtaposition as in \\(AB\\), 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.\n\nThe two-input truth table is:\n\nInput \\(A\\) | Input \\(B\\) | Output \\(Y\\)\n0 | 0 | 0\n0 | 1 | 0\n1 | 0 | 0\n1 | 1 | 1\n\nFor \\(n\\) inputs,\n\n\\[Y=\\bigwedge_{i=1}^{n} A_i.\\]\n\nThe output is therefore 1 for exactly one of the \\(2^n\\) possible input combinations: the combination in which every input is 1.\n\nAn 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."
    },
    {
      "heading": "Algebraic properties and related gates",
      "text": "AND obeys several identities that allow circuits to be simplified or rearranged:\n\nProperty | Identity\nCommutativity | \\(A\\land B=B\\land A\\)\nAssociativity | \\((A\\land B)\\land C=A\\land(B\\land C)\\)\nIdempotence | \\(A\\land A=A\\)\nIdentity | \\(A\\land 1=A\\)\nDomination | \\(A\\land 0=0\\)\nComplementation | \\(A\\land\\neg A=0\\)\n\nAssociativity 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.\n\nA NAND gate produces the complement of AND:\n\n\\[\\operatorname{NAND}(A,B)=\\neg(A\\land B).\\]\n\nFollowing 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.\n\nDe Morgan’s law relates AND to an OR gate:\n\n\\[A\\land B=\\neg(\\neg A\\lor\\neg B).\\]\n\nAND gates alone are not functionally complete: they cannot express every Boolean function. AND together with NOT is functionally complete, as is NAND alone."
    },
    {
      "heading": "Symbols and signal interpretation",
      "text": "Two common graphical conventions represent an AND gate:\n\n- Distinctive-shape notation: a D-shaped outline with a flat input side and a curved output side.\n- Rectangular notation: a rectangular block containing an ampersand, “&”.\n\nInputs 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.\n\nLogical 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.\n\nReal 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."
    },
    {
      "heading": "Physical implementation",
      "text": "Switches and diodes\n\nTwo normally open switches connected in series illustrate the AND condition: current can flow through the path only when both switches are closed.\n\nA 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.\n\nTransistor circuits\n\nModern 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.\n\nThe 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.\n\nThis 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."
    },
    {
      "heading": "Applications",
      "text": "Enabling and masking\n\nAn AND gate can pass or suppress a signal according to an enable input:\n\n\\[Y=D\\land E.\\]\n\nWhen \\(E=1\\), the output follows \\(D\\); when \\(E=0\\), the output is forced to 0.\n\nThe 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,\n\n\\[1011\\land1100=1000.\\]\n\nArithmetic\n\nIn a half adder, the carry output is\n\n\\[C=A\\land B,\\]\n\nbecause 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.\n\nDecoding and control\n\nAND 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."
    },
    {
      "heading": "Timing and implementation limits",
      "text": "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.\n\nFan-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.\n\nFan-out concerns the load an output can drive while meeting electrical and timing requirements. Excessive loading slows transitions and can compromise reliable operation.\n\nInput changes can also produce transient pulses. For example, a transition between input states \\(10\\) and \\(01\\) may briefly pass through \\(11\\) if the rising input arrives first, momentarily asserting the output. The truth table describes stable-state behavior, not every intermediate event.\n\nThis 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."
    }
  ],
  "links": [
    "logic-gate",
    "combinational-logic",
    "boolean-algebra",
    "truth-table",
    "flip-flop",
    "transistor",
    "integrated-circuit",
    "cmos",
    "mosfet",
    "bit"
  ],
  "sources": [],
  "license": "https://creativecommons.org/licenses/by/4.0/"
}