the statement if is needed for converting a vector

From the comments it seems you want good to be set to 0 whenever bar >= 10. In that case you can just do:

  variable tmp : integer;
  tmp := to_integer(signed(bar));
  if tmp < 10 then
    good(3) <= bar(3);
    good(2) <= bar(3) xor bar(2);
    good(1) <= bar(2) xor bar(1);
    good(0) <= bar(1) xor bar(0);
    good <= (others => '0');
  end if;
end process;

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top