Altera_Forum
Honored Contributor
16 years agoVHDL trouble
Hi,
I seem to be getting continuous errors with if statements in Quartus but cannot see a problem at all could someone please help here? Code: if (ip(1) xor ip(2) xor ip(3) xor ip(4) xor ip(5) xor ip(6) xor ip(7)) = '0' then error <= '0'; else error <= '1'; end if; ip is declared as "in std_logic_vector(7 downto 1)" error is a signal of std_logic The errors I'm receiving are: Error (10500): VHDL syntax error at hamming_decode.vhd(20) near text "if"; expecting "end", or "(", or an identifier ("if" is a reserved keyword), or a concurrent statement Error (10500): VHDL syntax error at hamming_decode.vhd(20) near text "="; expecting "<=" Error (10500): VHDL syntax error at hamming_decode.vhd(21) near text "else"; expecting "end", or "(", or an identifier ("else" is a reserved keyword), or a concurrent statement Error (10500): VHDL syntax error at hamming_decode.vhd(22) near text "if"; expecting ";", or an identifier ("if" is a reserved keyword), or "architecture" I seem to get these errors anytime I attempt an if statement. I've tried changing many things including declaring the value of the XOR sum as a check and writing: if check = '0' then..... to no avail of course. Does Quartus even support if statements in VHDL or only in AHDL?? Any help seriously appreciated. Thanks Maria