I'm confused about a problem I have in VHDL.
I make one VGA_display_ characters
, so I wanna convert some std_logic_vectors
into integer by to_integer
unsigned, then I wanna recuperate,
in this way I can't use those libraries in the same time.
ieee.std_logic_arith.all
and ieee.numeric_std.all
The error given by quartus:
(Error (10621): VHDL Use Clause error at interface.vhd(34): more than one Use Clause imports a declaration of simple name "unsigned" -- none of the declarations are directly visible Error (10784): HDL error at syn_arit.vhd(26): see declaration for object "unsigned" bellow my code :
My advice is: don't use
ieee.std_logic_arith
. It's proprietary (not officially part of VHDL) and causes far, far more problems than it solves.Use only
numeric_std
and you can do everything you need:to_integer(unsigned(X))
andto_integer(signed(X))
, whereX
is anstd_logic_vector
.To convert back in the other direction:
std_logic_vector(to_unsigned(K, N))
andstd_logic_vector(to_signed(K, N))
whereK
is the integer to convert andN
is the number of bits.