Next Article in Journal
An Effective Federated Object Detection Framework with Dynamic Differential Privacy
Previous Article in Journal
Erroneous Applications of Fractional Calculus: The Catenary as a Prototype
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

A Real-Number SNP Circuit for the Adder and Subtractor with Astrocyte-like Dendrite Selection Behavior Based on Colored Spikes

by
Tonatiuh Jimenez-Borgonio
1,
Juan Carlos Sanchez-Garcia
1,*,
Luis Olvera-Martinez
1,
Manuel Cedillo-Hernandez
1,*,
Carlos Diaz-Rodriguez
2 and
Thania Frias-Carmona
2
1
Instituto Politecnico Nacional, Escuela Superior de Ingenieria Mecanica y Electrica Unidad Culhuacan, Avenida Santa Ana 1000, San Francisco Culhuacan, Culhuacan CTM V, Coyoacan, Ciudad de Mexico CP 04440, Mexico
2
Independent Researcher, Ciudad de Mexico CP 04440, Mexico
*
Authors to whom correspondence should be addressed.
Mathematics 2024, 12(14), 2149; https://doi.org/10.3390/math12142149
Submission received: 6 May 2024 / Revised: 25 June 2024 / Accepted: 4 July 2024 / Published: 9 July 2024
(This article belongs to the Section Computational and Applied Mathematics)

Abstract

:
In recent years, several proposals have emerged for executing arithmetic operations using different variants of Spiking Neural P (SNP) systems. However, some of these proposals rely on distinct circuits for each arithmetic operation, while others mandate preliminary configurations for result computation. Recent research suggests that the biological brain decides to activate or inhibit specific neurons based on the operations performed, without prior preparation. Building upon this understanding, the current work introduces a real-number arithmetic SNP circuit capable of dynamically adjusting its behavior without the need for prior configuration. This adaptability is achieved by selecting between addition or subtraction through the utilization of astrocyte-like control and colored spikes. To validate its performance, the circuit was implemented on an FPGA system. The results indicate that the growth in the quantity of 10th-order digits is comparable to recent proposals in terms of hardware usage, requiring fewer neurons than alternative approaches. Moreover, the computation of floating-point numbers enhances the resolution and precision in various arithmetic applications.

1. Introduction

Spiking Neural Networks (SNNs) [1,2,3] represent the third generation of neural networks, efficiently mimicking the biological behavior of the brain [4,5]. Based on the architecture of SNNs, Ionescu et al. proposed Spiking Neural P systems in 2006 [6]. SNP systems are a class of distributed parallel computing devices inspired by the original concepts of SNN circuits, utilizing spikes for communication [6].
SNP systems follow the architecture of SNNs, utilizing spikes for communication between neurons. Each neuron can follow firing rules and forgetting rules. When a certain number of spikes satisfies a regular expression, a firing rule allows the neuron to send information (coded in spikes) to other neurons. Simultaneously, the neuron has the ability to “forget” its content when a certain number of spikes are stored. The entire system evolves synchronously, following these rules at each time unit. When no rules are available for execution, the computation halts, and the result is obtained. This computational model has proven to have the same computing power as a Turing machine.
The computational power of SNP systems has expanded by integrating more biological features, such as astrocyte behavior [7,8], neural structural plasticity [9,10], and synaptic weights [11]. Additionally, various researched variants of these circuits, like SNP systems with colored spikes [12], SNP systems with rules on synapses [13], SNP systems with dendrite behavior and astrocyte-like control [6], and SNP systems with structural plasticity [14], have been proposed and incorporated.
SNP systems have been applied in various domains, including intrusion detection [15], image hiding using visual cryptography [16], image processing [17], and Arithmetic Logic Unit functions [18,19]. However, existing circuits often involve different sections or integrate multiple modules for various operations (e.g., addition, subtraction, multiplication, etc.) [19]. Alternatively, they may require a prior configuration and are limited to computing only integer numbers [20,21,22], potentially leading to scalability issues and functional limitations.
A notable feature of colored SNP systems is the capacity to store multiple colored spikes inside neurons without changing the internal behavior or requiring different firing time steps.
To address these challenges, this document proposes a self-configuring, split-function circuit capable of performing addition and subtraction. This is achieved through astrocyte-like control and dendrite inhibition. Additionally, the use of colored spikes allows the neurons to store floating numbers as decimal representations within, eliminating the need for separating every element into different sections and requiring fewer neurons. Moreover, the final representation for displaying the computation results is easy to read, using different colors that match the decimal order for every 10th-order digit. This feature enables users to compute both integer and floating numbers without changing the circuit configuration.
The next section introduces a circuit based on neural systems, wherein the addition and subtraction operations between two operands are embedded in natural neural behavior. Implementation examples are provided to demonstrate the functionality of the circuit.

2. Signed Addition/Subtraction SNP Circuit

