The complement of A, written ("A bar" or "A prime"), is its opposite: 1 when A = 0, and 0 when A = 1. It is the NOT operation, and in a circuit it is a not gate (an inverter).
You can complement a whole expression too. is 1 on exactly the rows where is 0. The complement of a function F is written F′; see complement of a function.
Notation varies between books: A̅, A′, ¬A, ~A and !A all mean the same thing. This course draws a bar and types a prime.
Finding the complement of an expression takes de morgans laws: swap AND with OR and complement every literal, keeping the grouping. For the complement is .
Key facts:
- = 1 and = 0 (complement law).
- = A (involution law).
- The complement is different from the dual, which swaps the operators but leaves the literals alone.
| 0 | 0 | 1 | 0 |
| 0 | 1 | 0 | 1 |
| 1 | 0 | 0 | 1 |
| 1 | 1 | 1 | 0 |