# 4-bit binary to decimal into dual 7 segment displays

Status
Not open for further replies.

#### jupiter669

##### New Member
I am building a simple 3-bit adder that will add two 3-bit numbers together. The result is then display in decimal format onto either one or two 7 segment displays. The highest number that will be displayed is 14. I already have the adder logic setup and all is good as far as that goes. I also have the logic to display the "1" on the second 7 segment display for when the result is 10 or above. My problem now is how do I decode the the 4-bit binary number to display it? I cannot use a GAL or and other PLD. I thought about using a BCD decoder, but ran into problems digits above 9. I cannot have letters being displayed. My other options are using a 3:8 DeMux(s) somehow, or implemented the logic using gates.

#### Russlk

##### New Member
The 7447 BCD to 7-segment decoder is all you need. The data sheet will show the logic, if you want to build it from discrete gates.

#### jupiter669

##### New Member
How about for displaying the digits 10, 11, 12, 13, and 14? I know how to get the 1's onto the second display. What can I do to get the 0,1,2,3, and 4 to look right instead of how the output is displayed in the attatchment to this post?

#### Attachments

• bcd_7-seg_output.JPG
7.7 KB · Views: 2,054

#### ljcox

##### Well-Known Member
One way to do it would be to

1. if the number is between 0 and 9, display it on the first 7 segment and 0 on the second 7 segment.

2. if the number is between 10 and 15, add 0110 (ie. decimal 6) to the number and display this on the first 7 segment and display 1 on the second 7 segment.

This will require a 4 bit comparitor, a 4 bit adder and some gating.

If you post a block diagram outline of how you propose to do it, I and others will be able to comment.

Len

#### Russlk

##### New Member
Write the binary numbers, 9 to 14:
1001
1010
1011
1100
1101
1110
Now write the numbers that you want on the second display:
0000
0000
0001
0010
0011
0100
See the symmetry? Two AND gates and an inverter will do the logic. You also need to block input to the first display for numbers above 9.

#### Russlk

##### New Member
I was hasty, it is not quite that simple, but I did the units to show the method:

#### Attachments

• B_TO_B.jpg
5.7 KB · Views: 2,271

#### jupiter669

##### New Member
I think I have figured out a fairly simple way to do it. I intend on using the block method of stopping input above 9 to the BCD Decoder as described above. I will post my result upon completing the circuit and testing it. Thanks for everyones help.

#### ljcox

##### Well-Known Member
Here is an option for you to consider. It is based on my post of yesterday.

If I understand what you want correctly, it is to display (for example) 3 if the input number is 0011 or 13 if the number is 1101.

If you wish to display 03, then the circuit will need an inverter to invert the Carry Out signal such that the 2 right hand segments are always lit, and to light the left hand segments and the top & bottom segments also if Carry Out = 0.

Len

#### Attachments

• 7_segment_driver.gif
7 KB · Views: 7,915

#### k7elp60

##### Active Member
7 segment display

Another way to do the job would be to use 2 BCD counters 2 decoders and 2 displays.

#### ikelectro

##### Member
Here is an option for you to consider. It is based on my post of yesterday.

If I understand what you want correctly, it is to display (for example) 3 if the input number is 0011 or 13 if the number is 1101.

If you wish to display 03, then the circuit will need an inverter to invert the Carry Out signal such that the 2 right hand segments are always lit, and to light the left hand segments and the top & bottom segments also if Carry Out = 0.

Len

yes. your method trully great in that case.. can you tell me what to do in 8 bit binary to desplay in decimal in 7segment

#### ljcox

##### Well-Known Member
Here is a rough outline of how I would do it.

See if you can design the Control.

Let me know if you need more help.

Len

#### ikelectro

##### Member
Here is a rough outline of how I would do it.

See if you can design the Control.

Let me know if you need more help.

Len

the attachment is not working....
i need this file how you do 8bit binary to seven segment....

#### crutschow

##### Well-Known Member
Here's another thread on that subject which may help.

#### ljcox

##### Well-Known Member
the attachment is not working....
i need this file how you do 8bit binary to seven segment....
I could not find the original find the original files, but I found the basic circuit scribbled in a notebook.

Brief circuit description:-

Counters U1 & U2 are configured as an 8 bit binary count-down counter.

Counters U3, U4 & U5 are configured as a 3 digit BCD count-up counter.

Both are driven by the same oscillator.

