Setup (not strictly necessary to answering the problem; supplied for the curious): I have a single logic output pin from a device, logic 0 = 0 V, logic 1 = pulled high to Vcc through a 10 kΩ resistor. I want to use a bicolor common cathode LED to indicate its state: logic 0 = green LED on, red LED off; logic 1 = green LED off, red LED on. I could accomplish that alone easily enough (in fact, it's just a driver for the red LED, and an inverter/driver for the green one).
The complication is that I want both LEDs off if the input is disconnected from the device's GPIO pin, i.e., I want green to indicate only "true 0" and red to indicate only "true 1".
So the desired truth table is (Z = input disconnected from device):
in G R
------
0 1 0
1 0 1
Z 0 0
Anything I can think of tries to pull the input both high and low to accomplish the "default" state; of course, it's not possible to do both at the same time. A solution with a couple of transistors would be best, but I'm not opposed to something more involved.