# Display Double Digit Numbers on 2 seven segment displays

I'm making an Arithmetic Logic Unit(ALU) for an assignment and I'm on a point. So according to my circuit design on the link shared below, I am able to output 1 digit of my alu. It is a 4 bit ALU so the maximum output can be a result of an addition i.e. 9+9 = 18. This is where my problem is.

The correct output is shown until 9 on the 7 segment display. After that, random gibberish is shown. I added LEDs to see the binary output to check if the correct output is received in my simulation. Since there are only 4 bits, the output on LEDs also goes maximum to 1111 (for output 15 in decimal). After that it is reset to 0000 for 16 and starts all over again.

Can anyone please guide me with the correct approach to take here? How can I make 2 7 segment displays show my correct output in decimal? so that until the output is less than 9, the first 7 segment shows zero, but as soon as the output goes to 10, the first 7 segment displays a 1.

Help is much appreciated.

View post on imgur.com

• Easier to use an LED driver that can display a hex digit. Otherwise you have to do a conversion to decimal. – stark Apr 24 '16 at 11:11
• I have some idea that I have to use a BCD to 7 segment decoder. I'm already using that to display the one digit. How to extend it to display on 2 separate displays? – Ching Ling Apr 24 '16 at 11:14
• Also I'm not sure we're allowed to use hex digits. Would be better if I find a solution to convert to decimal from binary. – Ching Ling Apr 24 '16 at 11:16
• You can write C or assembly that turns on and off individual bits of the seven segment displays. The input to the function can be the number, and the code set the bits for the displays. – Niklas Rosencrantz Apr 24 '16 at 11:24
• If you are doing everything in decimal then you should change the logic of your adder to carry at 10 and generate the correct digit output. – stark Apr 24 '16 at 11:25

## 1 Answer

This circuit could be simpler, but it achieves what you want without modifying your original circuit. http://imgur.com/XwqYME4 is the link to the photo so you can zoom in for better detail.

• Am I correct in assuming you added $x\ge10$ and $x-10$-logic to the circuit? – Pål-Kristian Engstad Apr 28 '16 at 19:18
• Sorry but unfortunately I haven't learnt the notation for writing logic using text. If you send me a link, I could learn it quickly. – Bradman175 Apr 28 '16 at 23:39