I am writing a very very simple processor in VHDL that works with and 8-bit stream. I want to include a multiplication instruction in my ALU, but only tu multiply numbers that are inferior to 15, since a multiplication of two 8-bit numbers would result in a 16-bit number. So, for example, if I wanted to multiply 4 and 7, I would have 0000 0100 x 0000 0111, and the result would be 00011000.
So I wrote the following:
result <= std_logic_vector(unsigned(x)*unsigned(y));
But since I am working in a 8-bit system, my result signal is an 8-bit standard logic vector and ISE gives me an error message when I try to do this assignment. Since I just want the 8 least significant bits of the number, I've tried
result <= std_logic_vector(unsigned(x)*unsigned(y))(7 downto 0);
But then it says that I can't index the result of a type conversion, which seems clear but it doesn't point out any other way to do it.
Is there any way to pick the least significant bits of a multiplication without having to create a separate signal?
Thanks in advance.