# Spiking Neural P Systems for Basic Arithmetic Operations
## 2 Related Research
### Research on Arithmetic Operation of SNP  
Arithmetic operations are the basis for solving other complex problems and have always been a focus of SNPS research. In [28], the authors encoded the number as the time interval between two spikes to construct four SNP systems for calculating addition, subtraction, multiplication, and division. The number of neurons used was 10, 12, 22, and 24, respectively, and there were 4, 4, 12, and 15 rule types, respectively. In [29], numbers were coded into spike sequences and realized in three parts: the addition and subtraction of two natural numbers, the multiplication of fixed multiplicands and arbitrary multipliers, and the judgment of whether two numbers were equal. In this operation model, the addition of two natural numbers used three neurons and three rule types, subtraction used 1 ten neurons and six rule types, and multiplication used thirteen neurons and three rule types. In particular, the multiplier was fixed at 26 and used three neurons and two rule types to judge whether two numbers are equal. This article raised the open problem of how to design SNPS to solve the multiplication of two arbitrary natural numbers. In [30], the authors better answered the question about multiplication proposed by [29]. The designed operation model can solve the product of any two natural numbers of k-bit length binary digits (using k\({}^{2}\) + 5k + 3 neurons and ten rule types while taking 4k + 2 time slices) and designed an operation model that can solve the sum of n natural numbers (using 3k + 5 neurons and nine rule types). In [31], simple arithmetic problems were addressed using SNPS, including binary complement conversion (using six neurons and four rule types), addition and subtraction of signed integers (using seven neurons and six rule types), and the multiplication of any two natural numbers (using k\({}^{2}/2+15k/2+4\) neurons and six rule types). The operation of signed numbers in [31] was realized based on the sign bit and complement, and the subtraction operation was realized by adding the opposite number of the addend. In [28; 29; 31], the system had multiple input neurons, while in [30] there was only a single input neuron. In the SNP system mentioned above, the rules in neurons are all executed within one time slice. However, the time required for different biological operations is different as well. In [34], the authors introduced an SNP system with no time limit. This system's rule execution is time-independent and always produces the same result, and it was proven that a time-free SNP system with extended rules is Turing-complete. In [35], the authors studied and designed an adder, subtractor, multiplier, and divider based on the non-time-limited SNP system proposed in [34] using 2, 2, 11, and 10 neurons and 2, 6, 15, and 16 rule types, respectively. In [36], the authors designed the adder and multiplier of the SNPS with rules and weights using 2k + 4, 5k neurons and 13, k + 14 rule types, respectively. Based on the SNPS with anti-spikes introduced in [27], the authors of [37] considered the design of general-purpose AND gates, OR gates, and NOT gates for symmetric ternary systems. The three states correspond well to the 1, 0, and \(-1\) of the symmetric ternary system, which could effectively solve the representation and operation of negative integers. In [37], the authors realized the addition and subtraction of signed integers with an anti-spike neural p system.  
In this paper, we only deal with arithmetical operations between natural numbers. For example, when a natural number \(n\) is represented in Formula (2), we obtain the corresponding binary string \(b_{k-1}.\ldots.\ldots b_{1}b_{0}\), where \(b_{0}\) is the least significant bit, \(b_{k-1}\) is the most significant bit, and \(2^{i}\) is the order of \(2^{i}\), with \(0\leq i\leq k-1\).  
\[n=b_{k-1}2^{k-1}+\ldots.\ldots+b_{1}2^{1}+b_{0}2^{0},\quad 0\leq b_{i}\leq 1, \,0\leq i\leq k-1 \tag{2}\]