Hi, I am new on VHDL, and I am writing a code that comparing two 32 bits std_logic_vector. If they are equal, a result of all one bits is produce, otherwise, a result of all zero bits is produce.
However, when I simulate my code, the following warnings appears:
WARNING: There is an 'U'|'X'|'W'|'Z'|'-' in an arithmetic operand, the result will be 'X'(es).
and I didn't get the correct result. My tb values are:
a = 00000000000001111111111111111111
b = 00000000000001111111111111111111
the result should be 32 1's
but it gave me 32 0's.
Can anyone please help me out? Thank you so much!
The following is my code:
entity ceq is
port(ra : in std_logic_vector(31 downto 0);
rb : in std_logic_vector(31 downto 0);
rt : out std_logic_vector(31 downto 0));
end ceq;
architecture ceq_stru of ceq is
signal rts : std_logic_vector(31 downto 0);
begin
comp: process (ra, rb)
variable count : std_logic_vector (31 downto 0)
:= "00000000000000000000000000000000";
begin
rts <= ra xor rb;
if rts = count then
rt <= (others => '1');
else
rt <= count;
end if;
end process comp;
end ceq_stru;
However, when I simulate my code, the following warnings appears:
WARNING: There is an 'U'|'X'|'W'|'Z'|'-' in an arithmetic operand, the result will be 'X'(es).
and I didn't get the correct result. My tb values are:
a = 00000000000001111111111111111111
b = 00000000000001111111111111111111
the result should be 32 1's
but it gave me 32 0's.
Can anyone please help me out? Thank you so much!
The following is my code:
entity ceq is
port(ra : in std_logic_vector(31 downto 0);
rb : in std_logic_vector(31 downto 0);
rt : out std_logic_vector(31 downto 0));
end ceq;
architecture ceq_stru of ceq is
signal rts : std_logic_vector(31 downto 0);
begin
comp: process (ra, rb)
variable count : std_logic_vector (31 downto 0)
:= "00000000000000000000000000000000";
begin
rts <= ra xor rb;
if rts = count then
rt <= (others => '1');
else
rt <= count;
end if;
end process comp;
end ceq_stru;