A two-terminal stochastic switch is disclosed. The switch includes a magnetic tunnel junction (MTJ) stack, an access switch controlled by a first terminal and coupled to the MTJ stack, such that when the access switch is on, electrical current flows from a first source coupled to the MTJ stack, through the MTJ stack, and through the access switch to a second source, and a digital buffer coupled to the MTJ stack and the access switch which is configured to transform an analog signal associated with a voltage division across the MTJ stack and the access switch to a digital signal, output of the digital buffer forming a second terminal.
展开▼