Combinator Design: signal to any base N converter

Post pictures and videos of your factories.
If possible, please post also the blueprints/maps of your creations!
For art/design etc. you can go to Fan Art.

Post Reply
User avatar
MadZuri
Fast Inserter
Fast Inserter
Posts: 178
Joined: Tue Jan 06, 2015 8:15 am
Contact:

Combinator Design: signal to any base N converter

Post by MadZuri »

I was messing around with combinators and I designed a way to split up a signal into any base-n parallel signals. Shown is the input 987654321 broken down into 9 digits decimal. It's basically a combination of the following: N^x progressive multiplier, divider and modulus operator. I figured a way to make something like this work earlier, but I wanted it to be faster and have the outputs simultanious. I didn't like how my earlier designs stuttered. All digits update on the same tic with a change in count. If you change base (ie, hex to trinary) it does stutter along, as I haven't figured out to make the N^x operator work simultaneously in the time I allotted myself.
first10

Code: Select all

H4sIAAAAAAAA/+VY3W6bMBR+lYrLyXQxgbRVxcWeo5oiCm5nidjImK0R4t1nMNGCsQ04P92Wq4hgfA7fz/E5ZPQup2mS323jGhGOOUZlXNck2aHYSxjmP3aI
49RP6e4Vk4RT5oGClmIdJXH9Efvr+wjsxU8DMsxQ2v0fgpQSIi/Ebi8e9L7HNUOZ2LkLst/iLA5AillaYd5dNA14ZwgR8xLYgKNbm+Et8fiLF7RhxrtE6tKm
zS/DfXp/3jKu3zAr+bbE7yTJ45rvC4EC5mjnAYkIZpT4lCGvASVqN5laW+QJb1fTArGkA8f74gFa8aKajNM/2+Y7n5DVbD7GQEEz3OvB1aMJfJVjZUcdxw8X
YUdsUfKEcJHBeaA/bGgE/mCE+6gBbzjniLVGmplsJTINACYZ+pB4zo0ayqjBoqgHUcq4UBN3jvNl6NVy46uMa0QBldpgFNioDCxTz0/MeJXkB3TkTf/bKfb+
atCYPtRrXi22eF9zHZCPhrAeWxoGC1kZ1geoOt1cEmbUhFEyZ6FVYj2TWelMZ167d1pM7OosxA6ZeZqGWz2JjdyN6v4NuM2ZkweL2cKFpChmW882m7pSZzY1
mdswm3MRnXF8hTZKVjdoIude4cliIvXs1xAxbFvhaBIwkqSu1PnmIr3HX++bvu8LlnO5UY4ZDaYLpjp44uBghcQVf9OAoQ+2R3lOfzm2f6cSoBe1ytHVCej1
v2x+028lXt+xA3PA9nFa3MapWYPtRTqtf0Dc58Ffr22Voqvj/7nadi4bw45Fr+1xV2MBVx1JbkXczifnCN1JBibkfREGPrl0S32HTh8+oaXNHE3H58Cqe0G9
Vu2KO8bUv9Lw64bp2oJpeMOYhidgurFgGv1vmDYAp13qdf+BGtgwFuufGeIVI3fbZ0Sy38+6hSbaGgAA
I forgot to include the input box in the BP. After you place that BP down, link up the input to the red wire (Signal A) that travels horizontally, you can then BP the left 2 cells and place as many digits as you want, overlapping the last digit to easily copy the wire connections. In Binary, at the 32nd digit, the sign bit kicks on, and it overflows to a negative number. This happens with fewer and fewer digits the higher base you use.

But, here you go. Convert to decimal for use with a display? Set the iron ore constant combinator to 10. Want a binary number? Iron ore to 2. Any number system you could possibly want. I haven't tinkered around with it enough to make it work with negative numbers. For binary I was thinking of detecting if it was negative, throw a signal all the way to the sign bit, and run another operation before passing it along to the converter.


Post Reply

Return to “Show your Creations”