binary to bcd converter

Thread Starter

Lorenzo Silvano Gort

Joined Mar 5, 2019
1
Hi, I am making a 32 bit binary calculator. With that I would like to display the answer on a few 7-segment displays. I can find schematics for such a converter but it requirs the sn74185a, which is badly availible. So do you have a alternitive ic or a schematic with logic gates? I don't want to use a FPGA because I would like to build the calculator using gates or simple ic's.
 

crutschow

Joined Mar 14, 2008
38,503
Below is a Binary to BCD converter using binary down-counters and BCD up-counters, discussed here.
The clock can be one available in the calculator.
How many digits do you want to display? It requires about 2 counters per digit.

 
Last edited:

WBahn

Joined Mar 31, 2012
32,823
Below is a Binary to BCD converter using binary down-counters and BCD up-counters, discussed here.
The clock can be one available in the calculator.
How many digits do you want to display? It requires about 2 counters per digit.

So, just how long is it going to take to convert a 32-bit value (the width specified by the TS) from binary to bcd using this approach?
 

crutschow

Joined Mar 14, 2008
38,503
Depends upon how many digits he wants to display. :D
But you have a good point. It could get quite long for anything above 7 digits, even using high speed 74HC counters.
Above that you probably want to go with a ROM approach, if the TS doesn't want to use any microprocessors.
 

danadak

Joined Mar 10, 2018
4,057
Here is a project, one chip, done largely with internal LUTs, to do the decoding
for a 8 digit solution. PSOC 5LP is part. 4 digit solution trivial to change to. And
also in chip are counters and LED display controller for 7 seg work. PWM added
display dimming as a feature. If you need a cntr for each digit trivial to add.

Everything you see is all in this chip, and a lot more. Not for the beginner, but not
rocket science either. Solution only used ~ 1/2 of the programmable resources,
almost none of the fixed, and none of the available analog capability.

upload_2019-3-5_18-20-5.png

upload_2019-3-5_18-20-29.png

upload_2019-3-5_18-20-52.png


https://community.cypress.com/thread/25201

MCUs rock !


Regards, Dana.
 
Last edited:

WBahn

Joined Mar 31, 2012
32,823
Depends upon how many digits he wants to display. :D
But you have a good point. It could get quite long for anything above 7 digits, even using high speed 74HC counters.
Above that you probably want to go with a ROM approach, if the TS doesn't want to use any microprocessors.
Even seven digits of output is probably getting pretty long. It's unlikely that the conversion clock is going at much over 10 MHz (especially if this is a breadboarded implementation during development) and 7 digits would let you go up to just under 10,000,000, so that would take up to a second for each conversion. Depending on the application, that may or may not be acceptable. But since it's a calculator, I know I would want a calculator that took a second to display every value that was punched in or each result (to say nothing of up to two to three minutes for values that were up against the limits).
 

WBahn

Joined Mar 31, 2012
32,823
Here is a project, one chip, done largely with internal LUTs, to do the decoding
for a 8 digit solution. PSOC 5LP is part. 4 digit solution trivial to change to. And
also in chip are counters and LED display controller for 7 seg work.

Everything you see is all in this chip, and a lot more. Not for the beginner, but not
rocket science either.

View attachment 171621

View attachment 171622

View attachment 171623


https://community.cypress.com/thread/25201


Regards, Dana.
If the TS specifically stated that they don't want to even consider an FPGA approach because they want to implement it with gates and simple ICs, what would make PSOC a candidate?

PLEASE stop pushing PSOC anywhere and everywhere.
 

AlbertHall

Joined Jun 4, 2014
12,625
There are some 74185's on ebay, some at reasonable prices. As you will presumably be making only one calculator this way it may be worth it.
 

danadak

Joined Mar 10, 2018
4,057
@WBahn -

I don't want to use a FPGA because I would like to build the calculator using gates or simple ic's.
PSOC, as I used it above, is simple gates and simple counters and simple wiring (on chip).

PSOC is NOT an FPGA.

As used in my post it (user) wires up the components one would use externally, wires them up
onchip with onchip simple gates, cntrs, logic. Or one uses a rats nest of external chips and
a breadbord. Did a lot of that, whenever possible I avoid that approach now.
Just as I program in modern languages now vs a lot of ancient ones.

PLEASE stop pushing PSOC anywhere and everywhere.
If you like I can go back thru my last 100 posts and do a count of PSOC vs other,
like ATTINY, programming language discussions, analog discussions. Let me know.

I consider it, in a sense, a duty to show newbees and semi experienced
and experienced todays tools and approaches, not to force them, just to consider
alternatives. Its how people survive in hi tech by designing with current technology.

Regards, Dana.
 
Last edited:

djsfantasi

Joined Apr 11, 2010
9,237
@danadak

But consider that noobies may not be familiar yet with the “new” technologies that you, yourself, are facile with. Perhaps they need to learn first by the technologies they have been introduced to. Thusly, a noobie becomes comfortable enough to try something new.

And perhaps, by your forcing your excellent solutions on those who are not prepared to understand what you proselytize, are in fact overwhelmed and develop a learned aversion to your new technology and thus never learn it.

We all have a responsibility to new members. I know you’re up to the challenge.
 

danadak

Joined Mar 10, 2018
4,057
@djsfantasi

For sure I would agree noobies not familiar with a lot of stuff, thats what AAC is here for, unless
I completely miss how to raise peoples exposure to change. But I do agree with a sensitivity to
not "push" but rather pull, and only with some degree of sensitivity., Thats why I think I can say
I have not, when a TS goes in another direction, continued to pressure them. In fact I recall a
recent post where I showed technology, and TS asked me if he should abandon what he was
doing. I could tell he needed to stay on the path he was on, told him so, just keep in mind what
is possible for future work.

are in fact overwhelmed and develop a learned aversion to your new technology and thus never learn it.
Thats a risk we seniors are all taking, like a URL to an ap note that may be a challenge to read.
But I think most people are in general capable of managing their lack of knowledge, hence the need
to address it at some time. Like a surgeon about to mess with us, most of us do not talk their language,
and that prompts us to get online and learn. Your point is valid, I do not know how to address people
that throw in the towel as first choice, especially in Hi tech. Maybe I need some personal courses :).

Maybe one thing I can do is use a disclaimer in my posts, to let people know what is being posted
can be in their hands at a later time, with some training. That way they see what is possible, but
egos and feelings are preserved. Like moving from a tricycle to a two wheeler (I am
still on the former).....

Food for thought.

Regards, Dana.
 

dl324

Joined Mar 30, 2015
18,326
So do you have a alternitive ic or a schematic with logic gates?
Doing it with logic gates isn't a good idea. One four bit converter will take around 18 gates. Do you realize that if you go with something like 74185, you'll require dozens of them?

A lookup table is probably your best option.
 

AlbertHall

Joined Jun 4, 2014
12,625
Doing it with logic gates isn't a good idea. One four bit converter will take around 18 gates. Do you realize that if you go with something like 74185, you'll require dozens of them?

A lookup table is probably your best option.
TS says 32 bit binary. That's just 10 decimal digits, so I think ten 74185.
 
Top