Display Binary Number on 7-segment Display

Thread Starter

Python Person

Joined Feb 22, 2018
2
Hello all;

I am planning to create an adder circuit that will eventually (hopefully) be able to output a 5-bit binary number. I'd like to convert this binary number into decimal, then display the decimal number on a 7-segment display. Does anyone know of ICs or combinations of ICs that could accomplish this task? I would prefer not to use any microcontrollers or EEPROMs.

Thanks in advance!
 

crutschow

Joined Mar 14, 2008
34,285
74185 or 74LS185 for TTL version.

For 74HC185 CMOS version.
I think those devices are obsolete but they are a simple solution if you can find them.

Converting binary to decimal is not simply done using logic only.
Here's a previous thread on that.
The simplest is probably the one using the combination of binary and BCD counters.
The binary counter counts the binary number down to zero while the BCD counter counts up for the same number of counts.
Thus at the end of the count, the BCD number is available at the BCD counter output.
Some added logic to control the counters along with a clock source is, of course, also needed.
The frequency of the clock determines how long the conversion process takes.
 

Thread Starter

Python Person

Joined Feb 22, 2018
2
Alright, thanks so much for advice everybody!

I will look into the 74185 chips and the up/down counting - that seems interesting!
 

WBahn

Joined Mar 31, 2012
29,978
I think those devices are obsolete but they are a simple solution if you can find them.

Converting binary to decimal is not simply done using logic only.
Here's a previous thread on that.
The simplest is probably the one using the combination of binary and BCD counters.
The binary counter counts the binary number down to zero while the BCD counter counts up for the same number of counts.
Thus at the end of the count, the BCD number is available at the BCD counter output.
Some added logic to control the counters along with a clock source is, of course, also needed.
The frequency of the clock determines how long the conversion process takes.
And unfortunately this algorithm has exponential time complexity in the number of bits. Each additional bit in the binary value doubles the expected conversion time, which translates into each additional BCD digit increasing the conversion time by a factor of ten, making is a solution that doesn't scale beyond relatively small numbers.
 

dl324

Joined Mar 30, 2015
16,846
I will look into the 74185
A look up table in a byte wide EPROM/EEPROM would be more cost effective.

If you're not constrained for board space, you could design your own. The 4 bit binary to BCD converters in the circuit below are comprised of 20 gates:
upload_2018-2-22_20-4-41.png
 

WBahn

Joined Mar 31, 2012
29,978
Not for anything I suggested. o_O
For exactly what you suggested.

Let's keep things easy and just look at numbers that need a 1 in the most significant BCD digit and 0's in all the others.

How many clock pulses are needed to convert the number for 2 BCD digits? 10.

How many clock pulses are needed to convert the number for 3 BCD digits? 100.

How many clock pulses are needed to convert the number for n BCD digits? 10^(n-1)

That's exponential growth in the number of digits (which is exactly the same as exponential growth in the number of bits, since the base in use has no effect on the time complexity family).

What is the expected conversion time for a randomly generated 64-bit binary number if the clock is running at 1 GHz? Just shy of three centuries. This is actually the median, not the expected, which is much closer to five centuries.
 

crutschow

Joined Mar 14, 2008
34,285
Okay, you got me (again). :oops:
But it's still a practical approach for many digital displays.
It can convert 7 digits (23 bits) in 1 second maximum using a 10MHz clock and logic.

64 bits is what, 20 digits? I haven't see many 20 digit displays. :rolleyes:
 

crutschow

Joined Mar 14, 2008
34,285
Below is an LTspice functional simulation of the binary-to-BCD conversion counter technique for a maximum BCD value of 99 (7-bits). It can be readily expanded to with added counters.

The binary input is loaded in the U1 binary down counter at the start (11001 or 19d shown).
U1 then counts down while the BCD counters U2 and U3 count up.
When U1 reaches zero, the clock is stopped to both counters and the BCD counters now have the number in BCD.
This is shown as a 19d two digit BCD number in the plot, which can displayed with a BCD to 7-segment decoder.
Alternately the BCD counters can be replaced with the CD40110 decimal counter which has the 7-segment decoder built it.

Edit: Here's the updated schematic with a clock and logic to continuously perform the conversion.
To convert up to 99d requires 4 counters, 1 flip-flop, and 1 quad NAND gate.
The write-up on it can be found here.

upload_2018-2-25_12-4-45.png
 
Last edited:

WBahn

Joined Mar 31, 2012
29,978
Okay, you got me (again). :oops:
But it's still a practical approach for many digital displays.
It can convert 7 digits (23 bits) in 1 second maximum using a 10MHz clock and logic.

64 bits is what, 20 digits? I haven't see many 20 digit displays. :rolleyes:
No, but consider that the National Debt Clock, which I believe updates every second, currently needs 14 digits and would require a 20 GHz counter. Of course, since it is a running total display, once it's set to the current value it only needs to count at the rate that the debt is increasing, which is "only" about 30 k$/s.
 

MrChips

Joined Oct 2, 2009
30,712
Since you only need 5 bits, you could do it with around 30 gates vs the 40 that the more general cascadable solution I gave earlier would take.
Single chip solutions are available.
74185 or 74LS185 binary-to-BCD converter is simply a 32 x 8-bit PROM (7488)
Any byte-wide memory chip will do the trick. Or even a simple Microchip PIC or MSP430G2553 MCU will do the job.
 

dl324

Joined Mar 30, 2015
16,846
74185 or 74LS185 binary-to-BCD converter is simply a 32 x 8-bit PROM (7488)
Those chips are virtually unobtainium. I didn't look closely at the packages of the parts referenced on eBay (to see if there were indications of them being counterfeit), but at $6 each, that's an expensive solution.
Any byte-wide memory chip will do the trick. Or even a simple Microchip PIC or MSP430G2553 MCU will do the job.
The OP's requirements were:
Does anyone know of ICs or combinations of ICs that could accomplish this task? I would prefer not to use any microcontrollers or EEPROMs.
That would appear to bias solution space against the use of EPROMs, PROMs, and NOR FLASH. Though I suggested that a look up table would be more economical than a $6 virtually non-existent chip.
 
Last edited:

MMcLaren

Joined Feb 14, 2010
861
It's a shame you've diss'ed a microcontroller based solution. Any number of simple PIC projects like the one below could be modified for 5-bit binary input and the PIC could be programmed using a simple 'sketch' running on a $2 Arduino Nano.

Eric\'s 4477 IC.PNG
 
Last edited:
Top