The proposed Signed Addition/Subtraction SNP circuit exhibits characteristics related to the astrocyte control of plasticity and pruning in SNP systems, as mentioned earlier. In this case, synapses are connected to the astrocyte a s t s in the form of a s t s = ( s y n p l a s , t ) ; that is, if the threshold t is reached by a certain number of input spikes, the astrocyte prunes the exceeded synapses to establish the addition or subtraction behavior. This aligns with the SNP systems with the structural plasticity rule introduced by Carbale et al. [14], as a modification of the original plasticity rule. This new rule is defined as E / a n m α ( σ p r e , σ p o s ) , where E is a regular expression over O (this is explained in the Formal Definition Subsection), α { + , } , σ p r e is the pre-synaptic neuron, and σ p o s is the post-synaptic neuron. If a defined number of input colored spikes reaches the astrocyte a s t s and matches the activation condition of the regular expression E, the input colored spikes are consumed, and the astrocyte creates or prunes synapses between the pre-synaptic neuron σ p r e and the post-synaptic neuron σ p o s , according to the α value (if α is defined as +, the astrocyte creates synapses; if −, the synapses are pruned). Also, The proposed circuit incorporates the features of astrocyte-like control and SNP systems with colored spikes. The input numbers are segmented as follows:
{ a 1 m , a 2 m , , a n m }
where
  • n is the assigned color for every 10th-order exponent (i.e., 10 1 , 10 0 , 10 1 , etc.);
  • m is the number of digits with the same 10th-order exponent;
  • { a 1 m , a 2 m , a 3 m , , a n m } is a set of colored spikes used for representing every operand 10th-order digit.
The general circuit operation, as described in Figure 1, is divided into three main modules: 9s complement module ( 9 c ), addition and carry module ( a & c ), and signed separation module ( s s ). In case of a subtraction operation, the 9 c and a & c modules, depicted in Figure 2 and Figure 3, respectively, work in parallel and direct the corresponding outputs to the s s module. The s s module determines whether the result is positively signed or requires passing through the 9 c module again, signifying a negative sign. In the case of an addition operation, an astrocyte prunes the 9 c output, and subsequent modules operate normally.
The 9 c module receives operand B colored spikes and shares the output (separated into different colored spikes) with the a & c module.
Meanwhile, the a & c module receives operand A and the 9 c outcome colored spikes, sharing the sum of both inputs with the s s module, shown in Figure 4. The shared number is then divided into the non-carry addition operation and the carry behavior.
Finally, the s s module receives the outgoing inputs from the a & c module and determines whether the result is positively or negatively signed. In the case of a positive sign, the module triggers a positive P colored spike. For a negative sign, the module shares the addition spikes with the 9 c module and triggers a negative G colored spike.
The schematic view of the module connections is shown in Figure 5.

2.1. Formal Definition

The formal definition of the signed adder–subtractor SNP circuit Π S A S is described as follows:
Π S A S = { C , O , σ a , σ c , σ c a u x , σ S a , σ S t , σ S i , s y n , a s t s , a s t u i , i n e n , i n s u m , i n o p A i , i n o p B i , o u t i , o u t s i g P , o u t s i g G , Δ t d }
where
  • C = { i , m , r , G , P } is a set of colors that represents the 10th order of the input operand digits, the number of digits, the flag signal, the reset signal, and the negative/positive signals, respectively, where i { 1 , , n } ;
  • O = { a 1 , , a n } is the alphabet of every colored spike;
  • { σ a , σ c , σ c a u x , σ S i } = 0 ; every neuron within the circuit starts with any accumulation of spikes at the beginning of the computation, where i { 1 , , n } . This set of neurons contains rules of the following form:
    • E a i j a k l is the firing rule, with a regular expression E of the form a n m { n , m } N ; a i j defines the j number of spikes and type of color i that the neuron consumed in the process; a k l defines the l number of spikes and the type of the color k that the neuron fires to the environment. Consider { i , k } { 1 , , n } and { j , l } { 1 , , m } ;
    • E a i j λ is the inhibition rule, with a regular expression E of the form a n m { n , m } N ; a i j defines the j number of spikes and type of color i that the neuron consumed in the process; λ defines a process of consumption without firing spikes to the environment. Consider { i , k } { 1 , , n } ;
  • { i n s u m , i n o p A i , i n o p B i } is a set of inputs for the addition process activation, the separated digits for the operand A, and the separated digits of the operand B, respectively, where i { 1 , , n } ;
  • { o u t i , o u t s i g P , o u t s i g G } is a set of outputs for the operation result as separated digits, positive result sign, and negative result sign, respectively, where i { i , , n } ;
  • s y n = ( σ a , σ c ) ( σ c , σ S a ) ( σ S i , σ S j ) i { 1 , , n } ; j { 1 , , n } ( σ S i , σ S t ) i { 1 , , n } ( σ S a , σ S t ) ( σ S t , σ c a u x ) ( σ S t , σ c ) ( σ S t , σ a ) ( σ c a u x , σ S t ) . This set of synapses contains rules of the following form:
    • E a i j a k l is the firing rule, with a regular expression E of the form a n m { n , m } N ; a i j defines the j number of spikes and type of color i that the pre-synaptic neuron consumed in the process; a k l defines the l number of spikes and the type of the color k that the pre-synaptic neuron fires to the post-synaptic neuron. Consider { i , k } { 1 , , n } and { j , l } { 1 , , m } ;
    • E a i j λ is the inhibition rule, with a regular expression E of the form a n m { n , m } N ; a i j defines the j number of spikes and type of color i that the pre-synaptic neuron consumed in the process; λ defines a process of consumption without firing spikes to the post-synaptic neuron. Consider { i , k } { 1 , , n } ;
  • Δ t d = [ ( σ i , σ j ) n ] ; is a dendritic delay of n times from a neuron σ i towards σ j ;
  • a s t u i s y n k of the form a s t u i = ( s y n a s t j , 1 ) , where k 2 , i { 1 , , n } , and j { 1 , , n } . The set of synapses s y n a s t j is controlled by the set of astrocytes a s t u i , and the threshold for every astrocyte in the set is equal to a single colored spike;
  • a s t s is the pruning astrocyte, which deletes the set of synapses s y n a s t s connected to it. The internal pruning astrocyte rule takes the form of a 0 a 0 , ( σ a , σ c ) .

