Just tearing down an old Belkin USB KVM switch, and I just found something that has me scratching my head and thinking “Why the hell have they done that???”
The front panel has 2 buttons and 2 LEDs on it. The LEDs indicate which of the two channels is active. The panel is fed by 6 wires - +5V, ground, two for the buttons (very nicely with full hardware debouncing), and two for the LEDs.
Now, you’d expect the LEDs to just be fed directly by the 2 control lines, yes? Nope. For some reason they have decided to feed the two control lines into a 74HC139 dual 2-to-4 decoder. One control line is one of the “select” lines (A1), and the other the the enable (/G) line. The LEDs then are connected via a single resistor (yes, a single resistor, but then only one of them will ever be on at once) to +5V.
So you have 2 digital lines (coming from a PIC16 chip - DIP in a socket no less ) controlling 2 LEDs via a 2-to-4 decoder.
Any bright ideas why? It seems to me a completely pointless bit of circuitry…