Maker Pro
Maker Pro

Binary to BCD Converter

Luke Vassallo

Dec 10, 2014
33
Joined
Dec 10, 2014
Messages
33
I am building a simple circuit that will add two 4 bit numbers. So far my plan is to do the addition, convert, multiplex, BCD-7seg convertor, to display.

I have seen that you can do it with shift registers however, I have no idea how they work, and it seems that they need some kind of clock.

Apart from that I could do the conversion using k-maps, but the problem is that I am going to end up with 6 very complex functions. Is there any other way ?
 

Harald Kapp

Moderator
Moderator
Nov 17, 2011
13,741
Joined
Nov 17, 2011
Messages
13,741
I don't know why you do the math in binary numbers, anyway, why would you first convert binary to BCd and then BCd to 7-segment? You can do the conversion directly from binary to 7-segment code.

One simple way is a diode matrix (e.g. as described here). Another method could use a ROM to read the 7 segment code associated with a given binary number or a CPLD to implement the logic.
 

Merlin3189

Aug 4, 2011
250
Joined
Aug 4, 2011
Messages
250
As usual I think you need to say what it is you actually want to do: why do you want to build a circuit to add two 4 bit numbers? What is it you are trying to learn?
That would help people see what it is you need to design or build yourself and what bits you can just buy ready made - such as a 4 bit full adder chip!

Your comment about shift registers intrigues me. I have heard of serial adders, which use shift registers, but I've never actually met one in real life. Is serial data processing what you want to learn about?

If not, Harald has come up with some cracking ideas - really takes me back to the days before every electronic circuit has to have a Pic or Arduino and LCD display.
 

BobK

Jan 5, 2010
7,682
Joined
Jan 5, 2010
Messages
7,682
really takes me back to the days before every electronic circuit has to have a Pic or Arduino and LCD display.
In other words, back to the days when any small change in behavior required a hardware revision. :eek:

Bob
 

Luke Vassallo

Dec 10, 2014
33
Joined
Dec 10, 2014
Messages
33
Well you're right no one would work with binary numbers. Originally this was a lab thing but i wanted to expand a bit. Multiplexor we weren't supposed to use and also, all we needed to display was up to the 18th digit (simple addition with 2 4bit numbers. So the maximum input number will be 9.

Now I just figured out that the lab will take place in 2 days so i don't have enough time to design something even more complex so for now i am doing this simple adder, with a few comparators and in the weekend or next week I will try to increase on it.

I will upload the schematic tonight.
 

Harald Kapp

Moderator
Moderator
Nov 17, 2011
13,741
Joined
Nov 17, 2011
Messages
13,741
Well you're right no one would work with binary numbers.
In fact, you're right and I am wrong, sorry for that. I misinterpreted your first post and thought you were using another code I had in mind at that time.

ANother solution - too late for your lab project, but keep it n mind anyway - is a binary to BCD decoder chip.
 
Top