0
\$\begingroup\$

I'm looking for a logic circuit to convert 16-bit binary to 5-digit BCD, but one that is smaller / uses less gates than double dabble.

Are there any other binary-to-BCD conversion circuits besides double dabble?

\$\endgroup\$
4
  • \$\begingroup\$ You can implement components similar to the 5-in, 5-out implementation 74X185, but with more bits/terminals. Looking a bit closer, you'll see double dabble again, closer still, gates, then switches. One obvious approach would be to describe the full bundle of 19 binary functions of 16 variables and have it "optimised" and realised/mapped by some tool chain. See Kuba Ober's answer for an essentially 2 level and/or(NAND/NAND) + register implementation. \$\endgroup\$
    – greybeard
    Apr 5, 2023 at 19:21
  • \$\begingroup\$ (16 bit to 5×7 segment signals may or may not be a more useful circuit - think integrated.) \$\endgroup\$
    – greybeard
    Apr 5, 2023 at 19:29
  • \$\begingroup\$ Jason, do you want to use the BCD for BCD-7-seg displays? If so, that's a very different question (in terms of optimizing, anyway.) Or do you need the BCD for something else? You can just lay out the 16-bit to BCD (the upper-most BCD digit only needs 3 bits, not 4) and feed it to an algorithm to minimize, if you want. Or you can start there and hand-optimize its output. (You can almost always do better for something of this complexity -- even for algorithms that claim to 'minimize'.) Just for reference only, here's the generic double-dabble approach. \$\endgroup\$ Apr 6, 2023 at 0:10
  • \$\begingroup\$ For driving 7 segment displays. \$\endgroup\$
    – Jason C
    Apr 6, 2023 at 1:33

1 Answer 1

1
\$\begingroup\$

Double dabble doesn't use many gates... if you implement it in a serial fashion. I imagine the BCD output is for human interface/UI, so you wouldn't need those values very quickly anyway.

If this is for a discrete design, then a 256kbyte EEPROM, a counter that counts to 3, and three 8-bit latches would be the simplest, lowest-area solution, short of using a small MCU to do the math.

\$\endgroup\$
2
  • 1
    \$\begingroup\$ (You'd use few gate less letting the counter count to four - Johnson for ease of glitch-free decoding.) \$\endgroup\$
    – greybeard
    Apr 5, 2023 at 19:10
  • \$\begingroup\$ I found a circuit here and got it working, thanks for the serial double dabble idea. forum.digikey.com/t/binary-to-bcd-converter-vhdl/12530 \$\endgroup\$
    – Jason C
    Apr 6, 2023 at 19:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.