Basic Bits

Logic gates manipulate bits: turn zeros into ones, and ones into zeros. Each individual gate is easy to understand, but you can combine them into wonderfully complex calculating machines.

Not

If you feed a not-gate 0, it will spit out 1. If you feed it 1, it will spit out 0. That’s all there is to it.

The not-gate is also called an inverter.

And

An and-gate outputs 1 if its first input and its second input are 1.

Or

An or-gate outputs 1 if its first input or its second input is 1, or if both are 1.

Xor

Xor is an abbreviation of exclusive or. An xor-gate outputs 1 if its first input or its second input is 1, but not if both are 1.

Nor

Nor is an abbreviation of not or. That’s because a nor-gate is like an or-gate and not. What I mean is, a nor-gate does the same thing as an or-gate and then it inverts the result. That’s what the circle at the end of the symbol means: invert the result.

The nor-gate outputs 1 if neither the first input nor the second input is 1.