As others, e.g. @angelatlarge, have mentioned, logic gates are typically voltage controlled. The mapping between voltage and logic varies quite a bit between families. If you look at, e.g., a 74HC04 data sheet:
you see in section 9 (Static characteristics) a lot of details on this. The key parameters there are V_IH, V_IL, V_OH, and V_OL. For the data sheet above, what this works out at V_CC=4.5V and 25C is:
- If the input voltage is smaller than 1.35V (Max of V_IL), the input is considered logical 0, so the output is logical 1 and the output voltage is guaranteed to be at least 3.98V (Min of V_OH) (though that depends on the current you draw).
- If the input voltage is larger than 3.15V (Min of V_IH), the input is considered logical 1, so the output is logical 0 and the output voltage is guaranteed to be at most 0.26V (Max of V_OL).
Note that these values are designed to provide a reasonable safety margin (Min of V_OH is larger than min of V_IH, and max of V_OL is smaller than max of V_IL), so you can depend on being able to hook up the output of one gate of this family to the input of another gate in the same family. These guarantees don’t necessarily hold between different families, though.