# Performing Arithmetic Operations with Locally Homogeneous Spiking Neural P Systems
## 4 An Locally Homogeneous Spiking Neural P System for Subtraction
### An LHSNP System with 2 Input Neurons for 2 Numbers Subtraction
Namely, after \(\Pi_{5 ub1}\) receives \(k\)-bit binary numbers in the order from low to high, it can correctly perform subtraction and output spiking to the environment in the order from low to high._  
Proof of Theorem 3.: Let \(t\) represent the time slice. At the initial state \(t\) = 0, there is one spiking in \(\sigma_{aux_{1,0}}\) and \(\sigma_{aux_{1,1}}\). Starting from \(t\) = 1 time slice, two binary numbers are sequentially received by \(\sigma_{in_{1}}\) and \(\sigma_{in_{2}}\) from low to high. When the binary bit is 1, \(\sigma_{in_{1}}\) and \(\sigma_{in_{2}}\) received 1 spiking, otherwise 0 spiking were received. The minuend passes through \(\sigma_{aux_{1,6}}\) and \(\sigma_{minuend}\) passed to \(\sigma_{5 ub}\) participates in subtraction operations. Subtraction is passed in the order of \(\sigma_{in_{1,7}}\), \(\sigma_{subtubnd}\), and \(\sigma_{Sub}\). The calculation process of \(\Pi_{5 ub1}\) is as follows:  
1. Input Auxiliary Module  
The function of the input auxiliary module is to adjust the number of spiking corresponding to the binary number 0 represented by the minuend number during transmission. The purpose is to make the spiking representing the minuend and subtrahend corresponding to the binary number 0 different. The process for inputting auxiliary modules is as follows:  
1. \(t\) = 0, there is one spiking in \(\sigma_{aux_{1,0}}\) and \(\sigma_{aux_{1,1}}\). 2. \(t\) = 1 to 2, the input auxiliary module does not generate spiking output. At each time slice, \(\sigma_{aux_{1,0}}\) and \(\sigma_{aux_{1,1}}\) send spiking to each other and maintain 1 spiking. At the same time, \(\sigma_{aux_{1,0}}\) at every time slice sends 1 spiking to \(\sigma_{aux_{1,2}}\). These spikings are transmitted along \(\sigma_{aux_{1,2}}\) and \((\sigma_{aux_{1,3}},\,\sigma_{aux_{1,4}})\). 3. \(t\) = 3 to \(k+2\), the input auxiliary module does not send spiking output. \(\sigma_{aux_{1,3}}\) and \(\sigma_{aux_{1,4}}\) send one spiking to \(\sigma_{minuend}\) at each time slice. \(t\) = 3 to \(k-1\), \(\sigma_{aux_{1,0}}\) and \(\sigma_{aux_{1,1}}\)send spiking to each other. And \(\sigma_{aux_{1,0}}\) at each time sends 1 spiking to \(\sigma_{aux_{1,2}}\). At \(k-1\) time slice, \(k-1\) spikings stacked in \(\sigma_{aux_{2}}\). At \(t=k\) time slice, \(\sigma_{aux_{1,0}}\) and \(\sigma_{aux_{1,1}}\) received 2 spiking. One of the spiking comes from what they send to each other. Another spiking is sent by \(\sigma_{aux_{2}}\) using rule \(a^{k-1}\to a\). At \(k+1\) time slice, the spiking in \(\sigma_{aux_{1,2}}\) is cleared to zero. At \(k+1\) time slice, the spiking in \(\sigma_{aux_{1,3}}\) and \(\sigma_{aux_{1,4}}\) is cleared to zero. 4. At the \(k+3\) time slice, \(\sigma_{aux_{1,5}}\) send 1 spiking to \(\sigma_{aux_{3}}\). There are 8 spikings stacked in \(\sigma_{aux_{3}}\). 5. At the \(k+4\) time slice, the input auxiliary module no longer generates spiking. 6. Minuend Input \(t=1\) to \(k\), the spiking corresponding to each binary bit of the minuend is sequentially received by \(\sigma_{in_{1}}\) in order from low to high. These spikings are transmitted along \(\sigma_{aux_{1,6}}\), \(\sigma_{minuend}\), and \(\sigma_{Sub}\). 7. \(t=3\) to \(k+2\), the spiking corresponding to each binary bit of the minuend is sequentially received by \(\sigma_{minuend}\). At the same time, \(\sigma_{minuend}\) also received 2 spikings at each time from \(\sigma_{aux_{1,3}}\) and \(\sigma_{aux_{1,4}}\). 8. \(t=4\) to \(k+3\), the spiking corresponding to each binary bit of the minuend sent by \(\sigma_{minuend}\) is sequentially received by \(\sigma_{Sub}\). At each time slice, one spiking sent by minuend represents the binary number 1, and 2 spiking represents the binary number 0. At \(k+3\) time slice, the highest bit of the minuend is received by \(\sigma_{Sub}\). 9. Subtriehend Input \(t=1\) to \(k\), the spiking corresponding to each binary bit of the subtrahend is sequentially received by \(\sigma_{in_{2}}\) in order from low to high.