Binary to BCD conversion

For general Flowcode discussion that does not belong in the other sections.
Post Reply
chezkrimles
Posts: 9
http://meble-kuchenne.info.pl
Joined: Thu Jan 14, 2021 7:12 pm
Has thanked: 2 times

Binary to BCD conversion

Post 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.

mnfisher
Valued Contributor
Posts: 991
Joined: Wed Dec 09, 2020 9:37 pm
Has thanked: 106 times
Been thanked: 517 times

Re: Binary to BCD conversion

Post 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

Post Reply