В документации прочитал, что 1 18х18 умножитель может работать на частоте 287 МГц, а 9х9 умножитель на частоте 340 МГц
https://www.altera.com/content/dam/altera-w.../cyiv-53001.pdf стр 26.
А мне хочется использовать 32 битное умножение, но на частоте >10 МГц оно правильно не работает. Можно ли как-то ускорить это дело? А то 10 МГц как-то мало, я ожидал что-то вроде 150 МГц.
Использовал я это дело так (результат смотрел на компе. По сигналу ready считывается значение регистра mult, причём на умножение тратится 1 такт, так можно понять успевает оно выполниться на задаваемой частоте или нет) :
Код
library IEEE;
use IEEE.STD_LOGIC_1164.all;
use ieee.numeric_std.all;
entity arith is
port(
clk : in STD_LOGIC;
start : in STD_LOGIC;
a : in std_logic_vector(31 downto 0);
b : in std_logic_vector(31 downto 0);
ready : out STD_LOGIC;
mult : out std_logic_vector(63 downto 0)
);
end arith;
--}} End of automatically maintained section
architecture arch of arith is
signal state:natural:=0;
begin
process(clk)
begin
if(rising_edge(clk)) then
if(start='1') then
if(state=0) then
state<=1;
ready<='0';
end if;
else
if(state=1) then
mult<=std_logic_vector(unsigned(a)*unsigned(b));
state<=2;
end if;
if(state=2) then
ready<='1';
state<=0;
end if;
end if;
end if;
end process;
-- enter your statements here --
end arch;
use IEEE.STD_LOGIC_1164.all;
use ieee.numeric_std.all;
entity arith is
port(
clk : in STD_LOGIC;
start : in STD_LOGIC;
a : in std_logic_vector(31 downto 0);
b : in std_logic_vector(31 downto 0);
ready : out STD_LOGIC;
mult : out std_logic_vector(63 downto 0)
);
end arith;
--}} End of automatically maintained section
architecture arch of arith is
signal state:natural:=0;
begin
process(clk)
begin
if(rising_edge(clk)) then
if(start='1') then
if(state=0) then
state<=1;
ready<='0';
end if;
else
if(state=1) then
mult<=std_logic_vector(unsigned(a)*unsigned(b));
state<=2;
end if;
if(state=2) then
ready<='1';
state<=0;
end if;
end if;
end if;
end process;
-- enter your statements here --
end arch;