When the control applies a brief pulse (on line A) to the PE inputs of all counters, the binary information at the parallel inputs of U1 & U2 is transferred into the counters.

The parallel inputs of U3 ~ 5 are connected to 0V therefore these counters are set to 0.

When A goes low, U1 & U2 start counting down and U3 ~ 5 start counting up.

When the binary counter reaches 0, Co goes low which stops the oscillator.

The BCD digits can be then taken from the outputs of U3 ~ 5.

Thus they can be displayed on 7-seg displays until the next cycle starts.

If you need more any help, just let me know.

#### Attachments

• 8 bit binary 2 BCD.gif
590.3 KB · Views: 4,843

#### ikelectro

##### Member
I could not find the original find the original files, but I found the basic circuit scribbled in a notebook.

Brief circuit description:-

Counters U1 & U2 are configured as an 8 bit binary count-down counter.

Counters U3, U4 & U5 are configured as a 3 digit BCD count-up counter.

Both are driven by the same oscillator.

When the control applies a brief pulse (on line A) to the PE inputs of all counters, the binary information at the parallel inputs of U1 & U2 is transferred into the counters.

The parallel inputs of U3 ~ 5 are connected to 0V therefore these counters are set to 0.

When A goes low, U1 & U2 start counting down and U3 ~ 5 start counting up.

When the binary counter reaches 0, Co goes low which stops the oscillator.

The BCD digits can be then taken from the outputs of U3 ~ 5.

Thus they can be displayed on 7-seg displays until the next cycle starts.

If you need more any help, just let me know.

Hi again,, I have done this with 4526 (binary down counter) and 4026 IC in last year with the help of ccurtis ... but the problem is i have to feed two different external clock..View attachment very help full decoder circuit new.png this is the circuit.... so the display always shows zero and then the real value binary in decimal...
in your previous circuit which is include the adder 74LS83.... here the 7 segment shows output without any delay... and does not need any external clock also.....If 8bit binary can be done with adder this kind or something like this which does not need external clock which result flickering at 7 segment.... thank you......

#### ljcox

##### Well-Known Member
I originally thought about using adders, but it was complex. I don't remember the details.

That is why I changed to the counter option.

The clock does not have to be external, a simple CMOS RC oscillator will suffice.

The seven segment display will not flicker if the counting is sufficiently fast.

For example, if the oscillator frequency was 200 kHz, then the counting period would be 1.28 milliseconds.

And if the refresh rate was say one second, then I doubt if any flickering would be noticed.

#### ikelectro

##### Member
I originally thought about using adders, but it was complex. I don't remember the details.

That is why I changed to the counter option.

The clock does not have to be external, a simple CMOS RC oscillator will suffice.

The seven segment display will not flicker if the counting is sufficiently fast.

For example, if the oscillator frequency was 200 kHz, then the counting period would be 1.28 milliseconds.

And if the refresh rate was say one second, then I doubt if any flickering would be noticed.
Ok sure I'll try this....
but again can you tell me the concept with adder, may be I can think about it myself.

#### ljcox

##### Well-Known Member
You're welcome.

The attachment below explains the basic method. To do this in hardware, you would need:-

Several adder ICs, at least 1 counter, a register of some kind to store the result of each subtraction, 2 latches to store the hundreds & tens digits, some gates (or tri-state buffers) to do the data steerage and a control circuit.

My recollection is you would use the two’s complement technique to do the subtractions.

So in essence, the procedure is to:-

1. subtract 100 successively until the result is negative and count the number of subtractions (except the last)
2. subtract 10 successively from the remainder until the result is negative and count the number of subtractions (except the last)
3. The remainder is the units digit.

I can’t think of any other (easier) method using adders.

#### Attachments

• Successive subtraction method.gif
252.7 KB · Views: 661

#### ikelectro

##### Member
I see it's hard work for me... but definitely I try to do that in bread board.
now Im thinking you 4029 circuit is the easy one!!!!!

#### ljcox

##### Well-Known Member
Yes, that's why I abandoned the adder method.

But, on the other hand, it would be an interesting exercise to design one.

If you draw up a circuit & post it, I may be able to make suggestions on possible improvements/simplifications.

Status
Not open for further replies.

Replies
32
Views
13K
Replies
3
Views
2K
Replies
9
Views
6K
Replies
0
Views
1K
Replies
2
Views
1K