Building
Scrap Mechanic Logic Gates: Truth Tables and Circuits
All six gate modes with the rule the game prints for each, two-input and three-input truth tables, and wiring for a NOT, memory bit, clock and chase.
What a gate is actually reading
A Logic Gate has one job. It looks at everything connected into it, applies one rule, and turns itself on or off. Anything you connect out of it then sees that result as an input of its own, which is how gates chain.
The word the game uses for an input is “trigger”, and that covers more than switches. A Switch, a Button, a Sensor, another Logic Gate, a Timer, a seat, all of them can feed a gate. The gate does not care which kind it is. It only counts how many of its inputs are currently active.
Press E on a placed gate and you get six modes in two groups. The first three are the plain versions and the second three are their inverted partners. Swapping between them costs nothing and does not break your wiring, so a circuit that misbehaves is usually one mode change away from working.
The six modes, in the game’s own words
Each mode carries a one line rule in its menu. These are worth reading literally, because two of them do not mean what the usual electronics definition means:
- AND: Active if all of the linked triggers are active
- OR: Active if any of the linked triggers are active
- XOR: Active if only one of the linked triggers are active
- NAND: Active if any of the linked triggers are inactive
- NOR: Active if all of the linked triggers are inactive
- XNOR: Active if an even number of linked triggers are active
Note that every rule counts inputs. None of them is written for exactly two inputs, which matters as soon as you connect a third.
Two inputs
With two inputs the six modes behave the way anyone who has met logic gates before would expect.
| A | B | AND | OR | XOR | NAND | NOR | XNOR |
|---|---|---|---|---|---|---|---|
| off | off | off | off | off | on | on | on |
| on | off | off | on | on | on | off | off |
| off | on | off | on | on | on | off | off |
| on | on | on | on | off | off | off | on |
AND and OR are the two you will reach for most. NAND and NOR are their opposites, and both of them invert, which is the whole trick behind building a NOT.
Three inputs is where XOR and XNOR part company
Add a third input and the rules start to disagree with the textbook. XOR is active when exactly one input is on, not when an odd number are on. XNOR is active when an even number are on, and zero counts as even.
| Inputs active | AND | OR | XOR | NAND | NOR | XNOR |
|---|---|---|---|---|---|---|
| 0 of 3 | off | off | off | on | on | on |
| 1 of 3 | off | on | on | on | off | off |
| 2 of 3 | off | on | off | on | off | on |
| 3 of 3 | on | on | off | off | off | off |
Read the bottom row. With all three inputs on, XOR is off and XNOR is off too, so they are not opposites once you go past two inputs. If you have ever built a three way switch out of XOR gates and watched it fail in one corner case, that row is why.
The practical rule: XOR is a “one and only one” detector, and XNOR is a parity check. Keep XOR on two inputs unless you specifically want “exactly one”.
Timing, ticks and the Timer
The game runs its world at 40 ticks per second, and that is the unit the Timer counts in. Open a Timer and you get two sliders, one for seconds and one for ticks, so the smallest delay you can dial in is a single tick.
A Timer passes its input through and delays it. Feed it a signal that turns on, and the Timer’s output turns on that much later. Turn the signal off and the off travels through the same delay. That second half catches people out: a Timer is a delay line, not a one shot pulse.
Gates themselves settle very quickly, so for most builds you can treat a chain of gates as instant and only budget time where a Timer sits. Where the delay does show up is in a loop. A gate wired back into itself never settles, because its own output keeps changing its input, so it flips continuously. That is the fastest oscillator in the game and it is usually too fast to be useful. Putting a Timer in the loop is how you slow it to a rhythm you can see.
Circuits worth building
The wiring below is a suggestion rather than a rule the game enforces. Each one is built only from parts described above, so you can check it against the tables while you place it.
A NOT gate
There is no NOT part in the game, so you make one. Set a gate to NAND and give it a single input. The rule reads “active if any of the linked triggers are inactive”, and with one input that means it is on exactly when the input is off. A NOR gate with one input does the same thing.
This is the single most reused trick in Scrap Mechanic logic. Any time a guide tells you to invert a signal, it means one of these.
A switch that only works while something else is on
Two inputs into an AND gate: the master Switch and the button you actually press. The gate only fires when both are active, so the master Switch becomes a safety. Wire the AND gate’s output to whatever you were driving.
This is the cheapest way to stop a passenger seat from firing your thrusters while you are parked.
A memory bit
A memory bit stays on after you let go of the button that set it, and stays off after you let go of the button that cleared it. Three gates:
- Gate one is an OR. Its inputs are the Set button and gate two’s output.
- Gate two is an AND. Its inputs are gate one’s output and gate three’s output.
- Gate three is a NAND with the Reset button as its only input, which makes it a NOT.
Read the stored value off gate two. Pressing Set turns gate one on, which turns gate two on, which feeds back into gate one and holds it there once you release the button. Pressing Reset turns gate three off, which drops gate two, which drops the feedback, and the whole loop falls back to off.
A clock
Take a NAND gate with a single input, which is your NOT. Feed its output into a Timer, and feed the Timer’s output back into the NAND. The signal flips, waits out the delay, flips again. One full on and off cycle takes two delays, so a Timer set to one second gives a two second cycle.
Connect the NAND’s output to a light and you have a blinker. Connect it to a piston and you have a machine that never stops.
Running lights
Chain Timers rather than gates. Put a Switch into the first Timer, the first Timer into both a light and the second Timer, and keep going. Each Timer adds its own delay before passing the signal on, so the lights come on one after another down the chain, then go off in the same order when you flip the Switch back.
Give every Timer the same short delay for an even chase, or lengthen the ones near the end if you want it to slow down.
What the parts cost
None of this is expensive. A gate is one metal block, one board and one batch of glue:
- Logic Gate: 1 Metal Block Level 1, 1 Circuit Board and 1 Glue, 5 seconds at the Craftbot. Stacks to 10.
- Timer: 2 Metal Block Level 1, 4 Circuit Boards and 1 Glue, 10 seconds. Stacks to 5, and it takes up two blocks of space rather than one.
- Switch: 1 Metal Block Level 1 and 1 Circuit Board, or 5 Scrap Metal Blocks and 1 Circuit Board at a workbench.
- Button: 1 Metal Block Level 1 and 1 Circuit Board.
The Logic Gate and the Timer are also on the hideout trade list at 1 Caged Farmer each, which is worth knowing early, before you can make Circuit Boards in bulk.
Circuit Boards are the real cost here. A Timer is four of them, so a wall of Timers adds up quickly, and the crafting calculator is the fast way to price a control panel before you commit the quartz.
Logic gate questions
Is there a NOT gate in Scrap Mechanic?
No, there is no separate NOT part. Use a NAND or a NOR gate with a single input. Both read as “active when the input is inactive”, which is exactly an inverter.
Why does my XOR gate stop working with three inputs?
Because the game’s XOR is “active if only one of the linked triggers are active”, not the odd number parity rule. With three inputs on, an XOR gate reads off. Split the inputs across two gates, or use XNOR if what you actually wanted was a parity check.
How fast do logic gates run?
The world updates 40 times a second, and that is the smallest step the Timer can be set to. A gate wired back into its own input flips continuously rather than settling, which is why a self feeding gate makes a very fast oscillator and why a Timer is needed to slow one down.
Can a Timer make a short pulse?
Not on its own. A Timer delays both the on and the off, so a held signal comes out held. To get a pulse, run the signal into an AND gate together with an inverted, delayed copy of itself, so the two only overlap for the length of the delay.
What can I connect into a logic gate?
Anything that produces an on or off state: a Switch, a Button, a Sensor, a seat, a Timer, or another Logic Gate. The gate counts how many of them are active and applies its rule, and it treats every input the same way regardless of what produced it.