Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

7 Bit binary to Decimal on two 7-segment display.

Status
Not open for further replies.

Dagon

New Member
Hi, my problem is: I have this binary number and I want to display it on 2 7-seg-display without using PIC, like
0001010: 10
0000011: 03

A BCD could help?
I'm fairly new in this area.

Thanks in advance. :)
 
If you want to do it in just logic gates, it is extremely difficult. I made a four bit converter that does what you want. See this Thread. It also includes a truth table to make an 8 bit converter which would serve your needs, however, I have not had the time to make the schematic for it yet.
 
Thanks, I could use the Binary to BCD decoder but I can't figure out how to join them. That is the main problem.

There was a chip, the 74185, but is obsolet, the thing doesn't appear in CircuitMaker.

:?
 
Dagon said:
Thanks, I could use the Binary to BCD decoder but I can't figure out how to join them. That is the main problem.

There was a chip, the 74185, but is obsolet, the thing doesn't appear in CircuitMaker.

:?
If you have access to an eprom programmer, it is simple to program in a lookup table.
 
Thanks for your replies.

Anyone knows how it work the 74185 chip?
What logical gates form it?

Sorry, I can't make lookup tables, I'm a newbie at this. :oops:
 
just display it in hex = A3
to display two 4-bit binary values in decimal, you would need three digit display.
the simplest solution is to use any programmable chip such as
microcontroller, fpga or (e)prom.
if you are not willing to use hex or any of the programmable chips,
could you maybe settle for two 74LS154 decoders, each with 16LEDs?

if i had to translate it without using any programmable device
and - only to drive display, i would try to think of alternative approach.
something that is easy to troubleshoot... for example, an eye is quite
slow and there is no need to make "instant" conversion (result is for
indication only - not to drive other circuitry that would do some
sort of processing).

so for example, I would use two independant sets of counters
one binary and one BCD, both would be reset together and
both would be clocked together.

the BCD ones would be used to drive 7-seg displays, while binary one
would be used for comparison with input value.
as long as there is no match, simple AND gate would open and clock both counters.
once there is a match, both counters would stop and BCD would display value.
clock speed is not critical. make it faster for faster circuit response...
even with only 1kHz, 8-bit number (256 possible combinations)
would be decoded in only 256/1000Hz=0.256second and this is worst case
scenario. that's about 4 updates per second even for changing input.
that is pretty much as fast as display update on good multimeter but you
can clock it much faster than that. 10MHz clock would make it 10000x faster.
 
I agree that an eprom is the easy way. A lookup table is easier than it sounds. You create a table by taking pen and paper and create a table of values.

an eprom has many input pins and 8 output pins.
think of the 8 output pins as 2 groups of 4. If you were to connect them to a bcd-to-led driver chip, you could drive 2 7segment displays.

The 'lookup' table is simply a table of what do you put in each memory locaion. If 00000001 was to appear across the input pins, what BCD should appear on the output pins? Even the smallest eprom is extremely large for this simple application. No clocks, CPUs, pic chips or anything other than the eprom and 2 bcd-led drivers would be used (maybe some current limiting resistors).
 
Dagon said:
Thanks for your replies.

Anyone knows how it work the 74185 chip?
What logical gates form it?

Sorry, I can't make lookup tables, I'm a newbie at this. :oops:
According to what I can find, the 74185 was a mask-programmed ROM. It wasn't made of logic gates.
I fiddled around with the algorithm a little, and I think it would require literally dozens of MSI and SSI logic chips to perform asynchronous (no clocking) binary-BCD conversion for the numbers 0-99. You would need eight 7 (or 8)-bit, greater-than/less-than comparators, which I could not find a part number for. This means each of these would require two 4-bit comparators, which do exist (74XX85). Then you need a 7-bit full adder and an 8-way by 6-bit multiplexer. There are ways of sequential multiplexing to reduce the number of comparators, but that opens up a whole new can of worms.
I think your realistic choices are:
1. Find some 74185's (I think there are some available).
2. Use one of Panic Mode's ideas.
3. Program an eprom.
4. Use a microcontroller.
5. Use an FPGA.
 
