# How to convert 8 bit binary to BCD using logical gates on multisim?

I have a task to convert analogue signal to digital on multisim. But multisim have no Ic to convert 8 bit binary to BCD. Now I have to make logic circuits to convert 8 bit binary to bcd. I have used kmap technique to minimize first 4 bits than second four bits

then I have designed logic circuits through minimized expressions. I have made two sets of 4,4 bit converters on ADC output pins like this.

I have made this circuit on multisim but this is not converting a complete 8 bit binary to 8 bit bcd and not showing correct value of analog to digital

how I could convert a complete 8 bit binary to 8 bit bcd through single combinational logic circuit ?

• What is the range? 00 to FF = 000 to 255 : You need 3 BCD digits May 20, 2020 at 11:24
• You need to create a truth table that has 8 inputs and 8 outputs. Then, use 8-variable Karnaugh maps to simplify. Or, just write the thing in an HDL and synthesize. May 20, 2020 at 11:40
• What you are discovering hints at the reality that this is not a simple problem. Typically today it would be done in MCU software, as custom hardware implementations just aren't cost effective. I believe there exist panel meter ICs, but many cheap panel meters you buy now have an MCU in them... May 20, 2020 at 14:56
• #Elliot Alderson 8-variable k map is too complex for human beings to make SOP May 20, 2020 at 16:07

First of all, you can't convert 8 bits binary to EXACTLY one BCD, you'll need 3 BCD converters: the maximum value with 8 bits is 255, supposing you have unsigned numbers, so 3 digits are needed.

You have two choices:

1. Use asynchronous solution

There's an algorithm "Double dabble" that does the conversion from binary to BCD. You can start from here: Double dabble

2. Use synchronous solution

Use an 8×12 bits RAM. The address is the 8 bit value, the content of the cell, and hence the output, will be your BCD value.

• You mean a ROM not a RAM. Of course in a DIY implementation that's likely to be an EPROM or some comparable EEPROM device. In theory an old PROM could work, but finding one... May 20, 2020 at 14:58
• I said RAM because he may want to change the content later, for another use of that IC. It will be better to use a ROM in the simulation program as you said May 20, 2020 at 15:49
• The problem with a RAM is that you have to initialize the contents each time the system powers on. Most things that could do easily do that could simply solve the BCD problem themselves. May 20, 2020 at 16:01
• Yes I forgot about that, thank you, but I suppose that an EEPROM would still be better May 20, 2020 at 16:27

One logic-based method is to detect inputs greater than 9, then add 6 and carry out the excess to the next digit. So, a full adder and some gates for each digit.

Example:

• 10d = 1010b = 1 0000 bcd
• so, 1010b + 0110b = 1 (carry out) + 0000b

The logic to detect greater than 9 is a couple of product terms. Use that to select adding 0 or 6 at the full adder, plus carry-in.