|
![](static/image/common/ico_lz.png)
楼主 |
发表于 2011-6-29 11:34:41
|
显示全部楼层
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
-- Uncomment the following library declaration if using
-- arithmetic functions with Signed or Unsigned values
--use IEEE.NUMERIC_STD.ALL;
-- Uncomment the following library declaration if instantiating
-- any Xilinx primitives in this code.
--library UNISIM;
--use UNISIM.VComponents.all;
entity MODULE is
Port ( START : in STD_LOGIC;
CLK : in STD_LOGIC;
EN : out STD_LOGIC);
end MODULE;
architecture Behavioral of MODULE is
signal E12,E21: std_logic;
signal count: std_logic_vector(2 downto 0);
begin
PROCESS(START,E21)
BEGIN
IF RISING_EDGE(START)THEN
COUNT<="000";
ELSE IF E21'EVENT THEN
E12<='1';
END IF;
END process;
PROCESS(CLK,E12)
BEGIN
IF E12='0' THEN
IF RISING_EDGE(CLK)THEN
IF COUNT="011"; THEN
E21<=NOT E21;
ELSE
COUNT<=COUNT+1;
END IF;
END IF;
END IF;
END process;
EN<=E12;
end Behavioral;
自己试着写了一段,编译说 IF 和PROCESS结尾有错误 |
|