Digital logic
NOT gate (inverter)
Also called: NOT · inverter · complement · Ā
Definition
A NOT gate has one input and outputs its opposite: 0 becomes 1 and 1 becomes 0.
Picture it
Inverters turn active-low signals, such as a button with a pull-up that reads 0 when pressed, into active-high ones. Bitwise NOT flips every bit in a word, which is the first step of negating a two's-complement number.
The maths
Y = NOT A (written Ā or A′)
| Quantity | Unit | Symbol |
|---|---|---|
| ratio | dimensionless | 1 |
Worked example
In 8 bits, what is NOT 0b0011 0101 in binary and in unsigned decimal?
- Flip every bit: 1100 1010
- 128 + 64 + 8 + 2 = 202
- Check: 255 − 53 = 202
Answer1100 1010 = 202.
✓ The number in this answer is recomputed from scratch by an automated test.
logic tester
Logic gate tester
Y = 1
Y = A ⊕ B
| A | B | Y |
|---|---|---|
| 0 | 0 | 0 |
| 0 | 1 | 1 |
| 1 | 0 | 1 ◀ now |
| 1 | 1 | 0 |
XOR with A = 1, B = 0 gives Y = 1.
Ideal gates: no propagation delay. 1 = true = high, 0 = false = low.
Common misconceptions
- Misconception: In Python ~53 is −54, because Python ints are unbounded two's complement; mask with & 0xFF for 8 bits.
- Misconception: Applying NOT twice gives back the original signal.