Altera_Forum
Honored Contributor
14 years agoInteger to Bit Vector VHDL code error
I'm new to VHDL and I am trying to convert an integer to a 14 bit vector. Here is the protion of my code.
gear_calc <= to_integer(unsigned(to_stdlogicvector(Input_2))); synchro_gear <= gear_calc*36; IF synchro_gear < 360 THEN FOR i IN 0 to 16383 LOOP synchro_gear_vect(13 DOWNTO 0) <= bit_vector(to_unsigned(synchro_gear,i)); END LOOP; END IF; This is the error I get when I try to compile the code: Error (10305): VHDL Type Conversion error at gearbox.vhd(76): cannot convert type "UNSIGNED" to type "bit_vector" The libraries I'm using are here: USE IEEE.std_logic_1164.ALL; USE IEEE.numeric_std.ALL; Any help would greatly be appreciated. Thanks:)