Resources | Subject Notes | Computer Science
This section details the fundamental logic gates used in digital circuits. Logic gates perform Boolean logic operations on one or more binary inputs to produce a single binary output.
The NOT gate is a unary gate, meaning it has only one input. It inverts the input signal. If the input is 1 (high), the output is 0 (low), and vice versa.
Symbol:
Truth Table:
Input (A) | Output (Q) |
---|---|
0 | 1 |
1 | 0 |
Boolean Expression: $Q = \overline{A}$
The AND gate takes two or more inputs. Its output is 1 (high) only if all inputs are 1 (high). If any input is 0 (low), the output is 0 (low).
Symbol:
Truth Table:
Input A | Input B | Output (Q) |
---|---|---|
0 | 0 | 0 |
0 | 1 | 0 |
1 | 0 | 0 |
1 | 1 | 1 |
Boolean Expression: $Q = A \cdot B$ or $Q = A \land B$
The OR gate takes two or more inputs. Its output is 1 (high) if at least one input is 1 (high). The output is 0 (low) only if all inputs are 0 (low).
Symbol:
Truth Table:
Input A | Input B | Output (Q) |
---|---|---|
0 | 0 | 0 |
0 | 1 | 1 |
1 | 0 | 1 |
1 | 1 | 1 |
Boolean Expression: $Q = A + B$ or $Q = A \lor B$
The NAND gate is the inverse of the AND gate. It takes two or more inputs and produces a 0 (low) output only if all inputs are 1 (high). Otherwise, the output is 1 (high).
Symbol:
Truth Table:
Input A | Input B | Output (Q) |
---|---|---|
0 | 0 | 1 |
0 | 1 | 1 |
1 | 0 | 1 |
1 | 1 | 0 |
Boolean Expression: $Q = \overline{A \cdot B}$
The NOR gate is the inverse of the OR gate. It takes two or more inputs and produces a 1 (high) output only if all inputs are 0 (low). Otherwise, the output is 0 (low).
Symbol:
Truth Table:
Input A | Input B | Output (Q) |
---|---|---|
0 | 0 | 1 |
0 | 1 | 0 |
1 | 0 | 0 |
1 | 1 | 0 |
Boolean Expression: $Q = \overline{A + B}$ or $Q = A \overline{B}$
The XOR gate takes two inputs. Its output is 1 (high) if the inputs are different (one is 0 and the other is 1). The output is 0 (low) if the inputs are the same (both 0 or both 1).
Symbol:
Truth Table:
Input A | Input B | Output (Q) |
---|---|---|
0 | 0 | 0 |
0 | 1 | 1 |
1 | 0 | 1 |
1 | 1 | 0 |
Boolean Expression: $Q = A \oplus B$ or $Q = A \land \overline{B}$ or $Q = \overline{A \land B}$
Logic gates are combined to create more complex logic circuits that perform various functions, such as arithmetic operations, memory operations, and control functions.
Examples of logic circuits include: