I've got
douta : in std_logic_vector (3 downto 0);
doutb : in std_logic_vector (3 downto 0);
c0 : in std_logic;
f1 : in std_logic;
f0 : in std_logic;
res : out std_logic_vector (3 downto 0);
Im' trying to build a simple ALU, and one of the function this ALU provide is when
f1 and f0 both = 1 res = douta plus b plus c0
so I wrote
f1 = '1' and f0 = '1' then res <= douta + doutb + c0;
but obviously its not gonna work because the datatype of douta
and doutb
is std_logic_vector
where as co
is just std_logic
and I got this error when compile
' Error 603 line 34 : Incompatible types for arithmetic operator: LHS=std_logic_vector!18, RHS=std_logic
any idea how I can fix this problem ?
edit: also have tried
f1 = '1' and f0 = '1' then res <= douta + doutb + ("000" & c0);
but still no luck, this time the compiler says
LHS=std_logic_vector!7, RHS=array_1_of_std_logic_3_d_0