1. A finite-state machine comprising a combinatorial logic having input terminals for external input signals and output terminals for output signals generated by said combinatorial logic, said combinatorial logic assuming one of a plurality of states at a time; a state memory connected to said combinatorial logic so that said combinatorial logic receives signals indicative of a previous state of said combinatorial logic as input signals and said state memory receives and stores signals indicative of a present state of said combinatorial logic; means, connected to said combinatorial logic and to a reference level, for comparing said signals indicative of said present state of said combinatorial logic to set signals from said reference level, said reference level signals defining a boundary value between defined and undefined states in said finite-state machine, said comparing means setting an error signal when said finite-state machine is in an undefined state; and means connected to said comparing means for resetting said finite-state machine upon receiving said error signal.