Chargement…
Chargement…
Four-sample moving-average filter with no reset input.
Behaviour:
o_data is combinational and continuously equals (i_data + r_x1 + r_x2 + r_x3) / 4, with the fractional part discarded.r_x1, r_x2, and r_x3 hold the three previously stored samples. They are initialized to zero.i_clk, i_data enters the delay line and the oldest sample is discarded.i_data value, apply it after an edge and read o_data before the following edge.*Division by 4 is a right shift by 2 bits.*
| Signal | Direction | Width | Description |
|---|---|---|---|
i_clk | Input | 1 bit | System clock |
i_data | Input | 8 bits | Input sample |
o_data | Output | 8 bits | Moving average |