## A NAND gate is a logic gate with two or more inputs and one output. All input states must be high to produce a low output.

### NAND Gate Symbols

The inputs (`A, B`

) of an NAND gate are on the left, and the output (`X`

) is on the right of the logic NAND gate symbol.

Distinctive Shape | Rectangular Shape | DIN Shape (Historic) |
---|---|---|

### NAND Gate Truth Tables

#### Truth Table for NAND Gate with 2 Inputs

`A` | `B` | `X` |
---|---|---|

`0` | `0` | `1` |

`0` | `1` | `1` |

`1` | `0` | `1` |

`1` | `1` | `0` |

#### Truth Table for NAND Gate with 3 Inputs

`A` | `B` | `C` | `X` |
---|---|---|---|

`0` | `0` | `0` | `1` |

`0` | `0` | `1` | `1` |

`0` | `1` | `0` | `1` |

`0` | `1` | `1` | `1` |

`1` | `0` | `0` | `1` |

`1` | `0` | `1` | `1` |

`1` | `1` | `0` | `1` |

`1` | `1` | `1` | `0` |

### NAND Gate Test-It

To test the gate, click the switch symbols in the image below.

### NAND Gate Logical Expressions

#### Word Equation

`X = NOT (A AND B)`

#### Boolean Algebra

In boolean algebra the multiplication sign (`⋅`

) combined with the overbar sign (` `

) stands for the NAND operation, e.g.:

`X = A ⋅ B`

or simplified: `X = AB`

Alternative notations: `X = A ∧ B`

or `X = A ∧ B`

or `X = A ↑ B`

or `X = A | B`

`A` | `B` | `X = AB` |
---|---|---|

`0` | `0` | `X = 0 ⋅ 0 = 0 = 1` |

`0` | `1` | `X = 0 ⋅ 1 = 0 = 1` |

`1` | `0` | `X = 1 ⋅ 0 = 0 = 1` |

`1` | `1` | `X = 1 ⋅ 1 = 1 = 0` |

`A` | `B` | `C` | `X = ABC` |
---|---|---|---|

`0` | `0` | `0` | X = 0 ⋅ 0 ⋅ 0 = 0 = 1 |

`0` | `0` | `1` | X = 0 ⋅ 0 ⋅ 1 = 0 = 1 |

`0` | `1` | `0` | X = 0 ⋅ 1 ⋅ 0 = 0 = 1 |

`0` | `1` | `1` | X = 0 ⋅ 1 ⋅ 1 = 0 = 1 |

`1` | `0` | `0` | X = 1 ⋅ 0 ⋅ 0 = 0 = 1 |

`1` | `0` | `1` | X = 1 ⋅ 0 ⋅ 1 = 0 = 1 |

`1` | `1` | `0` | X = 1 ⋅ 1 ⋅ 0 = 0 = 1 |

`1` | `1` | `1` | X = 1 ⋅ 1 ⋅ 1 = 1 = 0 |