Trailmakers

Trailmakers

Not enough ratings
(Logic) Z.Z.Z's Pulse Generator _ Signal Generator ( 1 tick - 16min 40sec )
   
Award
Favorite
Favorited
Unfavorite
File Size
Posted
85.443 KB
Mar 9, 2020 @ 4:24pm
1 Change Note ( view )

Subscribe to download
(Logic) Z.Z.Z's Pulse Generator _ Signal Generator ( 1 tick - 16min 40sec )

Description
Lengthen, shorten and generate pulses of any length and magnitude. Even pulses as short a 1 tick with only 3 blocks! (1 tick = the length of time it takes for a signal to propagate from a gates inputs to it's output. AKA the shortest pulse a gate will recognize)

PLEASE READ full description if you want to know how to make or use this in your creations. Better info than the Wiki enclosed.

First a description of parts and logic, then I'll get into how to configure the circuit for different length signals.

The circuit is made up of the white blue and yellow blocks. Just those 3. Everything colored black is only there to demonstrate the circuit and visualize it's output.

The white block is the input, it also shortens the input to 1 tick. (I'll define 1 tick more in depth later) and outputs to the blue block.

The blue block is set to toggle, thus effectively extending the pulse indefinitely and outputting to the yellow block.

The yellow block then outputs a signal until its "Seconds to stay active when receiving input" time has run out. It outputs back to the blue block and on the falling edge it un-toggles the blue block, ending the pulse.

Setup and the 1 tick

So under the advanced settings on the logic gates, there are 3 timing settings represented in seconds. As you probably already know they are, "Delay before reacting to input", "Seconds to stay active when receiving input", "The time before a block resets it's active time". The UI makes it appear as though any number typed in this field will be rounded to the nearest second decimal place, and indeed it shows its rounded figure (0.015 would round to 0.02 in the UI), but the rounded figure is not the number the gate uses. It actually uses the number you typed in. (0.015 in our example instead of the 0.02 it's currently displaying). On top of that, you can put in numbers with up to 8 decimal places! (0.00000001 for example).

1 Tick explained

The shortest length pulse a gate will recognize, in this game, is EXACTLY 0.01666667 seconds. That's correct... its a repeating number rounded to the 8th decimal. When typed in, the UI will display 0.02 but don't be fooled, it won't use that. And it's a good thing it doesn't because it would make precision timing impossible unless they also changed the speed all the gates function. But i digress. Any pulse of an exact number of ticks needs a duration in seconds accurate to 8 decimal places. I'll list out the times in seconds for pulse durations up to 12 ticks. *** EDIT (This level of precision probably not necessary in less complex applications. i.e 0.0167 instead of the whole thing.)

1 Tick = 0.01666667
2 Ticks = 0.03333334
3 Ticks = 0.05000001
4 Ticks = 0.06666667
5 Ticks = 0.08333334
6 Ticks = 0.10000000
7 Ticks = 0.11666667
8 Ticks = 0.13333334
9 Ticks = 0.15000000
10 Ticks = 0.16666667
11 Ticks = 0.18333333
12 Ticks = 0.20000000

6 and 9 and 12 can be put in with out trailing 0's. 3 can not. IDK about more ticks you'll have to test it for yourself with this set up. Its a pretty obvious pattern + or - 0.00000001. Also, 1 tick looks like more ticks across the lights, until you pause the game. Then you can see its actual length. This is, in my testing, just the result of a visual bug or rendering limitation. Might just be my pc or frame rate. Point is, it seems logically sound. (If 2 of the OR gates at the top of the table powering the lights are tied to an AND gate, and a 1 tick pulse sent across the OR's, the AND gate will not produce an output.)

Setting

The white block appears to have 0.02 in its "Seconds to stay active when receiving input" field but it does not. The real value is 1 tick (0.01666667 seconds) and the UI has obscured this. This value should be as low as possible. It will still work with 0.02 typed in but it will break if a player manages to tap the button for less than 0.02 seconds but more than 0.01666667 seconds. So just use the latter.

The white block and the yellow block also have a "The time before a block resets it's active time" value of 1000.0 to prevent successive unwanted pulses.

To set the pulse duration, change the "Seconds to stay active when receiving input" on the yellow block. In order to see how many ticks long a pulse is press 1 and then Esc to pause the game. You can then count the number of lit lights. To set to exact number of ticks use the numbers provided above or timing wont be exact. The generator is preset for 1 Tick.

Using another circuit as an input

In this case just tie the output of your circuit to the input of the white block and remove the button input. The timings on this gate are integral (denoted by the blue dots)

Hope you find all this useful. Sorry if this was hard to follow. Any questions? leave em' in the comments and I'll get back to you.