signed/unsigned v.s. integer

Quote:

> I have discarded std_logic_signed/std_logic_unsigned and

> std_logic_arith as they are not standard. Now, talking about

> numeric_std types, what is the difference?. Both support logical and

> math operators. So, in the common situation of math-operating two

> std_logic_vector, is it really necessary to convert to integer?. For

> example, in the most simple case, both

> library ieee;

> use ieee.numeric_std.all;

> ....

-------------

--don't forget:

use ieee.std_logic_1164.all;

-------------

Quote:

> result<=std_logic_vector(to_unsigned(to_integer(unsigned(data_vector1))

> + to_integer(unsigned(data_vector2)),8));

> and

> result<=std_logic_vector((unsigned(data_vector1) + unsigned

> (data_vector2));

> work properly.

----pretty cool, isn't it?

Quote:

> So, which is the most correct/efficient approach?

-- I like to declare all logic vectors as unsigned.

-- This would give you:

result <= data_vector1 + data_vector2;

-- you can even do:

result <= data_vector1 + 42;

-- mike.treseler at flukenetworks dot com