You can use "not" on vectors. Just run the program below using ModelSim or ISim, and the inverted / negated bit will be printed to the console.
LIBRARY ieee; USE ieee.numeric_bit.ALL; entity test is end entity test; architecture beh of test is function vec_image(arg : bit_vector) return string is -- original author Mike Treseler (http://mysite.ncnetwork.net/reszotzl/) -- recursive function call turns ('1','0','1') into "101" ------------------------------------------------------------------------------- constant arg_norm : bit_vector(1 to arg'length) := arg; constant center : natural := 2; -- 123 variable bit_image : string(1 to 3); -- '0' variable just_the_number : character; begin if (arg'length > 0) then bit_image := bit'image(arg_norm(1)); -- 3 chars: '0' just_the_number := bit_image(center); -- 1 char 0 return just_the_number -- first digit & vec_image(arg_norm(2 to arg_norm'length)); -- rest the same way else return ""; -- until "the rest" is nothing end if; end function vec_image; begin demo:process is variable bitvec : bit_vector (7 downto 0) := "10100111"; begin report vec_image(bitvec); report vec_image(not bitvec); -- not bit vector wait; end process demo; end architecture beh;
source share