Types of logic gates
logic gateCircuit components which take several inputs, compare the inputs with each other, and provide a single output based on logical functions such as AND, OR and NOT. use BooleanA data type in computing which only has two possible values, true or false. operators. The most common Boolean operators are AND, OR and NOT. Each operator has a standard symbol that can be used when drawing logic gate circuits.
AND gate
An AND gate usually has two inputs. AND tells us that both Input A AND Input B have to be 1 (or ON) in order for the output to be 1. Otherwise the output is 0.
The Boolean expression can be written as Q = A AND B.
The truth table would look like this:
Input A | Input B | Input Q |
0 | 0 | 0 |
0 | 1 | 0 |
1 | 0 | 0 |
1 | 1 | 1 |
Input A | 0 |
---|---|
Input B | 0 |
Input Q | 0 |
Input A | 0 |
---|---|
Input B | 1 |
Input Q | 0 |
Input A | 1 |
---|---|
Input B | 0 |
Input Q | 0 |
Input A | 1 |
---|---|
Input B | 1 |
Input Q | 1 |
Logic gate diagrams would look like this:
OR gate
An OR gate has two inputs. OR tells us that EITHER Input A OR Input B has to be 1 (or ON) in order for the output to be 1. Otherwise the output is 0.
The Boolean expression can be written as Q = A OR B.
The truth table would look like this:
Input A | Input B | Input Q |
0 | 0 | 0 |
0 | 1 | 1 |
1 | 0 | 1 |
1 | 1 | 1 |
Input A | 0 |
---|---|
Input B | 0 |
Input Q | 0 |
Input A | 0 |
---|---|
Input B | 1 |
Input Q | 1 |
Input A | 1 |
---|---|
Input B | 0 |
Input Q | 1 |
Input A | 1 |
---|---|
Input B | 1 |
Input Q | 1 |
Logic gate diagrams would look like this:
NOT gate
A NOT gate has just one input. NOT tells us that Input A has to be 0 (or OFF) in order for the output to be 1. Otherwise the output is 0. A NOT gate is sometimes called an inverter.
The Boolean expression is written as Q = NOT A.
The truth table would look like this:
Input A | Input Q |
1 | 0 |
0 | 1 |
Input A | 1 |
---|---|
Input Q | 0 |
Input A | 0 |
---|---|
Input Q | 1 |
Logic gate diagrams would look like this: