# Binary adder with 7-seg display

#### elec_mech

Joined Nov 12, 2008
1,500
When the user pushes a button to increase the A input value, it adds 1 to the 7 segment and 1 to the binary.
Yup.

That binary number goes to the adder when the user is done selecting what value they want. (I will use a toggle switch to send the inputs to the adder)
There are a few ways we can prevent the final result from being displayed until the user is finished selecting the two input values. A toggle switch could work depending on how it is wired into the circuit.

Is everything correct?
So far, so good.

Also, should I test this in some computer program or should I just draw it in a piece of paper? If I should use a computer program, what free program should I use. I tried tina and spice but they don't have any of the chips I need (I dont think)
Personally, I'm not a fan of circuit simulations. You'll spend a lot of time looking for or configuring a chip to match a datasheet, then spend more time learning the nuances of the program, all to simulate something you're going to build and test anyway. Don't get me wrong, simulations have their place - if you're designing an extremely complex circuit and really want to make sure you're getting the right parts and that it will work as intended, then they are the way to go.

For hobbyist circuits like these, I recommend drawing the schematic so you know what you're building and can document changes as you test it, then building it. For that, you can use MS Paint, Visio, ExpressPCB, or just draw it on paper. Drawing with a computer program will make it easier to document, save, make changes, and share if you choose to. Using ExpressPCB schematic capture is probably the quickest and simplest at this point. If it doesn't list the IC you're using, just pick a blank one with the same number of pins. You're aiming to draw the circuit, not simulate it (unless you choose to).

Just remember to save often and save multiple versions. I start by making my basic circuit. Once done, everytime I add or change something, I choose Save As and save the modified version by that day's date. This helps me in case I make a goof somewhere and need to go back to an earlier design of the circuit.

#### crutschow

Joined Mar 14, 2008
25,123
Do both inputs occur simultaneously? If not the circuit can be simplified even further by using one BCD counter to sum both inputs. Even if they do occur simultaneously there are ways to separate them into two separate pulses, and that would likely still be simpler then using a binary adder and then converting back to BCD.

#### pillyg

Joined Sep 19, 2011
52
Im not sure what you mean. My finished project is a 6-bit binary adder with the inputs and the output being displayed on 7-seg displays.

Each input will be set separately if that's what you mean.

#### crutschow

Joined Mar 14, 2008
25,123
By simultaneous I mean are two people inputting the numbers at the same time?

#### pillyg

Joined Sep 19, 2011
52
Ah no. I will set input A then set Input B. Are you suggesting I use 1 driver and switch its inputs from A to B? If so I want both inputs to be displayed at the same time.

Can I connect 2 binary counters and to BCD counters to fit all 6 bits? I mean like a Cout to a Cin

Last edited:

#### crutschow

Joined Mar 14, 2008
25,123
Ah no. I will set input A then set Input B. Are you suggesting I use 1 driver and switch its inputs from A to B? If so I want both inputs to be displayed at the same time.
No, you still use two switches.

But if both numbers are input at separate times then you can simply combine the two input pulses with an OR gate and connect the OR gate output to the input of a third 40110 BCD counter. This counter will then contain the sum of the A and B inputs. No adder or BCD conversion required.

The 40110 is an Up/Down counter with separate clock up/down inputs so if you added separate subtract A and B buttons you could either add or subtract the input pulses.

Edit: You can cascade as many counters as you like.

Edit2: The counters have an output latch function so if you only want to display the sum only at the end of entering both inputs, you can do that also.

#### pillyg

Joined Sep 19, 2011
52
Ah. I understand now. That's a good idea. I will use momentary push button switches.

I am still confused about the 40110s though. Do I only need 1 for 3 digits? or 1 for each digit or what. I see looking at the data sheet that it has a borrow and a carry. Are those like Cin and Cout? the 40110 is 4-bit so if I connected the borrow to the carry of one to another, could I have up to 8 bits? (Im only going to use 6)

#### crutschow

Joined Mar 14, 2008
25,123
......I am still confused about the 40110s though. Do I only need 1 for 3 digits? or 1 for each digit or what. I see looking at the data sheet that it has a borrow and a carry. Are those like Cin and Cout? the 40110 is 4-bit so if I connected the borrow to the carry of one to another, could I have up to 8 bits? (Im only going to use 6)
You need one 40110 for each decimal digit (4-bits) so cascading two will give you two digits (ones and tens) with 8 BCD bits (maximum count of 99).

The borrow and carry are indeed for cascading the counters.

#### pillyg

Joined Sep 19, 2011
52
For the inputs, the clock(push button) will be connected to the 1s place 40110 and it's carry will be connected to the borrow on the 10s place?

Same with the output except the clock will be the output of the OR gate (inputs are the 2 push button inputs) and there will be 3 digits.

I think I know what Im doing now! Thanks Elec and crutschow

#### crutschow

Joined Mar 14, 2008
25,123
Almost right. If you look at Figure 15 in the CD40110 data sheet you will see how to cascade the counters. The BORROW goes to the CLK DN input and the CARRY goes to CLK UP input of the next stage.

Be sure and debounce the switches (Google "switch debounce") or you will likely get more than one count per button push.

Edit: Just to clarify, the push button and OR outputs go to the CLK UP (or DN for subtracting) input of the 1s counter.

#### elec_mech

Joined Nov 12, 2008
1,500
But if both numbers are input at separate times then you can simply combine the two input pulses with an OR gate and connect the OR gate output to the input of a third 40110 BCD counter. This counter will then contain the sum of the A and B inputs. No adder or BCD conversion required.
That, crutschow, is brilliant. My hat is off to you.

