Я получаю следующие ошибки: Строка 15: Синтаксическая ошибка рядом с «если». Строка 4: блок игнорируется из-за предыдущих ошибок.VHDL: ошибка синтаксиса рядом, если
Это, наверное, очень глупый вопрос, но может ли кто-нибудь помочь? :)
library IEEE;
use IEEE.std_logic_1164.all;
entity arithmetic is
port( I1 :in std_logic_vector(12-1 downto 0); -- Operand 1
I2 :in std_logic_vector(8-1 downto 0); -- Operand 2
O :out std_logic_vector(12-1 downto 0); -- Output
C :out std_logic; -- Carry Flag
V :out std_logic; -- Overflow Flag
VALID :out std_logic -- Flag to indicate if the solution is valid or not
);
begin
if ((unsigned(I1)-unsigned(I2)) > unsigned(I1)) and ((unsigned(I1)-unsigned(I2)) > unsigned(I2)) then
C <= '1';
else
C <= '0';
end if;
if I1(x)='1' and signed(std_logic_vector(unsigned(I1)-unsigned(I2)))>0 then --x ist das höchte Bit von I1
V <= '1';
else
V <= '0';
end if;
if unsigned(I1) < unsigned(I2) then
VALID <= '0';
else
VALID <= '1';
end if;
und
O <= std_logic_vector(unsigned(I1)-unsigned(I2));
end arithmetic;
Возможный дубликат [VHDL syntaxe ошибки вблизи если] (http://stackoverflow.com/questions/20435228/vhdl-syntaxe-error-near-if) – user1155120
Как дублируют, когда это совершенно другой код @ user1155120 – Alena
Я видел этот вопрос, и это не помогает мне @ user1155120 – Alena