NOT gate

The NOT gate takes one input and inverts it — a 0 becomes a 1, and a 1 becomes a 0.

In terms of marbles:

  • If we receive marble, we output hole
  • If we receive hole, we output marble

The first one is simple enough, but what about the second condition? To turn hole into marble, we need to create a marble out of thin air.

We can achieve this using a reservoir of marbles:

00/0000/00
loading…

not gate

definition

A reservoir is a stream of marblemarblemarblemarblemarblemarblemarblemarblemarble… which supplies a constant marble source.

Remember that we can think of an xor xor as checking if its inputs are different. Because the reservoir always provides marble, this means the xor xor is checking if our stream is not marble, which is exactly what we want for a NOT gate.

Reservoirs are a useful tool, but they’re bulky and inconvenient. Having to send an endless stream of marbles around can clutter up your disks. In the next tutorial, we’ll explore another way.

challenge

Can you figure out another way to implement a NOT Gate? Hint: you may need to think about how we’re representing 1 and 0.

continue