Multiplexer/Lookuptable Chip
closed
J
JollyDog
I happen to use the pattern in the image below again and again, but it feels utterly complicated for such a simple task. It takes a value and replaces it with another one using a lookup table.
I see two options to implement the chip:
1) 1 input, 1 output, reset pins. The menu looks similar to the selector chip, but allows inputting a second number that is the value the chip outputs instead of the input value.
2) 7 inputs, 1 output, reset pins. The menu is the same as the selector chip's, but only has 6 entries. The red input still determines which row in the menu is selected. But it selects from the other (green to black) input pins and outputs that value to the one output pin.
This is pretty much a reverse selector chip (apparently this is called multiplexer). In this variant the reset pins could be replaced by an additional input.
Joker
closed
This post has been re-created in the "Circuits V2 Feedback" category as part of a community polling effort during the CV2 open beta. This original request is closed for now, but you can find the new version at this link:
https://recroom.canny.io/creative-tools/p/multiplexerlookuptable-chip-1
D
Duke54
I don't understand how to use this. What's connected to the red pin on the selector chip, what is the selector chip selecting for, and what values are in the two variable chips connected to all the combinator chips?
DrummerGeek
Duke54: I personally use a similar circuit all the time. It is the equivalent of a value case statement in programming. Change the output value based on the incoming value.
The selector chip is inspecting the incoming value, and sending a one to the corresponding multiply combinator, then adding all of the results together to get the actual output. In this design, only one of the multipliers would be outputting a value other than 0 at any given time, so the final output value would be one of them.
D
Duke54
DrummerGeek: The selector pin already does what you describe without all the rest of the chips. I'm still confused what this system does beyond that.
DrummerGeek
Duke54: The selector only outputs the value coming in to the green pin to 1 or more of the output pins. What we are suggesting is a chip that has a selector pin and outputs a value to only one pin. That value changes based on what the selector pin receives
J
JollyDog
Now that the we can have values at unconnected input pins, the the second version is probably preferable.
DrummerGeek
Having seen state chips, a really cool and helpful implementation would be if it was 2 chips that linked together. Chip 1 would be input and output, Chip 2 would link to Chip 1 (and other Chip 2's) and have 7 input pins. The main chip could additionally have 2 more pins (Set, Value) that allows for dynamic values to be set similar to how the Set Player Stat chip works, as well as a reset the clears out the dynamic values. An option to allow dynamic values to override those in Chip 2 could be set in the chips configuration.
DrummerGeek
Ideally it would look something like this
J
JollyDog
DrummerGeek: If I understand this correctly, it is a proposal for a memory/dictionary chip? I'd put that into a separate post.
DrummerGeek
JollyDog: Not exactly. It is both a multiplexer and a dictionary chip. When thinking about the two problems and how the state machines worked, I realized that with something like this we could have both in a simpler package. Plus, this would allow for larger multiplexers without the need for combinators because the "Lookup Values" chip (which is the multiplexer in this case) would behave like the state chip. My original thought was for the Lookup chip just to act as the ID and output, but realized that with a couple of small tweaks it could do both.
Special-K
Version two would be nice. I would use it e.g. to provide different object-IDs to an object respawner.
J
JollyDog
To be fair, the exact opposite of the current selector chips would be 1. However there could also be a selector version of option 2.
Ian Oberst
I would love to have version 2 of this so I can route different inputs to a single output. Right now it's either the diagram above or putting together a bunch of addition circuits, which is cumbersome.
Aki Tensai
I have an alternate suggestion for this feature request. A chip that has many inputs and outputs (8 each?), and a combine on off setting. When the combine function is hit, all of the connected circuits get pulled "inside" of this chip. Whatever inputs and outputs from the combined circuit were attached to this chip are now exposed from this chip.
A chip like this, plus a copy/paste/storage feature for chips would allow complex sections of code to be reused easily. I imagine the price of the combined chip would be the total cost of the chips it contains.
J
JollyDog
Aki Tensai: I believe you are talking about Integrated Circuits. This is a whole different topic. As a matter of fact, it is a feature that AG promised since the very first days of circuits. The closest Canny I can find is this one: https://recroom.canny.io/creative-tools/p/circuits-packaging-up-circuits-for-more-space
Aki Tensai
JollyDog: Awesome. Upvoted it.