# Logic circuit for a seven-segment display?

I know this is an arduino forum but does anyone know of a good logic circuit for a seven-segment display? I have made two different designs myself but they have way to many logic gates to be practical. Assuming 3 or 4 switches, what is the best way?

Might be helpful if you could explain a bit more, like what this "logic circuit" is suppose to do.

Assuming 3 or 4 switches

Assuming that they do what?

[quote author=Runaway Pancake link=topic=188209.msg1393056#msg1393056 date=1379296299] http://www.jameco.com/webapp/wcs/stores/servlet/Product_10001_10001_50420_-1

http://www.jameco.com/webapp/wcs/stores/servlet/Product_10001_10001_13493_-1 [/quote] That's cheating haha. [quote author=James C4S link=topic=188209.msg1393061#msg1393061 date=1379296906] Might be helpful if you could explain a bit more, like what this "logic circuit" is suppose to do.

Assuming 3 or 4 switches

Assuming that they do what? [/quote] Well, using only 3 or 4 input switches the circuit should display all numbers (0-9) from a seven segment display. I don't really want to use a micro-controller or a driver, just PNP transistors.

Noahsdev: Well, using only 3 or 4 input switches the circuit should display all numbers (0-9) from a seven segment display.

Okay, now for the 2nd time, what do you want it do? For example how do those switches work?

Are the switches representing BCD? Binary? Individual elements?

You want a circuit to do something, but you aren't giving any details on what you want it to do.

Noahsdev: Well, using only 3 or 4 input switches the circuit should display all numbers (0-9) from a seven segment display.

Okay, now for the 2nd time, what do you want it do? For example how do those switches work?

Are the switches representing BCD? Binary? Individual elements?

You want a circuit to do something, but you aren't giving any details on what you want it to do. [/quote] That's what I'm asking. What is the best way, with the least gates. If I knew the best system to use I wouldn't be asking at all.

I honestly feel like this is how this thread is going.

10 Me: What do you want the switches to do? 20 You: I want them to work! 30 GOTO 10

[u]How do you want them to work?[/u]

[quote author=James C4S link=topic=188209.msg1393085#msg1393085 date=1379300170] I honestly feel like this is how this thread is going.

10 Me: What do you want the switches to do? 20 You: I want them to work! 30 GOTO 10

[u]How do you want them to work?[/u] [/quote] I think you need to learn to read. I have already said what I want them to do, I have said that I already have a design that works but it contains a lot of gates. I have said that my first priority is the amount of gates used and i have said that the number system used by the buttons does not matter. Don't be rude to me because you are too ignorant to read what is in front of you.

@Noahsdev
you have clear in your mind what you expect the switches to do
we do not

there is a big gap between “assume 3 or 4 switches” and a schematic that shows what those switches do
I could easily design a circuit with 1 switch that would do what you say
or with 9 switches
or any number in between

so
share what the switches actually do and you might get more help

7447 ic. BCD input, 7-seg output. One chip. It's apparently pretty hard to do with gates, and thus is a favorite example for a first PLD project. You could do it with a diode based ROM array...

This is precisely why Robert Noyce came up with the Integrated IC.

http://www.ebay.com.au/itm/1PCS-100-original-DIP16-TI-IC-CD4543BE-CD4543-DIP-16-4543-CHIP-/370719119385?pt=LH_DefaultDomain_0&hash=item565094d819

http://pdf1.alldatasheet.com/datasheet-pdf/view/26915/TI/CD4543.html

4 switches to toggle the Binary Coded Decimal value (4bit)

Noahsdev: I have said that I already have a design that works but it contains a lot of gates.

Your vague description of "I have a design that works" is meaningless to anyone that isn't you.

Describe the function of your circuit. You are trying to duplicate some kind of functionality and haven't explained what that functionality is.

Noahsdev: Don't be rude to me because you are too ignorant to read what is in front of you.

I'm trying to make the point that you HAVE NOT explained want you want this circuit to do. You said you have a seven segment display, 3 or 4 switches, and you want your design to use fewer gates. That completely lacks what those gates are doing, what your design is, and how the switches "work."

Obviously you want to drive a 7 segment display, but what kind of inputs do you want to give? And if you already have a design, why not share your design so that we a) have some idea of what you want to do and b) avoid wasting time suggesting what you already did.

Here's another example to what you are asking: "Hey everyone I wrote a letter today and it came out to be two pages long. Is there a better way to write it?"

(for example, both the 7447 and the 4543 are strictly BCD decoders handling values 0-9. If you want a circuit that does hexadecimal (ABCDEF can be put on a 7-seg display, somewhat inelegantly), you'd have to do some additional searching.)

Four reasonable alternatives to spaghetti logic are:

diode matrix, ROM, FPGA, microcontroller.

(Although an FPGA is really just a way to put lots of spaghetti logic in one package). These days a microcontroller would be cheaper than a small ROM I think!

These days a microcontroller would be cheaper than a small ROM I think!

These days a microcontroller is cheaper than a 7447 chip. Part of that is because 7447s have become a "rare part." The 4543 is a \$0.50 part, though, handles both CA and CC LED displays as well as LCDs, and includes a latch. (You'll note that the internal logic shown for the 4543 is pretty complex!)

westfw: (for example, both the 7447 and the 4543 are strictly BCD decoders handling values 0-9. If you want a circuit that does hexadecimal (ABCDEF can be put on a 7-seg display, somewhat inelegantly), you'd have to do some additional searching.)

I have done that additional searching, and it's basically impossible to find a decoder that does hexadecimal. You'll need to get a uC like ATtiny2313 or ATtiny84 to program.

That's what I'm asking. What is the best way, with the least gates. If I knew the best system to use I wouldn't be asking at all.

I hear and understand you. Working on it now. I want to use 4 bits (arduino pins) and output 0 through to 9. 4 bit is 16 different combos, so should be possible to build a transistor circuit to match.

https://www.electronics-tutorials.ws/combination/comb_6.html

I rebuilt the 'brains' to my midi-foot controller, which now contains 4 7-segments, for which i used 3 pins, 12 foot-push-buttons, for which i used 3 pins, and 12 LED's for which i used 3 pins on a pro-mini, then for the midi i used 2 more pins, and for 2 foot pedals to analog pins, the pin extensions were just done using bitshifters (4015's probably obsolete according to some) and did all the mapping in the software. I used a transistor for the LED's (and 7-seg's) common GND driven by a PWM pin so i could turn them off while the bits were shifting and to be able to dim the brightness. I am now waiting for my friend who has a laser cutter to make me a new cover plate.

With all those LEDs and 7-segment displays, the obvious approach would be to use a single MAX7219. Four seven-segment LEDs and 32 LEDs controlled by three pins.

Paul__B: With all those LEDs and 7-segment displays, the obvious approach would be to use a single MAX7219. Four seven-segment LEDs and 32 LEDs controlled by three pins.

Probably, but i needed to make the buttons work as well, either way it is a lot of wiring up to do, was actually wondering if there are 7-seg's with bitshifters already on them. I do recommend using a transistor to be able to dim the 7-seg's, they can be really bright in a darkened space.