417 Simple LIF Neuron

417 : Simple LIF Neuron

Design render

How it works

This project implements a hardware-optimized LIF (Leaky Integrate-and-Fire) neuron in Verilog, designed for area efficiency while maintaining biological realism. The system consists of four main components:

Core LIF Neuron Engine

The heart of the system implements authentic LIF dynamics:

  • Integration: V_mem = V_mem + weighted_input - leak_rate
  • Spike Generation: When V_mem ≥ threshold, generate spike and reset V_mem = 0
  • Refractory Period: 4-cycle no-spike period after each action potential
  • Variable Leak Rates: 4 different membrane leak speeds (1-4 units/cycle)

The implementation uses 8-bit arithmetic for hardware efficiency while maintaining biological accuracy across a 0-255 membrane potential range.

Enhanced Input Processing

  • 3-bit Channel Precision: Each synaptic input (Channel A, Channel B) accepts 0-7 stimulus levels
  • Weighted Integration: weighted_input = (chan_a × weight_a) + (chan_b × weight_b)
  • Synaptic Depression: Temporary weight reduction after spike generation for realistic synaptic fatigue
  • 64 Input Combinations: Full 8×8 stimulus space for fine-grained neural control

Serial Parameter Loader

A dedicated state machine loads five key parameters via single-bit serial interface:

  • Weight A/B (3 bits each): Synaptic strength for channels A and B
  • Leak Config (2 bits): Membrane leak rate selection (1-4 units/cycle)
  • Threshold Min/Max (8 bits each): Adaptive threshold bounds
  • 40-bit Total: Complete parameter set loaded serially for different neuron personalities

Advanced Biological Features

  • Adaptive Thresholds: Increase by 4 units after spikes, decrease by 1 unit during silence
  • Synaptic Depression: Weights temporarily reduced by 3 units after spiking
  • Multiple Neuron Types: Configurable personalities (high/low sensitivity, balanced, custom)
  • Realistic Dynamics: Proper integration, leak, refractory periods matching biological neurons

I/O Interface

  • 6-bit stimulus input: 3-bit Channel A + 3-bit Channel B with 2 pins reserved for expansion
  • 8-bit neural output: 7-bit membrane potential + 1-bit spike detection
  • Serial configuration: Single-bit parameter loading with status monitoring
  • Debug outputs: Parameter ready, spike monitor, activity indicators

How to test

Basic Operation Test

  1. System Reset: Assert rst_n low, then release while keeping ena high
  2. Apply Stimulus: Set ui_in[2:0] (Channel A) and ui_in[5:3] (Channel B) to desired values (0-7 each)
  3. Monitor Output: Watch uo_out for spikes, uo_out[6:0] for real-time membrane potential
  4. Expected Behavior: With default parameters, combined stimulus ≥ 4 should eventually generate spikes

Parameter Loading Test

  1. Enter Load Mode: Set uio_in (load_mode) = 1
  2. Send Parameters: Use uio_in (serial_data) to clock in 40 bits (5×8 bit parameters):
    • Weight A: 8 bits (try 0x04 for moderate synaptic strength)
    • Weight B: 8 bits (try 0x03 for balanced dual-channel response)
    • Leak Config: 8 bits (try 0x01 for slow leak, 0x03 for fast leak)
    • Threshold Min: 8 bits (try 0x20=32 for low sensitivity, 0x40=64 for high)
    • Threshold Max: 8 bits (try 0x60=96 for moderate, 0x80=128 for wide range)
  3. Monitor Status: Watch uio_out (params_ready) transition from 1→0→1
  4. Exit Load Mode: Set uio_in = 0
  5. Test New Behavior: Apply stimuli and verify different firing patterns

Neuron Configuration Testing

Load these parameter sets to test different neuron behaviors:

