VHDL中出现错误found illegal character 是怎么回事

我在eda编程时,出现66个错误,我不知道怎么回事,哪位高手可以帮我解决吗
程序是这样的,

LIBRARY IEEE;
USE IEEE.STD_LOGIC_1164.ALL;
USE IEEE.STD_LOGIC_UNSIGNED.ALL;
ENTITY kz IS
PORT (CLK1S,car:IN STD_LOGIC;--1S脉冲,支干道车辆检测
TIME1H,TIME1L:OUT STD_LOGIC_VECTOR(3 DOWNTO 0);--主干道计时
TIME2H,TIME2L:OUT STD_LOGIC_VECTOR(3 DOWNTO 0);--支干道计时
count:OUT STD_LOGIC_VECTOR(6 DOWNTO 0); --系统总计时
led:OUT STD_LOGIC_VECTOR(5 DOWNTO 0)); --交通灯显示
END kz;
ARCHITECTURE one OF kz IS
TYPE states IS (s0, s1, s2,s3, s4); --状态初始化
SIGNAL current_state,next_state : states;
SIGNAL c:STD_LOGIC_VECTOR(6 DOWNTO 0);
BEGIN
REG:PROCESS(CLK1S,car,current_state,c)
BEGIN
IF car = '0' THEN current_state <= s0 ;
c<="0000000";
ELSE
IF CLK1S'EVENT AND CLK1S = '1' THEN --支干道有车开始计数
c <= c +1;
current_state <= next_state;
END IF;
END IF;
CASE current_state IS--状态转换
WHEN s0 => LED <= "100001"; --支干道无车不减计时
TIME1H<="0100";TIME1L<="0101";
TIME2H<="0101";TIME2L<="0000";
IF car = '1' THEN next_state <= s1;
ELSE next_state <= s0;
END IF;
WHEN s1 => LED <= "100001"; --主干道绿灯,支干道红灯
IF c="0101100" THEN next_state <= s2;
ELSE next_state <= s1;
END IF;
WHEN s2 => LED <= "010001"; --主干道黄灯,支干道红灯
IF c="0110001" THEN next_state <= s3;
ELSE next_state <= s2;
END IF;
WHEN s3 => LED <= "001100"; --主干道红灯,支干道绿灯
IF c="1001010" THEN next_state <= s4;
ELSE next_state <= s3;
END IF;
WHEN s4 => LED <= "001010"; --主干道红灯,支干道黄灯
IF c="1001111" THEN next_state <= s1;
ELSE next_state <= s4;
END IF;
WHEN OTHERS => LED <= "100001";next_state <= s0;
END CASE;

IF c="0101101" THEN TIME1H<="0000";TIME1L<="0101";--系统时间为45,主干道黄灯计时5秒
END IF;
IF c="0110010" THEN TIME1H<="0011";TIME1L<="0000";TIME2H<="0010";TIME2L<="0101";--系统时间为50,支干道计时30秒。支干道计时25秒
END IF;
IF c="1001011" THEN TIME2H<="0000";TIME2L<="0101";--系统时间为75,支干道黄灯计时5秒
END IF;
IF c="1010000" THEN TIME1H<="0100";TIME1L<="0101";TIME2H<="0101";TIME2L<="0000";--系统时间为80,主干道计时45,支干道计时50
END IF;
IF c="1010000" THEN c<="0000000";--系统时间清零
END IF;
END PROCESS REG;
count <= c;
END one;

你最后面那一段IF的改成这样就可以了
IF c="0101101" THEN TIME1H<="0000";TIME1L<="0101";
ELSIF c="0110010" THEN
TIME1H<="0011";TIME1L<="0000";TIME2H<="0010";
ELSIF c="1001011" THEN TIME2H<="0000";TIME2L<="0101";
ELSIF c="1010000" THEN TIME1H<="0100";TIME1L<="0101";TIME2H<="0101";TIME2L<="0000";
ELSIF c="1010000" THEN c<="0000000";
END IF;
END PROCESS REG;
温馨提示:内容为网友见解,仅供参考
无其他回答

VHDL syntax error: found illegal character in a based literal 懂VH...
源代码是用Verilog HDL写的,文件名后缀应当是.v,不是.vhd,所以出现编译错误。

VHDL报错,“ found illegal character'?”在倒数第二句(下面那一句...
可能是你在编辑源程序时的手误造成的,仔细看下那句的附近有什么符号(' 或?之类的)没 程序本身没什么问题的

VHDL中出现错误found illegal character 是怎么回事
你最后面那一段IF的改成这样就可以了 IF c="0101101" THEN TIME1H<="0000";TIME1L<="0101";ELSIF c="0110010" THEN TIME1H<="0011";TIME1L<="0000";TIME2H<="0010";ELSIF c="1001011" THEN TIME2H<="0000";TIME2L<="0101";ELSIF c="1010000" THEN TIME1H<="0100";TIME1L<="...

vhdl syntax error: found illegal use of a statement in a de...
语法错误不好说,最好是将错误行包括其上下几行的代码贴出来才看得出来是什么错误

相似回答