User manual
Tutorial: Using the logic estimator
FIR TAKING ADVANTAGE OF SYMMETRICAL COEFFICIENTS
The FIR filter can easily be modified to take advantage of symmetrical coefficients. First, we add code to
add pairs of inputs, as per the diagram shown above:
par (i = Taps - 1, j = 0; i > j; i--, j++)
{
AddLayer[j] = adjs((DataArray[i]),(DataWidth + 1)) +
adjs((DataArray[0@j]),(DataWidth + 1));
}
Then, we handle a possible middle input, if there are an odd number of coefficients:
ifselect((Taps % 2) == 1)
AddLayer[((Taps + 1) / 2) - 1] = adjs(DataArray[Taps / 2],(DataWidth + 1));
The block of multipliers is then used as before, but this time the number of multipliers is smaller:
macro expr NumberMults = (Taps + 1) / 2;
par(i = 0; i < NumberMults; i++)
{
MultResults[i] = FirPtr->Coeffs[i] * adjs(AddLayer[i],ResultWidth);
}
The call to RecurseAdd is also modified to take account of the reduced number of multipliers:
FirPtr->Output = RecurseAdd(MultResults, NumberMults-1);
The modified code is included in the
Version4 project in the TutorialFIR workspace, accessible from
Start>Programs>Celoxica>Platform Developer's Kit>Tutorials>TutorialFIR on the Start Menu.
www.celoxica.com
Page 115