Forum Discussion
Altera_Forum
Honored Contributor
13 years agoipixel is a std_logic_vector
unsigned( ipixel(23 downto 16)) converts the top 8 bits to an unsigned type. std_logic_vector( unsigned( ipixel(23 downto 16)) ) converts the unsigned back to a std_logic_vector. A std_logic_vector is not a number, it is just a collection of bits. An unsigned type is a similar array that can be treated as an unsigned number, hence the ability to do arithmatic with it. So the answer I proposed: opixel(23 downto 16) <= std_logic_vector( unsigned( ipixel(23 downto 16) ) + 9 ); converts the input to an unsigned, adds 9 to it, then converts the result back to a std_logic_Vector.