如何通过生成循环使用1位组件实现1位递增/递减的计数器?

时间:2019-05-21 08:20:54

标签: vhdl

嘿,我正在尝试使用一个使用1位分量递增/递减的generate循环来实现向上/向下计数器。 计数器必须是同步设计,并且能够加载给定的初始值。 使用在生成循环中实例化的1位分量(递增/递减)实现计数器的总体思路是什么?

我的柜台实体:

entity  counter is
    port (
        did : out std_logic_vector (2 downto 0);    
        err :out std_logic;                      
        cnt : out std_logic_vector (11 downto 0);   
        --
        valLd : in std_logic_vector (11 downto 0);   
        nLd   : in std_logic;       
        up    : in std_logic;                   
        down  : in std_logic;               
        --
        clk   : in std_logic;       
            nres  : in std_logic);           
   end entity  counter;

0 个答案:

没有答案