# Stochastic Computing in a Single Device

## Randomness makes some computations simpler. Now it can be done in a single MRAM-like device

Researchers at the University of Minnesota say they’ve made a big leap in a strange but growing field of computing. Called stochastic computing, the method uses random bits to calculate via simpler circuits, at lower power, and with greater tolerance for errors. Though it was first conceived in the 1960s, one of the things holding stochastic computing back was the lack of suitable devices to make it practical.

At the 2017 IEEE International Electron Devices Meeting last month in San Francisco, electrical engineering professor Jian Ping Wang and his Ph.D. student Yang Lv reported that they’d built just such a device. Their device, similar to an MRAM memory cell, can perform the stochastic computing versions of both addition and multiplication on four logical inputs.

An MRAM cell is basically a nanoscale two-terminal device called a magnetic tunnel junction. Like many devices, it fundamentally has a sandwich structure: ferromagnetic layer, non-ferromagnetic layer, ferromagnetic layer. The orientation of the magnetizations in the top and bottom layers is what’s key. If they have the same orientation, current can tunnel from one to the other with little resistance. If their magnetizations point in opposite directions, the resistance becomes huge. MRAM can store data because one of the magnetic layers can have its field flipped using a certain type of current. However, when writing data into a cell, there is a chance that the cell will not switch to the desired orientation. This is a problem when these devices are used as memory.

Instead of suppressing this random aspect of the magnetic tunnel junction’s nature, Wang and Lv put it to use. They designed a cell that produces random strings of bits that carry and compute information.

Previous incarnations of stochastic computing would use such a device as a random number generator whose bits would then be fed into a set of stochastic logic circuits. In such a system, values would be represented as probabilities—4 would be represented by a seemingly random string of, say, 100 bits, of which about 40 would be 1s. It’s easy to see that stochastic computing would be relatively immune to simple errors, where a bit or two gets flipped, because it would hardly make a difference. But it also makes some calculations less complex. Multiplying two numbers, for example, can simply be done with a single AND gate.

“So far, most stochastic computing proposals involving novel spintronic devices are to use spintronic devices as random generators but still use conventional logic gates as the computation part,” says Wang. “We pursued implementing the random generation and computation functions in one single MTJ cell.”

They demonstrated that the tunnel junction’s randomness could be tuned by four independent values: the amplitude and width of a pulse of current fed into the junction, a bias current running through the junction, and a biasing magnetic field. Stochastic data can easily be converted to any of these with some simple circuitry. When Wang and Lv did that, they found that the device summed whatever values were input as pulse amplitude, bias current, and the bias magnetic field. The result of that triple summation was then multiplied by the value represented by the pulse width to produce an answer in the stochastic computing form—a string of random bits with a particular probability of 1s occurring.

They built and tested magnetic tunnel junction stochastic computing units in their lab, but to really see what they can do, they’re partnering with the chipmaker GlobalFoundries. The company has a commercial process for making embedded MRAM in microprocessors and other chips, and Wang hopes they can find a practical way for that memory to do computation as well.  “What we’ve done here, in principle, GlobalFoundries could fabricate in near future,” he says.

The University of Minnesota’s demonstration of a single magnetic tunnel junction stochastic computing unit is one in a wave of recent research looking to utilize the inherent random activity of nanoscale devices to compute in new ways. Engineers at Purdue University and the University of California, Berkeley, proposed using a thermally unstable magnetic tunnel junction combined with a transistor to form what they called a p-bit, which has the odd ability to allow logic circuits to run both forward and backward. Scientists in Osaka used the tunable randomness in the connections among carbon nanotubes to enhance sensing and believe it could aid computing as well. And researchers at Hewlett-Packard Laboratories demonstrated that a particular type of memristor demonstrates a kind of controlled chaotic behavior. When they simulated a network of these so-called analog compute engines, the chaos helped speed the solution of a traveling salesman problem.