[an error occurred while processing this directive]
|
mux <= a when(acc(N) = '0') else ma;
process(clk,rst)
begin
if rst = '1' then
acc(N) <= '1'; acc(N-1 downto 0) <= (others => '0');
elsif clk = '1' and clk'event then
acc <= ext(acc(N-1 downto 0),N+1) + ext(mux,N+1);
end if;
end process;
Здесь:
a - приращение
ma - 2**N - /модуль/ + a
Числа будут циклически повторятся в пределах [ma,..,2**N,0,..,a-1],
аналогично асс = (асс + a) mod /модуль/.
E-mail: info@telesys.ru