Jump to content
    

[VHDL, Modelsim]

Здравствуйте, уважаемые форумчане! Недавно был вынужден перейти с 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

Share this post


Link to post
Share on other sites

rAdd := unsigned("0" & xA) + unsigned(yB) + unsigned("" & carryIn); -- full 32 bit adder with carry /// вот эта строчка вызывает ошибку

Проблема, вероятно, в пустых кавычках. Можно написать так:

unsigned'("")&carryIn

Share this post


Link to post
Share on other sites

Точно, внес еще небольшое изменение:

rAdd := ("0" & unsigned(xA)) + unsigned(yB) + unsigned'("") & carryIn; -- full 32 bit adder with carry

 

И заработало. Спасибо Вам огромное! :)

Edited by FROL_256

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...