TOP :integer:=1024;-- Define the max counting number.. the number must be expressed as 2 power, cause the range of counting is going to be defined as TOP-1 downto TOP/2.
TOP :integer:=1024;-- Define the max counting number.. the number must be expressed as 2 power, cause the range of counting is going to be defined as TOP-1 downto TOP/2.
-- However this is going to be by now, cause in the future the ray generation will GO on for higher resolution images , and perhaps it would be required a more extended range for the yu component.
-- However this is going to be by now, cause in the future the ray generation will GO on for higher resolution images , and perhaps it would be required a more extended range for the yu component.
SCREENW :integerrange0to1023:=320-- resolution width is 320
SCREENW :integer:=320-- resolution width is 320
);
);
port(
port(
clk,ena,rst :instd_logic;
clk,rst,ena :instd_logic;
lineDone :outstd_logic;-- Finished image row. once a hundred and sixty times....
lineDone :outstd_logic;-- Finished image row. once a hundred and sixty times....
ypos :outintegerrange TOP/2to TOP-1
ypos :outintegerrange TOP/2to TOP-1
-- ocntr : out integer range 0 to SCREENW/2
-- ocntr : out integer range 0 to SCREENW/2
);
);
endentity;
endentity;
Line 126...
Line 126...
-- Now, the integration function, cause we are at a new line..
-- Now, the integration function, cause we are at a new line..
if cc =0then
if cc =0then
ypos <= f1;
ypos <= f1;
f0 := f1;
f0 := f1;
lineDone <='1';
else
else
lineDone <='0';
ypos <= f0;
ypos <= f0;
if sf0(0)='1' then
if sf0(0)='1' then
f0 := f0 - 1;
f0 := f0 - 1;
endif;
endif;
endif;
endif;
-- Count when reach linefeed +3 (159) then turn cc into 0, else turn it into cc+1!
-- Count when reach linefeed +3 (159) then turn cc into 0, else turn it into cc+1!