I have
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);
I am trying to create a simple ALU, and one of the functions that ALU provides 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 it is obvious that it will not work, because the data type of douta and doutb is std_logic_vector , where as co is just std_logic
and I got this error while compiling
' 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?
also tried to change
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
source share