Hint for
@Ash You can use CMOS Schmitt triggers when you don't need precision thresholds. That saves on component count/complexity significantly.
Typical chips: 74HC14 (in 5V logic), 4093, 40106, 4584
CD4093 is 2-input NAND, so it can perform some useful logic functions at the same time.