小编meg*_*ghs的帖子

为什么我没有得到以下除以3时钟vhdl代码的输出?

以下代码中没有合成错误,但在模拟时仍未获得输出.cout一直保持逻辑1.请任何人帮我解决什么错误?

library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;

entity divide_by_3 is
port (
  cout   :out std_logic; -- Output clock
  clk    :in  std_logic; -- Input clock
  reset  :in  std_logic  -- Input reset
 );
end divide_by_3;

architecture Behavioral of divide_by_3 is
  signal pos_cnt :std_logic_vector (1 downto 0);
  signal neg_cnt :std_logic_vector (1 downto 0);
begin

  process (clk, reset) 
    begin
      if (reset = '1') then
        pos_cnt <= (others=>'0');
      elsif (rising_edge(clk)) then
        if (pos_cnt = "10") then
          pos_cnt <= pos_cnt + '1'; …
Run Code Online (Sandbox Code Playgroud)

vhdl

0
推荐指数
1
解决办法
804
查看次数

标签 统计

vhdl ×1