|
用Vhdl写的分频器的代码问题!
l
ibrary ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_arith.all;
entity fdiv is
port(clk , and3 :in std_logic;--位同步时钟与逻辑门3的控制信号
freclk: out std_logic);
end fdiv;
architecture fp of fdiv is
signal cnt:integer range 0 to 31;
begin
process(clk,and3)
begin
if and3='0' then freclk='0';
elsif(clk'eventand clk='1')then
if(cnt=cnt'high)then
cnt<=0;
freclk<='1';
else
cnt<=cnt+1;
freclk<='0';
end if;
end if;
end if;
end process;
end fp;
错误提示:Error: VHDL syntax error at fdiv.vhd(6) near text ?
Error: VHDL syntax error at fdiv.vhd(6) near text "?; expecting ";"
Error: VHDL syntax error at fdiv.vhd(6) near text ?
Error: VHDL error at fdiv.vhd(8): entity fdiv is used but not declared
Error: VHDL error at fdiv.vhd(9): object integer is used but not declared
Error: VHDL syntax error at fdiv.vhd(13) near text "="; expecting "'" or "(" or "."
Error: VHDL error at fdiv.vhd(16): object cnt is used but not declared
Error: VHDL error at fdiv.vhd(17): object freclk is used but not declared
Error: VHDL error at fdiv.vhd(19): object cnt is used but not declared
Error: VHDL error at fdiv.vhd(20): object freclk is used but not declared
Error: VHDL error at fdiv.vhd(15): object cnt is used but not declared
Error: VHDL error at fdiv.vhd(14): object clk is used but not declared
Error: VHDL error at fdiv.vhd(13): object and3 is used but not declared
Error: VHDL syntax error at fdiv.vhd(23) near text "if"; expecting "process"
Error: VHDL error at fdiv.vhd(11): object clk is used but not declared
Error: VHDL error at fdiv.vhd(11): object and3 is used but not declared
Error: Quartus II Analysis & Synthesis was unsuccessful. 16 errors, 0 warnings
Error: Processing ended: Wed May 23 10:02:13 2007
Error: Elapsed time: 00:00:02 |
|