FROL_256 0 October 18, 2014 Posted October 18, 2014 · Report post Здравствуйте, уважаемые форумчане! Недавно был вынужден перейти с ActiveHDL на ModelSim. Появилась ошибка компиляции, смысл которой я пока не понимаю ... подскажите пожалуйста что ему не нравится. subtype WORD is STD_LOGIC_VECTOR (31 downto 0); variable xA : WORD := x"00000000"; -- first op variable xB : WORD := x"00000000"; -- second op variable yB : WORD := x"00000000"; -- second op passed to adder variable carryIn : std_logic := '0'; variable rAdd : unsigned(32 downto 0) := (others => '0'); -- result of add ops group ... rAdd := unsigned("0" & xA) + unsigned(yB) + unsigned("" & carryIn); -- full 32 bit adder with carry /// вот эта строчка вызывает ошибку Ambiguous type in infix expression; ieee.std_logic_1164.STD_LOGIC_VECTOR or work.A0.REGISTER_MEMORY. Illegal type conversion to ieee.NUMERIC_STD.UNSIGNED (operand type is not known). Ambiguous type in infix expression; ieee.std_logic_1164.STD_LOGIC_VECTOR or ieee.std_logic_1164.STD_ULOGIC_VECTOR. Illegal type conversion to ieee.NUMERIC_STD.UNSIGNED (operand type is not known). VHDL Compiler exiting Quote Share this post Link to post Share on other sites More sharing options...
Timmy 1 October 19, 2014 Posted October 19, 2014 · Report post rAdd := unsigned("0" & xA) + unsigned(yB) + unsigned("" & carryIn); -- full 32 bit adder with carry /// вот эта строчка вызывает ошибку Проблема, вероятно, в пустых кавычках. Можно написать так: unsigned'("")&carryIn Quote Share this post Link to post Share on other sites More sharing options...
FROL_256 0 October 19, 2014 Posted October 19, 2014 (edited) · Report post Точно, внес еще небольшое изменение: rAdd := ("0" & unsigned(xA)) + unsigned(yB) + unsigned'("") & carryIn; -- full 32 bit adder with carry И заработало. Спасибо Вам огромное! :) Edited October 19, 2014 by FROL_256 Quote Share this post Link to post Share on other sites More sharing options...