- Joined
- Sep 23, 2009
- Messages
- 6
- Reaction score
- 0
hi all,
I design a multiplier but I have a mistake that I can not understand why. It always reports this sentence:"Can't determine definition of operator ""sll""--found posible definition".I think because I use "sll" keyword in a wrong way but I don't know how to correct.Help me plz!
Here is my code:
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
use ieee.numeric_std.all;
--------------------------
entity nhan is
port(a: in std_logic_vector(3 downto 0);
b: in std_logic_vector(3 downto 0);
kq: out std_logic_vector( 7 downto 0));
end nhan;
--------------------------
architecture nhan of nhan is
type mang is array( 0 to 3) of std_logic_vector(7 downto 0);
begin
process(a,b)
variable x: mang;
variable t: std_logic_vector(7 downto 0);
begin
for j in 0 to 3 loop
if b(j)='1' then
x(j):=("0000"& a) sll j;
else
x(j):=(others =>'0');
end if;
t:=t+x(j);
end loop;
kq<=t;
end process;
end nhan;
I design a multiplier but I have a mistake that I can not understand why. It always reports this sentence:"Can't determine definition of operator ""sll""--found posible definition".I think because I use "sll" keyword in a wrong way but I don't know how to correct.Help me plz!
Here is my code:
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
use ieee.numeric_std.all;
--------------------------
entity nhan is
port(a: in std_logic_vector(3 downto 0);
b: in std_logic_vector(3 downto 0);
kq: out std_logic_vector( 7 downto 0));
end nhan;
--------------------------
architecture nhan of nhan is
type mang is array( 0 to 3) of std_logic_vector(7 downto 0);
begin
process(a,b)
variable x: mang;
variable t: std_logic_vector(7 downto 0);
begin
for j in 0 to 3 loop
if b(j)='1' then
x(j):=("0000"& a) sll j;
else
x(j):=(others =>'0');
end if;
t:=t+x(j);
end loop;
kq<=t;
end process;
end nhan;