Introduction

Mathematics initially developed from counting abstract quantities. Our early ancestors recognized and learned how to do elementary arithmetic, addition and subtraction, by counting objects. Abacus, a counting frame, used to be a helpful tool to perform some complex calculations other than counting. For example, the Chinese abacus, also known as suanpan, is capable of doing both decimal and hexadecimal computations, including multiplication, division, square root and cube root operations and fractional arithmetic (Supplementary Figure S1) as well. Some basic algorithms, such as the “Chinese division table”, were developed to make the calculation accurate and efficient. Abacus is barely used nowadays as people can do computations in a computer program. Nevertheless, its counting based principle is valuable for designing some new concept computation. For instance, some electronic circuits mimicking the Chinese abacus have been designed to achieve fast CMOS adders/multipliers operating1. However, this approach requires different circuits for sum and multiplication operations. Furthermore, the binary-to-abacus conversion is needed since such computation still relies on the digital computers. A non-binary computation built upon new concept computers is still a challenge for the computer science and technology.

New concept computers have long been sought because the current computers based on the von Neumann paradigm are not brain-like. On the one hand, they do computing in a binary and digital manner. Computation is performed on data that are encoded using binary-coded decimal. Such encoding could not exactly represent decimal fractions, making it unsuitable especially for the human-centric applications2. On the other hand, the computers generally consist of central processing units, memories and the “von Neumann bottleneck” connecting them3,4. This configuration of separated computing and memory results in the fact that the von Neumann computers are incapable of processing information the way the brain does. The brain allows the integration of computing and learning in neurons owing to the activity-dependent synaptic plasticity. To achieve a kind of synapse-like electronic device is therefore essential to develop neuromorphic circuits towards the level of the brain5,6,7.

Recently, memristive devices with inherent learning abilities have been demonstrated to construct the electronic synapses6,7,8,9,10,11,12,13,14. The synaptic learning is achieved by means of remembering the history of repeated electrical inputs applied to the device. The positive (negative) signals potentiate (depress) the conductance, i.e. the memristive long-term potential, LTP (long-term depression, LTD). By detecting the change in synaptic weight (SW) or conductance6,14, the quantity of the input signals can be “counted”15, which makes it possible to achieve the functions of abacus and hence the counting based computations. In this work, we report a kind of memristive abacus based on Ag-Ge-Se (AGS) electrolytes and take as an example to show how to calculate decimal fractions in such “proof-of-concept” devices in the light of the abacus algorithms.

Results

in situ TEM observations

Before implementing the abacus computation, we need to make clear how such device is capable of mimicking LTP and LTD, since our approach is based on these memristive synaptic responses. The formation of conductive pathways caused by a chemically driven phase transformation is responsible for the memory in physical systems of both transition metal oxides (like TiO2) and solid electrolytes (like AGS). It has been revealed recently that the high concentration of oxygen vacancies in TiO2 matrix will lead to the thermodynamically favored Magnéli phases constructing the conductive nanofilaments16,17. Similarly, our earlier studies showed that the supersaturation of Ag ions in glassy AGS matrix induces the precipitation of conductive Ag2Se phases18,19. However, the memristive process is itself a dynamic one. The conductive nanostructures evolve dynamically under applied biases20,21. Although direct identifications were provided via transmission electron microscopy (TEM) characterization to show the outcome of such chemically driven phase transformations16,17,18, the knowledge of the dynamic phase change remains insufficient yet.

In this work, the dynamic evolution of conductive phases in AGS is studied via in situ TEM technique. The fabrication of electrode/film/electrode structure is a key step in preparing the samples for in situ TEM observations20,21. To reduce the steps of fabricating electrodes and make the sample preparation simpler, we herein develop a method to prepare our TEM samples. The glassy AGS samples used for TEM observations were deposited via pulsed laser deposition technique. AGS films of 100 nm thick were grown on well-polished NaCl single crystal substrates at room temperature. Then we put these as-grown samples into de-ionized water to dissolve NaCl substrates and carefully dredged up the AGS films using copper grids. This keeps the AGS samples away from those unwanted damages by ion milling or focused ion beam (FIB) cutting because AGS are unstable against these treatments. The copper girds were cut in half, insuring some part of AGS film being exposed outside for the following electrical contact. The rest of the film is still on the copper girds, where the grids were grounded as an inert electrode. The prepared samples were then equipped on a STM-TEM sample holder that supplies an Ag tip as active electrode and connects a controller with Nanofactory's data acquisition software, as schematically depicted in Figure 1a . Biases are applied on this Ag tip for the in situ observations. The time dependent conduction data corresponding to the microstructural evolution are recorded and shown in Supplementary Figure S2.

Figure 1
figure 1

