|The subject of this article is from the Beyond update.
The information from this article is up-to-date as of 27 November, 2019.
The information from this article is up-to-date as of 27 November, 2019.
Logic is a base building option.
- 1 Summary
- 2 Logic Basics
- 3 Circuit Types
- 4 Complex and Misc. Circuits
- 5 Notes and Layout Precautions
Summary[edit | edit source]
Logic is a base building option added with the Beyond update.
The parts are used to control the flow of power in such a way that they can be combined to form true logic circuits. For example, building a lock with buttons to secure a door or display patterns and numbers with light boxes.
This page and the logic sub-pages are very much a first draft. Please feel free to add to and expand them. This page and the below sub-pages are currently being worked on by Reddit users binoscope, Achereto and SelenianRanger and wiki user DarkNinja2462 (perhaps add your names here if you are also working on these pages?)
Logic Basics[edit | edit source]
Logic Components[edit | edit source]
There are several types of items available to help build Logic circuits.
- Switches are components that manipulate the flow of power in circuits. Some must be triggered manually and some are triggered by the circuit using control signals.
- These are the components that have a power/signal input and can be manipulated to do certain functions using power.
Power States[edit | edit source]
In traditional electronics, the state of an output or input can be described as being in one of two states, 0 or 1. In existing circuitry, this means there is either a low or a high voltage
- 0 = low voltage
- 1 = high voltage
In NMS this is expressed as the power being on in a line or not. You can see this as wire will glow as:
- 0 = dark orange
- 1 = blue
note: when no technology component (such as a light) is connected to a circuit, the wires will not glow when not powered.
Logic Tick[edit | edit source]
In the game, auto switches and inverters take a moment to update their output when their control signal is changed. This delay is referred to as one tick. It is roughly one second.
Signals and Pulses[edit | edit source]
Circuits with a stable output are said to produce a signal — an ON signal (also "1") if powered, or an OFF signal ("0") if unpowered. When a signal changes from OFF to ON and then back again, that is described as a pulse (or ON pulse), while the opposite is described as an OFF pulse. ON pulses are far more common, and in casual discussion, a "signal" often refers to an ON pulse.
Very short pulses (1 or 2 ticks) can cause problems for some complex or circuits because they have different update sequences to change states. For example an SR-NOR Latch will require a 2-tick pulse to function correctly and will flash and require manual reset if a shorter pulse is given to it.
Circuit Types[edit | edit source]
Combining these individual components, we can form working higher level logic circuits. Some have functions and uses on their own and some may work best when combined with other circuits.
Basic Circuits[edit | edit source]
Some components function as logic circuits in their own right, forming the basis of other more complex circuits.
Transmission Circuits[edit | edit source]
In NMS, signals have no restriction on the distance they can travel as long as they are connected in the same base. However some forms of restriction or control may be useful in some situations.
- One-Way Circuit
- One-Way Circuits (traditionally known as "Diodes") are circuits that only allow a signal to propagate through the circuit from one direction, and will stop the signal if it's directed from the other side.
- A delay repeats a signal, adding a delay to its propagation. This is useful in making clocks with custom intervals or to sync multiple signal timings.
Pulse Circuits[edit | edit source]
Some circuits require specific pulses, of different lengths and intervals. Pulse circuits are circuits that manipulate and create custom pulses.
A circuit that is stable in one output state and unstable in the other is known as a mono-stable circuit. Most pulse circuits are mono-stable because they are stable in their OFF state but unstable in their ON state as it will eventually revert to OFF.
- Pulse Limiter
- A pulse limiter makes a short pulse when triggered (by a long pulse or a stable signal).
- Pulse Extender
- A pulse extender makes a long pulse when triggered (by a short pulse).
Clock Circuits[edit | edit source]
A clock circuit is a pulse generator that produces a specific sequence of pulses repeatedly.
Combinational Circuits[edit | edit source]
Logic gates and similar circuits produce a certain output based on their current inputs. In traditional electronics, these are called combinational circuits.
- Logic Gates
- NOT Gate: A NOT gate (or inverter) is ON when its input is OFF.
- OR Gate: An OR gate is ON if any of its inputs is ON.
- NOR Gate: A NOR gate is ON only if none of its inputs are ON.
- AND Gate: An And gate is ON only when all of its inputs are ON.
- NAND Gate: A NAND Gate is ON if any of its inputs is OFF.
- XOR Gate: An XOR gate is ON if its inputs are alternated, or different.
- XNOR Gate: An XNOR gate is ON if its inputs are identical.
- Multiplexers and Demultiplexers are special circuits that allow the propagation of signals through certain paths based on their selector inputs.
Memory Circuits[edit | edit source]
Memory circuits work in contrast to combinational circuits. Their outputs are based on their past state and current input. They can save and maintain their state if no input is given. These circuits are called sequential circuits and are the foundation of more complex circuits.
- SR latch
- An SR Latch is a circuit with 2 control inputs, SET and RESET. When SET is triggered, the state of the circuit is changed to "1". When RESET is triggered, the state of the circuit is changed to "0".
- JK/T Flip-Flop
- A JK flip-flop is similar to a an SR latch, having 2 control inputs J and K that work identically as the SET and RESET control inputs of an SR latch, respectively. The only difference is, when both J and K control inputs are triggered, the state of the circuit is toggled.
- Connecting both J and K inputs creates a circuit that can toggle its state. This is called a T flip-flop and the control input is named T.
Complex and Misc. Circuits[edit | edit source]
Combining above circuits together allows for complex and useful circuits with practical uses in mini-games, calculations, etc.
- Whereas memory circuits could only save one state, counters and registers can save many states and manipulate them in different ways such as incrementing the combined value.
- Using colored lights or light boxes, along with some circuitry, we can display numbers, text or patterns with logic.
Notes and Layout Precautions[edit | edit source]
- Signal Feedback
- In NMS, auto switches and inverters both have 3 snapping points. Two at opposite sides (input/output) and one in the middle (control input). The 2 opposing side can both act as either input or output at the same time. This causes a big issue that if you're not careful, in some designs a signal you were using as output from a component is powering the control input of a component as well as acting as the input for that component. This can cause a feedback loop that will break some circuits and make others behave in ways you were not expecting them to.
- A simple way this can happen is if there's a power source (battery or generator) on the output side of the circuit which will overload the output signal and prevent it to cut signals and function properly. As a simple precaution make sure there are no power sources connected to a circuit other than the dedicated power lines that power certain components in some designs.
- Build Direction
- In traditional circuit diagrams, they are usually laid out to show signals flowing left to right. In NMS you can physically build a logic circuit any way you want to. However, if you want others to have a hope of understanding your design, build left to right. An example would be to put the push button on the left, the auto switch in the middle then the lamp on the right.
- Power Lines
- Even though it doesn't technically matter, power lines are shown as being at the topmost of the circuit. In NMS often people have designed the power distribution to be down low, perhaps even under the floor; building them along the top of the wall instead will make your design more obvious. You can also color code certain lines to make it easier to distinguish these power lines from internal wiring or input lines.