8x8-bit multiply

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

Reply to
WTec
Loading thread data ...

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).

Reply to
Bevan Weiss

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.