2.2. Circuit Behavior

A detailed description of each module is provided below:
As previously mentioned, the circuit operates in two main ways depending on the astrocyte behavior, indicating pruning based on the operation—either addition or subtraction. In the case of addition, the a 0 colored spike reaching the astrocyte a s t s triggers the dendrite pruning responsible for the complement computation connected to σ a . Other than this pruning, the rest of the circuit’s functionality remains unchanged.
To ensure the synchronization of firing rules among the constituent modules within the entire circuit, the a 0 colored spike acts as a flag for processing other colored spikes stored within each neuron. This flag is consumed and then triggered anew at the start of each new process, effectively initiating subsequent processes through the use of dendritic delays. This innovative approach enables the circuit to perform the entire process in parallel without relying on time step counting. Moreover, this feature proves highly advantageous for integrating diverse processes and modules designed to operate in both synchronous and asynchronous modes. It eliminates the need for generating distinct channel labels to differentiate between various synapses governed by different spiking rules [23,24,25]. Additionally, it provides flexibility to incorporate multiple flag-colored spikes, thanks to the properties of colored spikes, without being limited to the use of only two distinct types of spikes [26,27].
The primary change within the circuit for performing addition operations is the dendrite pruning described above. Therefore, we will now focus on describing the subtraction operation.
The process begins at the 9 c module. The schematic view of this module is shown in Figure 2.
In a subtraction operation, the B operand numbers, converted into colored spikes, are delayed one time within the incoming dendrites and further fired to the σ c neuron. Also, a single flag-colored a 0 spike is dispatched to the input of the σ a neuron. This a 0 spike is absorbed, initiating the generation of distinct labeled n colored spikes along with another flag-colored a 0 spike: a 1 10 spikes, a 2 9 spikes, , a n 9 spikes. It is important to remark that this newly generated a 0 colored spike is delayed nine times within the dendrite, in order to synchronize the time when all the a 1 , , a n spikes arrive at the σ c neuron.
Neuron σ c begins accumulating the 9s complement for every operand B digit. These complement signals are generated in the σ a neuron, based on operand B input signals, and are annihilated by astrocytes u n . These astrocytes inhibit parallel signals from the σ a and B operand incoming spikes passing through dendrite paths to neuron σ c . At the same time, the σ a neuron generates a n 9 spikes for every n 10th-order digit generated by operand B, except for the a 1 spikes’ digits. As the 9s complement process requires a final addition of a single unit for creating the complement, this is compensated by generating a 1 10 spikes instead of a 1 9 . Thus, the σ a neuron and digitwise astrocytes create the 9s complement signals that reach σ c neuron. In the case of an addition operation, dendrites from σ a to σ c are pruned, and astrocytes attached to these paths are inhibited.
After colored spikes are stored and the a 0 colored spike reaches the σ c neuron, firing rules on its outgoing dendrites are activated according to the number of colored spikes associated with every 10th-order digit. The rules of the form a 0 , ( a n 1 ) + a 0 , a n 1 a n 1 fire the corresponding 1 colored spikes when both a n 1 and a 0 exist within. There is an exception for the a 1 spikes’ digits; when the number of this specific spike within the neuron surpasses or is equal to ten, in order to avoid an additional further carry computation, the carry process for a 2 spikes’ digits occurs by the rule a 0 , ( a 1 10 ) + a 0 , a 1 10 a 2 , generating a single a 2 spike. However, if this condition is not reached, the rule a 0 , ( a 1 < 10 ) + a 0 , a 1 < 10 a 1 < 10 works in the same way as the last mentioned rules.
Once the a 0 spike reaches the σ c neuron, these spikes are consumed and sent to post-synaptic neurons σ S a , σ S 1 , , σ S n , accompanied by a new outgoing a 0 spike directed to the σ S a and σ S 1 neurons. This new spike is delayed ten times in the dendrite to synchronize the further process in the a & c module.
Simultaneous to the operation of the 9′c module, the a & c module performs the non-carry addition operation and carry behavior. The schematic view of this module is shown in Figure 3.
The spikes corresponding to the operand A numbers are accumulated in neurons σ S a , σ S 1 , …, σ S n , based on their respective 10th-order digits.
Neuron σ S a possesses a distinct set of rules within its soma and attached to outgoing dendrites. The inhibition rules take the form ( a 1 10 ) + a 1 10 λ , , ( a n 10 ) + a n 10 λ , and the firing rules are of the form a 0 , ( a 1 9 ) + a 0 , a 1 9 a 1 9 , , a 0 , ( a n 9 ) + a 0 , a n 9 a n 9 . The first set of rules ensures that the incoming stored colored spikes for every 10th-order digit do not exceed nine spikes, thus performing an addition operation without carry behavior. Meanwhile, the second set fires the accumulated colored spikes to the σ S t neuron when the a 0 spike, coming from the σ c neuron, is consumed and processed along with the other colored spikes within. It also fires a new flag-colored a 0 spike, which is delayed nine times within the dendrite path, to ensure adequate synchronization with the s s module.
On the other hand, σ S 1 , , σ S n neurons possess four different kinds of rules: firing-to- σ S t rules (located along dendrite paths going to the s s module), firing-to- σ S n rules (located along dendrite paths going to further σ S n + 1 neurons), flag rules (also connected to dendrite paths going to subsequent σ S n + 1 neurons), and inhibition rules (located within the neurons). The first set of rules, described as a 0 , ( a n > 9 ) + a 0 , a n > 9 a n + 1 1 , fires a single a n + 1 colored spike to the σ S t neuron when accumulated a n colored spikes within σ S n surpass nine spikes, being consumed and creating a carry behavior (complementary to the non-carry addition operation performed in σ S a ). The second set of rules possesses a similar functionality and is described in the same way as the previous one, but dendrite paths connect to σ S n + 1 neurons to record every carry colored spike. As the whole process occurs simultaneously, the third set of rules, described as a 0 a 0 , fires a flag-colored a 0 spike to synchronize adequate non-carry addition and carry output between the already stored operand A digits and incoming carry a n + 1 colored spikes. There is an important modification for the last stated set of rules that occurs at the final 10th-order digit assigned the σ S n neuron; as there is no subsequent σ S n + 1 neuron, the outgoing dendrite and firing-to- σ S n rule does not exist. The firing-to- σ S t rule changes to a 0 , ( a n > 9 ) + a 0 , a n > 9 a 0 , and the flag rule changes to a 0 a r . The change made in the firing-to- σ S t rule is needed to determine the sign of the final result in the further s s module, thus requiring a dendrite delay of 9 n times for the outgoing flag-colored a 0 spike. Similarly, the modification made in the flag rule changes the original outgoing flag-colored a 0 spike for a reset-colored a r spike, which is delayed nine times inside the dendrite path and connected to every σ S 1 , , σ S n neuron, to avoid inhibiting stored a n m colored spikes before the addition operation and carry behavior end. This process is performed by the inhibition rule, described as a r , ( a n < 10 ) + λ . As there will be some cases where the number of stored a n m colored spikes within σ S 1 , , σ S n neurons will not be greater than nine spikes, it is necessary to remove them before using the Π S A S circuit again to avoid further miscalculation.
After performing the non-carry addition operation and carry behavior, the s s module generates the sign for final computation. The schematic view of this module is shown in Figure 4.
Neuron σ S t possesses five different kinds of rules: inhibiting rules, located within its soma; firing-to- 9 c rules, located at dendrites connected to the 9 c module; the flag rule, located at a dendrite also connected to the 9 c module; firing-to-out rules, attached to outgoing dendrites, which fires the result of the computation; and the positive-label rule, located at a dendrite in charge of signalizing a positive result.
The carry behavior, occurring in the previous a & c module, requires a final non-carry addition operation to calculate the adequate result of the computation. Therefore, the σ S t neuron requires inhibition rules for this purpose. Colored spikes coming from the a & c module are stored within σ S t , and the inhibition rules take the form ( a 2 10 ) + a 2 10 λ , , ( a n 10 ) + a n 10 λ . After storing all incoming colored spikes, there are two different cases for signaling the process, according to the number of incoming a 0 flag-colored spikes; every time a positive-sign result is processed, the a & c module fires two a 0 colored spikes to the s s module. On the other hand, the a & c module only fires a single a 0 flag-colored spike if a negative-sign result is being processed.
The first case occurs when two a 0 flag-colored spikes reach the σ s T neuron at the same time; firing-to-out rules fire all the accumulated a 1 m , , a n m colored spikes stored within the neuron, and the positive-labeled rule fires a positive P sign-colored spike, thus creating the final result, then computation halts, giving a positive-sign value.
The second case occurs when only one a 0 flag-colored spike reaches σ S t . This signal activates the firing-to- 9 c rules, and the neuron fires all the accumulated a 1 m , , a n m colored spikes to the σ c neuron, while the flag rule fires an a 0 colored spike, which is separated into two different paths: the first one going to the σ a neuron for activating the 9s complement computation again and the second one, connected to σ c a u x , being delayed 25 times within the dendrite, in order to synchronize the process for negative signalization. The a 1 m , , a n m colored spikes for this new 9s complement process are annihilated by a different set of u n astrocytes, connected in parallel with the σ a and σ c a u x neurons’ outgoing dendrites, just as occurred in the 9 c module.
The negative signalizing σ c a u x neuron contains three different sets of rules, located at its outgoing dendrites’ paths: the flag rule, the positive-sign rule, and the negative-sign rule. Once the previously delayed a 0 flag-colored spike reaches σ c a u x , three different signal-colored spikes are fired: the flag rule, defined as a 0 a 0 , fires a single a 0 colored spike to the σ S t neuron, and it is delayed nine times within the dendrite path; the positive-sign rule, defined as a 0 a P , fires a positive P sign-colored spike, which is delayed 11 times within the dendrite path; finally, the negative-sign rule, defined as a 0 a G , fires a negative G sign-colored spike, which is also delayed 11 times within the dendrite path. It is important to remark that all the mentioned dendrite delays serve synchronization purposes. By the time the σ c a u x neuron fires all the signal-colored spikes, incoming spikes from the a & c module are accumulated in the σ S t neuron anew. In order to avoid the activation of firing-to- 9 c rules again, the incoming a 0 colored spike from the σ c a u x neuron (aided by the a 0 flag-colored spike from the a & c module) activates the firing-to-out rules. As a positive P sign-colored spike is fired at the same time as the other P sign-colored spike (coming from the σ c a u x neuron), these parallel signals are connected to the u s astrocyte, thus annihilating both to avoid an incorrect signalized result. The only sign-colored spike that reaches the final result is the negative G sign-colored spike (coming from the σ c a u x neuron), and the computation halts.
It is important to remark that, when the Π S A S circuit performs an addition operation, the second case for negative signalization is never reached.
Two simple examples are explained as follows: The first example, shown in Table 1, represents the addition operation between 6.4 and 5.0 . At time t = 0 , there are no colored spikes accumulated in the neurons. Then, at t = 12 , the separated digits for each operand are accumulated in the neurons σ c , σ S a , σ S 1 , and σ S 2 . In the next step, at t = 24 , the σ S a neuron accumulates the addition of both operands without considering the carry behavior. Meanwhile, the σ S 1 and σ S 2 neurons accumulate only the carry addition between the operands. Finally, in the step at t = 36 , all the neurons fire the accumulated colored spikes to the σ S t neuron, where the operation result is stored.
The second example, shown in Table 2, represents the subtraction operation between 6.4 and 5.0 . The first step at t = 1 starts with the preparation in the σ a neuron for the 9s complement of the second operand (colored spikes are not accumulated in this neuron when an addition operation is performed). After that, in step t = 12 , the σ S a , σ S 1 , and σ S 2 neurons accumulate the operands’ digits, and the σ c neuron stores the addition of the first operand digits and the 9s complement conversion of the second operand digits. Similar to the previous example, at step t = 24 , the σ S a neuron converts the accumulated spikes in the σ c neuron into an addition without the carry behavior. Meanwhile, the σ S 1 and σ S 2 neurons accumulate only the carry addition between the operands. Lastly, at step t = 36 , all the neurons fire the accumulated colored spikes to the σ S t neuron, where the subtraction operation result is stored.

