Altera_Forum
Honored Contributor
15 years agoexpression has 2 elements, but must have 4 elements
Hey guys,
This is trashing my brain, please help.library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
--use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.NUMERIC_STD.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
ENTITY shifter IS
PORT (
A: IN UNSIGNED (1 downto 0);
B: IN UNSIGNED (1 downto 0);
OUTPUT : OUT UNSIGNED (3 downto 0)
);
END shifter;
ARCHITECTURE identifier OF shifter IS
BEGIN
process(A,B)
variable C : INTEGER range 0 to 15;
BEGIN
C := TO_INTEGER(B);
OUTPUT <= A sll C;
END PROCESS;
END identifier;Logs: Error (10344): VHDL expression error at shift.vhd(23): expression has 2 elements, but must have 4 elementswhich means this line OUTPUT <= A sll C; Thanks