The correspondence between deterministic and stochastic digital neurons: analysis and methodology