8x8-bit multiply

Nov 08, 2005 1 Replies

Hello all


I want to multiply two signed 8-bit numbers and pick 8 bits from the result.


My code is like this:


library IEEE;



use IEEE.STD_LOGIC_1164.ALL;



use IEEE.STD_LOGIC_ARITH.ALL;



use IEEE.STD_LOGIC_UNSIGNED.ALL;


entity test is



Port ( k : in std_logic_vector(7 downto 0);



x : in std_logic_vector(7 downto 0);



y : out std_logic_vector(7 downto 0));



end test;


architecture beh of test is



signal kx : std_logic_vector(15 downto 0);



constant Offset : integer := 4;



begin



kx


They're just warnings, and quite valid ones, so I'm not sure why you want to get rid of them.

If you're not going to use the high order bits, then why calculate them? Surely kx should only be from 7+Offset downto 0

That would get rid of the first warning, though may produce one about kx not being of sufficient size for the 8x8 result (or some other such warning).

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required