mbramwel said:
an eprom has many input pins and 8 output pins.
think of the 8 output pins as 2 groups of 4. If you were to connect them to a bcd-to-led driver chip, you could drive 2 7segment displays.

Connect together the corresponding segments of two 7-Seg LED. Use one of the data pin output to select which digit to turn on. 0 select LSD and 1 select MSD.

Drive the 7-segment directly using the remaining 7 data output. Use one of the EPROM address line as multiplex clock input and remaining as the binary digit input. No decoder or latch needed. Can't think of anything simplier than that.

P.S. I am wondering if I connect the data pin output used for LED multiplexing back to the address line but with a slight delay using RC, maybe I do not need a separate clock afterall. i.e. the EPROM becomes an oscillator !!!
 
if i had to translate it without using any programmable device
and - only to drive display, i would try to think of alternative approach.
something that is easy to troubleshoot... for example, an eye is quite
slow and there is no need to make "instant" conversion (result is for
indication only - not to drive other circuitry that would do some
sort of processing).

so for example, I would use two independant sets of counters
one binary and one BCD, both would be reset together and
both would be clocked together.

the BCD ones would be used to drive 7-seg displays, while binary one
would be used for comparison with input value.
as long as there is no match, simple AND gate would open and clock both counters.
once there is a match, both counters would stop and BCD would display value.
clock speed is not critical. make it faster for faster circuit response...
even with only 1kHz, 8-bit number (256 possible combinations)
would be decoded in only 256/1000Hz=0.256second and this is worst case
scenario. that's about 4 updates per second even for changing input.
that is pretty much as fast as display update on good multimeter but you
can clock it much faster than that. 10MHz clock would make it 10000x faster.

That sounds so much better, the thing is I can't see how to do it, sorry, maybe if someone could be kind enough to put a schematic for it, I would aprreciate it, Thanks again.
 
Where is the binary number coming from? How frequently can it change? Is there an independent signal (strobe) that occurs when the number changes? What are your power supply voltage options? The design depends on the answers to these questions.
 
The number comes from an input of 7 logical switches.

It can change, say you want the number 2 the switch #6 would be on.
 
Dagon said:
The number comes from an input of 7 logical switches.

It can change, say you want the number 2 the switch #6 would be on.
Well, one out of four ain't bad. :?
(I asked four questions - you answered the first one).
Are the switches manually controlled? What about the supply voltage?
 
Ron H said:
Dagon said:
The number comes from an input of 7 logical switches.

It can change, say you want the number 2 the switch #6 would be on.
Well, one out of four ain't bad. :?
(I asked four questions - you answered the first one).
Are the switches manually controlled? What about the supply voltage?

I know I'm not really offering any help here, but Ron H, isn't your avatar Janet Jackson's Nipple? :lol:

I would guess the supply voltages are +5 V and they are manually controlled, it makes the most sense that way from what he's trying to do.

{edit: guess i'm just a minute too late}
 
My avatar is actually Janet Jackson's left nipple.
Dagon, here's a converter based on Panic Mode's suggestion. I have not built it or simulated it, so it may not work. You can replace the oscillator with a 555 or whatever. I used what I hope are commonly available parts. You could use TTL parts instead.
Connect one of the 100nF caps across the power pins of each IC.
 

Attachments

  • binary_to_bcd.gif
    binary_to_bcd.gif
    23.1 KB · Views: 1,315
And another. The 4093 produces a pulse on the leading edge of PL to latch data and on the trailing edge to reset the BCD to avoid race conditions.
Not tested
 

Attachments

  • binbcdckd.gif
    binbcdckd.gif
    23.9 KB · Views: 980
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top