I need help in Digital logic Design?

Thread Starter


Joined Feb 4, 2021
Hi, I need help in DLD. I want to you to help me in digital numbers. Kindly if you know any shortest way to convert decimal into binary numbers. If you have any formulas for conversions kindly share with me.


Joined Jan 18, 2008
Welcome to AAC, Chris.

There are lots of ways to convert decimal to binary. Please start by defining:
1) How many decimal digits do you need to convert?
2) Do you want algorithms or do you want the code to do it?

Here's one of several methods: https://www.electro-tech-online.com...th-numbers-larger-than-32-bits-solved.160721/

Here's another: http://www.piclist.com/techref/microchip/math/radix/a2b-2d8b-sd.htm

And here's a link with several methods: http://www.piclist.com/techref/microchip/math/radix/index.htm


Joined Jan 29, 2010
hi Chris,
Do want to do the Deci to Bin conversion in hardware or software.
You say DLD, so a HW solution would be to clock a Binary counter with a Deci clock.

If SW , which programming language and MCU.?


Joined Jan 29, 2010
hi chris,
If SW , which programming language and MCU.?

We need more information in order to give a meaningful answer.;)


Joined Jan 18, 2008
Same here, except when writing code. Then I let the Assembler do it for me.

Several years ago, Sharp EL-531X* were on sale at a local store for something like 2 for $10. So, of course, I bought two. Quite useful when I am bit banging.

*It has conversions for bin, oct, hex, and dec plus the usual logic operators (NOT, AND, OR, XOR, and XNOR) .


Joined Mar 14, 2008
It can be done all in hardware if you like.
One way is to load the binary word into a binary down-counter and have it count down to zero.
There is also a decimal up-counter that counts up with the same clock for the same number of counts.
You then have the decimal (BCD) output of the binary word at the end of the count.

This is not very fast, especially for larger numbers, but it's generally adequate if the BCD number goes to a visual display.

Edit: I see the TS wants decimal to binary. For that just make the BCD counter the input with the binary counter being the output
Last edited:


Joined Oct 2, 2009
There are four combinations.

1) SW decimal to binary
2) SW binary to decimal
3) HW decimal to binary
4) HW binary to decimal

Choose one to start.


Joined Jan 18, 2008
While the TS asks specifically about decimal to binary, the title is not so restrictive. Digital and binary are not the same. Awhile back, I saved an interesting piece on using decimal math without conversion to binary.

https://www.sciencedirect.com/science/article/pii/S0895717709001496 (2008)
Since radix-10 arithmetic has been gaining renewed importance over the last few years,
high performance decimal systems and techniques are highly demanded. <snip> The algorithm works with BCD operands
and no conversion to binary is needed.