2019-08-17 17:41:27 +02:00
|
|
|
library IEEE;
|
|
|
|
|
use IEEE.STD_LOGIC_1164.ALL;
|
|
|
|
|
|
2019-08-17 18:45:31 +02:00
|
|
|
entity SpecialCasesCheck is
|
2019-08-17 17:41:27 +02:00
|
|
|
port(
|
2019-08-17 18:45:31 +02:00
|
|
|
X, Y: in std_logic_vector(31 downto 0);
|
|
|
|
|
isNan, isZero: out std_logic
|
2019-08-17 17:41:27 +02:00
|
|
|
);
|
2019-08-17 18:45:31 +02:00
|
|
|
end SpecialCasesCheck;
|
2019-08-17 17:41:27 +02:00
|
|
|
|
2019-08-17 18:45:31 +02:00
|
|
|
|
|
|
|
|
architecture SpecialCasesCheckArch of SpecialCasesCheck is
|
2019-08-17 19:22:19 +02:00
|
|
|
component NaNCheck is
|
2019-08-17 18:45:31 +02:00
|
|
|
port(
|
2019-08-17 19:22:19 +02:00
|
|
|
X, Y: in std_logic_vector(31 downto 0);
|
|
|
|
|
isNan: out std_logic
|
2019-08-17 18:45:31 +02:00
|
|
|
);
|
|
|
|
|
end component;
|
2019-08-17 19:22:19 +02:00
|
|
|
|
2019-08-17 18:45:31 +02:00
|
|
|
signal xSign: std_logic;
|
|
|
|
|
signal ySign: std_logic;
|
|
|
|
|
signal isSameAbsValue: std_logic;
|
2019-08-17 17:41:27 +02:00
|
|
|
|
2019-08-17 18:45:31 +02:00
|
|
|
begin
|
2019-08-17 19:22:19 +02:00
|
|
|
NC: NaNCheck
|
|
|
|
|
port map (X => X, Y => Y, isNan => isNan);
|
2019-08-17 17:41:27 +02:00
|
|
|
|
2019-08-17 18:45:31 +02:00
|
|
|
xSign <= X(31);
|
|
|
|
|
ySign <= Y(31);
|
|
|
|
|
|
|
|
|
|
isSameAbsValue <= '0'; -- TODO
|
|
|
|
|
|
|
|
|
|
isZero <= (xSign and (not ySign) and isSameAbsValue) or ((not xSign) and ySign and isSameAbsValue);
|
|
|
|
|
end SpecialCasesCheckArch;
|
2019-08-17 17:41:27 +02:00
|
|
|
|
|
|
|
|
|