Menu

Boolean Logic

NOT gate

The NOT gate is the simplest logic gate: it has exactly one input and one output, and its output is always the opposite of the value on that input. Send it a 1 and you get a 0; send it a 0 and you get a 1. Because it flips the value like this, the NOT gate is also called an inverter.

A NOT gate drawn with one input A and output NOT A, beside its two-row truth table showing the output is the opposite of the input.

Truth table

With one input there are only two possible input values, so the truth table has just two rows:

ANOT A
01
10

AND and OR each take two inputs, so their truth tables need four rows. A two-row table only ever describes a single input, which is the giveaway that the gate is NOT.

Writing NOT

The output is written as NOT A. Whatever value A has, NOT A holds the other one: if A is 1 then NOT A is 0, and if A is 0 then NOT A is 1.

It works on a whole condition too. A school website shows a banner when it is not a school day, so calling "it is a school day" S, the banner's output is NOT S: on a school day S is 1 and the banner stays off, and at the weekend S is 0 so the banner is 1. Applying NOT twice cancels out, so NOT NOT S behaves exactly like S.

For example, a bike's battery sensor gives 1 while the battery is charged. The warning light must come on when the battery is not charged, so its output is NOT B: when B is 1 the light is 0, and when B is 0 the light is 1 and warns you to recharge.

Practise this