Altera_Forum
Honored Contributor
8 years agoInteger vs Arbitrary Precise Integer Intel HLS
Hello all great people and Anand,
Below is the code snippet. I am using Intel HLS tool. The data type used in below given code is integer. I want to compare the result of integer data type with arbitrary precise integer represented as ac_int <W> in Intel HLS tool through AC data type library of Intel HLS tool. My question is what should be the exact representation of ac_int <W> in terms of 'W' for input arrays, dout, acc, a_reg, sub and sub2 for less latency and less resource utilization. I want to use the exact code for precise integer type instead of native integer and later compare the results of integer and arbitrary precise data type. void diff_sq_acc(int a[N], int b[N], int *dout) { unsigned char i; int acc= 0; int a_reg, b_reg, sub, sub2; for(i=0; i<N; i++) { a_reg = a;b_reg = b; sub = a_reg - b_reg; sub2 = sub*sub; acc += sub2; } *dout = acc; }