level 1
zhrj87
楼主
ALibrary IEEE;
Use IEEE.STD_LOGIC_1164.all;
use IEEE.STD_LOGIC_UNSIGNED.all;
USE IEEE.STD_LOGIC_ARITH.all;
ENTITY CLOCK_DIVIDER is
generic (N: positive);
port (CLK,RST:in STD_LOGIC;CTRL:in BIT_VECTOR(0 TO 6);CLK_DIV:out STD_LOGIC);
end CLOCK_DIVIDER;
Architecture behavior of CLOCK_DIVIDER is
BEGIN
PROCESS (CLK,RST,CTRL)
variable N:integer;
variable COUNT:NATURAL;
variable a :STD_LOGIC:='0';
BEGIN
CASE CTRL is
when "0000001" => N:=1193;
when "0000010" => N:=1063;
when "0000100" => N:=947;
when "0001000" => N:=896;
when "0010000" => N:=797;
when "0100000" => N:=710;
when "1000000" => N:=633;
when others => N:=0;
end CASE;
IF (RST='0') then
COUNT := 0;
CLK_DIV <= '0';
ELSIF (CLK'EVENT and CLK ='1') then
COUNT := COUNT + 1;
IF (COUNT = N) then
--a <= not a;
--CLK_DIV <= a;
COUNT := 0;
end IF;
end IF;
end PROCESS;
end BEHAVIOR
这是一个关于分频的程序,我在用MAXPLUSS2模拟的时候出现了这样的一个错误…………
error:line41:file e:\zhrj87\clock_divider.vhd:VHDL syntax error;unexpected end-of-file -try using the Text Editor's Syntax Coloring command to find the missing delimiter or keyword
2009年03月13日 10点03分
1
Use IEEE.STD_LOGIC_1164.all;
use IEEE.STD_LOGIC_UNSIGNED.all;
USE IEEE.STD_LOGIC_ARITH.all;
ENTITY CLOCK_DIVIDER is
generic (N: positive);
port (CLK,RST:in STD_LOGIC;CTRL:in BIT_VECTOR(0 TO 6);CLK_DIV:out STD_LOGIC);
end CLOCK_DIVIDER;
Architecture behavior of CLOCK_DIVIDER is
BEGIN
PROCESS (CLK,RST,CTRL)
variable N:integer;
variable COUNT:NATURAL;
variable a :STD_LOGIC:='0';
BEGIN
CASE CTRL is
when "0000001" => N:=1193;
when "0000010" => N:=1063;
when "0000100" => N:=947;
when "0001000" => N:=896;
when "0010000" => N:=797;
when "0100000" => N:=710;
when "1000000" => N:=633;
when others => N:=0;
end CASE;
IF (RST='0') then
COUNT := 0;
CLK_DIV <= '0';
ELSIF (CLK'EVENT and CLK ='1') then
COUNT := COUNT + 1;
IF (COUNT = N) then
--a <= not a;
--CLK_DIV <= a;
COUNT := 0;
end IF;
end IF;
end PROCESS;
end BEHAVIOR
这是一个关于分频的程序,我在用MAXPLUSS2模拟的时候出现了这样的一个错误…………
error:line41:file e:\zhrj87\clock_divider.vhd:VHDL syntax error;unexpected end-of-file -try using the Text Editor's Syntax Coloring command to find the missing delimiter or keyword