microcreat 发表于 2009-6-30 21:58:59

我在资料上看到一段VHDL的代码!有问题请教!

-- --------------------------
-- Clk16 Clock Generation
-- --------------------------
process (RST, CLK)
begin
if RST='1' then
Top16 <= '0';
Div16 <= 0;
elsif rising_edge(CLK) then
Top16 <= '0';
if Div16 = Divisor then
Div16 <= 0;
Top16 <= '1';
else
Div16 <= Div16 + 1;
end if;
end if;
end process;

microcreat 发表于 2009-6-30 22:09:08

呵呵!不好意思,刚刚想了下,想通了!呵呵!

McuPlayer 发表于 2009-6-30 22:12:00

process (RST, CLK)
begin
        if RST='1' then
                Top16 <= '0';
                Div16 <= 0;
        elsif rising_edge(CLK) then
                Top16 <= '0';
                if Div16 = Divisor then
                        Div16 <= 0;
                        Top16 <= '1';
                else
                        Div16 <= Div16 + 1;
                end if;
        end if;
end process;

McuPlayer 发表于 2009-6-30 22:12:54

我帮你做了下排版,看是不是很容易就看懂了
页: [1]
查看完整版本: 我在资料上看到一段VHDL的代码!有问题请教!