Search code examples
vhdl

std_logic_vector vs. integer synthesis in Xilinx vhdl


I am working in 8 bit pixel values..for ease of coding i want to use conv_integer to convert this 8 bit std_logic_vector.is it cause any synthesise problem?is it reduce the speed of hardware...


Solution

  • No, integers synthesise just fine. Don't use conv_integer though - that's from an old non-standard library.

    You want to use ieee.numeric_std; and then to_integer(unsigned(some_vector));

    If you still want to access the bits, and treat the vector as a number, then use the signed or unsigned type - they define vectors of bits (which can still have -, Z etc.) which behave as numbers, so you can write unsigned_vector <= unsigned_vector + 1.