Configuration Weight A Weight B Leak Thr Min Thr Max Expected Behavior
High Sensitivity 0x06 0x05 0x01 0x19 0x50 Spikes with low inputs
Low Sensitivity 0x01 0x01 0x03 0x3C 0x78 Requires high inputs
Balanced 0x04 0x04 0x02 0x1E 0x5A Moderate responses
Fast Dynamics 0x03 0x03 0x03 0x28 0x5A Rapid leak, brief integration

Stimulus Response Testing

  • Chan A=0, Chan B=0: Should remain at rest (membrane potential ~0-10)
  • Chan A=1, Chan B=1: Subthreshold integration, gradual membrane rise
  • Chan A=2, Chan B=2: Threshold region, occasional spikes depending on configuration
  • Chan A=3, Chan B=3: Suprathreshold, regular spike generation
  • Chan A=7, Chan B=7: Maximum input, high-frequency firing or rapid adaptation

Advanced Feature Testing

  • Adaptive Thresholds: Apply repeated stimuli, observe increasing inter-spike intervals
  • Synaptic Depression: High-frequency stimulation should show reduced response over time
  • Leak Rate Effects: Compare integration speed with different leak configurations
  • Dual Channel: Test various A/B combinations to verify independent channel processing

Debug Monitoring

  • uio_out: Parameter loading status (1=ready, 0=loading)
  • uio_out: Duplicate spike output for external monitoring
  • uio_out: Membrane activity indicator (1=active, 0=quiet)
  • uio_out[5:7]: Echo signals for load mode, serial data, and enable verification

External hardware

No external hardware required for basic operation:

  • Stimulus Input: Connect DIP switches or digital signals to ui_in[5:0] for manual channel control
  • Spike Output: Connect LED to uo_out for visual spike indication
  • Membrane Monitor: Connect 7-segment display or LED bar to uo_out[6:0] for membrane voltage visualization

IO

#InputOutputBidirectional
0CHAN_A_BIT0V_MEM_BIT0LOAD_MODE
1CHAN_A_BIT1V_MEM_BIT1SERIAL_DATA
2CHAN_A_BIT2V_MEM_BIT2PARAMS_READY
3CHAN_B_BIT0V_MEM_BIT3SPIKE_MONITOR
4CHAN_B_BIT1V_MEM_BIT4MEM_ACTIVITY
5CHAN_B_BIT2V_MEM_BIT5LOAD_MODE_ECHO
6RESERVED_0V_MEM_BIT6SERIAL_DATA_ECHO
7RESERVED_1SPIKE_OUTENABLE_STATUS

Chip location

