Design a MACD (Moving Average Convergence/Divergence) indicator.

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

Ports:
  - input                     clk
  - input                     rst_n         // Active-low synchronous reset
  - input  signed [WIDTH-1:0] price_in      // Signed fixed-point price
  - input                     valid_in      // High for one cycle when price_in is valid
  - output signed [WIDTH-1:0] macd_line     // EMA_fast - EMA_slow
  - output signed [WIDTH-1:0] signal_line   // EMA of macd_line (period 9)
  - output signed [WIDTH-1:0] histogram     // macd_line - signal_line
  - output                    valid_out     // High after enough samples for signal line

Functional specification:
  - EMA_fast: EMA with period 12, alpha ~= 2/(12+1) ~= 0.154 -> 39 in Q0.8
  - EMA_slow: EMA with period 26, alpha ~= 2/(26+1) ~= 0.074 -> 19 in Q0.8
  - macd_line = EMA_fast(price) - EMA_slow(price)
  - signal_line = EMA(macd_line, period 9), alpha ~= 2/(9+1) = 0.2 -> 51 in Q0.8
  - histogram = macd_line - signal_line
  - Instantiates the ema submodule (3 instances: fast, slow, signal)
  - valid_out asserts once the signal EMA has been initialized
  - On reset, all sub-EMAs reset
