Error (10500): VHDL syntax error at cnt16.vhd(26) near text "PROCESS"; expecting "if"

LIBRARY IEEE;USE IEEE.STD_LOGIC_1164.ALL;use IEEE.std_logic_signed.all;use IEEE.std_logic_arith.all;ENTITY CNT16 ISPORT (CLK,RST,EN: IN STD_LOGIC; CQ:OUT STD_LOGIC_VECTOR(3 DOWNTO 0); COUT:OUT STD_LOGIC);END CNT16;ARCHITECTURE behav OF CNT16 ISBEGINPROCESS (CLK, RST,EN) VARIABLE CQI :STD_LOGIC_VECTOR(3 DOWNTO 0); BEGIN IF RST='1' THEN CQI:=(OTHERS=>'0'); ELSIF CLK'EVENT AND CLK='1' THEN IF CQI<9 THEN CQI :=CQI+1; ELSE CQI:=(OTHERS=>'0'); END IF; END IF;IF CQI=9 THEN COUT<='1';ELSE COUT<='0'; END IF; CQ<=CQI; END PROCESS; END behav;

第1个回答  2012-12-15
LIBRARY IEEE;
USE IEEE.STD_LOGIC_1164.ALL;
use IEEE.std_logic_signed.all;
use IEEE.std_logic_arith.all;
ENTITY CNT16 IS
PORT (CLK,RST,EN: IN STD_LOGIC; CQ:OUT STD_LOGIC_VECTOR(3 DOWNTO 0); COUT:OUT STD_LOGIC);
END CNT16;
ARCHITECTURE behav OF CNT16 IS
BEGIN
PROCESS (CLK, RST,EN)
VARIABLE CQI :STD_LOGIC_VECTOR(3 DOWNTO 0);
BEGIN
IF RST='1' THEN
CQI:=(OTHERS=>'0');
ELSIF CLK'EVENT AND CLK='1' THEN
IF CQI<9 THEN CQI :=CQI+1;
ELSE
CQI:=(OTHERS=>'0');
END IF;
END IF;-----------------------------------多了一个end if;
IF CQI=9 THEN
COUT<='1';
ELSE
COUT<='0';
END IF;
CQ<=CQI;
END PROCESS;
END behav;
弄这么乱,真服了你了本回答被网友采纳
相似回答