我有一个名为 amux 的数组,我想A
在数组中保存整数倍的信号。下面的伪代码给出了一个想法:
amux(0) <= "00001101";
amux(1) <= amux(0);
....
amux(n) <= amux(n-1);
我的完整代码如下所示:
-- n is 4 and m is 3, amux is an array, mzeros is 0's
regA: process(clk)
variable r : integer := 2**m;
begin
if rising_edge(clk) then
if ld_a = '1' then
amux(0) <= std_logic_vector(to_unsigned((0),n*m+m));
amux(1) <= mzeros & A;
for i in 2 to r-1 loop
if (i mod 2) = 0 then
amux(i) <= amux(i/2)(n*m+m-2 downto 0) & '0';
else
amux(i) <= std_logic_vector(unsigned(amux(i-1))+unsigned(amux(1)));
end if;
end loop;
end if;
end if;
结束进程 regA;
我当前的实现输出所有“00000000”,除了amux(0)。我的方法有什么问题?