Slayer1234
Newbie level 3
- Joined
- Feb 5, 2014
- Messages
- 4
- Helped
- 0
- Reputation
- 0
- Reaction score
- 0
- Trophy points
- 1
- Activity points
- 73
Hi guys,its my first time here in this forum.Firstly,nice to meet you all.I would like to request help for my assignment as I am having difficulties at one part of my assignment.
I am trying to read from a file that has 3 columns,and I only need the middle column,So I declared 2 extra variables to store the left and right column while another variable(for my input)is used for the middle column.Attached is my input file and below is my code(reading part).Any help is greatly appreciated and thanks for taking your time to read my post.
Input File
____________________
View attachment input8.txt
Code
__________________
I am trying to read from a file that has 3 columns,and I only need the middle column,So I declared 2 extra variables to store the left and right column while another variable(for my input)is used for the middle column.Attached is my input file and below is my code(reading part).Any help is greatly appreciated and thanks for taking your time to read my post.
Input File
____________________
View attachment input8.txt
Code
__________________
Code VHDL - [expand] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 process use std.textio.all; use ieee.numeric_std.all; file inputfile:text open read_mode is "input8.txt"; variable ipa:std_logic_vector(63 downto 0); variable ipb:std_logic_vector(63 downto 0); variable inline:line; variable ipc:character; begin while not(endfile(inputfile))loop readline(inputfile,inline); hread(inline,ipa); --data_in<=ipa; hread(inline,ipb); data_in<=ipb; read(inline,ipc); --data_out2<= std_logic_vector(to_unsigned(character'pos(ipc),data_out2'length)); wait for 800 ns; end loop; wait; end process;
Last edited by a moderator: