# Logic Gates

A logic gate performs the basic logical functions that are the fundamental building blocks of digital integrated circuits. Most logic gates take an input of two binary values, and output a single value of a '1' or '0'. Some circuits may have only a few logic gates, while others, such as microprocessors, may have millions of them. There are six different types of logic gates.

In the following table, each logic gate except the NOT gate has two inputs, A and B, which can either be '1' (True) or '0' (False). The resulting output is a single value of '1' if the result is true, or '0' if the result is false.

Name | Description | Logic Gate |
---|---|---|

AND | The output value of Y is 1 when both input values A and B are 1. | |

OR | If either of the input values are 1 then the output will be 1. | |

NOT | The state of the output is the inverse of the input. | |

NAND | Not AND. The output value Y is 1 except when both A and B are 1. | |

NOR | The output Y is 1 when both inputs A and B are 0. | |

XAND | The output Y is 1 except when both inputs A and B are the same. |

**Truth Tables**

A truth table is a compact way of showing the possible outputs from all possible variations of inputs into logic gate. A truth table shows the relation between the values that the variables may take and the result of the operation. The table below shows all possible input variables 'A' and 'B' are listed, showing the result 'C' for each combination.

Name | Description | Truth Table | |
---|---|---|---|

AND | The output value of C is 1 when both input values A and B are 1. | Input | Output |

OR | If either of the input values are 1 then the output will be 1. | cell-content | cell-content |

NOT | The state of the output is the inverse of the input | cell-content | cell-content |

NAND | Not AND. The output value C is 1 except when both A and B are 1. | cell-content | cell-content |

NOR | The output C is 1 when both inputs A and B are 0. | cell-content | cell-content |

XOR | The output C is 1 Except when both inputs A and B are the same. | cell-content | cell-content |

In logic, '0' is usually associated with False and '1' with True. A truth tables is used to check if the output from a gate is correct. The truth table for a switch (A) which shows the two possible states in which the switch can function can be written as:

A |

0 |

1 |

Truth tables are used to indicate the output of a logic function for all possible inputs.