Forums - Open Redstone Engineers
Binary to Analog Decimal using Double-Dabble - Printable Version

+- Forums - Open Redstone Engineers (https://forum.openredstone.org)
+-- Forum: ORE General (https://forum.openredstone.org/forum-39.html)
+--- Forum: Projects & Inventions (https://forum.openredstone.org/forum-19.html)
+---- Forum: In Progress (https://forum.openredstone.org/forum-20.html)
+---- Thread: Binary to Analog Decimal using Double-Dabble (/thread-5419.html)

Pages: 1 2 3


Binary to Analog Decimal using Double-Dabble - Legofreak - 12-29-2014

So earlier tonight I was trying to understand the Double-Dabble algorithm. It didn't really make sense at first... still doesnt really... but this thing works so far.
[Image: BinarytoACD_zpsa7bd9fa1.png]

It consists of 2 kinds of modules: A "shift" module and a "+3 if >4" module
8 is the carry in of the first shift module.
4 is the carry in of the second shift module.
2 is 3rd and so on...

The "shift" module is actually just subtracting the same number twice from 15 and getting its compliment, essentially multiplying by 2. Then there is some carry logic for future output digits.

The other one kinda explains itself. Add 3 if greater than 4. No carry logic needed apparently.

The logic is flat(2 tall) and with the input wires its only 4 blocks tall. I think it can stack 6 blocks wide but I might expand to 8 for input wire spacing.

I think its something like 36 ticks from 8's input to the output.

Only step to get to BCD now is an analog to binary decoder slapped onto each output.

Edit: Since I dont have MC here at work, I felt like making block diagrams in autocad to help explain the logic.
[Image: ShiftModule_zps6d0a5dfc.png]
I should rename Cin and Cout to Shift in and Shift out.
[Image: Add3Module_zps13967050.png]

[Image: hexbcd1_zps77e921a8.png]


RE: Binary to Analog Decimal using Double-Dabble - Apocryphan - 12-29-2014

i like it, i was looking at newo's video about double dabble a while ago and thought about making something like that.


RE: Binary to Analog Decimal using Double-Dabble - Chibill - 12-29-2014

So now I have a fast way to get to acd.


RE: Binary to Analog Decimal using Double-Dabble - Legofreak - 12-29-2014

Is this faster than what you have made? I don't think I've seen any of your ACD stuff that you talk about.


RE: Binary to Analog Decimal using Double-Dabble - Chibill - 12-29-2014

Mines a basic touch powered binary to Anolog


RE: Binary to Analog Decimal using Double-Dabble - Legofreak - 12-30-2014

I was able to stack it. 8 bit now. Works like a charm. I'm so surprised.

[Image: 8bitBINtoACD_zps244c465b.png]


RE: Binary to Analog Decimal using Double-Dabble - newomaster - 01-01-2015

I thought about doing something like this a while back but school started and I never really got around to it. Glad to see someone gave it a go. Another thing you may want to try is have analog hex input and analog decimal output somehow and then figure out how to condense the conversion from there - there's probably some interesting conversion algorithms you could derive using hexadecimal instead of straight up binary.


RE: Binary to Analog Decimal using Double-Dabble - Legofreak - 01-01-2015

(01-01-2015, 09:37 AM)newomaster Wrote: I thought about doing something like this a while back but school started and I never really got around to it. Glad to see someone gave it a go. Another thing you may want to try is have analog hex input and analog decimal output somehow and then figure out how to condense the conversion from there - there's probably some interesting conversion algorithms you could derive using hexadecimal instead of straight up binary.


I was hoping double dabble would let me do that, but after I finished a cell and started stacking, I realized that the input always goes into the Cin.

I googled for hex to dec conversion but the algorithms I found involve multiplication in dec. I havent quite figured out the best way to do that yet.

So the only way I can think to do that right now is just throw some hex to bin decoders in the inputs... but thats a really slow cop-out.

So far, I've gotten each double cell down to 7 ticks. I combined the 2 so there would only be 2 inversions instead of 4.

Also, at least it seems like I dont need the first 3 shifts since it wont add 3 until there are 3 bits.


RE: Binary to Analog Decimal using Double-Dabble - Apocryphan - 01-02-2015

Would it be a cop out to use a rom instead of a multiplier and then just add the first hex digit? That's the easiest way I can think of right now.


RE: Binary to Analog Decimal using Double-Dabble - Apocryphan - 01-02-2015

[Image: 7c7i24S.png]

The first hex value is easy to convert to decimal, the 2nd i noticed some patterns but im not sure how to manipulate it to get the right output.

[Image: nLm8UxS.png]

Far left hopper is the input. the first digit repeats after 5 so i adjust it to 1-5. The tens digit seems like a similar pattern every 5, but subtracted by 2 or even shifting diagnolly there is a pattern. the increments go up by +1 +2 +1 +2 +2. Not sure how i should go about doing it, any input would be awesome.

ten's digit
1-5 1 3 4 6 8
6-10 9 1 2 4 6
11-15 7 9 0 2 4


Edit: I threw a rom on the 2nd digit, and it works for the 2nd hex value, so this works as a hex multiplier. i just need to make it add the 1st value and carry when necessary.

[Image: 6f0SWrK.png]