Wiring

Background Knowledge
Before diving too deeply into wiring, there is a slight bit of background knowledge to familiarize yourself with.

Binary & Binary Addition
Our "normal" counting system uses 10 digits: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9. I will refer to this as Base-10. In Base-10, when you get to the last value in the list (9), you wrap around to first value (0) and increment the place to the left by one. For example: 9 + 1 = 10

Note that the above is equivalent to the following: 09 + 01 = 10

Binary is a simpler version of this. Binary is a system of counting that only has two digits it in, 0 and 1. So, when you would add two 1s together, you will get 0.

All binary numbers on this page will be given this prefix: b'

So in example, adding 1 and 1 in binary: b'1 + b'1 = b'10

or, alternatively: b'01 + b'01 = b'10

We add 1 and 1, which makes us loop around to 0. When we loop, we increment the place to the left by 1, just like in Base-10.

Here are some more addition examples: b'0010 + b'0010 = b'0100 b'0100 + b'0001 = b'0101 b'0101 + b'0001 = b'0110 b'0110 + b'0010 = b'1000

In Starbound, signals will either be ON or OFF, which correspond to 1 and 0 in binary, respectively.

This is really all we will need for now, but if you want a more in-depth look at binary, the Wikipedia Article on it is a good starting point.

Inputs and Outputs


In Starbound, if you toggle Wire Mode (default hotkey "T") and look around, you will notice many different devices have red and blue nodes on them. Blue nodes function as signal(and/or power) inputs and red nodes are signal (or power) outputs. Note that for signal inputs, if at least one of the inputs to that blue node is ON, then the input node as a whole is considered as ON.

Generally speaking, if you scan an object (default hotkey "N", then click on it) you should get some insight into what the inputs and outputs of an object do.



Logic Gates
A Logic Gate is a device that, when given a combination of one or more input(s), will always output a particular value that is dependent on the input combination.

Truth Tables
A truth table is a table that shows all the possible input combinations and the corresponding output value of an object based on those inputs. We will use these to describe Logic Gates. See the table in the next section for an example of a Truth Table.

NOT Gate


The first thing you might notice about the NOT gate is that it only has one input. A NOT gate takes and returns the inverse of the input (0 if 1, 1 if 0).

AND Gate
The AND gate takes 2 or more inputs and only returns ON if all inputs are also ON.

OR Gate
The OR gate takes 2 or more inputs and returns ON if at least one of its inputs is ON.