我有一个可变长度的矢量std_logic_vector(X downto 0).现在我试图在我的包中定义一个常量来进行复位,这样低位X/2就是1,其他位是零.
例如,3位向量(X=3)将产生常量"011",4位向量将产生常量"0011".
我怎么能在VHDL包中做到这一点?下面的代码解释了我想要做的事情.
type Entry_Type is record
state : std_logic_vector(X-1 downto 0);
end record;
constant Entry_Constant : Entry_Type := <???>;
Run Code Online (Sandbox Code Playgroud) vhdl ×1