母猪,我需要画一个红色圆圈〜100 px半径。我想我应该使用一些向量,但是如何?
entity VGAFrameTest is
port( yrow, xcolumn : in unsigned(9 downto 0); -- row and column number of VGA video
VGA_CLK : in std_logic; -- pixel clock
VGA_R, VGA_G, VGA_B: out std_logic_vector(9 downto 0)); -- color information
end;
architecture rtl of VGAFrameTest is
constant COLOR_ON : std_logic_vector(9 downto 0) := (others=>'1');
constant COLOR_OFF : std_logic_vector(9 downto 0) := (others=>'0');
constant ROW_HEIGHT : integer := 480; -- number of visible rows
-- A test of visible range is recommended
-- VGA 640x480@60Hz resolution is not natural for LCD monitors
-- They support it but some monitors do not display all columns
-- 1 or 2 last columns can be missing
constant COLUMN_WIDTH : integer := 640 -1 ; -- number of visible columns - correction
begin
frame:process(VGA_CLK)
begin
if rising_edge(VGA_CLK) then
VGA_R<=COLOR_ON;VGA_G<=COLOR_ON;VGA_B<=COLOR_ON; --initilize color to white
if (yrow = 240 and xcolumn = 320) then
VGA_B<=COLOR_OFF; VGA_G<=COLOR_OFF;
elsif yrow = 1 or yrow = ROW_HEIGHT-2 or xcolumn=1 or xcolumn = COLUMN_WIDTH-2 then
VGA_R<=COLOR_OFF; VGA_G<=COLOR_OFF; VGA_B<=COLOR_OFF; -- black frame
elsif yrow = ROW_HEIGHT-1 then
VGA_B<=COLOR_OFF; VGA_G<=COLOR_OFF; --last column is red
end if;
end if;
end process;
end;