F
Fredxx
I'm using the following lines which can read binary data from a file.
signal data_char : STD_LOGIC_VECTOR(15 downto 0);
type character_file is file of character;
file myfile: character_file;
variable character_variable : character;
file_open ( myfile, "file_name", read_mode);
read(myfile, character_variable);
data_word <= CONV_STD_LOGIC_VECTOR(character'pos(character_variable), 16);
But as is expected the 'character' is only 8 bits and only populates the
lower 8 bits of data_word.
Is VHDL able to read in 16 bit data, or should I give up now?
signal data_char : STD_LOGIC_VECTOR(15 downto 0);
type character_file is file of character;
file myfile: character_file;
variable character_variable : character;
file_open ( myfile, "file_name", read_mode);
read(myfile, character_variable);
data_word <= CONV_STD_LOGIC_VECTOR(character'pos(character_variable), 16);
But as is expected the 'character' is only 8 bits and only populates the
lower 8 bits of data_word.
Is VHDL able to read in 16 bit data, or should I give up now?