extract the meaningful data from the input data, then calculate.
| 37 | } |
| 38 | // extract the meaningful data from the input data, then calculate. |
| 39 | ap_uint<W_PU> calculate(ap_uint<W_PU> data) { |
| 40 | #pragma HLS inline |
| 41 | ap_uint<W_PU> p = data.range(W_PRC - 1, 0); |
| 42 | ap_uint<W_PU> d = data.range(W_PRC + W_DSC - 1, 0); |
| 43 | ap_uint<W_PU> nd = p * d; |
| 44 | return nd; |
| 45 | } |
| 46 | |
| 47 | /** |
| 48 | * @brief update each data as output |