Structural evolution caused by the chemically driven phase transformation.

(a), Schematic of the in situ experimental set-up. (b–j), TEM images showing the growth of dendrites. k, SAED pattern demonstrating the dendrites composed of orthorhombic Ag2Se. Schematics of the growth of the dendrites are shown in Supplementary Figure S3.

The movable holder is driven carefully toward the Ag tip till the tip contacts the AGS film. This whole contacting process is monitored via TEM. The final contact structure of the grid/AGS/Ag tip is shown in Figure 1b . Most part of the sample is flat and homogeneous except for some wrinkles near the grid. The as-prepared AGS is initially in its amorphous state, as confirmed by the selected area electron diffraction (SAED) pattern (the inset of Figure 1b ). Then a positive bias of 0.5 V is applied onto the Ag tip to trigger the oxidation of Ag. Here a small bias and a wide span of 600 nm between the tip and grid are just for the slow down of the memristive transition, which facilitates us to capture the detailed structural evolution.

On loading the bias, the active Ag electrode is electrochemically oxidized. The growth of conductive pathways takes place as Ag+ ions keep injecting into the electrolyte. The whole process was recorded and summarized in Figures 1c to 1j . However, this AGS device does not work the way that other electrolytic devices (like Ag2S) do. The conductive dendrites grow in opposite directions. The growth of the filament has been reported to be limited by the cation transport process21. In those electrolytic devices with high cation mobility, Ag dendrites should grow from the cathode toward the Ag electrode because Ag+ ions reach the cathode and become reduced there in the light of the conventional electrochemical metallization theory21,22,23. But Figures 1c and 1d indicate that the nucleation of dendrites in AGS electrolyte starts from Ag electrode, as marked by the yellow circles, which is unexpected in previous studies21. Further, it is Ag2Se precipitate not Ag reduction product that composes the conductive dendrite. The SAED pattern of the dendrite is shown in Figure 1k , which identifies the dendrite is composed of orthorhombic Ag2Se with symmetry of P212121 (19). Corresponding (), () and () lattice constants are calculated to be 0.225, 0.242 and 0.261 nm, respectively.

Now that Ag species still exist in the form of Ag+ ions in the Ag2Se dendrites, no reduction reaction is necessary for the growth. That is why the new phase is able to nucleate near the anode, which is attributed to the chemically driven precipitation reaction. Once the ionized Ag+ ions dissolve into the AGS matrix from the anode, they prefer to build a supersaturation of Ag there. The increasing injection of Ag+ ions spontaneously raises the total free energy and brings the system to the instability threshold. According to Henry's law and regular solid solution model18, the unstable system tends to decompose forming precipitates to lower the free energy. The phase diagram of AGS system points out that the local Ag supersaturation will lead to the precipitation transformation24. Ag2Se precipitates that are thermodynamically favored nucleate at this stage ( Figures 1c and 1d ). The continuous supplement of Ag+ ions from the Ag electrode maintains the Ag supersaturation in the matrix that is driving the nucleation in untransformed region. The growth of these precipitates takes place and forms the dendrite obeying the kinetics of coarsening and growth25. The dendrite frontier advances divergently like a “firework”, as shown in Figures 1e to 1g . Multiple dendrites are also observed in Figures 1g to 1j . Another dendrite grows beside the first one and the networking of these dendrites is formed as shown in Figure 1j .

The dendrites stay stable there unless a reversed bias is applied to the Ag tip. Ag electrode then turns to cathode as -0.5 V is loaded. The reduction of Ag+ ions occurs and depresses the Ag saturation in the matrix. The total free energy increases because the Ag gradient across the interface between Ag2Se regions and matrix gives rise to an additional gradient energy25. This additional energy that drives the precipitates dissolve back into the matrix depends on the composition gradient. The larger the gradient, the higher the energy25. As more Ag+ ions are reduced from the system, the initial equilibrium is sooner or later destroyed. The dendrites begin to dissolve from their roots at the Ag electrode, as shown in Figure 2a . Then the dissolution spreads to the other parts of the dendrites as the reduction continues ( Figures 2b and 2c ). However, the kinetics of reactions determines that this driving force is not enough to completely dissolve the Ag2Se precipitates. There would be residual precipitates when the system reaches a kinetic equilibrium. This is confirmed by the TEM results. Some residues exist in the matrix, which leaves a “cerebral cortex” like feature after the bias is removed. HRTEM image ( Figure 2d ) and its corresponding fast Fourier transformation (FFT) pattern (the inset of Figure 2d ) identify such dark imaging residue as orthorhombic Ag2Se with symmetry of P212121 (19), consistent with the SAED results shown in Figure 1k .

Figure 2
figure 2

