MagixD
Junior Member level 1
Hello,
I want to multiply two 32bit vectors and add a 32bit vector to it. As we know, if we multiply two 32bit vectors the result is a 64bit vector. I know that the result of the multiplication in my design will not exceed 32bit, so i wrote a code in a style like this:
Is it possible to write the code without the use of the signal res, like:
I hope anyone can understand my problem.
magixD
I want to multiply two 32bit vectors and add a 32bit vector to it. As we know, if we multiply two 32bit vectors the result is a 64bit vector. I know that the result of the multiplication in my design will not exceed 32bit, so i wrote a code in a style like this:
Code:
signal arr1 : signed(31 downto 0);
signal arr2 : signed(31 downto 0);
signal res : signed(63 downto 0);
signal foo : signed(31 downto 0);
res <= arr1*arr2;
foo <= res(31 downto 0) + X"0000000F";
Is it possible to write the code without the use of the signal res, like:
Code:
foo <= (arr1*arr2)(31 downto 0) + X"000000F";
I hope anyone can understand my problem.
magixD