Page 1 of 1

Binary to BCD conversion

Posted: Tue Mar 02, 2021 10:06 pm
by chezkrimles
I have to convert an unsigned 8-bit binary value to BCD.

There is the 'Double-Dabble' method, but I cannot figure out how to do this in Flowcode.

Does anyone have an idea how to do this? Thanks.

Re: Binary to BCD conversion

Posted: Tue Mar 02, 2021 11:13 pm
by mnfisher
I posted an implementation of this here https://www.matrixtsl.com/mmforums/view ... hp?t=20462

If memory serves then I converted binary to one digit per byte for output as a string rather than BCD - but it should give you some idea of the bit manipulation needed..

Martin