# 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 2 Numbers Addition
Addend Input The spiking corresponding to the addend is sorted in order from low to high received by \(\sigma_{in}\). These spikings pass through \(\sigma_{addend}\) transferred to \(\sigma_{Add}\). Due to the fact that the spiking output to the environment during the time slice \(t=16\) to 18 is all 0, the spiking situation in the system during this time period is omitted from Table 1. 1. \(t=1\) to 10, there is no spiking output in \(\sigma_{addend}\). 2. \(t=9\) to 16, the corresponding spiking 0, 1, 1, 0, 0, 0, 0, 0, 0, 0 of the addend from low to high are sequentially represented received by \(\sigma_{in}\). These spikings through \(\sigma_{addend}\) transferred to \(\sigma_{Add}\). At \(t=9\) time slice, the spiking 0 corresponding to the lowest bit of the addend is received by \(\sigma_{in}\). At \(t=16\) time slice, the spiking 0 corresponding to the highest bit of the addend is received by \(\sigma_{in}\). 3. \(t=10\) to 17, there are 2, 3, 3, 2, 2, 2, 2, 2, 2 spikings in \(\sigma_{addend}\) at each time slice. These spikings come from \(\sigma_{aux_{2}}\), \(\sigma_{aux_{2},1}\), and \(\sigma_{in}\). During the time slice t = 10 to 17, \(\sigma_{aux_{3}}\) receives spikings sent by \(\sigma_{aux_{2}}\), \(\sigma_{aux_{2},1}\) and \(\sigma_{in}\) at each time slice. At \(t=17\) time slice, there are 18 spikings stacked in \(\sigma_{aux_{3}}\). 4. \(t=11\) to 18, the spiking in \(\sigma_{sum_{7}}\), \(\sigma_{sum_{6}}\), \(\ldots\), \(\sigma_{sum_{0}}\) are sequentially cleared. 5. Overflow Monitoring 1. \(t=0\) to 9, there is no spiking input in \(\sigma_{aux_{4}}\). 2. \(t=10\) to 18, \(\sigma_{aux_{4}}\) receives 1 spiking sent by \(\sigma_{aux_{2,3}}\) at each time slice. And stack these spiking in \(\sigma_{aux_{4}}\). At \(t=18\) time slice, 9 spikings stacked in \(\sigma_{aux_{4}}\). 3. At \(t=19\) time slice, \(\sigma_{aux_{4}}\) sends 4 spikings after using rule \(a^{9}\to a^{4}\) to \(\sigma_{Add}\). At this point, the highest bit of the two addends have been calculated and no carry has been generated. There are 4 spikings in \(\sigma_{Add}\), no rules can be use, and there is no data overflow. At the same time, \(\sigma_{aux_{4}}\) received 1 spiking sent by \(\sigma_{aux_{2,1}}\), which is stacked in \(\sigma_{aux_{4}}\). 5. Addition Operation 1. \(t=1\) to 10, there is no spiking input in \(\sigma_{Add}\). 2. \(t=11\) to 18, the spiking corresponding to each of the two binary addends is sent in sequence from low to high to \(\sigma_{Add}\). At \(t=11\) time slice, \(\sigma_{Add}\) received the spiking corresponding to the lowest order of two addends. At this time, there is 1 spiking in \(\sigma_{Add}\). At \(t=18\) time slice, \(\sigma_{Add}\) received spiking corresponding to the highest bit of 2 addends, there are 0 spiking in \(\sigma_{Add}\). 3. \(t=12\) to 19, it is the effective output time of \(\Pi_{Add2}\). During this time slice, the calculation results are sent to the environment in order from low to high. In each time slice, the environment received 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0 spikings in sequence. 4. \(t=19\), \(\sigma_{Add}\) received 4 spikings sent by \(\sigma_{aux_{4}}\). At this time, there are no rules that can be used in \(\Pi_{Add2}\), and the system operation stops. The system \(\Pi_{Add2}\) calculates that the sum of 000001012 and 000001102 is 000010112, and the calculation result is correct. From Table 1, it can be seen that the effective output time of the system is \(t=12\). And the sum of two natural numbers 5 and 6 is 000010112, which is 11. The addition LHSNP system constructed of \(\Pi_{Add2}\) can perform the addition operation of 2 \(k\)-bit binary numbers.