如果哪位能解释下这种情况和就我的程序给点意见,那就先谢谢了!
这是源代码:
LIBRARY IEEE;
USE IEEE.STD_LOGIC_1164.All;
ENTITY divider IS
PORT( clkin : IN STD_LOGIC; --输入信号
clkout : OUT STD_LOGIC --输出信号
);
END divider ;
ARCHITECTURE behv OF divider IS
SIGNAL temp: INTEGER RANGE 0 TO 8;
BEGIN
PROCESS(clkin)
BEGIN
IF clkin'EVENT AND clkin = '1' THEN
IF temp = 8 THEN
temp<= 0;
ELSE
temp<= temp + 1;
END IF;
END IF;
END PROCESS;
PROCESS(temp)
BEGIN
IF temp < 4 THEN
IF clkin = '0' THEN
clkout<= '0' ;
END IF;
ELSIF clkin'EVENT AND clkin = '1' THEN
clkout<= '1';
END IF;
ENDPROCESS;
ENDARCHITECTURE;