Forum Discussion
Altera_Forum
Honored Contributor
13 years agoso should i change file extension to .dat instead of .txt or what??
here is my process if (rising_edge(clk)) then if rst = '1' then eog_sig <= '0'; else--rst while (col_s < starting_line_col) loop if(NOT(endfile(testing_read))) then READLINE(testing_read, my_line_read); else eog_sig <= '1'; end if; col_s := col_s + 1; end loop; col_e := col_s; while col_e < (ending_line_col+1) loop if(NOT(endfile(testing_read))) then READLINE(testing_read, my_line_read); READ(my_line_read, s); end if; while (row_s < starting_line_row) loop READ(my_line_read, s); row_s := row_s + 1; end loop;--row_s < starting_line_row row_e := row_s; row_s := 1; while row_e < (ending_line_row+1) loop READ(my_line_read, s); row_e := row_e + 1; x := x+s; i := i+1; end loop; col_e := col_e + 1; end loop; results := x/i; x := 0; i := 1; resultd_out <= To_StdLogicVector(results,N) ; col_s := 1; col_e := 1; row_s := 1; row_e := 1; end if;--rst end if;--clk Note: starting_line_col, starting_line_row, ending_line_col, ending_line_row are input integer values representing a rectangular area of x,y,width,height from which i select certain area to calculate its avarage sorry for my lazy code.. execuse me cause i'm totally new in that field.. willing to write smart code next time... thanks for your patiance.. Niveen