【发布时间】:2011-01-14 15:41:09
【问题描述】:
几天前我开始学习 VHDL 初学者课程。
我有一个代码(在下面),我正试图了解它显示了什么样的电路以及不同步骤的运作方式。 我已经在互联网上四处寻找了一段时间,但无法真正理解它的作用?所以我想现在有人可以给我一些解释吗? :.-)
我不确定,但我认为它是一种带缓冲区的“加法器”?并且缓冲区使用 2 位(Cs-1 下降到 0)但是我不知道 Cs 是什么意思……事实上,这段代码中有很多东西我不明白。
如果有人能花一些时间帮助我理解代码,我将不胜感激。
entity asc is
generic (CS : integer := 8)
port (k, ars, srs, e, u: in std_logic;
r: buffer std_logic_vector(Cs-1 downto 0));
end asc;
architecture arch of asc is
begin
p1: process (ars, k) begin
if ars = ‘1’ then
r <= (others => ‘0’);
elsif (k’event and k=’1’) then
if srs=’1’ then
r <= (others) => ‘0’);
elsif (e = ‘1’ and u = ‘1’) then
r <= r + 1;
elsif (e = ‘1’ and u = ‘0’) then
r <= r - 1;
else
r <= r;
end if;
end if;
end process;
end arch;
【问题讨论】:
-
你能正确缩进吗?没有缩进帮助很难阅读。
标签: vhdl