Logic Gates:
Gates are basic logic circuits composed of basic electronic elements like transistors, capacitors, etc., that give a certain output when one or more inputs are ‘turned on.’ Combinations of gates are used to perform computations in electronic computers. A couple of basic combinations of gates are the “half adder” and the “full adder,” which perform the addition operations.
Three basic types of gates are the AND, OR, and NOT
gates.
1. The AND gate takes two inputs (call them A and B, each of which can be 0 or 1) and has an output of 1 only if both its inputs are 1 (in logic, think of it as both conditions A and B must be satisfied in order to get an output). Otherwise, the output is 0.
AND Gate:
Input A |
Input B |
Output |
0 |
0 |
0 |
0 |
1 |
0 |
1 |
0 |
0 |
1 |
1 |
1 |
2. The OR gate also takes two inputs (call them A and B, each of which can be 0 or 1) and has an output of 1 if at least one of its inputs is 1 (in logic, think of it as either condition A or condition B must be satisfied in order to get an output). Otherwise, the output is 0.
OR Gate:
Input A |
Input B |
Output |
0 |
0 |
0 |
0 |
1 |
1 |
1 |
0 |
1 |
1 |
1 |
1 |
2. The NOT gate takes only one input (call it A, which can be 0 or 1) and has an output that is complement of the input (in logic, think of it as negation. If A is 1, output is 0; If A is 0, output is 1).
NOT Gate:
Input A |
Output |
0 |
1 |
1 |
0 |