An output/state encoding for self-checking finite state machine