VHDL分频器代码

时间:2016-09-25 18:38:52

标签: vhdl

我有这段代码:

architecture Behavioral of BlockName is
  signal t: std_logic;
  signal c : std_logic_vector (1 downto 0);
begin
  process (reset, clk) begin
    if (reset = '1') then
      t <= '0';
      c <= (others=>'0');
    elsif clk'event and clk='l' then
      if (c = din) then
        t <= NOT(t);
        c <= (others=>'0');
      else
        c <= c + 1;
      end if;
    end if;
  end process;
  dout <= t;
end Behavioral;

此代码的作用是在输入时将频率除(时钟+值)并输出分频。

现在我的问题:

  1. c <= (others=>'0');是什么意思?
  2. 这里有什么价值t <= NOT(t);?最后的t值? <=的工作是=吗?

2 个答案:

答案 0 :(得分:3)

  1. c <= (others=>'0');相当于c <= "00";
  2. t <= not(t);t的当前值与t分配给=
  3. <=是VHDL中的相等比较。
  4. public List<Counter> findAllById1AndId2AndId3AndC1AndYearInAndMonthInAndDayInAndHourInAndMinuteIn(String id1, STring id2, String id3, String c1, List<Long> years, List<Long> months, List<Long> days, List<Long> hours, List<Long> minutes) 是VHDL中的信号分配。

答案 1 :(得分:0)

因为&#39; C&#39;被视为一个向量,并用零&#39; c&lt; =(其他=&gt;&#39; 0&#39;)存储它的每一位;&#39;在VHDL中没有使用阻塞和非阻塞信号的概念。这里&#39; =&#39;用于比较和&#39;&lt; =&#39;用于分配信号。 在您的代码中&#39; t&#39;声明为信号,信号将在过程块的每次迭代结束时更新。所以在声明中&lt; = NOT(t);&#39; t的值仍然是旧值,并将在当前模拟滴答结束时更新。