【发布时间】:2016-04-13 15:39:30
【问题描述】:
我有这个用于 3 位向上/向下计数器的 vhdl 代码,但是当我模拟它时没有给出任何输出结果,这是怎么回事??
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use ieee.std_logic_unsigned.all;
use ieee.numeric_std.all;
entity counter is
Port ( rst,clk : in STD_LOGIC;
up: in bit;
z : out STD_LOGIC_vector( 2 downto 0 ));
end counter;
architecture Behavioral of Counter is
signal zint: STD_LOGIC_vector( 2 downto 0 ) ;
begin
z<= zint;
process (clk)
begin
if (clk' event and clk='1') then
if (rst ='1') then
zint <= "000" ;
end if;
if (zint <= "111" )then zint <= "000";
elsif (up='1') then zint <= zint+1;
else zint <= zint-1;
end if;
end if;
end process;
end Behavioral;
【问题讨论】:
-
欢迎来到 Stack Overflow。通常最好提供MCVE,以便其他人可以重现您的错误,但在这种情况下,我想我可以看到问题所在。
-
请缩进您的代码。
-
请出示您的测试台。 不给出任何输出结果是什么意思?