3. Hardware Implementation

In this section, a revision of four examples is performed to evaluate the proposed SNP signed addition and subtraction circuit Π S A S . It has been implemented in an Altera Cyclone V FPGA, which has 29,080 adaptive logic modules (ALMs) and runs at 50 MHz.
For these examples, the implementation uses up to three 10th-order digits for every operand. The Π S A S circuit, with the ability to actively choose the operation it will perform, requires 1087 ALMs.
In the first example, the Π S A S circuit was tested using two operands of two digits each, as shown in Figure 6. The operand inputs are o p A 1 , 2 = 4 , 6 and o p B 1 , 2 = 0 , 5 ; the a 0 addition flag-colored spike is not fired; thus, a subtraction is performed between 6.4 minus 5.0 . When the computation halts, the result is represented in colored spikes ( 1.4 ), with a positive-labeled spike, after 36 clock cycles.
For the next example, the circuit was tested using the same number of operands, but changing the number to three 10th-order digits for each, as shown in Figure 7. The operand inputs are o p A 1 , 2 , 3 = 7 , 2 , 3 and o p B 1 , 2 , 3 = 5 , 1 , 3 . The addition flag-colored a 0 spike is not fired, and the subtraction is performed between 3.27 minus 3.15 . When the computation halts, the result is represented in colored spikes ( 0.12 ), with a positive-labeled spike, after 36 clock cycles.
Using the same number of operands and 10th-order digits, as shown in Figure 8, the operand inputs are o p A 1 , 2 , 3 = 2 , 1 , 3 and o p B 1 , 2 , 3 = 1 , 7 , 5 . The addition flag-colored a 0 spike is not fired, and the subtraction is performed between 3.12 minus 5.71 . When the computation halts, the result is represented in colored spikes ( 2.59 ), with a negative-labeled spike, after 72 clock cycles.
As mentioned before, the circuit can be set to perform addition operations. For the last example, shown in Figure 9, the operand inputs are o p A 1 , 2 , 3 = 3 , 6 , 2 and o p B 1 , 2 , 3 = 4 , 2 , 3 ; the addition flag-colored a 0 spike is fired, and the addition is performed between 2.63 plus 3.24 . When the computation halts, the result is represented in colored spikes ( 5.87 ), with a positive-labeled spike, after 36 clock cycles.
The Π S A S circuit was tested by performing subtraction and addition operations between two operands. For the subtraction operation, obtaining a positive-labeled sign spike output, the circuit needs 34 clock cycles to compute the result. The same clock cycle numbers are needed to compute an addition operation, obtaining a positive-labeled sign spike output. On the other hand, a subtraction operation, obtaining a negative-labeled sign spike output, needs 72 clock cycles to compute the result because the 9 c module processes the first output to obtain the correct computation.
The Π S A S circuit is capable of processing the subtraction and addition operations with operands of a high number of 10th-order digits, without the need for drastically increasing the clock cycle number required for the computation.

