CPLD state machine implemented, but not tested