Silicon to Scripting 2
To build the full computer, we will be using the website nandgame.com. It provides all the levels and components in order. You could even disregard these posts altogether, but I hope that they bring more value than just the game.
A bit of vocabulary before we start:
- input / output: the nodes given to you by the level
- inlet / outlet: the nodes of a component
The first level wants us to build a NAND
gate. A gate is just another name for operator or function.
The given truth table is:
A | B | Output |
---|---|---|
F | F | T |
T | F | T |
F | T | T |
T | T | F |
We only have two types of relays available.
When constructing these gates, it’s useful to break the problem down into smaller parts by phrasing the problem differently. The NAND
gate can be described as the following
Always on unless both
A
andB
are on.
We can now solve this level in two setps
- Always on
- unless both
A
andB
are on
To complete part one, we can use the always on relay.
And for part two, we need to turn that gate off when A
and
B
are on.
By the looks of it, the “relay (default off)” only turns on when the current c
is on and the input in
is on: an and
gate.