【发布时间】:2013-01-24 03:49:35
【问题描述】:
我对 VHDL 非常陌生,正在尝试弄清楚如何在 Altera Cyclone II 上做一些相当基本的事情。 FPGA 有四个按钮 - 其中两个需要被编程来增加和减少选定的寄存器 (0-F),另外两个需要被编程来增加和减少将在的值 (从 00 到 FF)那个寄存器。这是我目前所拥有的:
entity raminfr is
port (
clk : in std_logic;
we : in std_logic;
a : in unsigned(3 downto 0);
di : in unsigned(7 downto 0);
do : out unsigned(7 downto 0)
);
end raminfr;
architecture rtl of raminfr is
type ram_type is array (0 to 15) of unsigned(7 downto 0);
signal RAM : ram_type;
signal read_a : unsigned(3 downto 0);
begin
process (clk)
begin
if rising_edge(clk) then
if we = '1' then
RAM(to_integer(a)) <= di;
end if;
read_a <= a;
end if;
end process;
do <= RAM(to_integer(read_a));
end rtl;
有人可以提供一些基本的示例代码来说明如何对按钮进行编程吗?
【问题讨论】:
标签: vhdl fpga intel-fpga