Skip to content
BetterDL

Multi-input gate

Also called: 3-input gate, 4-input gate, n-input gate, multiple-input gate, wide gate

A logic gate with three or more inputs. AND, OR, NAND and NOR keep their rules; XOR becomes 1 for an odd number of 1s and XNOR for an even number.

Most gates come in versions with more than two inputs. The number of inputs is the gate's fan in. Each type extends its two-input rule in a natural way:

  • AND: 1 only when every input is 1, as in .
  • OR: 1 when at least one input is 1, as in .
  • NAND: 0 only when every input is 1, as in .
  • NOR: 1 only when every input is 0, as in .
  • XOR: 1 when an odd number of inputs are 1.
  • XNOR: a multi-input XOR with an output bubble, so 1 when an even number of inputs are 1.

A gate with n inputs has 2ⁿ truth-table rows. The number of rows that give 1 follows a pattern:

  • AND and NOR: exactly 1 row.
  • OR and NAND: all but 1 row, so 2ⁿ − 1.
  • XOR and XNOR: exactly half, 2ⁿ⁻¹.

You can build a wide AND, OR or XOR by chaining or tree-wiring 2-input gates of the same type, because those operations are associative. That trick fails for NAND, NOR and XNOR. Their built-in inversion acts in the middle of the chain, so build the non-inverting version first and invert once at the end.

ABCY

Worked examples

Example

Counting 1-rows for 5-input gates

A 5-input gate has 2⁵ = 32 rows. How many give output 1 for each gate type?

  1. 1.

    AND: only 11111, so 1 row.

  2. 2.

    NAND: every row except 11111, so 31.

  3. 3.

    OR: every row except 00000, so 31.

  4. 4.

    NOR: only 00000, so 1.

  5. 5.

    XOR and XNOR: half the rows each, so 16.

Example

Evaluating a 3-input NAND

Find the output of a 3-input NAND for A = 1, B = 1, C = 0.

ABCY
  1. 1.

    The AND part is 1 · 1 · 0 = 0, because C is 0.

  2. 2.

    Invert: Y = 1.

  3. 3.

    Quick rule: a NAND is 1 whenever any input is 0.

Common mistakes

  • Saying a 3-input truth table has 6 rows. It has 2³ = 8.

  • Chaining 2-input NANDs to widen a NAND. is not .

  • Thinking a 3-input XOR is 1 only for exactly one 1. Three 1s is also odd, so 111 gives 1.

Practice Multi-input gate

Interactive questions with instant feedback and a worked solution for every wrong answer.

Learn it step by step

Multi-input gate is taught in Logic Gates.