2

嘿,我几乎没有使用 Xilinx 的经验。我有一个即将到期的数字逻辑课程的小组项目,我的搭档本应负责 Xilinx 仿真,但决定放弃我。所以在这里我试图在最后一刻弄清楚。

我使用几个 JK 触发器设计了一个同步计数器,我需要为 FJKC 定义 CLK 输入。

我已经绘制了正确的原理图,但我不知道如何定义时钟输入。

任何帮助表示赞赏,是的,这是家庭作业。我只是在网上找不到任何基本的 xilinx 文档/教程,老实说,我没有时间学习整个 IDE。

我正在使用 VHDL

4

2 回答 2

3

假设您有一个示例设备,如下所示:

ENTITY SampleDevice IS 
    PORT 
    ( 
        CLK : IN std_logic
    );
END SampleDevice;

为了将 CLK 信号附加到 FPGA 中的真实时钟输入,您应该将其设置为Top Module并创建一个带有条目的 UCF 文件:

NET "CLK"  LOC = "P38";

P38是 Xilinx Spartan 3 XC3S200 中的时钟输入。

于 2010-05-20T13:46:47.633 回答
2

看看这个例子。

library IEEE;
use IEEE.std_logic_1164.all;
use IEEE.numeric_std.all;    -- for the unsigned type

entity counter_example is
generic ( WIDTH : integer := 32);
port (
  CLK, RESET, LOAD : in std_logic;
  DATA : in  unsigned(WIDTH-1 downto 0);  
  Q    : out unsigned(WIDTH-1 downto 0));
end entity counter_example;

architecture counter_example_a of counter_example is
signal cnt : unsigned(WIDTH-1 downto 0);
begin
  process(RESET, CLK) is
  begin
    if RESET = '1' then
      cnt <= (others => '0');
    elsif rising_edge(CLK) then
      if LOAD = '1' then
        cnt <= DATA;
      else
        cnt <= cnt + 1;
      end if;
    end if;
  end process;

  Q <= cnt;

end architecture counter_example_a;

来源

于 2010-05-03T17:12:22.193 回答