Hello,
i'm now implementing an entity wich compute the maximum of 4 signed inputs. the device target is Virtex 5. this implementation gives me 215 MHz of maximum frequency:
ENTITY MAX4 IS
GENERIC (CONSTANT M: natural := 5); -- input and output width
Port (
X1: in signed(M-1 downto 0);
X2: in signed(M-1 downto 0);
X3: in signed(M-1 downto 0);
X4: in signed(M-1 downto 0);
MAX: out signed(M-1 downto 0)); -- MAXIMUM Value
end MAX4;
ARCHITECTURE RTL OF MAX4 IS
signal TEMP1: signed(M-1 downto 0);
signal TEMP2: signed(M-1 downto 0);
BEGIN
-----------------------------------------------------------
--
-----------------------------------------------------------
compare_x1rocess(X1,X2)
begin
TEMP1 <= X1;
if X1<X2 then
TEMP1<=X2;
end if;
end process;
compare_x3rocess(X3,X4)
begin
TEMP2 <= X3;
if X3<X4 then
TEMP2<=X4;
end if;
end process;
compare_temprocess(TEMP1,TEMP2)
begin
MAX_NXT<= TEMP1;
if TEMP1<TEMP2 then
MAX<=TEMP2;
end if;
end process;
end;
did any one have an idea how to implement the MAX4 function in better way to increase the frequency.
Thanks,
Aymen
i'm now implementing an entity wich compute the maximum of 4 signed inputs. the device target is Virtex 5. this implementation gives me 215 MHz of maximum frequency:
ENTITY MAX4 IS
GENERIC (CONSTANT M: natural := 5); -- input and output width
Port (
X1: in signed(M-1 downto 0);
X2: in signed(M-1 downto 0);
X3: in signed(M-1 downto 0);
X4: in signed(M-1 downto 0);
MAX: out signed(M-1 downto 0)); -- MAXIMUM Value
end MAX4;
ARCHITECTURE RTL OF MAX4 IS
signal TEMP1: signed(M-1 downto 0);
signal TEMP2: signed(M-1 downto 0);
BEGIN
-----------------------------------------------------------
--
-----------------------------------------------------------
compare_x1rocess(X1,X2)
begin
TEMP1 <= X1;
if X1<X2 then
TEMP1<=X2;
end if;
end process;
compare_x3rocess(X3,X4)
begin
TEMP2 <= X3;
if X3<X4 then
TEMP2<=X4;
end if;
end process;
compare_temprocess(TEMP1,TEMP2)
begin
MAX_NXT<= TEMP1;
if TEMP1<TEMP2 then
MAX<=TEMP2;
end if;
end process;
end;
did any one have an idea how to implement the MAX4 function in better way to increase the frequency.
Thanks,
Aymen