Hardware Accelerator for Spiking Neural Networks Based on Comparator Array and Hardware Acceleration Method for Spiking Neural Networks
By using a hardware accelerator based on a comparator array, the problems of high power consumption, high area cost, and latency uncertainty in hardware acceleration schemes for spiking neural networks are solved, achieving low power consumption, low area, parallel sensing, and deterministic latency, which is suitable for edge computing and IoT sensors.
Patent Information
- Application Number
- CN202611168516.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Priority Date
- 2026-07-27
- Filing Date
- 2026-08-03
- Publication Date
- 2026-11-17
AI Technical Summary
Existing hardware acceleration solutions for spiking neural networks suffer from high power consumption, high area cost, non-zero static power consumption, and lack of deterministic latency, making it difficult to achieve large-scale parallel sensing and real-time control with low power consumption and small silicon area.
A hardware accelerator based on a comparator array is adopted. The comparator unit performs state storage, difference judgment and output control to achieve independent parallel processing, eliminate multiply-accumulate operations, and support adaptive threshold update and Winner-Take-All competition mechanism.
It achieves power consumption below 100 microwatts, massive parallel sensing in a very small silicon area, near-zero static power consumption and deterministic latency, and is suitable for edge computing, wearable devices and IoT sensors.
Smart Images

Figure CN123117221A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of hardware acceleration technology for Spiking Neural Networks (SNNs), specifically involving a neural network hardware architecture based on a comparator array rather than traditional multiply-accumulate units, which is suitable for ultra-low power edge computing, wearable devices, IoT sensors, and real-time pattern recognition scenarios. Background Technology
[0002] Spiking neural networks (SNNs), hailed as the third generation of neural networks, encode information through the timing and frequency of pulse firing, exhibiting characteristics such as event-driven operation and low power consumption. However, existing SNN hardware acceleration solutions suffer from the following technical problems.
[0003] The existing Intel Loihi chip is a typical digital SNN processor. Its first-generation Loihi chip integrated approximately 130,000 neurons using a 14nm process, with a chip area of approximately 60mm². Its successor, Loihi 2, using Intel's 4nm process, reduced the chip area to 31mm², increasing the number of neurons per chip to 1 million, achieving an energy efficiency of approximately 15 TOPS / W. However, the Loihi series' neuron nuclei still contain synaptic weight storage, leakage integrators, and threshold comparators, requiring multiply-accumulate (MAC) operations, resulting in a single-pulse energy consumption of approximately 20 picojoules.
[0004] The existing IBM TrueNorth chip (released in 2014) uses a simplified parametric spiking neuron model, with each neuron containing 5 configurable parameters. This solution integrates 4096 cores with a total of 1 million neurons using a 28nm process, consuming approximately 70 milliwatts of power. This solution also requires performing multiply-accumulate operations.
[0005] BrainChip's Akida series chips employ an event-driven architecture. The Akida Pico, released in 2024, achieved a compact NPU core with an area of 0.12-0.18 mm² and power consumption of <1 mW using a 22nm process. However, the Akida series is based on the TENN (Temporal Event Neural Network) model, and its architecture still includes multiply-accumulate (MAC) units, requiring multiply-accumulate operations during inference. This invention completely eliminates the MAC unit through a pure comparator architecture.
[0006] The above solutions all suffer from the following common technical drawbacks: First, power consumption cannot be further reduced. All solutions require integration, leakage current, or multiplication and accumulation calculations, resulting in high power consumption in battery-powered continuous sensing scenarios. Second, area costs are high. LIF neurons require leakage current integrators, synaptic weight storage, and complex connection routing. Third, there is non-zero static power consumption. Even if the input remains unchanged, existing solutions still suffer from static power consumption such as leakage current and clock distribution. Fourth, there is a lack of deterministic delay guarantees. The integration process of the LIF model causes the delay to depend on the input strength and accumulation time, making it difficult to guarantee deterministic response delays in real-time control scenarios.
[0007] In recent years, several exploratory SNN accelerator schemes have emerged in academia. The published paper Comperity (ACM Transactions on Architecture and Code Optimization, 2025) proposes a stateless, index-driven dataflow SNN accelerator that uses lightweight AND / XOR logic arrays to replace complex pattern matching operations. However, Comperity's "stateless" design prevents its processing units from maintaining historical states—each input must be processed independently, failing to achieve the "event-driven" resting power characteristic. In other words, while Comperity reduces some logic overhead, it sacrifices the core "state preservation" capability of spiking neurons, making it impossible to enter a near-zero power state when the input remains unchanged. Furthermore, although some existing analog SNN schemes use comparators to assist in membrane potential comparison, these comparators are all used as auxiliary functions in the "integration-firing" pipeline of the LIF model, not as independent core computational units of neurons. Summary of the Invention
[0008] Technical problems to be solved The present invention aims to solve the following technical problems: First, to achieve continuous data sensing under the constraint of a power consumption budget of less than 100 microwatts; Second, to achieve large-scale parallel sensing in an extremely small silicon area; Third, to achieve near-zero static power consumption sensing state maintenance; Fourth, to achieve deterministic delay signal change sensing.
[0009] Technical solution
[0010] To address the aforementioned technical problems, this invention provides a hardware accelerator for spiking neural networks based on a comparator array, comprising:
[0011] A comparator array, comprising multiple comparator units, each comparator unit including: a state storage unit for storing the current state value of the comparator unit, the state storage unit including but not limited to D flip-flops, latches, SRAM units, DRAM units, or non-volatile memory units; a comparator connected to the output of the state storage unit for comparing an input data value with the state value to determine whether the change exceeds a threshold; an output switch connected to the output of the comparator, which turns on to output the input data value when the change exceeds the threshold, and turns off to block the output otherwise; and a state update circuit connected to the output of the comparator and the input of the state storage unit, which writes the input data value into the state storage unit when the change exceeds the threshold.
[0012] The comparator array comprises multiple comparator units arranged in at least one of ordered array and independent configurations. Each comparator unit constitutes a spiking neuron. The conduction of the output switch corresponds to pulse firing, and the deactivation of the output switch corresponds to rest.
[0013] Furthermore, each comparator unit further includes: a threshold register for storing a threshold parameter of the comparator unit, wherein the comparator calculates the change between the input data value and the state value and compares it with the threshold parameter; the calculation method of the change includes, but is not limited to, the absolute value of the difference, the ratio, the normalized difference, the weighted difference, or the mean square error; a firing frequency counter for counting the number of firings by the comparator unit within a time window; and an adaptive threshold update circuit connected to the firing frequency counter for dynamically adjusting the value of the threshold register according to the number of firings: increasing the threshold when the firing frequency is higher than the target value, and decreasing the threshold when the firing frequency is lower than the target value.
[0014] It should be noted that the specific method for calculating the change described above is merely an illustrative example of the present invention and not a limitation thereof. Any metric that can measure the degree of difference between input data values and state values should be understood as falling within the scope of change calculation of the present invention. Similarly, parameters such as the number of comparator units, data bit width, threshold range, process node (not limited to 28nm, but applicable to any process node of 40nm, 14nm, 7nm and more advanced or more mature processes), and layout size (not limited to 1024 units, but any number) are all configurable embodiments and do not constitute a limitation on the scope of protection of the present invention.
[0015] Furthermore, the comparator array supports at least one of the following arrangements: ordered array arrangement, in which the multiple comparator units are arranged in a two-dimensional grid, and each comparator unit has fixed spatial coordinates and neighbor relationships; independent arrangement, in which the multiple comparator units work independently without spatial coordinates and neighbor relationships; and mixed arrangement, in which the first part of the comparator array is arranged in an ordered array and the second part is arranged independently.
[0016] Furthermore, in the ordered array arrangement, adjacent changed comparator units form a connected region. The accelerator outputs the bounding box of the connected region and the values of the comparator units within the region. The connected region generates a suppression signal to the adjacent region to increase its threshold, thereby realizing the Winner-Take-All competition mechanism.
[0017] Furthermore, the output frequency of the comparator unit tracks the changing frequency of the input signal: when the input signal oscillates around a threshold at a specific frequency, the comparator unit generates periodic outputs at the corresponding frequency, and the output frequencies of multiple comparator units are combined to form a spatiotemporal signature.
[0018] Furthermore, the comparator array supports the following structural layers: a pipeline layer, where each comparator unit is a pipeline; an array layer, consisting of multiple ordered or independently arranged comparator units; a region layer, where multiple adjacent comparator units form region units, providing connected region aggregation and compensation output functions; and a system layer, including an input distributor, an output synthesizer, a control interface, and a data bus interface.
[0019] This invention also provides a hardware acceleration method for a spiking neural network based on a comparator array, applied to a comparator array containing multiple comparator units, comprising the following steps: an allocation step, in which the input data stream is allocated to each comparator unit in the comparator array; a holding step, in which the state storage unit of each comparator unit independently stores the current state value; a comparison step, in which the comparator of each comparator unit compares the current input data value with its own state value to determine whether the change exceeds a preset threshold; an output step, in which when the change exceeds the threshold, the output switch of the comparator unit is turned on, outputting the current input data value, and simultaneously the state update circuit writes the input data value into the state storage unit; and a resting step, in which when the change does not exceed the threshold, the output switch of the comparator unit is turned off, blocking the output, and the state storage unit retains its original value. Each step is executed independently and in parallel by multiple comparator units in the comparator array.
[0020] Furthermore, the method also includes an adaptive step: each comparator unit counts the number of times it fires within a time window, and dynamically adjusts its threshold parameter based on the deviation between the number of fires and the target value. The method also includes a water hammer coding step: when the input signal oscillates around a threshold at a specific frequency, the comparator unit periodically fires at the corresponding frequency to form a spatiotemporal signature. The method also includes a contention step: in an ordered array arrangement, the connected regions formed by adjacent changed comparator units are detected, output on a region-by-region basis, and a suppression signal is applied to adjacent regions through a compensation output.
[0021] This invention distributes input data to multiple channels, with each channel corresponding to a data unit. Each channel independently maintains its state value, independently determines whether it has changed, and independently decides to output or block.
[0022] Each pipe initializes its state value upon its first input and sends an initialization flag to the receiver via the frame header, notifying the receiver that the pipe is ready. Thereafter, each pipe compares its state value with each input; if a change occurs, it outputs and updates its state; otherwise, it blocks output.
[0023] In this invention, "pipeline" refers to a data processing unit with state holding, differential comparison, and output control functions. Those skilled in the art should understand that the term "pipeline" is used for ease of describing the technical solution of this invention, and its specific name does not constitute a limitation on the scope of protection of this invention. Any processing unit possessing the functions of "independently holding state values, independently comparing the current input value with the state value, independently determining whether a change has occurred, independently deciding on output or blocking, and independently updating the state value to the current input value," regardless of its specific implementation, falls under the category of "pipeline" as referred to in this invention.
[0024] In software implementation, pipes correspond to variables, data structures, or objects in memory; in hardware implementation, pipes correspond to registers, signal lines, or circuit nodes. The data types carried by pipes include at least one of the following: integer, long integer, floating-point, string, structure, and class object, but are not limited to any specific data type.
[0025] Traditional difference schemes calculate the difference between the current value and the reference value using a mathematical algorithm. This invention does not calculate the difference; instead, each pipeline independently determines whether it has changed—this determination compares the current value with its own state value to see if they are "the same," rather than calculating "how much they differ." This invention is a data processing architecture, not a difference algorithm. Traditional difference schemes are centralized—a single module calculates the difference for all data. This invention is distributed—each pipeline makes its own decisions. Traditional difference schemes output the difference (which may be 0), while this invention outputs the current value when it changes and blocks the output when it remains unchanged—this is a physical / logical layer on / off action, not a mathematical calculation resulting in a 0.
[0026] Each pipeline independently checks for changes, and the results are independent of each other. This distributed architecture allows the pipelines to run in parallel naturally, making it suitable for hardware acceleration. The work of each pipeline is independent of the others, with no data dependencies. Increasing the number of pipelines does not affect the processing latency of a single pipeline.
[0027] The multiple pipelines can be arranged arbitrarily according to application requirements: when the input data has a spatial structure (such as image pixels), the pipelines can be arranged into an ordered array, with each pipeline having a fixed position in the array, forming a spatial neighbor relationship. When the input data is protocol control information (such as resolution, frame rate, timestamp), the pipelines can be allocated as needed, without requiring a fixed spatial arrangement, and each pipeline works independently, only outputting when the state changes.
[0028] The arrangement of the pipes does not affect the implementation of the core method of this invention. Pipes in any arrangement follow the same rules: independently maintain state, independently determine changes, independently output or block, and independently update state.
[0029] When pipes are arranged in an ordered array, each pipe has a fixed position within the array, forming spatial neighbor relationships with adjacent pipes based on these positions. Pipes communicate with their neighbors, sensing changes in the state of those adjacent pipes. Multiple adjacent pipes, based on their spatial neighbor relationships and state change information, form a connected region, and the pipes within this region collectively decide on the output pattern.
[0030] This spatial topology naturally endows pipe arrays with the following capabilities: neighbor communication, connectivity expansion, direction awareness, and local energy. These capabilities are inherent properties of pipes in an ordered array, a natural consequence of spatial arrangement, rather than externally added functions. For pipes not arranged in an array, these capabilities do not apply, but the pipes still operate independently, fulfilling their core functions.
[0031] In a static scenario, all pipes (including those carrying control information and those carrying the payload) simultaneously block output, resulting in an overall bandwidth approaching zero. Control information is not transmitted repeatedly, and the payload only transmits the changed portions.
[0032] The pipeline supports branching, replication, multi-level cascading, and topology bypass operations. Topology bypass operation includes: when the change exceeds a threshold, part of the data stream bypasses into the data subset processing path, and then merges into the output after completion.
[0033] When the coverage of the connected region exceeds the threshold, the compensation output mode is activated, and the output mode description parameters are replaced with pipe-by-pipe output.
[0034] When implemented in hardware, each pipeline unit includes an input terminal, a status register, a comparator, an output switch, and a status update circuit. Multiple pipeline units operate in parallel, with no data dependencies between them. The comparator can be implemented using logic gates, in-memory computation (CIM) matched-line structures, or in-memory processing (PIM) architectures. Beneficial effects
[0035] Compared with the prior art, the present invention has the following beneficial effects:
[0036] First, power consumption is significantly reduced. This invention eliminates the need for multiply-accumulate operations. In a typical configuration (28nm CMOS process, 8-bit data width), the power consumption of a single comparator unit in active state is estimated to be in the microwatt range using standard cell library logic synthesis. At a 10K cell scale, the total active power consumption of the neuron core array is approximately 10 milliwatts, and the total resting power consumption is approximately 0.1 milliwatts. Compared to traditional LIF neuron implementations that rely on multiply-accumulate operations and leakage integrators, the neuron core architecture of this invention offers a significant architectural advantage in terms of power consumption.
[0037] It should be noted that the data bit width (1 / 2 / 4 / 8 bits), process node (not limited to 28nm, applicable to any process node of 40nm, 14nm, 7nm and more advanced or more mature processes), and array size (not limited to 1024, any number) in this application are all optional configurations. Taking the data bit width as an example, the comparator area is approximately 20-50μm² in the 1-2 bit configuration, and the power consumption is approximately 0.1-0.5μW; the area is approximately 100-200μm² in the 4-8 bit configuration, and the power consumption is approximately 1-2μW (the above values are estimated based on logic synthesis of a typical CMOS standard cell library). Each configuration variation is a simple scaling of the dimensions of this invention and does not depart from the protection scope of this invention.
[0038] It should be noted that the power consumption data mentioned above are typical reference values estimated based on logic synthesis of the standard cell library. Actual power consumption depends on factors such as process node, data bit width, operating frequency and array size. Power consumption values may vary under different process and configuration parameters, but the architecture of this invention maintains the non-multiplicative accumulation characteristic under all configurations.
[0039] Second, area efficiency is significantly improved. Each comparator unit requires only a comparator, a state storage unit, and an output switch, with no leakage integrator or synaptic weight storage. In a typical configuration (28nm CMOS process), the area of a single comparator unit is estimated to be on the order of 100 square micrometers by standard cell library logic synthesis, which is much smaller than the traditional LIF neuron core solution that includes full storage, routing, and cache overhead.
[0040] Third, it achieves near-zero power consumption in the resting state. When the input data remains unchanged, the output switches of all comparator units are open, and only the data storage unit retains power, achieving a near-zero power consumption resting state. When the input data changes, only the comparator units that have changed are activated, while the comparator units that have not changed remain silent.
[0041] Fourth, achieve deterministic perceived latency. The latency for completing a single comparison operation is constant, independent of input strength or historical states, providing a guaranteed response time for real-time control scenarios.
[0042] Fifth, no programming or software stack is required. The comparator array is driven by the inherent physical characteristics of the input data, requiring no external programming, no training framework, and no compiler support; the hardware natively performs perceptual computation. The configuration interface is used for parameter setting, not instruction programming.
[0043] Sixth, flexible deployment. It can be deployed in various forms such as standalone chip, SoC IP core, and MCU embedded, adapting to different cost and application requirements. Attached Figure Description
[0044] Figure 1 This is a schematic diagram of the system architecture of the comparator array-based spiking neural network hardware accelerator of the present invention.
[0045] Figure 2 for Figure 1 A schematic diagram of the structure of a single comparator unit.
[0046] Figure 3 for Figure 1 A schematic diagram of the topology of an ordered array arrangement.
[0047] Figure 4 for Figure 1 Diagram of the connected region and compensation output function.
[0048] Figure 5 This is a flowchart of the pipeline data processing method of the present invention.
[0049] Figure 6 This is a schematic diagram of the data flow of a single-pipe unit according to the present invention.
[0050] Figure 7 This is an overview diagram of the distributed parallel pipeline architecture of the present invention.
[0051] Figure 8 This is a schematic diagram of the pipe arrangement of the present invention.
[0052] Figure 9 This is a schematic diagram of the hardware implementation structure of the pipeline unit of the present invention.
[0053] Figure 10This is a schematic diagram of the pipeline topology operation of the present invention.
[0054] Figure 11 This is a flowchart of the compensation output mode of the present invention. Detailed Implementation
[0055] The technical solution of the present invention will now be described in detail with reference to the accompanying drawings.
[0056] like Figure 5 As shown, the method of the present invention first distributes the input data to multiple pipes, each pipe corresponding to a data unit; each pipe independently maintains its corresponding state value; each pipe compares the current input value with its own state value to determine whether a change has occurred; if a change has occurred, the current input value is output; if no change has occurred, the output is blocked; each pipe independently updates its state value to the current input value.
[0057] like Figure 6 As shown, each pipeline unit includes an input terminal, a comparator, a status register, and a status update circuit. Data is input through the input terminal to the comparator, which compares the current input value with the status value stored in the status register to determine if a change has occurred. If a change has occurred, the data is output; otherwise, the output is blocked. The status update circuit updates the value of the status register to the current input value.
[0058] like Figure 7 As shown, the core architecture of this invention is a distributed parallel pipeline array, in which multiple pipelines work in parallel logically, with no data dependency between them. Each pipeline independently maintains its state value, independently compares, independently judges, independently outputs or blocks, and independently updates its state.
[0059] like Figure 8 As shown, the multiple pipelines can be arranged in any way according to application requirements: when the input data has a spatial structure, the pipelines can be arranged into an ordered array, with each pipeline having a fixed position in the array, forming a spatial neighbor relationship; when the input data is protocol control information, the pipelines can be allocated as needed, without requiring a fixed spatial arrangement, and each pipeline works independently.
[0060] like Figure 9 As shown, when implemented in hardware, each pipeline unit includes an input terminal, a comparator, an output switch (tri-state gate), a status register (D flip-flop / memory bit unit), and a status update circuit. Multiple pipeline units operate in parallel within the same clock domain, with no data dependency between them. The comparator can be implemented using logic gate circuits or an in-memory computation / processing (CIM / PIM) architecture.
[0061] like Figure 10As shown, the pipeline supports various topology operations such as branching, replication, multi-level cascading, and topology bypass. The output of the upper-level pipeline can be used as the input of the lower-level pipeline; when the change exceeds a threshold, part of the data stream can bypass into the data subset processing path, generate output mode description parameters, and then be fed into the output terminal.
[0062] like Figure 11 As shown, when the pipes are arranged in an ordered array, each pipe senses the state change information of its neighboring pipes, and multiple neighboring pipes form a connected region based on spatial neighbor relationships. When the coverage of the connected region exceeds a threshold, the compensation output mode is activated, and the output mode description parameters (such as motion vector, spectrum change parameters, sensor change vector, and change trend parameters) are used to replace the pipe-by-pipe output. The system still works normally when the compensation mode is not used.
[0063] Comparator circuit implementation
[0064] The comparator in this invention is a pure combinational logic digital comparator. Each comparator unit contains a comparator that directly compares the input data value with the state value. Its output is directly connected to the state update circuit and the output switch via a combinational logic path. The result of determining whether the change exceeds the threshold is directly indicated by the carry / borrow output or the overflow flag bit (i.e., the comparison result flag bit) of the comparator.
[0065] Unlike the traditional "subtractor + comparator" scheme, the comparator array of this invention does not have an intermediate subtractor data storage path for calculating the absolute value of the difference. The traditional scheme requires first calculating the absolute value of the difference (through the subtractor) and then comparing the difference with a threshold—this requires the intermediate difference data to be stored and transmitted between the subtractor and the comparator, increasing the latency and area overhead of the data path.
[0066] This invention achieves the shortest data flow path through the design of a pure combinational logic digital comparator: the input data value and the state value are directly and simultaneously input to the comparator, and the comparison result (i.e., whether it exceeds the threshold) is directly given by the carry / borrow output or overflow flag of the comparator, eliminating the need for intermediate difference data storage and transmission. The technical benefits of this design include: first, the shortest data path and lowest latency, with a constant delay for a single comparison independent of input strength; second, no intermediate subtractors, resulting in higher area efficiency; and third, no intermediate data storage, leading to lower power consumption, as the output switch is physically disconnected when the comparison result is below the threshold, completely blocking subsequent power consumption along the path.
[0067] It should be noted that, Figure 2The condition |X(t)-S(t-1)|>θ shown is a mathematical representation and does not restrict the specific circuit implementation of the comparator. In actual implementation, this judgment can be completed through a dual comparator path: the first comparator judges X(t)>S(t-1)+θ, the second comparator judges S(t-1)>X(t)+θ, and the OR operation of the two results yields the judgment result |X(t)-S(t-1)|>θ. This dual comparator path does not have a data storage path for storing the difference X(t)-S(t-1); the judgment result is directly indicated by the comparator's comparison result flag and then combined, which is completely consistent with the description of the present invention of "data storage path without intermediate subtractor".
[0068] Furthermore, when the output switch is turned off, the output node is pulled down to a resting level (or processed into a high-impedance state by the sample-and-hold circuit inside the output synthesizer) to explicitly indicate to subsequent circuits that no pulse is being delivered.
[0069] Example 1: Independent Coprocessor Chip
[0070] This embodiment provides a hardware accelerator chip for spiking neural networks based on a comparator array.
[0071] Chip specifications: Can be made using, for example, a 28nm CMOS process (other process nodes are also possible), integrates, for example, 1024 comparator units (other numbers are also possible), data bit width for example, 8 bits (configurable for example, 1 / 2 / 4 / 8 bits), threshold range for example, 1 to 127 (configurable), interface supports for example, SPI and I2C, and chip area is approximately 0.1 square millimeters in 28nm process.
[0072] Power consumption characteristics: Under typical configurations, total power consumption in active mode can reach approximately 1 milliwatt, and in static mode approximately 10 microwatts. Supports Hebb adaptive thresholding, with a learning rate α set to, for example, 0.01.
[0073] Workflow: An external MCU configures the threshold and mode parameters of each comparator unit via, for example, an SPI interface. The coprocessor continuously receives sensor data (e.g., 100 samples per second). Each comparator unit independently performs threshold comparison operations: it outputs when the input change exceeds the threshold and blocks the output when the input does not exceed the threshold. The Hebb adaptive mechanism automatically adjusts the threshold of each comparator unit during operation to adapt to changes in sensor characteristics.
[0074] Example 2: UART sensor interface (independent arrangement)
[0075] This embodiment provides a hardware acceleration method for spiking neural networks for vibration monitoring in industrial IoT.
[0076] Configuration parameters: The number of comparator units is, for example, 8 (other numbers are possible), arranged independently (without spatial neighbor relationship), each comparator unit corresponds to one sensor channel, and the threshold is configured independently according to the sensor type.
[0077] Workflow: Data from each sensor channel is allocated to the corresponding comparator unit. The comparator unit continuously monitors whether the input value deviates from its state value by more than a threshold. When the sensor reading is stable, all comparator units are in a quiescent state, blocking output. When a sensor reading changes and exceeds the threshold, the corresponding comparator unit outputs. The output can adopt a reservoir mode: for example, 8 samples are combined into a data packet and then reported in batches.
[0078] Example 3: Always-On wake-up coprocessor
[0079] This embodiment provides a spiking neural network hardware accelerator for keyword wake-up of smart devices.
[0080] Configuration parameters: The number of comparator units is, for example, 128 (other numbers are possible), arranged in an ordered array, with each comparator unit corresponding to a frequency bin in the audio spectrum. The threshold for the low-frequency bin is set higher, for example, to suppress ambient noise, while the threshold for the high-frequency bin is set lower, for example, to enhance sensitivity.
[0081] Workflow: Audio spectrum data is continuously input to each comparator unit. Ambient noise causes some comparator units to continuously fire, triggering the Hebb adaptive mechanism to raise their thresholds, producing a sensory adaptation effect. When a keyword appears, the input change pattern of a specific frequency bin is encoded as a firing frequency signature by the water hammer effect. When the processor's output pattern matching logic detects this signature, it wakes up the main processor.
[0082] Example 4: Multi-mode sensor fusion
[0083] This embodiment provides a hardware acceleration system for spiking neural networks for multi-mode sensor fusion.
[0084] Configuration parameters include, for example, three subarrays, corresponding to accelerometer, gyroscope, and magnetometer data, respectively. Each subarray contains, for example, 128 ordered comparator units (other numbers are possible), and the subarrays are connected via a region-level interface.
[0085] Workflow: Data from each sensor is distributed to its corresponding subarray. Each subarray independently performs threshold comparison and release operations. Adjacent comparator units within a subarray implement a contention mechanism through compensated outputs. The release patterns of each subarray are combined to form a motion state signature.
[0086] Stability description of the adaptive mechanism
[0087] The adaptive threshold update mechanism of this invention is a negative feedback loop. The learning rate α and the statistical window width W are set to ensure stable convergence of this negative feedback loop. When the input signal oscillates continuously, the adaptive mechanism generates a sensory adaptation effect: the comparator unit firing frequency increases, the threshold gradually rises above the signal swing, and firing stops; subsequently, the threshold slowly falls back, firing resumes, forming a dynamic equilibrium. This behavior is consistent with the sensory adaptation characteristics of biological neurons and is the expected performance of the Hebb learning mechanism of this invention.
[0088] Information encoding capacity of spatiotemporal signature
[0089] For an array of N comparator units, the firing / resting binary states of each unit can be combined to encode up to 2^N spatial patterns. Combined with the firing frequency dimension (time domain coding) of each unit, high-dimensional encoding of spatiotemporal two-dimensional information can be achieved, which is suitable for the recognition of complex time-series patterns.
[0090] The above description is merely a preferred embodiment of the present invention and does not limit the scope of the patent. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.
Claims
1. A comparator array based hardware accelerator for spiking neural networks, characterized in that, include: A comparator array, comprising multiple comparator units, each of the comparator units including: A state storage unit is used to store the current state value of the comparator unit; The comparator has a first input terminal that receives an input data value and a second input terminal that is connected to the output terminal of the state storage unit to receive the state value. It is used to compare the change between the input data value and the state value with a preset threshold parameter and output a change judgment result. The preset threshold parameter is a hard-wired fixed value or a configurable value received from the configuration interface. An output switch is connected to the output terminal of the comparator and the input data value. When the change judgment result is that the change exceeds the threshold, the switch is turned on to output the input data value; otherwise, the switch is turned off to block the output. A state update circuit is connected to the output of the comparator to receive the change judgment result and the input data value, and is connected to the input of the state storage unit. When the change judgment result is that the change exceeds a threshold, the input data value is written into the state storage unit. The comparator array comprises multiple comparator units arranged in at least one of ordered array and independent arrangement (the ordered array refers to a two-dimensional grid arrangement with fixed spatial coordinates and neighbor relationships, and the independent arrangement refers to each unit working independently without spatial coordinates and neighbor relationships). Each comparator unit constitutes a spiking neuron, and the conduction of the output switch corresponds to pulse firing, while the deactivation of the output switch corresponds to rest.
2. The spiking neural network hardware accelerator of claim 1, wherein, Each of the comparator units further includes: The threshold register is used to store the threshold parameters of the comparator unit. The firing frequency counter is used to count the number of times the comparator unit fires within a time window; An adaptive threshold update circuit, connected to the firing frequency counter, is used to dynamically adjust the value of the threshold register according to the number of firings: when the firing frequency is higher than the target value, the threshold is increased; when the firing frequency is lower than the target value, the threshold is decreased. The comparator is a pure combinational logic digital comparator. Its output is directly connected to the state update circuit and the output switch via a combinational logic path. The change judgment result is directly indicated by the comparison result flag bit of the comparator. There is no intermediate subtractor data storage path in the comparator array for calculating the absolute value of the difference. The state storage unit includes, but is not limited to, D flip-flops, latches, SRAM units, DRAM units, or non-volatile memory units.
3. The spiking neural network hardware accelerator of claim 1, wherein, The comparator array supports at least one of the following arrangements: The comparator units are arranged in an ordered array, with each comparator unit having fixed spatial coordinates and neighbor relationships, and can access the state values of its neighboring comparator units. The multiple comparator units are arranged independently and operate independently, without spatial coordinates or neighbor relationships. The comparator array is arranged in a mixed configuration, with the first part arranged in an ordered array and the second part arranged independently.
4. The spiking neural network hardware accelerator of claim 1, wherein, The output frequency of the comparator unit tracks the changing frequency of the input signal: when the input signal oscillates around a threshold at a specific frequency, the comparator unit generates periodic pulses at the corresponding frequency; the output frequencies of multiple comparator units are combined to form a spatiotemporal signature, which is used to identify the timing pattern of the input signal; wherein, the pulse firing timing of the comparator unit is independently driven by the inherent changing frequency of the input signal, and the pulse firing is asynchronous with the external system clock, that is, no external clock is required to control the pulse firing time, but the sampling and latching of the input data can still be based on the external clock or asynchronous handshake signal.
5. The spiking neural network hardware accelerator of claim 3, wherein, In an ordered array arrangement, adjacent changed comparator units form a connected region; the accelerator outputs the bounding box of this connected region and the values of the comparator units within the region as a compensation output; the compensation output generates a suppression signal on the adjacent region, raising its threshold and realizing a Winner-Take-All competition mechanism.
6. The spiking neural network hardware accelerator as described in claim 1, characterized in that, Includes the following structural levels: The pipeline layer, each of the comparator units is a pipeline, which consists of a comparator, a state storage unit, an output switch and a state update circuit; The array layer consists of M×N comparator units arranged in an ordered manner or N independently arranged comparator units; The region layer, located above the array layer, is composed of a logical combination of multiple adjacent comparator units in the array layer, providing connected region aggregation and compensation output functions. The system layer includes an input distributor, an output synthesizer, a control interface, and a data bus interface, enabling communication with external systems.
7. The spiking neural network hardware accelerator as described in claim 1, characterized in that: When the input data remains unchanged, the output switches of all comparator units in the comparator array are turned off, and only the data retention power of the state storage unit is maintained, thus achieving a near-zero power consumption resting state. When the input data changes, only the output switches of the comparator units that have changed are turned on, while the comparator units that have not changed remain in a dormant state.
8. The spiking neural network hardware accelerator as described in claim 1, characterized in that, The following configuration methods are supported: Threshold configuration allows for independent or uniform configuration of threshold parameters for each comparator unit. The bit width configuration allows for independent configuration of the data bit width for each comparator unit, wherein the data bit width is 1 bit, 2 bits, 4 bits, or 8 bits. Adaptive parameter configuration allows for independent configuration of the adaptive learning rate and target firing frequency for each comparator unit; The arrangement method can be configured as an ordered array arrangement, an independent arrangement, or a mixed arrangement; The mode switching configuration can be set to low-power monitoring mode (higher threshold, lower issuance frequency) or precise sensing mode (lower threshold, higher detection sensitivity). Output switch type configuration, wherein the output switch is any one of a transmission gate, a tri-state buffer, or a multiplexer.
9. The spiking neural network hardware accelerator as described in claim 1, characterized in that, Supports offline training configuration mode: In this mode, the accelerator receives and stores threshold configurations and adaptive parameters generated by external computing tools after offline analysis of the statistical characteristics of training data through the configuration interface; during inference, the comparator array performs pure comparison inference with zero multiplication operation according to the stored configuration.
10. A hardware acceleration method for a spiking neural network based on a comparator array, applied to a comparator array containing multiple comparator units, characterized in that, Includes the following steps: The allocation step distributes the input data stream to the individual comparator units in the comparator array; In the maintenance step, each comparator unit independently maintains its current state value through its state storage unit; In the comparison step, the comparator of each comparator unit compares the current input data value with its own state value, determines whether the change exceeds a preset threshold, and outputs the change judgment result. In the pulse issuance step, when the change judgment result is that the change exceeds the threshold, the output switch of the comparator unit is turned on to output the current input data value. At the same time, the state update circuit writes the input data value into the state storage unit to realize pulse issuance. In the resting step, when the change judgment result is that the change amount does not exceed the threshold, the output switch of the comparator unit is turned off to block the output, and the state storage unit keeps the original value unchanged, thus achieving resting. In the adaptive step, each comparator unit dynamically adjusts its threshold parameter based on the deviation between its statistical distribution frequency and the target value—raising the threshold to reduce the distribution rate when the distribution frequency is higher than the target value, and lowering the threshold to increase the distribution rate when the distribution frequency is lower than the target value, thus realizing the Hebb adaptive learning mechanism. The allocation step, holding step, comparison step, issuing step, resting step, and adaptive step are executed independently and in parallel by multiple comparator units in the comparator array; in the change determination step, the determination result of whether the change exceeds the threshold is directly indicated by the comparison result flag bit of the comparator, without relying on the storage of intermediate difference data.
