按照书上的分频电路,综合后仿真出来是未知值?
时间:10-02
整理:3721RD
点击:
前仿真没问题,但是综合之后,输出的时钟就是未知量,一条红线?
-- clk_div.vhd
LIBRARY IEEE;
USE IEEE.Std_Logic_1164.ALL;
USE IEEE.Std_Logic_Arith.ALL;
USE IEEE.Std_Logic_Unsigned.ALL;
ENTITY clk_div IS
PORT
(clkin :IN Std_Logic;
reset: in STD_Logic;
clkout :OUT Std_Logic
);
end;
ARCHITECTURE BEHAVIR OF clk_div IS
signal temp:std_logic;
signal count :Integer RANGE 0 TO 3;
begin
process(clkin,reset)
begin
if reset='0' then
temp<='0';
elsif falling_edge(clkin) then
if count=3 then
count<=0;
temp<=not temp;
else
count<=count+1;
end if;
end if;
end process;
clkout<=temp;
end;
-- clk_div.vhd
LIBRARY IEEE;
USE IEEE.Std_Logic_1164.ALL;
USE IEEE.Std_Logic_Arith.ALL;
USE IEEE.Std_Logic_Unsigned.ALL;
ENTITY clk_div IS
PORT
(clkin :IN Std_Logic;
reset: in STD_Logic;
clkout :OUT Std_Logic
);
end;
ARCHITECTURE BEHAVIR OF clk_div IS
signal temp:std_logic;
signal count :Integer RANGE 0 TO 3;
begin
process(clkin,reset)
begin
if reset='0' then
temp<='0';
elsif falling_edge(clkin) then
if count=3 then
count<=0;
temp<=not temp;
else
count<=count+1;
end if;
end if;
end process;
clkout<=temp;
end;