Forum Discussion
Altera_Forum
Honored Contributor
11 years agoBit widths for addition
Hi, I am trying to write a pipelined adder for a filter design. all the gaussianPixels are 8 bits wide. gaussianPartialSum0 <= ("00" & gaussianPixels(0)) + ('0' & gaussianPixels(3) & '0') ...
Altera_Forum
Honored Contributor
11 years ago --- Quote Start --- Ok. thank you. I will try that. These values are all unsigned so hopefully it wont do any bit extension or anything. --- Quote End --- Look at the code that implements the resize() function in the numeric_std source. Please note that it works on only unsigned and signed types, not std_logic_vectors. For unsigned operands, it boils down to simple zero extension. For signed operands, it does proper sign extension.