0
\$\begingroup\$

I have been trying to convert 8bit binary to 8bit BCD. The circuit I have been working on is below:
enter image description here I built a 4bit binary to 5bit BCD converter using a similar truth table like the one here:
enter image description here
Do I need a bigger truth table if I am going to design an 8bit binary to 8bit BCD converter? Also, are there any other ways I can create the converter circuit? Your help is much appreciated.

\$\endgroup\$
  • \$\begingroup\$ You have 2 7-segment displays, which can handle decimal 0 to 99. 2^7 = 128. So at best you will have a 7 bit binary to 8 bit BCD. So you will need a bigger truth table. \$\endgroup\$ – StainlessSteelRat May 29 '19 at 13:25
  • \$\begingroup\$ @StainlessSteelRat yeah I did the truth table. Its massive and I don't really know how I can get the K-maps for it. \$\endgroup\$ – AugieJavax98 May 29 '19 at 14:09
  • \$\begingroup\$ @AugieJavax98 Still looking for some ideas? There are two easy and completely different ones I can imagine. \$\endgroup\$ – jonk May 31 '19 at 1:26
0
\$\begingroup\$

When doing arithmetic, K-maps are less useful than other techniques — basically, they are "too general" when doing something as specific as "sometimes I need to add 6 to a number".

Yes, you'll eventually get a correct answer after a lot of effort — and a lot of opportunities for errors to creep into the process. But if you think in terms of comparators and adders to begin with, you'll find that this is a much more direct approach.

\$\endgroup\$
  • \$\begingroup\$ Using the comparator and adder method, I can do the shift add 3 process and get my result right? \$\endgroup\$ – AugieJavax98 May 29 '19 at 11:18
  • \$\begingroup\$ I don't understand the question. There are many ways to implement binary-to-BCD conversion. Have you searched the Web for techniques? \$\endgroup\$ – Dave Tweed May 29 '19 at 11:25
  • \$\begingroup\$ What I need to do is build a converter circuit that converts 8bit binary to 8bit BCD. I have searched the web, but most of what I've found are techniques for 4bit binary to 5bit BCD. To add on, all of the techniques involved the use of truth tables and K-maps. \$\endgroup\$ – AugieJavax98 May 29 '19 at 11:32
0
\$\begingroup\$

I'll suggest the more obvious of the two ideas that came to mind. If you haven't already done so, take a look at the double dabble algorithm for conversion. I'll use it as the basis for the following schematics (there are two.)

This first schematic accepts a binary value and leaves it unchanged if the value is \$\le 4\$. Otherwise, it adds \$3\$ to the binary input. There are some assumed illegal input values: \$10-15\$. But it doesn't really matter what happens there. So adding \$3\$ in those cases is fine.

schematic

simulate this circuit – Schematic created using CircuitLab

The second schematic uses the above circuit (named PLUS3 below), repeatedly:

schematic

simulate this circuit

That's all there is to implementing the algorithm documented on the Wiki page mentioned above.

Please do note that the output is 10-bit (or 12-bit if you don't mind going there.) But not 8-bit. (At least 10 bits are required for full conversion.) If you don't need the hundreds, then throw away those you don't need.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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