4. Conclusions and Future Work

In this paper, we presented a reliable and compact circuit designed for hardware implementation, capable of performing addition and subtraction operations between real numbers. Utilizing colored spikes and dendrite rules, a smaller number of neurons are required to compute the addition and subtraction behavior. This allows the circuit to have an active simple self-configuration switch, requiring a single spike to perform this action. It also uses a set of two colors to precisely differentiate the sign of the operation result.
The comparison of the performance for the proposed circuit’s simulation time step usage, given by the time usage functions shown in Table 3 and Table 4, is depicted in Figure 10. Also, the comparison of the growth of the quantity of neurons shown by the functions in Table 5 is illustrated in Figure 11.
In the first graph, Frias et al.’s proposal [28] shows the same amount of time step usage for performing the addition and subtraction operations. The proposed circuit requires fewer time steps as the number of 10th-order digits increases for performing addition operations. Thus, for a result with a resolution of six 10th-order digits, it requires two time steps less than the Frias et al. proposal (the time gap increases with the number of 10th-order digits).
This feature is especially useful for applications that require the use of large numbers (15 or more 10th-order digits), such as prime number cryptography [29] and accuracy for positioning systems [30]. However, the time needed for performing subtraction operations is higher, and it requires at least a result of 38 10th-order digits for using fewer time steps.
On the other hand, the second graph shows the number of neurons required for performing the computation in both proposals. For the applications mentioned above, Frias et al.’s proposal uses 198 neurons for the computation of a 15-digit result, while our proposal only requires 20 neurons for computing the same result. Thus, the use of colored spikes significantly decreases the neurons required for every operation.
Working with real numbers implies the use of floating numbers. Using colored spikes facilitates digit separation and permits a single neuron to store multiple types of colored spikes within. But also, changing between performing the addition and subtraction operations only requires a single spike configuration, and the whole circuit behavior is set using plasticity with astrocyte control.
As future work, the improvement of time step usage for the subtraction operations is one of the main concerns, so the circuit will require a lower number of cycles to compute the results of at least 15 10th-order digits (according to the mentioned applications). Also, the addition of functionalities for this circuit will be evaluated, so it does not require a huge structural change, being capable of performing multiplication and division operations, increasing decimal resolution, and managing computation for numbers with a different quantity of 10th-order digits. New proposals will permit the implementation for applications in finite field arithmetic.

