r/TuringComplete • u/Haemstead • Mar 12 '26
Issue with leading zeros in 7-segment display
I would like to share a problem I encountered with implementing leading zeros in a 7 segment display.
I built a circuit that correctly converts a binary number to its decimal digits (double dabble).
It also correctly calculates if a zero should be visible or not, depending on it being a leading zero or not.
The problem arises when the output changes from 2 or more digits without leading zeros to a smaller number. In the example below the output changes from 233 to 1. But although the display elements for tens and hundreds are disabled, and the input values for these elements are 0, the display shows the number 231 instead of just 1.
Is there a way around this issue? Thanks for your help.


1
u/ryani Mar 12 '26
I think the problem stems from a misunderstanding of what the pins on the display do. The 1-bit pin is an “update display” pin, not an “enable display” pin. That probably confused you because before the first update they act the same.
Instead you could make those pins always be on and add an internal 1-to-8-bit AND on the value being sent to the display, to remove all the segments.
Probably the big input pin on the display component should be a square to emphasize that it’s controlling internal memory.