Ring buffer / FIFO

Børge Strand-Bergesen borge.strand at gmail.com
Fri Nov 13 15:42:46 CET 2009


Hi all,

I'm working on a program that performs a convolution of two arrays,
each one consisting of 16 signed 64-bit words. One array will have
fixed contents (i.e. coefficients) while the other will act as a FIFO
or ring buffer (i.e. samples). I will need to access each member of
both arrays individually.

As a new sample arrives, the oldest member of the samples array is
overwritten. This can be done by shifting the existing 15 members one
position (I don't mind the time penalty) or overwriting the oldest
while updating an index offset. After the new sample has arrived, a
multiply-accumulate is performed on the two arrays. The purpose is to
verify an actual MAC that resides in an FPGA. I plan to do the
calculations in paralell and exchange data over the UART. The basic
functionality already works. This time around I'm adding the arrays to
make it act as an actual filter.

I believe this is all doable using arrays and special functions in
GMP. But before I get cracking on that I wanted to check if there are
existing functions or code for this.


Thanks,
Borge


More information about the gmp-discuss mailing list