Author Contributions

Conceptualization, T.J.-B. and C.D.-R.; methodology, T.J.-B., C.D.-R. and J.C.S.-G.; writing—original draft preparation, T.J.-B. and C.D.-R.; writing—review and editing, J.C.S.-G., M.C.-H., L.O.-M. and T.F.-C. All authors have read and agreed to the published version of the manuscript.

Funding

This document is the result of the research project supported by Grant 815609 from the master’s fellowship of CONaHCyT scholarship.

Data Availability Statement

The codes used for the Π S A S circuit implementation can be obtained from this source, accessed on 1 April 2024: https://github.com/enritona/SNP-real-numbers.git.

Conflicts of Interest

The authors declare that they have no known competing financial interests or personal relationships that could have appeared to influence the work reported in this paper.

References

  1. Maass, W. Networks of spiking neurons: The third generation of neural network models. Neural Netw. 1997, 10, 1659–1671. [Google Scholar] [CrossRef]
  2. Jahnke, A.; Schönauer, T.; Roth, U.; Mohraz, K.; Klar, H. Simulation of spiking neural networks on different hardware platforms. In Proceedings of the International Conference on Artificial Neural Networks, Lausanne, Switzerland, 8–10 October 1997; Springer: Berlin/Heidelberg, Germany, 1997; pp. 1187–1192. [Google Scholar]
  3. Cabarle, F.G.C. Thinking about spiking neural P systems: Some theories, tools, and research topics. J. Membr. Comput. 2024, 6, 148–167. [Google Scholar] [CrossRef]
  4. Bialek, W.; Rieke, F. Reliability and information transmission in spiking neurons. Trends Neurosci. 1992, 15, 428–434. [Google Scholar] [CrossRef]
  5. Judd, K.T.; Aihara, K. Pulse propagation networks: A neural network model that uses temporal coding by action potentials. Neural Netw. 1993, 6, 203–215. [Google Scholar] [CrossRef]
  6. Paun, G. Spiking Neural P Systems with Astrocyte-Like Control. J. Univers. Comput. Sci. 2007, 13, 1707–1721. [Google Scholar]
  7. Derouiche, A.; Frotscher, M. Peripheral astrocyte processes: Monitoring by selective immunostaining for the actin-binding ERM proteins. Glia 2001, 36, 330–341. [Google Scholar] [CrossRef]
  8. Reemst, K.; Noctor, S.; Lucassen, P.; Hol, E. The indispensable roles of microglia and astrocytes during brain development. Front. Hum. Neurosci. 2016, 10, 566. [Google Scholar] [CrossRef]
  9. Lavialle, M.; Aumann, G.; Anlauf, E.; Pröls, F.; Arpin, M.; Derouiche, A. Structural plasticity of perisynaptic astrocyte processes involves ezrin and metabotropic glutamate receptors. Proc. Natl. Acad. Sci. USA 2011, 108, 12915–12919. [Google Scholar] [CrossRef]
  10. Bernardinelli, Y.; Muller, D.; Nikonenko, I. Astrocyte-synapse structural plasticity. Neural Plast. 2014, 2014, 232105. [Google Scholar] [CrossRef] [PubMed]
  11. Hopfield, J.J.; Tank, D.W. Computing with neural circuits: A model. Science 1986, 233, 625–633. [Google Scholar] [CrossRef]
  12. Song, T.; Rodríguez-Patón, A.; Zheng, P.; Zeng, X. Spiking neural P systems with colored spikes. IEEE Trans. Cogn. Dev. Syst. 2017, 10, 1106–1115. [Google Scholar] [CrossRef]
  13. Song, T.; Pan, L.; Păun, G. Spiking neural P systems with rules on synapses. Theor. Comput. Sci. 2014, 529, 82–95. [Google Scholar] [CrossRef]
  14. Cabarle, F.G.C.; Adorna, H.N.; Pérez-Jiménez, M.J.; Song, T. Spiking neural P systems with structural plasticity. Neural Comput. Appl. 2015, 26, 1905–1917. [Google Scholar] [CrossRef]
  15. Idowu, R.K.; Muniyandi, R.C.; Othman, Z.A. The prospects of using spiking neural P system for intrusion detection. Int. J. Inf. Netw. Secur. 2013, 2, 492. [Google Scholar]
  16. Olvera-Martinez, L.; Jimenez-Borgonio, T.; Frias-Carmona, T.; Abarca-Rodriguez, M.; Diaz-Rodriguez, C.; Cedillo-Hernandez, M.; Nakano-Miyatake, M.; Perez-Meana, H. First SN P visual cryptographic circuit with astrocyte control of structural plasticity for security applications. Neurocomputing 2021, 457, 67–73. [Google Scholar] [CrossRef]
  17. Song, T.; Pang, S.; Hao, S.; Rodríguez-Patón, A.; Zheng, P. A parallel image skeletonizing method using spiking neural P systems with weights. Neural Process. Lett. 2019, 50, 1485–1502. [Google Scholar] [CrossRef]
  18. Dong, J.; Luo, B.; Zhang, G. Automatic design of arithmetic operation spiking neural P systems. Natural Comput. 2022, 22, 55–67. [Google Scholar] [CrossRef]
  19. Zhang, G.; Rong, H.; Paul, P.; He, Y.; Neri, F.; Pérez-Jiménez, M.J. A complete arithmetic calculator constructed from spiking neural P systems and its application to information fusion. Int. J. Neural Syst. 2021, 31, 2050055. [Google Scholar] [CrossRef]
  20. Vazquez, A.; Garcia, L.; Avalos, J.G.; Sanchez, G.; Nakano, M.; Toscano, K.; Sanchez, J.C. A high-precision multi-arithmetic neural circuit for the efficient computation of the new filtered-X Kronecker product APL-NLMS algorithm applied to active noise control. Expert Syst. Appl. 2022, 191, 116255. [Google Scholar] [CrossRef]
  21. Wang, H.; Zhou, K.; Zhang, G. Arithmetic operations with spiking neural P systems with rules and weights on synapses. Int. J. Comput. Commun. Control 2018, 13, 574–589. [Google Scholar] [CrossRef]
  22. Zeng, X.; Song, T.; Zhang, X.; Pan, L. Performing four basic arithmetic operations with spiking neural P systems. IEEE Trans. Nanobiosci. 2012, 11, 366–374. [Google Scholar] [CrossRef]
  23. Song, X.; Peng, H.; Wang, J.; Ning, G.; Sun, Z. Small universal asynchronous spiking neural P systems with multiple channels. Neurocomputing 2020, 378, 1–8. [Google Scholar] [CrossRef]
  24. Peng, H.; Yang, J.; Wang, J.; Wang, T.; Sun, Z.; Song, X.; Luo, X.; Huang, X. Spiking neural P systems with multiple channels. Neural Netw. 2017, 95, 66–71. [Google Scholar] [CrossRef]
  25. Chen, X.; Peng, H.; Wang, J.; Hao, F. Supervisory control of discrete event systems under asynchronous spiking neuron P systems. Inf. Sci. 2022, 597, 253–273. [Google Scholar] [CrossRef]
  26. Song, X.; Wang, J.; Peng, H.; Ning, G.; Sun, Z.; Wang, T.; Yang, F. Spiking neural P systems with multiple channels and anti-spikes. Biosystems 2018, 169, 13–19. [Google Scholar] [CrossRef]
  27. Paul, P.; Sosík, P. Solving the SAT problem using spiking neural P systems with coloured spikes and division rules. J. Membr. Comput. 2024, 1–12. [Google Scholar] [CrossRef]
  28. Frias, T.; Sanchez, G.; Garcia, L.; Abarca, M.; Diaz, C.; Sanchez, G.; Perez, H. A new scalable parallel adder based on spiking neural P systems, dendritic behavior, rules on the synapses and astrocyte-like control to compute multiple signed numbers. Neurocomputing 2018, 319, 176–187. [Google Scholar] [CrossRef]
  29. Childs, L.N. RSA cryptography and prime numbers. Cryptol. Error Correct. Algebr. Introd.-Real-World Appl. 2019, 135–151. [Google Scholar] [CrossRef]
  30. Gante, J.; Sousa, L.; Falcao, G. Dethroning GPS: Low-power accurate 5G positioning systems using machine learning. IEEE J. Emerg. Sel. Top. Circuits Syst. 2020, 10, 240–252. [Google Scholar] [CrossRef]
