AVGresponding's circuit will work, but the gates are probably not necessary. Assuming these are modern low power indicator LEDs, you typically need 1mA or less to get adequate brightness, so if you have an MCU with 128 GPIOs available, you can just run one GPIO to each end of each LED and skip the gates altogether*. Likewise if you're using IO expanders, you'll need 128 pins either way, so the gates don't really offer any benefit here.
You can get the same results using only 65 GPIO lines. I don't have any red/yellow bipolar LEDs in my library, but the basic idea is attached.
If you have GPIO pins that can tristate (IE, you are connecting directly to an MCU), set the LED GPIO lines low for red, high for blue, or set them to inputs to turn an LED off, and then toggle the
Blue and
#Red line between high and low (you can tie them together in this case). The red LEDs will be on when
Blue/#Red are low, and the blue LEDs will be on when those lines are high. Toggle fast enough, and the eye won't notice the change, it will look like both are on at the same time.
If you cannot tristate the GPIO lines (IE, if you're using shift registers or whatever to drive the LEDs), then you'll need to toggle between these states:
- set
Blue/#Red high and each LED GPIO high for blue, and low for off/red (blue LEDs will be on, all others off)
- set
Blue/#Red low and each LED GPIO low for red, and low for off/blue (red LEDs will be on, all others off)
Ideally you would change the states of all of the control lines at the same time, which is pretty easy with a chain of shift registers. If you aren't able to do that, then you might need to incorporate an 'off' state in between the red and blue to ensure that no LEDs light up during the transition.
* Note that if you were to turn all 64 LEDs on at once the total current might exceed the maximum current rating for the MCU's power pins, in which case using gates would help. But for only 6 LEDs at a time that shouldn't be a concern with indicator LEDs run at reasonable current. If you're using IO expanders, then there isn't really a concern.