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 を終了します。
私の現在の実装では、amux(0) を除いてすべて「00000000」が出力されます。私のアプローチの問題は何ですか?