Scrap Mechanic

Scrap Mechanic

Not enough ratings
Cyclic arbitrator
   
Award
Favorite
Favorited
Unfavorite
File Size
Posted
17.869 KB
11 Feb, 2024 @ 7:54am
1 Change Note ( view )

Subscribe to download
Cyclic arbitrator

Description
Used for managing multiple components that share a single resource. It will make sure only one component has access at the same time.

Video: https://youtu.be/F-VZipJm_Vw

Give each component one of these modules, and then hook the modules up in a cycle. A 1 tick pulse will loop through the cycle forever. If a component wants to make use of the common resource, it's arbitrator will intercept the next pulse, send a signal to the connected component that it can start to do stuff. Once the component is done using the resource, it should give a signal to the arbitrator, and then the arbitrator will release it's intercepted pulse and allow the next component to make use of the common resource.

vanilla, uses selfwired XOR gates.

Useage:
- Connect these in a chain, by making connections from the light-cyan or-gate, to both the cyan and dark-cyan and-gates.
- If your component wants to make use of a shared resource, it should give a single 1 tick pulse to the white sw-XOR gate to toggle it on. The dark-cyan and-gate will give a 1 tick pulse once this component can safely start using the common resource. Once the resource can be used by something else again, give a 1 tick pulse to the light-cyan or-gate.
- To start up this system, you need to put an initial 1-tick pulse in the loop. Just give a 1-tick pulse to any one of the light-cyan or-gates upon logic reset.