The module you provided,RecurrentSpikingNeuron, is a implementation for a spiking neuron model, specifically a type of recurrent neuron that includes feedback from its own output. This design is based on the leaky integrate-and-fire (LIF) model, often used in computational neuroscience and neuromorphic engineering. Here’s a breakdown of its components and functionality:
Module Description:
Module Name:RecurrentSpikingNeuron
Inputs:clk(Clock signal)reset(Asynchronous reset, active high)enable(Enable signal for updating the neuron)external_input_current(8-bit external input current)threshold(8-bit firing thresholdVthreshV_{thresh}Vthresh)decay(8-bit decay value for membrane potential)refractory_period(8-bit duration of refractory period in clock cycles)feedback_scale(8-bit scaling factor for feedback from the output spike)
clk(Clock signal)
reset(Asynchronous reset, active high)
enable(Enable signal for updating the neuron)
external_input_current(8-bit external input current)
threshold(8-bit firing thresholdVthreshV_{thresh}Vthresh)
decay(8-bit decay value for membrane potential)
refractory_period(8-bit duration of refractory period in clock cycles)
feedback_scale(8-bit scaling factor for feedback from the output spike)
Output:spike_out(Signal indicating whether a spike occurred)
spike_out(Signal indicating whether a spike occurred)
Module Name:RecurrentSpikingNeuron
Inputs:
clk(Clock signal)
reset(Asynchronous reset, active high)
enable(Enable signal for updating the neuron)
external_input_current(8-bit external input current)
threshold(8-bit firing thresholdVthreshV_{thresh}Vthresh)
decay(8-bit decay value for membrane potential)
refractory_period(8-bit duration of refractory period in clock cycles)
feedback_scale(8-bit scaling factor for feedback from the output spike)
clk(Clock signal)
reset(Asynchronous reset, active high)
enable(Enable signal for updating the neuron)
external_input_current(8-bit external input current)
threshold(8-bit firing thresholdVthreshV_{thresh}Vthresh)
decay(8-bit decay value for membrane potential)
refractory_period(8-bit duration of refractory period in clock cycles)
feedback_scale(8-bit scaling factor for feedback from the output spike)
Output:
spike_out(Signal indicating whether a spike occurred)
spike_out(Signal indicating whether a spike occurred)
Internal Components:
LeakyIntegrateFireNeuron Submodule:This submodule handles the core functionality of the leaky integrate-and-fire neuron model. It computes whether the neuron spikes based on the current input and the neuron's parameters (threshold, decay, etc.).
LeakyIntegrateFireNeuron Submodule:This submodule handles the core functionality of the leaky integrate-and-fire neuron model. It computes whether the neuron spikes based on the current input and the neuron's parameters (threshold, decay, etc.).
Key Functionality:
Feedback Mechanism:After theLeakyIntegrateFireNeurondetermines a spike, the output spike (internal) influences the input for the next cycle. The spike is scaled byfeedback_scaleand added to the external input current. This feedback loop allows the neuron model to exhibit recurrent behavior.
Signal Processing:Scaling and Sign Extension:The output spike and external current are extended to 9 bits to maintain sign information correctly and facilitate arithmetic operations.Total Current Calculation:The scaled spike and the extended external input are summed to form the total input current for the next cycle.Handling Overflows:The module handles potential overflow and underflow when computing the total current to keep the values within the 8-bit range using two's complement arithmetic.
Scaling and Sign Extension:The output spike and external current are extended to 9 bits to maintain sign information correctly and facilitate arithmetic operations.
Total Current Calculation:The scaled spike and the extended external input are summed to form the total input current for the next cycle.
Handling Overflows:The module handles potential overflow and underflow when computing the total current to keep the values within the 8-bit range using two's complement arithmetic.
Output Spike Handling:The internal spike signal directly drives the output spike signal, indicating whether a spike occurred during the current clock cycle.
Feedback Mechanism:After theLeakyIntegrateFireNeurondetermines a spike, the output spike (internal) influences the input for the next cycle. The spike is scaled byfeedback_scaleand added to the external input current. This feedback loop allows the neuron model to exhibit recurrent behavior.
Signal Processing:
Scaling and Sign Extension:The output spike and external current are extended to 9 bits to maintain sign information correctly and facilitate arithmetic operations.
Total Current Calculation:The scaled spike and the extended external input are summed to form the total input current for the next cycle.
Handling Overflows:The module handles potential overflow and underflow when computing the total current to keep the values within the 8-bit range using two's complement arithmetic.
Scaling and Sign Extension:The output spike and external current are extended to 9 bits to maintain sign information correctly and facilitate arithmetic operations.
Total Current Calculation:The scaled spike and the extended external input are summed to form the total input current for the next cycle.
Handling Overflows:The module handles potential overflow and underflow when computing the total current to keep the values within the 8-bit range using two's complement arithmetic.
Output Spike Handling:The internal spike signal directly drives the output spike signal, indicating whether a spike occurred during the current clock cycle.
Feedback Calculation:
The feedback mechanism involves sign-extending the 8-bitfeedback_scaleandexternal_input_currentto 9 bits and then using the sign bit to maintain the proper arithmetic behavior. This design choice ensures that feedback can be both positive and negative, depending on the sign offeedback_scale.
The feedback mechanism involves sign-extending the 8-bitfeedback_scaleandexternal_input_currentto 9 bits and then using the sign bit to maintain the proper arithmetic behavior. This design choice ensures that feedback can be both positive and negative, depending on the sign offeedback_scale.
This module effectively models a neuron's dynamic response to input stimuli, including its own output, providing a powerful tool for simulating neural networks with recurrent connections.