Electronics Guide

The wires update introduced a lot of new neat digital gates etc. There are some fundamental differences with how things work in the real world however. For instance, wires can just magically carry a current, without there being an active power source. If current was introduced into a circuit at some point it can magically persist in the wire without there being a need for an active path the current can travel.

Signals in wires can travel instantaneously, while when current travel past a semiconductor, there will be a propagation delay of one time unit. This is similar to real world semiconductors operate, and this allows us to build things like edge detectors. The circuit needs to have at least two semiconductors for propagation delay to be simulated. To avoid race conditions or ensuring pulses are of a desired length you should count the number of semiconductors along a signal's propagation path.

Race conditions can happen and can be spotted where several wires and logical gates switch rapidly on and off, this indicates electronics that is spazzing out, and this can't actually be used to build an oscillator if you wondered. Some circuits with fancy wiring such as cross-feeds or signals that are fed back into one of the parent semiconductors to form a signal propagation loop can be especially prone to race conditions.

"ø" or nil indicates no shape or no current. This is different from zero which counts as a current bearing signal in this game. If you hook a filter up to such a wire it will display as not powered, often this will result in the desired behaviour however. If that is not the case, "ø" can be converted into a zero for instance by passing it through an OR gate connected to nothing or a "0" constant signal.

Red wires indicates short-circuits.

## Clocks

### High speed clocks

This contraption provides the fastest clock signal possible. The XOR binary counter is able to act as a frequency divider for it.

In a measurement it looped through a fast 8-bit counter in 132 seconds which gives a frequency of ca. 1.94 Hz.

This clock can be set to the desired interval by changing the number of NOT gates, but it must be an odd number.

### Low speed clocks

Feed a single shape into a conveyor belt of the desired length and have it run in a loop. Have a belt reader provide a pulse. A rendered shape will travel at a speed of 2.70 tiles per second, so to calculate the length of belt you need just multiply the desired pulse interval in seconds with 2.70. Hook this up to a rising edge detector to shorten the pulse down to something more reasonable.

## Edge detectors

### Falling and rising edge detectors

The number of NOT gates must be odd (before the primary gate). The number of NOT gates determines the length of the resulting pulse.
The fact that edge detectors work is proof that the game engine simulates propagation delays in semiconductors. For a delay to be simulated a circuit needs to have at least 2 logical gates (any semiconductor).

## Latches and flip-flops

### JK latch

The JK latch (named after Jack Kilby) is notoriously unstable. Try removing and re-adding parts that fluctuates to stabilize it. Also if you set both J and K to 1, and leave the enable pin on, the whole thing will start to oscillate because the electronics can't keep up. A solution is to keep the pulses on the enable pin short, something a rising edge detector might help with.

### T latch

The T latch (also called Toggle latch) is notoriously unstable. Try removing and re-adding parts that fluctuates to stabilize it. Also if the enable/clock pin is kept on the electronics can't seem to keep up and the whole thing will start to oscillate. In the picture you can see there's a rising edge detector added to the enable pin, to shorten a long signal down to a length the electronics is happy with. It was experimentally determined that 3 NOT gates was too little to pulse a T latch, but 5 did the trick.

### Other

A stable pulse activated T-latch equivalent, consisting of a rising edge detector and an XOR gate that feeds back into itself. Functionally equivalent to a T latch, but can be modified to operate like one of the other types of basic latches.

If you hook one of these up to a low speed clock you can use it to turn on and off things at regular intervals. This can be used for an automated Hub delivery system for instance.

Another stable pulse activated T-latch equivalent.

## Binary counters

### Ripple counter

4-bit binary counter made from combining 4 T-latches. The first latch' Q is fed back to the clock input of the next latch. The not-Q signals is sent to displays. This device can also be used as a frequency divider.

### Others

In the following image, you can see a simple, stackable binary counter. This example includes 4 latches and can count from 0 to 7. This system needs to be "primed" with a single tick and after that operates normally.

4-bit binary counter made from combining 4 XOR bitstores. The output from one is used as the clock input for the next one. This device can also be used as a frequency divider.

## Flowmeters

This contraption with 5 splitters taps off 1/25 or 1/32 of the belt capacity and has the belt reader send a pulse every time this occurs. If the belt is not at full capacity the time between pulses will be longer. Half capacity means the time between pulses will be twice as long etc. With 10 splitters measuring 1/210 or 1/1024 of full flow was measured taking 260 seconds.

You might want to attach a filter and a bypass lane if you only wish to measure the flow of one specific shape.

Should the flowmeter start misbehaving you can reset it by cutting and pasting it back at its original position.

You can also use this for a low speed clock by changing the number of splitter sections or changing the input flow rate (chaining extractors lets you do this by 1/5ths), but it is less flexible than the provided slow clock example.

## See also

* Wires
* Logic Gates