Comparing objects of different lengths always returns false. Thus, such comparisons should be removed.
entity top is
port (
A : in std_logic_vector(1 downto 0);
B : in std_logic_vector(2 downto 0);
Z : out std_logic
);
end;
architecture rtl of top is
begin
process (A, B) is
begin
if (A = B) then
Z <= '1';
else
Z <= '0';
end if;
end process;
end;
entity top is
port (
A : in std_logic_vector(2 downto 0);
B : in std_logic_vector(2 downto 0);
Z : out std_logic
);
end;
architecture rtl of top is
begin
process (A, B) is
begin
if (A = B) then
Z <= '1';
else
Z <= '0';
end if;
end process;
end;