# Spiking Neural P Systems for Basic Arithmetic Operations
## 1 Introduction
In [29], the author encoded the number as spike sequences and designed an operation model based on SNPS to realize the addition and subtraction of two natural numbers, the multiplication of a fixed multiplicand, an arbitrary multiplier, and judging whether two numbers are equal. The SNPS operation model designed in [30] can solve the product of any two natural numbers with a binary bit length of k bits, and can solve the summation problem of n natural numbers. In [31], simple arithmetic problems were addressed using the spiking neural p system, including binary complement conversion, addition and subtraction of signed integers, and multiplication of any two natural numbers. The motivation of the present study is to design arithmetic SNPS that are fast and contain fewer neurons and rule types. We encoded numbers as spike sequences and utilized a single input neuron and a single output neuron to design a complete set of addition, subtraction, multiplication, and division operations in SNPS based on extended rules. We analyzed the number of neurons, types of rules, and required time slices for each system. The main contributions of this paper include:  
(1) Designing the SNPS \(\mathbf{\Pi_{BASNP}}\) for k-bit binary addition. The system can complete the addition of two k-bit binary numbers in 2k + 4 time slices using k + 8 neurons, three types of instantaneous firing rules, and three types of forgetting rules. (2) Designing the SNPS \(\mathbf{\Pi_{BSSNP}}\) for k-bit binary subtraction. The system can complete the subtraction of two k-bit binary numbers in 2k + 3 time slices using k + 13 neurons, seven types of instantaneous firing rules, and four types of forgetting rules. (3) Designing the SNPS \(\mathbf{\Pi_{BMSNP}}\) for k-bit binary multiplication. The system can complete the multiplication of two k-bit binary numbers in 3k + 5 time slices using 3k + 8 neurons, five types of instantaneous firing rules, and four types of forgetting rules. (4) Designing the SNPS \(\mathbf{\Pi_{BDSNP}}\) for k-bit binary division. The system can complete the division of two k-bit binary numbers in 2k + quotient + 4 time slices using 5k + 12 neurons, sixteen types of instantaneous firing rules, and thirteen types of forgetting rules. Based on instance-based analysis, the effectiveness of the four SNPS designed in this paper is verified. The rest of the paper is organized as follows. Section 2 briefly introduces the basic knowledge and related research on SNPS, Section 3 presents the designed addition, subtraction, multiplication, and division SNPS and instance analysis, and Section 4 summarizes and analyzes various known arithmetic SNPS from multiple dimensions. Finally, Section 5 summarizes the whole work. The SNP operation model proposed in this paper uniformly uses a single input and output neuron, and a new way of input data construction was constructed. In the addition and multiplication computational models we constructed, we reduce the number of neurons used compared to the addition and multiplication proposed in [30]. Based on multiple subtraction operations, in this we paper achieve the division of any two natural numbers, and the running time of this division model is positively correlated with the size of the quotient.