Finite state machine design for high accurate stochastic computing