Altera_Forum
Honored Contributor
10 years agoimage read in vhdl
i want to read an image (or preferably a matrix of size 8x8) pixel by pixel in one clock cycle(if rising edge then read one pixel in 2nd rising edge 2nd pixel)....thanks in advance
package newtype is
type row_t is array(0 to 3) of integer;
type matrix_t is array(0 to 3, 0 to 3) of integer;
type row_pixel is array (0 to 0) of integer;
end newtype;
--function to extract each pixels of a row
function extract_row_pixel(row1 : row_t; pixel : integer) return row_pixel is
variable ret_pixel : row_pixel;
begin
for i in 0 downto 3 loop
ret_pixel(i) := row1(pixel, i);------error is Type integer is not an array type and cannot be indexed.
end loop;
return ret_pixel; ------error is Expecting type row_pixel for <ret_pixel>.
end function;
if rising_edge(clk) then
temp_row_pixel <= extract_row_pixel (output, to_integer(count));
count <= count + 1;
output1 <= temp_row_pixel;
end if;
error is :