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[]
Highest speed clocks[]
Examples of higher speed frequency generators (approximately 2 times faster than the example of "High speed clocks" below). The first example is more complex and includes a single shortest and fastest one-pulse generator.
First button - starting clock on press button or change value (see "Edge detectors" sub-paragraph of whole Aticle). Second button - ON/OFF a generation (1 -ON 0 - OFF). After switching on, it is necessary to apply a single pulse for the generator to start. In the off state - also passes a single pulse to the output. This scheme of combining one pulse and generators is useful for debugging and analysis and productivity) Also, a repeated single pulse with the generation on can stop it. (if you need not "ø"/1 sequences , just insert any logical elements after)
The second example - there are most simplest and fastest scheme as possible in fact:
Button: ON/OFF a generation (1 -ON 0 - OFF). (And Yes! it more efficient compared with scheme below. Just like Quartz. And it give 0/1 sequence, not "ø/1")
(How does it works? In code of SHAPEZ - there is а "tics" for whole scheme, and for one our element "XOR" - it is always was there controversy output-out and input-in for XOR for our simulation - 0/1 for for every tics!)
You may change scheme of generator to it simplest form, when you debugged all logic of your logical scheme...
High speed clocks[]
(obsolete sub article,,, see above)
Now this article - is abominated! Will We drop it out? Оr keep as Historical?
This contraption provides "the fastest clock signal possible" (Not so anymore) . 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[]
Change value detector[]
Makes a shortest impulse (0->1) when in-value is changes. Latency = 1 (in terms of speed signals based on numbers of logical elements in whole scheme)
(How does it works? The signal is behind for XOR by one element for every tics of calculation. Consequently. In the final evaluation, XOR haves "0/1" or "1/0" every times, when in-value is changes)
All detectors in one simplest scheme[]
More efficient scheme of edge-detectors. Latency = 2..3 Аfter XOR - it detects all change value event, after AND (left side on the scheme) - it detects rising event. For falling detector (right side on the scheme)- latency is increased by one NOT element.
Beware! It not works for highest speed clocks! for rise and falling - It's just repeat input frequency... But for change value it not works eather as repeater!
(Why? Because XOR - for every tics - have "0/1" in her inputs, by highest possible speed clocks in simulation)
Falling and rising edge detectors[]
(obsolete sub article,,, see above ,,, Latency - is critical! This schemes haves latency = 5...7 )
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[]
SR latches[]
D latches[]
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[]
... I'll give you are some expand for this sub-article ... about synchronous and asynchronous counters ... later/. /// 1-2 days ... All realization of standart logical counter from in SHAPEZ - is sucks! ...
Example of synchronous (bottom) and asynchronous counters (top)
In the following image, you can see a simple (asynchronous), 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.