The dissolution of Ag2Se dendrites during long-term depression.

(a–c), TEM images revealing the dissolution of dendrites starts from the root and then spreads to the other parts. The images demonstrate some residues exist in the matrix. (d), HRTEM image and the corresponding FFT pattern (the inset of (d)) identifying the residues are orthorhombic Ag2Se. Schematics of the dissolution of the dendrites are shown in Supplementary Figure S3.

These residual Ag2Se precipitates provide embryos for the subsequent dendritic growth once the positive bias (0.5 V) is loaded again, as summarized in Figures 3a to 3d . The growth starts from the Ag electrode, similar to the foregoing case. At the same time, some crystals also grow inside the matrix far from the electrode, as marked by the red circles in Figures 3a to 3d . This is because some nuclei are already there and would grow locally driven by the increasing Ag concentration in the system, in accordance with our previous Monte Carlo simulation19.

Figure 3
figure 3

Re-growth of Ag2Se dendrites in a subsequent electrical cycle.

(a–d), TEM images showing the residual precipitates act as embryos for the growth.

Calibration of the memristive abacus

It is known that the orthorhombic Ag2Se exhibits high electrical conductivity at room temperature26. According to the time dependent transformation, the application of positive voltage signals forms the conductive Ag2Se precipitates and thus increases the conductance19, while the application of negative signals decreases the conductance by rupturing the conductive dendrites. These LTP and LTD functions enable us to perform the abacus computations based on the change in SW, where no calculation dependent threshold is required to be defined15. Here, addition and subtraction are first implemented to calibrate the computation. On the one hand, the abacus operations, like “replace”, are actually based on addition and subtraction. On the other hand, the requirements of AA = 0 and A + B = B + A should be met to guarantee the calculation functional.

The calibration is carried out according to the following route. First, the quantity of the input pulses is “counted” by testing the resultant ΔSW, where ΔSW is the percentage change in conduction with respect to the initial value. For example, in Figure 4a , a train of 12 consecutive positive pluses (amplitude of +0.05 V and duration of 0.1 s) generates the ΔSW of 3.7%. So, the number 12 will be read if ΔSW is 3.7% in the subsequent calculation. Of course, a ΔSW of 0% refers to the number 0. The numbers from 0 to 12 are accordingly indexed. The more positive pluses applied, the larger number indexed. These ΔSW values can be sensed by employing the memristor-synapse circuit for a practical device6,14. According to the principle of phase transformation, each memristive abacus would have a restriction on the affordable number in the calculation for given pulse parameters. Accordingly, it requires additional circuit to cascade multiple calculating cells and convert the data when dealing with a larger number, similar to the use of a series of abacus. Second, we do the subtraction (12 − 12). A train of 12 consecutive negative pluses (−0.15 V height and 0.1 s width) is loaded to depress the SW. AA = 0 is realized as the final ΔSW is 0% as verified in Figure 4b , although there are fluctuations during the nonlinear LTD process. Then, the commutative addition is implemented. Two sets of input signals are applied in different order. All the pulses are the same with those used in Figure 4a . After loading a train of 9 consecutive positive pluses, a ΔSW of 3.2% (number 9) is detected. Another series of 3 pulses is then applied on the basis of 9. The resultant ΔSW starts from 3.2% and is finally up to 3.7% (i.e. number 12), confirming 9 +3 = 12, as indicated in Figure 4c . We also reverse the order of input 3 and 9 to check whether this computation follows the commutative law. Similarly, Figure 4d demonstrates the value of 3 + 9 is also 3.7% (12), i.e. A + B = B + A.

Figure 4
figure 4

Calibration of memristive abacus.

(a–b), Demonstration of AA = 0. Here, ΔSW of 3.7% (number 12) is achieved after loading a train of 12 consecutive positive pluses (amplitude of +0.05 V and duration of 0.1 s). The subtraction 12 − 12 is implemented by using another train of 12 consecutive negative pluses (−0.15 V height and 0.1 s width). The resulting ΔSW is 0%, verifying 12 − 12 = 0. (c−d), Confirmation of commutative addition by changing the order of input 3 and 9. Here, the pulses are identical to those described in (a).

Discussion

Division of integers can be done using successive subtraction, but such treatment just results in the answer of quotient and remainder. Decimal fractions cannot be calculated directly by this approach, much less recurring decimal. For example, we have the result of 1 remainder 1 for , but it is impossible to obtain 1.25 just using 5 − 4. Furthermore, it is unable to do division by successive subtraction if the dividend is smaller than the divisor.