Figure 1. Generalized circuit function flow chart. The green dotted area generates the 9s complement; the blue dotted area performs the addition operation and carry behavior; the red dotted area signifies the result.
Figure 1. Generalized circuit function flow chart. The green dotted area generates the 9s complement; the blue dotted area performs the addition operation and carry behavior; the red dotted area signifies the result.
Mathematics 12 02149 g001
Figure 2. The 9s complement module circuit.
Figure 2. The 9s complement module circuit.
Mathematics 12 02149 g002
Figure 3. Addition and carry module circuit.
Figure 3. Addition and carry module circuit.
Mathematics 12 02149 g003
Figure 4. Signed separation module circuit.
Figure 4. Signed separation module circuit.
Mathematics 12 02149 g004
Figure 5. Generalized Signed Subtraction SNP circuit. The green dotted area represents the 9 c module; the blue dotted area represents the a & c module; the yellow dotted area represents the s s module.
Figure 5. Generalized Signed Subtraction SNP circuit. The green dotted area represents the 9 c module; the blue dotted area represents the a & c module; the yellow dotted area represents the s s module.
Mathematics 12 02149 g005
Figure 6. Subtraction operation with two digits for every operand.
Figure 6. Subtraction operation with two digits for every operand.
Mathematics 12 02149 g006
Figure 7. Subtraction operation with three digits for every operand.
Figure 7. Subtraction operation with three digits for every operand.
Mathematics 12 02149 g007
Figure 8. Subtraction operation with three digits for every operand with negative result.
Figure 8. Subtraction operation with three digits for every operand with negative result.
Mathematics 12 02149 g008
Figure 9. Addition operation with three digits for every operand.
Figure 9. Addition operation with three digits for every operand.
Mathematics 12 02149 g009
Figure 10. Graph of simulation time step usage. The red line shows the usage for positive-labeled results, while the yellow line represents the time step usage for negative-labeled results [28].
Figure 10. Graph of simulation time step usage. The red line shows the usage for positive-labeled results, while the yellow line represents the time step usage for negative-labeled results [28].
Mathematics 12 02149 g010
Figure 11. Graph of neuron growth [28].
Figure 11. Graph of neuron growth [28].
Mathematics 12 02149 g011
Table 1. Spike accumulation in the Π S A S circuit neurons, for an addition operation of 6.4 + 5.0 = 11.4 .
Table 1. Spike accumulation in the Π S A S circuit neurons, for an addition operation of 6.4 + 5.0 = 11.4 .
Time Steps σ a σ c σ S a σ S 1 σ S 2 σ S t
t = 0 a 1 0 , a 2 0 a 1 0 , a 2 0 a 1 0 , a 2 0 a 1 0 , a 2 0 a 2 0 , a 3 0 a 1 0 , a 2 0 , a 3 0
t = 12 a 1 0 , a 2 0 a 1 0 , a 2 5 a 1 4 , a 2 6 a 1 4 , a 2 0 a 2 6 , a 3 0 a 1 0 , a 2 0 , a 3 0
t = 24 a 1 0 , a 2 0 a 1 0 , a 2 0 a 1 4 , a 2 1 a 1 0 , a 2 0 a 2 0 , a 3 1 a 1 0 , a 2 0 , a 3 0
t = 36 a 1 0 , a 2 0 a 1 0 , a 2 0 a 1 0 , a 2 0 a 1 0 , a 2 0 a 2 0 , a 3 0 a 1 4 , a 2 1 , a 3 1
Table 2. Spike accumulation in the Π S A S circuit neurons, for a subtraction operation of 6.4 5.0 = 1.4 .
Table 2. Spike accumulation in the Π S A S circuit neurons, for a subtraction operation of 6.4 5.0 = 1.4 .
Time Steps σ a σ c σ S a σ S 1 σ S 2 σ S t
t = 1 a 1 10 , a 2 9 a 1 0 , a 2 0 a 1 0 , a 2 0 a 1 0 , a 2 0 a 2 0 , a 3 0 a 1 0 , a 2 0 , a 3 0
t = 12 a 1 0 , a 2 0 a 1 10 , a 2 4 a 1 4 , a 2 6 a 1 4 , a 2 0 a 2 6 , a 3 0 a 1 0 , a 2 0 , a 3 0
t = 24 a 1 0 , a 2 0 a 1 0 , a 2 0 a 1 4 , a 2 1 a 1 0 , a 2 0 a 2 5 , a 3 0 a 1 0 , a 2 0 , a 3 0
t = 36 a 1 0 , a 2 0 a 1 0 , a 2 0 a 1 0 , a 2 0 a 1 0 , a 2 0 a 2 0 , a 3 0 a 1 4 , a 2 1 , a 3 0
Table 3. Time step growth for positive-signed results, where y is the time step cycles and x is the number of digits used for every operand.
Table 3. Time step growth for positive-signed results, where y is the time step cycles and x is the number of digits used for every operand.
Frias et al. (2018) [28]Our Proposal
y = 28 + 2 ( x 1 ) y = 34 , x 9 25 + x , x > 9
Table 4. Time step growth for negative-signed results, where y is the time step cycles and x is the number of digits used for every operand.
Table 4. Time step growth for negative-signed results, where y is the time step cycles and x is the number of digits used for every operand.
Frias et al. (2018) [28]Our Proposal
y = 28 + 2 ( x 1 ) y = 72 , x 9 63 + x , x > 9
Table 5. Neuron growth, where n is the number of neurons required for performing all the functions and x is the number of digits used for every operand.
Table 5. Neuron growth, where n is the number of neurons required for performing all the functions and x is the number of digits used for every operand.
Frias et al. (2018) [28]Our Proposal
n = 12 x n = 5 + x
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Share and Cite

