나는VHDL std_logic 신호와 함께 std_logic_vector를 함께 추가하는 방법은 무엇입니까?
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);
나는 간단한 ALU를 구축하기 위해 노력하고있어있어, 및
f1 and f0 both = 1
res = douta plus b plus c0
그래서 난
f1 = '1' and f0 = '1' then res <= douta + doutb + c0;
을 쓸 때이 ALU가 제공하는 기능 중 하나는 입니다
하지만 douta
및 doutb
의 데이터 유형이 std_logic_vector
인 경우 분명히 작동하지 않습니다. co
은 std_logic
내가이 오류를 받았을 때 컴파일
' Error 603 line 34 : Incompatible types for arithmetic operator: LHS=std_logic_vector!18, RHS=std_logic
나는이 문제를 해결할 수있는 방법을 어떤 생각?
는편집 : 또한 가
f1 = '1' and f0 = '1' then res <= douta + doutb + ("000" & c0);
하지만 여전히 행운을 시도, 이번에는 컴파일러
LHS=std_logic_vector!7, RHS=array_1_of_std_logic_3_d_0
사용하지 마십시오 std_logic_vector 당신이 만약 당신의 아이디어를 줄 것이다 생각 ! 내 대답을 참조하십시오. –