MACC
/*
This file represents a small multiply-accumulate component.
*/
void MAC(int num1_in, int num2_in, int num3_in, int& sum_out)
{
sum_out = (num1_in * num2_in) + num3_in ;
}
Description
The C code for the MACC is shown above. Module code must define an implementation function that defines what computations occur. Inputs are identified as parameters passed in by value and outputs to the module are identified as parameters passed in by reference (&). All input variables must come first in the function declaration followed by all of the output variables. The implementation must be a void function in which all computation inside this function will be translated into hardware.