小编Has*_*san的帖子

从 VHDL 中的输入值开始倒数

我正在尝试将输入值分配给下面代码中的aa信号。t编译成功,但是有警告:

警告[9]:C:/Modeltech_5.7f/examples/hassan1.vhd(14):(vcom-1013)“t”的初始值取决于信号“aa”的值。

这是代码:

library IEEE;
use IEEE.std_logic_1164.all; 
use IEEE.std_logic_unsigned.all ;
use ieee.numeric_std.all; 
entity counter is
port(clk :in std_logic;
 reset : in std_logic;
 aa: in std_logic_vector(3 downto 0);
 check : out std_logic_vector(3 downto 0));
end counter;     

architecture imp of counter is 
signal i:std_logic_vector(3 downto 0):="0000"; 
signal t:std_logic_vector(3 downto 0):=aa;
begin
 process(clk)
  begin
  if rising_edge(clk) and (t>0) then
      t<=t-1;
      i<=i+1;
  end if;
 end process;
check<=i;
end  imp;  
Run Code Online (Sandbox Code Playgroud)

我应该做什么才能减少过程中的输入“aa”?该程序旨在将输入值递减aa至 0。

vhdl

2
推荐指数
1
解决办法
7556
查看次数

标签 统计

vhdl ×1