A Complex Programmable Logic Device (CPLD) is a great piece of hardware to have in your repertoire. As its name implies, you can program these chips to serve the logic functions you need.
The CPLD is electrically erasable meaning you can ... making it ideal for small and medium size application. Build along and have fun!