# Performing Arithmetic Operations with Locally Homogeneous Spiking Neural P Systems
## 3 An Locally Homogeneous Spiking Neural P System for Addition
### An LHSNP System with 1 Input Neuron for \(n\)-addition
Starting from \(t=1\) time slice, the spiking corresponding to \(n\)\(k\)-bit binary addends are received by \(\sigma_{in}\) in order from low to high. The spiking corresponding to the first binary addend is sequentially transmitted to \(\sigma_{Add}\) through \(\sigma_{aux_{3}}\) and the auxiliary neuron \(\sigma_{sumi}\) (\(0\leq i\leq k-1\)) in the summand cache module. The spiking corresponding to the \(2\)nd to \(n\)th addends is sequentially transmitted to \(\sigma_{Add}\) through \(\sigma_{add}\). The calculation process of \(\Pi_{Add3}\) is as follows:  
1. Input Assistance Module The input assistance module of \(\Pi_{Add3}\) is similar to \(\Pi_{Add2}\), and compared to \(\Pi_{Add2}\), \(\Pi_{Add3}\) has made the following improvements: (1) Add an auxiliary neuron \(\sigma_{aux_{3}}\). \(\sigma_{aux_{3}}\) and \(\sigma_{aux_{1,0}}\) connected to each other. And \(\sigma_{aux_{3}}\) is also connected to \(\sigma_{aux_{1,1}}\). \(\sigma_{aux_{3}}\) controls \(\sigma_{aux_{1,0}}\) and \(\sigma_{aux_{1,1}}\) to stop generating spiking. \(\sigma_{aux_{1,0}}\) send \(1\) spiking to \(\sigma_{aux_{1,1}}\) while also sending \(1\) spiking to \(\sigma_{aux_{3}}\). These spikings accumulate in \(\sigma_{aux_{3}}\) until the number of spiking reaches \((n-1)k\). When there are \((n-1)k\) spikings, \(\sigma_{aux_{3}}\) is fired and sends spiking to \(\sigma_{aux_{1,0}}\) and \(\sigma_{aux_{1,1}}\) to stop generating spiking output. (2) Add a connection between \(\sigma_{Add}\) and \(\sigma_{sum_{k-2}}\). \(\sigma_{Add}\) send the calculation results to both the environment and \(\sigma_{sum_{k-2}}\) for accumulate plus. (3) Add overflow monitoring neuron \(\sigma_{OF}\). If data overflow, \(\sigma_{OF}\) sends \(4\) spikings to some neurons in the system truncation spiking transmission. The aim is to stop the system. (4) Modify the conditions for firing \(\sigma_{aux_{4}}\). If the number of stacked spiking in \(\sigma_{aux_{4}}\) reaches \(k\), then firing \(\sigma_{aux_{4}}\) sends \(4\) spikings to \(\sigma_{Add}\) to mark the highest bit of the \(2\) addends in \(\sigma_{Add}\). (2) The First Addend Input The first addend is passed to \(\sigma_{Add}\) through the auxiliary neurons \(\sigma_{in}\), \(\sigma_{aux_{3}}\), and the addend cache module in order of binary bits from low to high. The process of inputting the first addend is as follows: (1) \(t=1\) to \(k\), the spiking corresponding to the first binary addend is received by \(\sigma_{in}\) in order from low to high. At each time slice, these spikings are transmitted sequentially along \(\sigma_{aux_{3}}\), \(\sigma_{sum_{k-1}}\), \(\sigma_{sum_{k-2}}\), \(\ldots\), \(\sigma_{sum_{0}}\). At the same time, \(\sigma_{add}\) also receives spikings from \(\sigma_{in}\) at each time slice. These spikings are consumed by rule \(a\to crlambda\) in \(\sigma_{add}\). In order to stop the first addend transmit through \(\sigma_{add}\). (2) \(t=k+1\) to \(k+2\), the addend cache module does not generate spiking output. At \(t=k+2\) time slice, the spiking corresponding to each bit of the first binary addend is sequentially stored in \(\sigma_{sum_{0}}\), \(\sigma_{sum_{1}}\), \(\ldots\), \(\sigma_{sum_{k-1}}\) from low to high. At the same time, \(\sigma_{aux_{3}}\) continues to receive spiking sent by \(\sigma_{in}\), \(\sigma_{aux_{2,0}}\), \(\sigma_{aux_{2,1}}\) until \((n-1)\)\(k+3\) time slice. And these spikings accumulate in \(\sigma_{aux_{3}}\). (3) \(t=k+3\) to \(2k+2\), the spiking corresponding to the first binary addend is sequentially received by \(\sigma_{Add}\). At \(t=2k+2\) time slice, the spiking corresponding to the highest bit of the first addend is received by \(\sigma_{Add}\). (3) The \(2\)nd to \(n\)th Addend InputThe spiking corresponding to the second to nth binary addends are received by \(\sigma_{in}\) in order from low to high. And these spikings are transmitted to \(\sigma_{Add}\) through \(\sigma_{addend}\). The process of inputting the 2 nd to \(n\)th addends is as follows:  
1.