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
, we output
- If we receive
, we output
The first one is simple enough, but what about the second condition? To turn into
, we need to create a marble out of thin air.
We can achieve this using a reservoir of marbles:
loading…
Remember that we can think of an xor as checking if its inputs are different. Because the reservoir always provides
, this means the xor
is checking if our stream is not
, 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.
continue