A logic gate is a device that implement a boolean function, that is, performs logical operations on one or more logical inputs to produce a single logical output.

x | out |
---|---|

1 | 1 |

0 | 0 |

Logical negation ("not").

x | out |
---|---|

1 | 0 |

0 | 1 |

Logical conjunction ("and").

A HIGH output (1) results only if all the inputs to the gate are HIGH (1). Otherwise, a LOW output (0) results.

x | y | out |
---|---|---|

1 | 1 | 1 |

1 | 0 | 0 |

0 | 1 | 0 |

0 | 0 | 0 |

Logical alternative denial ("not both").

A LOW output (0) results only if all inputs to the gate are HIGH (1). Otherwise, a HIGH output (1) results.

x | y | out |
---|---|---|

1 | 1 | 0 |

1 | 0 | 1 |

0 | 1 | 1 |

0 | 0 | 1 |

Logical disjunction ("or").

A HIGH output (1) results if one or both inputs to the gate are HIGH (1). Otherwise, a LOW output (0) results.

x | y | out |
---|---|---|

1 | 1 | 1 |

1 | 0 | 1 |

0 | 1 | 1 |

0 | 0 | 0 |

Logical exclusive disjunction ("one or the other but not both nor none").

A LOW (0) output results If both inputs to the gate are the same. Otherwise, a HIGH output (1) results.

x | y | out |
---|---|---|

1 | 1 | 0 |

1 | 0 | 1 |

0 | 1 | 1 |

0 | 0 | 0 |

Logical joint denial ("neither...nor").

A HIGH output (1) results if both inputs to the gate are LOW (0). Otherwise, a LOW output (0) results.

x | y | out |
---|---|---|

1 | 1 | 0 |

1 | 0 | 0 |

0 | 1 | 0 |

0 | 0 | 1 |

Logical biconditional ("if and only if").

A HIGH output (1) results if both inputs to the gate are the same. Otherwise, a LOW output (0) results.

x | y | out |
---|---|---|

1 | 1 | 1 |

1 | 0 | 0 |

0 | 1 | 0 |

0 | 0 | 1 |

Logical material implication ("if...then").

If input x is HIGH (1), the output follows input y. Otherwise, the output is always HIGH (1).

x | y | out |
---|---|---|

1 | 1 | 1 |

1 | 0 | 0 |

0 | 1 | 1 |

0 | 0 | 1 |

Logical material nonimplication ("but not").

A HIGH output (1) results if input x is HIGH (1) but input y is LOW (0). Otherwise, a LOW output (0) results.

x | y | out |
---|---|---|

1 | 1 | 0 |

1 | 0 | 1 |

0 | 1 | 0 |

0 | 0 | 0 |