NOT: TRUE if the input is FALSE (negation)
What is Negation? The Logical NOT
Imagine you have a light switch. If the switch is ON, the light is ON. Negation is like a magical box that reverses the state: if you put ON into the box, it gives you OFF. In logic, we work with statements that are either true or false. The NOT operator (also called negation or logical complement) takes one statement and flips its truth value. For example, if the statement "It is raining" is TRUE, then "NOT (it is raining)" is FALSE. It’s that simple — a single‑input, single‑output operation that always gives the opposite.
We often write negation using symbols. In mathematics and logic, you might see a tilde ~, a minus sign −, an exclamation mark !, or an overline. In computer science, the exclamation mark is common (e.g., !true equals false). The core idea never changes: it’s the ultimate “opposite day” operation.
Truth Table of the NOT Gate
A truth table is a handy way to show all possible inputs and their corresponding outputs for a logical operation. Because NOT has only one input, there are only two possibilities: input TRUE and input FALSE. The table is tiny but essential:
| Input (A) | Output (NOT A) |
|---|---|
| TRUE | FALSE |
| FALSE | TRUE |
This table is the definition of NOT. No matter how complex a logical system becomes, when you see a NOT, you can always replace it with this simple flip. In Boolean algebra, we often denote NOT A as $\neg A$, $\bar{A}$, or $A'$.
NOT in Everyday Language and Math
We use negation every day without thinking. When you say "I am not hungry", you are applying NOT to the statement "I am hungry". If you are actually hungry, your statement is false; if you are not hungry, your statement is true. This matches the truth table perfectly.
In mathematics, negation is crucial for defining opposites. For example, the inequality $x > 5$ is negated to $x \leq 5$. Notice that the opposite of “greater than” is not just “less than” — it includes equality. This careful handling comes directly from the logical NOT: if it is not true that $x > 5$, then $x$ must be either less than or equal to $5$.
Real‑World Application: The Inverter Gate in Electronics
One of the most direct applications of NOT is the inverter gate in digital electronics. A computer chip uses tiny switches (transistors) that work with two voltage levels: high (usually 1 or TRUE) and low (0 or FALSE). An inverter is a circuit that takes one voltage level and outputs the opposite. If you feed it $5V$ (TRUE), it outputs $0V$ (FALSE), and vice versa.
Inverters are building blocks for more complex logic gates. For instance, a NAND gate (NOT AND) is simply an AND gate followed by an inverter. In fact, any logic circuit can be built using only NAND gates — that’s how powerful the NOT operation is when combined with others. In circuit diagrams, an inverter is often drawn as a triangle with a small circle on the output, symbolizing the negation.
Double Negation: Flipping Twice
What happens if you apply NOT twice? For example, NOT (NOT A). If A is TRUE, NOT A is FALSE, then NOT (FALSE) is TRUE — we’re back to the original. In logic, this is called double negation elimination: $\neg(\neg A) = A$. It’s like saying "I am not unhappy" — which usually means you are happy. In mathematics, this principle is used to simplify expressions and proofs. In everyday language, double negatives can be confusing, but in logic they cancel out perfectly.
How Computers Use NOT: Searching and Filtering
When you use a search engine, you can often include a minus sign or the word NOT to exclude terms. For example, searching for "jaguar -car" tells the engine to find pages about jaguars but NOT those about cars. Behind the scenes, the search engine builds a logical expression: for each page, if it contains “jaguar” AND (NOT “car”), then show it. This is a direct application of the NOT operator on the “car” condition.
Similarly, in programming, conditionals often use NOT. In Python, you might write:
if not user.is_logged_in: show_login_page()
This means: if the user is NOT logged in, execute the code. The computer evaluates user.is_logged_in as TRUE or FALSE, then NOT flips it.
Important Questions About Negation
No, NOT is logical, subtraction is arithmetic. $5 - 3 = 2$ is not a truth value. However, in some logic systems, we use a minus sign for negation, but it’s a different concept. NOT only works with TRUE/FALSE, not numbers.
No, by definition NOT is a unary operator — it takes exactly one input. If you see something like NOT (A AND B), the NOT is applied to the result of the AND, which is a single value (TRUE or FALSE). So it still only has one input at the moment of negation.
Because there are only two possible truth values (TRUE and FALSE) in classical logic. With one input, you have only two rows. If we had three‑valued logic (TRUE, FALSE, UNKNOWN), the table would have three rows, but the principle stays: each input maps to its opposite. In binary, it’s the simplest possible operation.
Footnote
[1] Boolean algebra: A branch of algebra dealing with TRUE/FALSE values, named after George Boole. It uses operators like AND, OR, and NOT.
[2] Inverter gate: An electronic circuit that performs logical negation, also called a NOT gate.
[3] NAND gate: A logic gate that gives FALSE only if all its inputs are TRUE; it is an AND gate followed by a NOT (inverter).
[4] Unary operator: An operator that takes only one operand (input), like NOT or the square root in mathematics.
