4

I am working on a calculator. After the input is decoded into binary and passes through the adders, it needs to be decoded in a form that the visual display can recognize. The only way I have thought of doing this is creating a segment that decodes each and every possible number. Of course, this is just unfeasible, because if I want to expand the calculator I'd have to build an enormous amount of these segments.

I was wondering if anyone had a more efficient way to create a visual display that decodes the binary so that I wouldn't have to create hundreds of modules for the calculator.

3
  • @Joachim The question is how to build a binary-to-decimal encored with redstone. May 7, 2020 at 3:57
  • You could do calculations in binary, like dividing by 10 (1010₂) and writing the remainder into the lowest digit, then dividing the result by 10 again and so on. That would work, but I bet there are better ways. I think researching how a real computer does it could help. May 7, 2020 at 4:00
  • @FabianRöling Yes, I see it now, the OP added that in-between our comments.
    – Joachim
    May 7, 2020 at 10:02

1 Answer 1

1

I've come up with a generic solution that is quite wild but does work.

Here is a diagram to help explain:

enter image description here

Basically, the first step of the cycle is to fill droppers (black squares next to green) with the correct number of non-stackable items like swords. Pulses of the correct length can allow and disallow filling from hoppers. The droppers will now have 1, 2, 4, 8 etc items in them respectively.

To then "read" the output from the calculator a clock connected to each of the droppers is either on or off for a fixed length of time (which should be the bit size multiplied by the clock speed) so that all the items in the powered dispensers are moved into a water stream or hopper line.

The number of items in a container at the end is the now value in base 10 of the output.

Using a row of hoppers for the output container along with comparators and redstone lamps at different distances down the wire along with signs showing which number you can then see the base 10 output of the calculations.

This is of course incredibly slow so would love input from anyone else!

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .