Stochastic logic. (a) A buffer (or an identity gate). (b) An inverter. (c) An AND gate. (d) An OR gate. (e) An XOR gate. (f) A multiplexer. Stochastic logic performs a probabilistic analysis by encoding probabilities into random binary bit streams as a proportional number of bits, for example, the mean number of 1’s in a binary sequence.