# How to display a double digit decimal value on a seven segment display?

I recently finished a 4 bit adder project and I wanted to "extend" it.Right now,the output is represented by 4 led's(1 for each bit).I want to display the answer as a decimal in a seven segment display.The biggest value that the adder can output is 15(since it is a 4 bit adder).I have two single digit seven segment displays.I was thinking of using the 74ls47 chip to do the binary to seven seg conversion.Here is the datasheet for BCD TO 7-SEGMENT CODER/DRIVER

How do I check to see if the addition output is a double digit number?Using this information, how do I "tell" the binary to seven seg converter, that it is double digit?Do I need two of these chips?My final question is:the biggest decimal a single digit seven segment display can represent is 9. When the 74ls47 gets an input greater than this it starts display jibberish:( I got that information from Using the 74xx47 BCD to Seven-segment display.

How would I prevent the jibberish from getting displayed(basically I need a way to check if the output of the addition is 10 or greater.)

Sorry about all the questions this is the first digital logic circuit that I have made.

What you need to do is convert the binary into something called BCD - Binary Coded Decimal.

Basically BCD is binary, but only takes the values 0-9 for each digit.

If you can still get hold of them (no idea if you can), there was a 7400 series IC that does the conversion. As I recall it was 74185.

Alternatively, if they are not available, you could use a parallel EEPROM IC or something like that. If you store the BCD equivalent values in addresses 0-15 of the EEPROM, then the lower 4 address bits become your 4bit binary input, then 5 of the bits of the data outputs can be your BCD value (the 5th bit being carry - i.e. 10).

Thinking about it, you could even use an 8-bit EEPROM to do the whole thing (including 7-segment). If you use the lower 7 bits for the first 7-segment, and the other data bit can go to segments B&C on the second 7-segment display. Again by storing the equivalent values in addresses 0-15 you can make a lookup table to generate the mapping.

You can use a ROM but that's sort of cheating.

Another method is to detect when the number is >9 and add 0x6 to the number (you need to have another 4-bit adder). Then you will have 0..9 in the least significant digit and 1 or 0 in the most significant digit (if the number before the second adder is > 9 it is 1, otherwise 0).

The out put above '9' is not jibberish, it is defined see the 74ls47 Data Sheet. If you don't like the appearance there are other chips that will display 'A' 'b' 'C' 'd' 'E' 'F'. give me a sec to find one. Here's one: DM9368 Data Sheet.

• what do you mean when you say 'A' 'b' 'C' 'd' 'E' 'F'.Sorry i'm a newbie when it comes to seven segment displays. I know that each letter represents one of the 7 led's of the display.But why did you capitalize some? – zack1544 Sep 27 '15 at 23:13
• 'B' looks like an '8' & 'D' looks like an '0' on the 7 segment display. The other letters would be hard to display uniquely as lowercase. – Jrican Sep 27 '15 at 23:30
• @zack1544 If numbers are represented in a hexadecimal format the letters a to f are used to represent 10-15. The capitalistaion is how they are displayed given the constraints of a seven segment display. for example if uppercase 'B' was used it would be indistinguishable from '8' and the same with 'D' and'0'. – ElecEnthusiast Sep 27 '15 at 23:31
• So should I use the Dm9368? – zack1544 Sep 27 '15 at 23:59
• @zack1544, I think using the DM9368 would be the easiest/cheapest solution for any number less than or equal to 0xF (15). Assuming you are learning electronics, this solution will also make everything easier to troubleshoot. – Jrican Sep 28 '15 at 3:55