Design a running average module with a dynamically growing divisor, computing the mean of all samples received so far.

Module name: running_avg
Parameters:
  - WIDTH = 24        // Total bit width (signed fixed-point)
  - FRAC  = 8         // Fractional bits

Ports:
  - input  clk
  - input  rst_n
  - input  signed [WIDTH-1:0] value_in    // New value to include in average
  - input                     valid_in    // New value available
  - output signed [WIDTH-1:0] avg_out     // Current running average
  - output [15:0]             sample_count // Number of samples included
  - output                    valid_out   // Pulses when new average is ready

Functional specification:
  - Maintain cumulative_sum (48-bit internal to prevent overflow) and sample_count
  - On each valid_in: cumulative_sum += value_in, sample_count++
  - avg_out = cumulative_sum / sample_count (signed integer division with rounding toward zero)
  - valid_out asserts when the division is complete (multi-cycle latency)
  - New valid_in is ignored while a division is in progress (busy)
  - Sequential module: multi-cycle latency due to iterative division

Key challenge:
  Division by a dynamic (non-power-of-2) divisor that changes every sample. The divisor
  starts at 1 and increments each time, so hardware cannot use shift-based shortcuts.
  An iterative restoring division is used internally.

Financial motivation:
  TWAP (Time-Weighted Average Price) and arrival-price benchmarks require a running average
  with a growing divisor. Unlike SMA which has a fixed window, the divisor changes every
  sample, making hardware implementation harder than fixed-N division. This is the core
  computation behind TWAP execution algorithms used in institutional trading.

Example (WIDTH=24, FRAC=8):
  - value_in = 100.0 (first sample) -> avg_out = 100.0, sample_count = 1
  - value_in = 102.0 (second sample) -> sum = 202.0, avg_out = 101.0, sample_count = 2
  - value_in = 99.0 (third sample) -> sum = 301.0, avg_out = 100.333..., sample_count = 3