MDPI and ACS Style

Jimenez-Borgonio, T.; Sanchez-Garcia, J.C.; Olvera-Martinez, L.; Cedillo-Hernandez, M.; Diaz-Rodriguez, C.; Frias-Carmona, T. A Real-Number SNP Circuit for the Adder and Subtractor with Astrocyte-like Dendrite Selection Behavior Based on Colored Spikes. Mathematics 2024, 12, 2149. https://doi.org/10.3390/math12142149

AMA Style

Jimenez-Borgonio T, Sanchez-Garcia JC, Olvera-Martinez L, Cedillo-Hernandez M, Diaz-Rodriguez C, Frias-Carmona T. A Real-Number SNP Circuit for the Adder and Subtractor with Astrocyte-like Dendrite Selection Behavior Based on Colored Spikes. Mathematics. 2024; 12(14):2149. https://doi.org/10.3390/math12142149

Chicago/Turabian Style

Jimenez-Borgonio, Tonatiuh, Juan Carlos Sanchez-Garcia, Luis Olvera-Martinez, Manuel Cedillo-Hernandez, Carlos Diaz-Rodriguez, and Thania Frias-Carmona. 2024. "A Real-Number SNP Circuit for the Adder and Subtractor with Astrocyte-like Dendrite Selection Behavior Based on Colored Spikes" Mathematics 12, no. 14: 2149. https://doi.org/10.3390/math12142149

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Article metric data becomes available approximately 24 hours after publication online.
Back to TopTop