Understanding how a tristate buffer works (74LS241)
A tristrate output can have 3 different states: low, high, or disconnected (also sometimes called 'floating', 'high-z'). In the first two instances the output is actively pulled low or high using a transistor; in the disconnected state, neither transistor is activated. 

Pins 1 and 19 of the LS241 control this state for the buffers inside the chip. These 'G' inputs must be activated in order to have the buffers connected to them pull their outputs low or high, depeding on their input. Without it, the outputs float. Note the invertor symbol (tiny o ring) at the control gate connected to pin 1; you must pull pin 19 high to activate, and pin 1 low to activate.

This circuit will help:







simulate this circuit &ndash; Schematic created using CircuitLab

If you pull pin 19 down, the output will float and both LEDs will glow dimly because current is passing through both of them. Pull pin 19 high, and the output will follow the input (17) and either the green or the red LED will glow brightly; the other one will be off.