Controller Mux Mux Mux Mux Mux Mux Mux Mux Mux Mux Mux Mux Mux Mux Mux Mux Mux tt_um_chip_rom (Chip ROM) tt_um_factory_test (Tiny Tapeout Factory Test) tt_um_oscillating_bones (Oscillating Bones) tt_um_tt_tinyQV (TinyQV - Crowdsourced Risc-V SoC) tt_um_rejunity_atari2600 (Atari 2600) tt_um_rejunity_lgn_mnist (LGN hand-written digit classifier (MNIST, 16x16 pixels)) tt_um_izh_neuron_lite (LIF Neuron) tt_um_blptrk_weaving01 (weaving in silicon #1) tt_um_rte_eink_driver (E-ink display driver) tt_um_bleeptrack_prism (Prism) tt_um_zerotoasic_logo_screensaver (VGA Screensaver with Zero to ASIC Logo) tt_um_kianV_rv32ima_uLinux_SoC (KianV uLinux SoC) tt_um_nefelimet_updown_cntr (3-bit up-down counter) tt_um_wokwi_434917577229968385 (LIF neuron) tt_um_wokwi_434917320361309185 (TinyTapeout 2025) tt_um_wokwi_434917171311441921 (MC first Wokwi) tt_um_wokwi_434917344830882817 ('') tt_um_wokwi_434918300941464577 (WowkiProject) tt_um_wokwi_434917453767462913 (Mini Calculator v1) tt_um_wokwi_434917219039482881 (and) tt_um_wokwi_434917025263649793 (DigOTA) tt_um_wokwi_434917044822739969 (TinyTapeoutWorkshop) tt_um_wokwi_434921821909078017 (and gate) tt_um_wokwi_434917167895180289 (Encoder) tt_um_wokwi_434917143298726913 (Chip design from Wokwi) tt_um_wokwi_434921804663145473 (Tapeout try) tt_um_wokwi_434917374201501697 (dummy) tt_um_wokwi_434917318393129985 (Tiny Tapeout Template Copy) tt_um_wokwi_434917632188986369 (Timo 1) tt_um_wokwi_434917842159020033 (And Gate) tt_um_wokwi_434917427319226369 (Tiny Tapeout Chip) tt_um_wokwi_434917260383792129 (Tiny Tapeout Workshop Project by Nick Figner) tt_um_wokwi_434917040492120065 (4 bit incrementer) tt_um_wokwi_434917990496885761 (Projekt) tt_um_wokwi_434917381796339713 (Nils Tinytapeout Proj) tt_um_wokwi_434917317189363713 (tinytapeoutchip) tt_um_wokwi_434917679388544001 (tiny tapeout chip) tt_um_wokwi_434917506576906241 (ToDo) tt_um_wokwi_434917139713644545 (in progress) tt_um_wokwi_434917382645687297 (numbers) tt_um_wokwi_434917816595781633 (number display) tt_um_wokwi_434918311072808961 (GG) tt_um_wokwi_434917362908337153 (noclue) tt_um_wokwi_434917682511205377 (Random) tt_um_wokwi_434925031692840961 (demo-tiny) tt_um_wokwi_434917760986646529 (Barans erster Template Design) tt_um_wokwi_434917419779963905 (Tapeout Test1) tt_um_wokwi_434917684709021697 (Tiny Tapeout Template Copy_Orion) tt_um_wokwi_434918956220790785 (Simple classification perceptron ) tt_um_wokwi_434918068909406209 (Tiny Tapeout) tt_um_parx (example-verilog) tt_um_wokwi_434917624377094145 (brostarscard) tt_um_urish_simon (Simon Says memory game) tt_um_emmk_riscv (ENSEIRB-MATMECA RISC-V ASIC) tt_um_abhinav8prasad_dds (8-bit DDS sine wave generator) tt_um_wokwi_436554456427191297 (OCDCpro TT key lock test design IHP) tt_um_wokwi_434391222509479937 (4-Bit Adder) tt_um_ihp_logo_screensaver (VGA Screensaver with the IHP Logo) tt_um_pqn (PQN Model with Verilog) tt_um_Xelef2000 (RNG) tt_um_gamepad_pmod_demo (Gamepad Pmod Demo) tt_um_anujic (Morse Code Trainer) tt_um_rodald_cpr (CRP - Custom Risc Processor) tt_um_alif_dual_unileak (LIF Neuron) tt_um_riscv_mini_ihp (RISC-V Mini IHP) tt_um_wokwi_434917200607612929 (test_design) tt_um_alif_single_dualleak (Simple LIF Neuron) tt_um_blptrk_weaving02 (weaving in silicon #2) tt_um_blptrk_weaving03 (weaving in silicon #3) tt_um_blptrk_weaving04 (weaving in silicon #3) tt_um_dumbrv_yliu_hashed (DUMBRV) tt_um_iz_neuron (IZH Neuron) tt_um_test_chip_pius (Verilog OR-Gate) tt_um_pwm_block (PWM_SPI) tt_um_2048_vga_game (2048 sliding tile puzzle game (VGA)) tt_um_dpi_adexp (AdExp DPI Neuron ) tt_um_urish_sic1 (SIC-1 8-bit SUBLEQ Single Instruction Computer) tt_um_cedrichirschi_sar (SAR ADC Controller) tt_um_htfab_yadge (Yet Another Diffraction Grating Experiment) tt_um_ds_comp_adc (Delta Sigma Comparator Based ADC) tt_um_tinytapeout_logo_screensaver (VGA Screensaver with Tiny Tapeout Logo) Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available