I am designing a 2s complement code but it is showing that error can any one help me with that.
library ieee;
use ieee.std_logic_1164.all;
use IEEE.std_logic
When using Synopsys packages, you need to add use of the std_logic_unsigned
package after std_logic_1164
, like:
use IEEE.std_logic_unsigned.all;
With this you can even use integer notation for addition like:
y <= not(a) + 1;
Alternative is to use the IEEE VHDL standard numeric_std
package, with changes like:
library ieee;
use ieee.std_logic_1164.all;
use ieee.numeric_std.all;
...
y <= std_logic_vector(unsigned(not(a)) + 1);