Things are different if such division is implemented in the light of the abacus algorithms. The Chinese abacus algorithms suggest that division can be done by combining subtraction and addition, where the moves like “replace” are required. Accordingly, complex external circuitry should be necessary to implement the “replace” operations during the division. Several rules should be clarified before the calculation. First, subtraction will continue unless the remainder is smaller than the divisor (by comparing the resultant ΔSW). Second, the quotient is obtained according to the number of the times that subtraction is performed. For , if ABB is smaller than B, then the subtraction stops and the quotient will be 2. Third, given that the remainder (r) is smaller than the divisor, addition is required to operate the “replace”. Considering the decimal system, the remainder should be replaced by r × 10. To achieve this replacement, a multiple of 9 (r × 9) is added, i.e. r +r × 9. Then successive subtraction can be implemented again. Fourth, every time the “replace” operation is carried out, the decimal fraction is getting ten times smaller, e.g. from tenths to hundredths. Fifth, once the remainder equals 0 the computation is fulfilled.

Here we take as the example to show the approach. Following the method shown in Figure 4 , after the device is reset to 0, a train of 5 positive pluses is applied to obtain the dividend 5, as indicated by the blue columns in Figure 5 . Then we calculate 5 − 4 using a train of 4 negative pluses (orange columns in Figure 5 ), which leaves 1 as the remainder. The subtraction cannot be carried out again as 1 < 4 and the integer quotient is thus 1. So, a “replace” operation is required to continue the computation. We apply a train of 9 positive pulses (1 × 9) to replace the remainder 1, i.e. 1 + 1 × 9 = 10. The subtraction of 10 − 4 − 4 is performed until the remainder 2 is smaller than 4 once again, resulting in a new quotient of 2. We obtain the first number to the right of the decimal point, i.e. 2 tenths. Then the replacement has to be done for a second time, leading to the hundredths position. For this situation, two trains of 9 positive pulses (i.e. 2 × 9) are used to replace remainder 2 by 20 (2 + 9 + 9). After that, we repeat the above subtraction (−4) for 5 times until the remainder becomes 0, as confirmed by the last ΔSW of 0% in Figure 5 . Accordingly, 5 is the number at hundredths position and a decimal fraction 1.25 is thus calculated. The statistical data of is provided in Supplementary Figure S4 to show the repeatability of this abacus approach.

Figure 5
figure 5

Calculation of in the light of the abacus algorithms.

The calculating route: +5 − 4 + 1 × 9 − 4 − 4 + 2 × 9 − 4 − 4 − 4 − 4 − 4.

The approach presented herein can be adopted to calculate the decimal fraction smaller than one, recurring decimal (e.g. ) and so on. It is possible to do decimal arithmetic in memristive devices without encoding binary-coded decimal. This kind of memristive abacus can provide new insight into the development of the intelligent computing beyond the binary paradigm. This memristive approach, however, is at a “proof-of-concept” stage, which makes reliability assessment premature, because it is a challenge to completely solve the fluctuations in memristive synaptic responses at this stage6,14. Our hope is that the presented prototype will stimulate more systematic studies focusing on memristive computations. It is still a long way to accomplish the intelligent computing beyond the “proof-of-concept” stage. Many obstacles, for instance, the integration of MOSFETs/memristors circuits to improve the signal-to-noise ratio and transfer IMP states, are waiting to be solved. In addition, the in situ TEM observations suggest that the memristive LTP and LTD in many physical systems can be understood in the light of the kinetics of chemically driven phase transformation27.

Methods

For in situ TEM observations, AGS films of 100 nm were deposited onto NaCl single crystal substrates by pulsed laser deposition (PLD) technique using a KrF excimer laser (COMPex, Lambda Physik, 248 nm in wavelength, 30 ns in pulse width) at room temperature. The ternary alloy with a composition of Ag30Ge17Se53 used as the target for PLD was prepared by cold crucible levitation melting in high vacuum. Energy dispersive x-ray spectroscopy analysis showed that the deposited films are of nearly the same composition as the target. The investigations on the time dependent transformation were performed with a Tecnai 20 TEM operated at 200 kV.

The device we used to do calculations consists of Ag as the reactive electrode and Pt as the inert electrode and a thin AGS film, as schematically illustrated in Supplementary Figure S5. The AGS films were also derived by PLD, where the deposition condition is exactly the same with that for the TEM samples. Before depositing AGS films, the Pt/Ti/Si substrates were coated with an amorphous SiO2 insulating layer. Circular through holes with a diameter of 1 μm were then drilled in the SiO2 layer by using FIB technique (FEI Strata FIB201), which allows the AGS film to contact the bottom Pt electrode. After the deposition of AGS film, Ag reactive electrodes were deposited by magnetron sputtering technique through the shadow mask with a diameter of 0.2 mm at room temperature. The electrical measurements were performed by employing a Keithley 2400 source-measure unit.