Guest
Hi,
The following code (for a decimation rate 2 FIR) is generated from Matlab Coder:
wire signed [29:0] sumofproducts; // sfix30
wire signed [55:0] sumofproducts_cast; // sfix56
// Add the products in linear fashion
assign sumofproducts = product;
// Resize the sum of products to the accumulator type for full precision addition
assign sumofproducts_cast = $signed({{26{sumofproducts[29]}}, sumofproducts});
I find the last line is difficult to understand. I suppose that it should be resize sumofproducts from 30 bits to 56 bits. Does the above line make a cascade of sumofproducts?
Could you explain it to me?
Thanks,
The following code (for a decimation rate 2 FIR) is generated from Matlab Coder:
wire signed [29:0] sumofproducts; // sfix30
wire signed [55:0] sumofproducts_cast; // sfix56
// Add the products in linear fashion
assign sumofproducts = product;
// Resize the sum of products to the accumulator type for full precision addition
assign sumofproducts_cast = $signed({{26{sumofproducts[29]}}, sumofproducts});
I find the last line is difficult to understand. I suppose that it should be resize sumofproducts from 30 bits to 56 bits. Does the above line make a cascade of sumofproducts?
Could you explain it to me?
Thanks,