William, I can help you with a deboucing circuit. Actually, just look at the circuit in the attachment I did earlier this year. It shows how to cascade two 40110s, has a 4-switch input debouncer, and the auto clocks for holding the buttons down that I mentioned earlier. You don't need the flashing circuit, toggle switch, any of the transistors, or the 3V regulator. If you're going to use standard 0.56" tall, 7-segment displays, I don't think you'll need the 2982s either. This should give you a good starting point.

#### Attachments

• 111.1 KB Views: 50

#### pillyg

Joined Sep 19, 2011
52
Yeah I agree. Thanks crutschow!
The diagram is a bit much for me lol. Would a debouncer like the one in the picture work? Do I need one for each switch? For the reset, should I have a master reset or a reset for each value (2 input and 1 output) I think I should have 1 for each so you can reset 1 part without doing the whole thing.

Also, let me make sure Im right for the 40110s. I connect the carry to the clock up and the borrow to the clock down.
Where can I find the circuit to keep the counter going when the button is pressed-the Auto count thing.

William

#### Attachments

• 12.8 KB Views: 55

#### elec_mech

Joined Nov 12, 2008
1,500
Hey William,

Look at the circuit I attached one piece at a time. Everything is in there - it is a bit much so I'll need to walk you through it a bit at a time.

Let's start with the debouncer. Look at U7, the CD4093. This is a quad, 2-input NAND Schmitt trigger. What this means is it has 4 NAND gates with two inputs for each. The Schmitt trigger helps with debounce. In my circuit, I'm interfacing it to switches with a different voltage, so I had to add the transistors. You don't need them. You'll connect a switch between the input of the NAND and ground. This circuit is similar with less parts to the one you posted last.

I'll be back later to explain more.

#### pillyg

Joined Sep 19, 2011
52
Ok. So the 1 NAND gate replaces the whole debouncer? I was gonna use logic gates to make the adder but that was way too much. What will the 2 NAND inputs be? The switch and what else?

What resistors do I need for this? I know 330 for the 7 segments, but I don't know what to use for the rest. Do I even need them for the other components?

I just checked the ICs on jameco and the displays and ICs are $20 alone. Is there any way I can use a CD4553? It is a 3 digit BCD counter. Could I use that on the output display at all? The 7 40110s are almost$10 so if I could use the 4553s that would be good.

(I am in high school and I don't have any source of income so less money is better)

Last edited:

#### crutschow

Joined Mar 14, 2008
25,123
The diagram is a bit much for me lol. Would a debouncer like the one in the picture work? Do I need one for each switch? For the reset, should I have a master reset or a reset for each value (2 input and 1 output) I think I should have 1 for each so you can reset 1 part without doing the whole thing.
You need one debounce circuit for each switch.

You need to reset everything at once otherwise the sum value will be incorrect.

#### crutschow

Joined Mar 14, 2008
25,123
...................
I just checked the ICs on jameco and the displays and ICs are $20 alone. Is there any way I can use a CD4553? It is a 3 digit BCD counter. Could I use that on the output display at all? The 7 40110s are almost$10 so if I could use the 4553s that would be good.
You can't go from BCD to a 7-segment display directly. If you used the 4553 you will need also need a BCD to 7-segment converter chip such as the 4511 for each digit. Since the output of the 4553 is multiplexed you will need to generate the proper decoder signals to latch each output value into the appropriate 4511 chip. All-in-all a much more complicated circuit then just using 40110s. Futurlec has them for \$1.10 each.

#### pillyg

Joined Sep 19, 2011
52
Ok. I will use futurlec for some stuff. They are pretty cheap. I also need a breadboard and I will get 2 840 point breadboards.

Also, can I use double displays http://www.futurlec.com/LED/7DR5621ES.shtml Instead of single ones (they are the same price but 2 displays)

Do I need any other components besides the switches, ICs, and displays? (what resistors and other stuff do I need)

Sorry if I ask too many questions

William

#### crutschow

Joined Mar 14, 2008
25,123
.............Also, can I use double displays http://www.futurlec.com/LED/7DR5621ES.shtml Instead of single ones (they are the same price but 2 displays)

Do I need any other components besides the switches, ICs, and displays? (what resistors and other stuff do I need)
That double display should work fine.

The only other components you might need are any resistors and capacitors for the debounce circuits, and current limit resistors for each LED segment (the resistor value depends upon the LED current you want,typically 10 to 20mA, depending upon the desired brightness, and your power supply voltage).

#### pillyg

Joined Sep 19, 2011
52
I will probably us an AC to DC black box thing. Or maybe a transformer and a voltage regulator. I want 5v.

#### elec_mech

Joined Nov 12, 2008
1,500
Ok, I've isolated a debouncer circuit based on the CD4093 with its maximum number of switch inputs - 4. If you don't need to debounce 4 switches, you can leave off the respective resistor and capacitor pair AND tie all unused INPUTS to ground. You can use any mechanical switch for SW1-SW4, typically normally open (N.O.) momentary switches. Whenever a N.O. switch is pressed, the output goes high and stays high for as long as the switch is pressed.

I don't have much time this weekend, so I'll be back when I can to explain more about the auto-counting circuits.

Before you buy anything, draw up a circuit. Spend time doing the best you can on the design first so you get all your parts figured out. Once we see your circuit, we can help you select resistor values, remind you to add bypass and de-coupling capacitors, find errors, etc. Then you'll have your complete parts list and we can help you find the best suppliers and prices. Otherwise you're going to order some parts, find out you're missing something, reorder parts, and spend extra money on multiple shipments.

#### Attachments

• 129.1 KB Views: 55
Last edited: