User:1sfoerster/enes245/fall2014/VHDL-understanding the VGA screen

=Problem= The problem is to understand the VGA display and be able to create drawings and/or animations on the display based on this understanding.

=Conceive=

the starting point is to further understand the VGA project from chapter 19 of the IntroToSpartanFPGABook pdf file. In this chapter we were instructed to make a significant change to the Xilinx projects Professor Foerester Supplied to us. during this chapter I played around with the code to figure out what setting the colors to the different parts  of the counter did both pixelwise and linewise. I also started to look at the possibility of trying to control different portions of the screen separately and trying to figure out the locations of the pixels and lines on the screen.

=starting point= This project started with code from the VGA_Video files provided be professor Foerster in a link to three Xilinx projects provided as a starting point for the chapter 19 VGA project. https://github.com/jtoller7619/VGA-starting-point

library ieee; use ieee.std_logic_1164.all; use ieee.numeric_std.all;

entity VGA_Palette is	port(		ext_clock: in std_logic;		red: out std_logic;     green: out  std_logic;      blue: out  std_logic;      hsync: out  std_logic;      vsync: out  std_logic;		--		c: out std_logic	); end VGA_Palette;

architecture Behavioral of VGA_Palette is	component dcm_32_to_25 port(			clkin_in: in std_logic;         			clkfx_out: out std_logic;			clkin_ibufg_out: out std_logic;			clk0_out: out std_logic		); end component; constant PIXEL_COUNT: integer := 800; constant LINE_COUNT: integer := 525; signal pixel_counter: unsigned(9 downto 0) := (others => '0'); signal line_counter: unsigned(9 downto 0) := (others => '0'); signal clock: std_logic; begin vga_clock: dcm_32_to_25 port map(			clkin_in => ext_clock,			clkfx_out => clock,			clkin_ibufg_out => open,			clk0_out => open		);

update_pixel_counter: process(clock) begin if clock'event and clock = '1' then if pixel_counter = PIXEL_COUNT - 1 then pixel_counter <= (others => '0'); else pixel_counter <= pixel_counter + 1; end if; end if; end process; update_line_counter: process(clock) begin if clock'event and clock = '1' then if line_counter = LINE_COUNT - 1 then line_counter <= (others => '0'); elsif pixel_counter = PIXEL_COUNT - 1 then line_counter <= line_counter + 1; end if; end if; end process; update_hsync: process(clock) begin if clock'event and clock = '1' then if pixel_counter <= 94 then hsync <= '0'; else hsync <= '1'; end if; end if; end process; update_vsync: process(clock) begin if clock'event and clock = '1' then if line_counter <= 1 then vsync <= '0'; else vsync <= '1'; end if; end if; end process; update_pixel: process(clock) begin if clock'event and clock = '1' then if pixel_counter <= 94 or line_counter <= 1 then red <= '0'; green <= '0'; blue <= '0'; elsif (2 <= line_counter and line_counter <= 33) or (514 <= line_counter and line_counter <= 524) then red <= '0'; green <= '0'; blue <= '0'; elsif (95 <= pixel_counter and pixel_counter <= 135) or (776 <= pixel_counter and pixel_counter <= 799) then red <= '0'; green <= '0'; blue <= '0'; else red <= pixel_counter(9); green <= pixel_counter(6); blue <= line_counter(5); end if; end if; end process; process(clock) begin c <= clock; end process;

end Behavioral;

=Stages= Stage One

stage one was playing with the pattern in chapter 19. beginning to understand the ability to control different segments of the screen separately and seeing the effects of changing things in the different portions of the screen.

library ieee; use ieee.std_logic_1164.all; use ieee.numeric_std.all;

entity VGA_Palette is	port(		ext_clock: in std_logic;		red: out std_logic;     green: out  std_logic;      blue: out  std_logic;      hsync: out  std_logic;      vsync: out  std_logic;		--		c: out std_logic	); end VGA_Palette;

architecture Behavioral of VGA_Palette is	component dcm_32_to_25 port(			clkin_in: in std_logic;         			clkfx_out: out std_logic;			clkin_ibufg_out: out std_logic;			clk0_out: out std_logic		); end component; constant PIXEL_COUNT: integer := 800; constant LINE_COUNT: integer := 525; signal pixel_counter: unsigned(9 downto 0) := (others => '0'); signal line_counter: unsigned(9 downto 0) := (others => '0'); signal clock: std_logic; begin vga_clock: dcm_32_to_25 port map(			clkin_in => ext_clock,			clkfx_out => clock,			clkin_ibufg_out => open,			clk0_out => open		);

update_pixel_counter: process(clock) begin if clock'event and clock = '1' then if pixel_counter = PIXEL_COUNT - 1 then pixel_counter <= (others => '0'); else pixel_counter <= pixel_counter + 1; end if; end if; end process; update_line_counter: process(clock) begin if clock'event and clock = '1' then if line_counter = LINE_COUNT - 1 then line_counter <= (others => '0'); elsif pixel_counter = PIXEL_COUNT - 1 then line_counter <= line_counter + 1; end if; end if; end process; update_hsync: process(clock) begin if clock'event and clock = '1' then if pixel_counter <= 94 then hsync <= '0'; else hsync <= '1'; end if; end if; end process; update_vsync: process(clock) begin if clock'event and clock = '1' then if line_counter <= 1 then vsync <= '0'; else vsync <= '1'; end if; end if; end process; update_pixel: process(clock) begin if clock'event and clock = '1' then if pixel_counter <= 94 or line_counter <= 1 then red <= '0'; green <= '0'; blue <= '0'; elsif (2 <= line_counter and line_counter <= 33) or (514 <= line_counter and line_counter <= 524) then red <= '0'; green <= '0'; blue <= '0'; elsif (95 <= pixel_counter and pixel_counter <= 135) or (706 <= pixel_counter and pixel_counter <= 799) then red <= pixel_counter(2); green <= pixel_counter(2); blue <= line_counter(5); else red <= pixel_counter(9); green <= pixel_counter(8); blue <= line_counter(7); end if; end if; end process; process(clock) begin c <= clock; end process;

end Behavioral;

https://github.com/jtoller7619/GhostingEffectAndScreenSplitting

Stage two

stage two was experimenting with trying to get things to "grow" or "shrink" on the screen. this was accomplished by using a counter to step though elsif statements where the shape was made slightly larger each  counter increment on and upper portion of the counter. several portions were tried. 24 downto 21 provided the smoothest transition anything slower and the movement looked augmented anything faster went quite fast the much faster portions went too fast and looked like nothing was happening.

library ieee; use ieee.std_logic_1164.all; use ieee.numeric_std.all; use IEEE.STD_LOGIC_ARITH.ALL; use IEEE.STD_LOGIC_UNSIGNED.ALL;

entity VGA_Palette is	port(		ext_clock: in std_logic;		red: out std_logic;     green: out  std_logic;      blue: out  std_logic;      hsync: out  std_logic;      vsync: out  std_logic;		--		c: out std_logic	); end VGA_Palette;

architecture Behavioral of VGA_Palette is	component dcm_32_to_25 port(			clkin_in: in std_logic;         			clkfx_out: out std_logic;			clkin_ibufg_out: out std_logic;			clk0_out: out std_logic		); end component; constant PIXEL_COUNT: integer := 800; constant LINE_COUNT: integer := 525; signal pixel_counter: unsigned(9 downto 0) := (others => '0'); signal line_counter: unsigned(9 downto 0) := (others => '0'); signal clock: std_logic; ---	--added 11/17/14 signal counter : STD_LOGIC_VECTOR(29 downto 0) := (others => '0'); signal seconds : STD_LOGIC_VECTOR(7 downto 0) := (others => '0'); --- begin vga_clock: dcm_32_to_25 port map(			clkin_in => ext_clock,			clkfx_out => clock,			clkin_ibufg_out => open,			clk0_out => open		);

--added 11/17/14 clk_proc: process(clock) begin if rising_edge(clock) then counter <= counter + 1; if counter = 31999999 then --- this is where try to match fpga frequency seconds <= seconds + 1; counter <= (others => '0'); end if; end if; end process; -		update_pixel_counter: process(clock) begin if clock'event and clock = '1' then if pixel_counter = PIXEL_COUNT - 1 then pixel_counter <= (others => '0'); else pixel_counter <= pixel_counter + 1; end if; end if; end process; update_line_counter: process(clock) begin if clock'event and clock = '1' then if line_counter = LINE_COUNT - 1 then line_counter <= (others => '0'); elsif pixel_counter = PIXEL_COUNT - 1 then line_counter <= line_counter + 1; end if; end if; end process; update_hsync: process(clock) begin if clock'event and clock = '1' then if pixel_counter <= 94 then hsync <= '0'; else hsync <= '1'; end if; end if; end process; update_vsync: process(clock) begin if clock'event and clock = '1' then if line_counter <= 1 then vsync <= '0'; else vsync <= '1'; end if; end if; end process; update_pixel: process(clock) begin if clock'event and clock = '1' then if pixel_counter <= 94 or line_counter <= 1 then red <= '0'; green <= '0'; blue <= '0'; elsif (2 <= line_counter and line_counter <= 33) or (514 <= line_counter and line_counter <= 524) then red <= '0'; green <= '0'; blue <= '0'; --			elsif (95 <= pixel_counter and pixel_counter <= 330) and (34 <= line_counter and line_counter <=513) then --or (700 <= pixel_counter and pixel_counter <= 735) then elsif ((160 <= line_counter and line_counter <=170) and (260 <= pixel_counter and pixel_counter <= 270)) and (counter(24 downto 21)="0000") then red <= '0'; green <= '1'; blue <= '1'; --end if; elsif ((155 <= line_counter and line_counter <=175) and (255 <= pixel_counter and pixel_counter <= 275)) and (counter(24 downto 21)="0001") then red <= '0'; green <= '1'; blue <= '1'; --end if; elsif ((150 <= line_counter and line_counter <=180) and (250 <= pixel_counter and pixel_counter <= 280)) and (counter(24 downto 21)="0010") then red <= '0'; green <= '1'; blue <= '1'; --end if; elsif ((145 <= line_counter and line_counter <=185) and (245 <= pixel_counter and pixel_counter <= 285)) and (counter(24 downto 21)="0011") then red <= '0'; green <= '1'; blue <= '1'; --end if; elsif ((140 <= line_counter and line_counter <=190) and (240 <= pixel_counter and pixel_counter <= 290)) and (counter(24 downto 21)="0100") then red <= '0'; green <= '1'; blue <= '1'; elsif ((135 <= line_counter and line_counter <=195) and (235 <= pixel_counter and pixel_counter <= 295)) and (counter(24 downto 21)="101") then red <= '0'; green <= '1'; blue <= '1'; elsif ((130 <= line_counter and line_counter <=200) and (230 <= pixel_counter and pixel_counter <= 300)) and (counter(24 downto 21)="0110") then red <= '0'; green <= '1'; blue <= '1'; elsif ((125 <= line_counter and line_counter <=205) and (225 <= pixel_counter and pixel_counter <= 305)) and (counter(24 downto 21)="0111") then red <= '0'; green <= '1'; blue <= '1'; --end if; --				case counter (22 downto 20) is -- --				when "000" => --				if ((160 <= line_counter and line_counter <=170) and (260 <= pixel_counter and pixel_counter <= 270)) then --				red <= '0'; --				green <= '1'; --				blue <= '1'; --				end if; --				when "001"=> --				if((155 <= line_counter and line_counter <=175) and (255 <= pixel_counter and pixel_counter <= 275)) then --				red <= '0'; --				green <= '1'; --				blue <= '1'; --				end if; --				when "010"=> --				if((150 <= line_counter and line_counter <=180) and (250 <= pixel_counter and pixel_counter <= 280)) then --				red <= '0'; --				green <= '1'; --				blue <= '1'; --				end if; --				when "011"=> --				if((145 <= line_counter and line_counter <=185) and (245 <= pixel_counter and pixel_counter <= 285)) then --				red <= '0'; --				green <= '1'; --				blue <= '1'; --				end if; --				when Others=> --				if((160 <= line_counter and line_counter <=170) and (260 <= pixel_counter and pixel_counter <= 270)) then --				red <= '0'; --				green <= '1'; --				blue <= '1'; --				end if; --				end case; else red <= '0'; green <= '0'; blue <= '0'; end if; end if; end process; process(clock) begin c <= clock; end process;

end Behavioral;

https://github.com/jtoller7619/squaregrowingTopLeftCorner

https://www.youtube.com/watch?v=X5CVpLipwnU&feature=youtu.be

Stage three

stage three was to get things to change colors at different positions and to move across the screen. the colors were changed by setting the red green and blue values to differently in the elsif statements that were being moved through by the counter. position change

library ieee; use ieee.std_logic_1164.all; use ieee.numeric_std.all; use IEEE.STD_LOGIC_ARITH.ALL; use IEEE.STD_LOGIC_UNSIGNED.ALL;

entity VGA_Palette is	port(		ext_clock: in std_logic;		red: out std_logic;     green: out  std_logic;      blue: out  std_logic;      hsync: out  std_logic;      vsync: out  std_logic;		--		c: out std_logic	); end VGA_Palette;

architecture Behavioral of VGA_Palette is	component dcm_32_to_25 port(			clkin_in: in std_logic;         			clkfx_out: out std_logic;			clkin_ibufg_out: out std_logic;			clk0_out: out std_logic		); end component; constant PIXEL_COUNT: integer := 800; constant LINE_COUNT: integer := 525; signal pixel_counter: unsigned(9 downto 0) := (others => '0'); signal line_counter: unsigned(9 downto 0) := (others => '0'); signal clock: std_logic; ---	--added 11/17/14 signal counter : STD_LOGIC_VECTOR(29 downto 0) := (others => '0'); signal seconds : STD_LOGIC_VECTOR(7 downto 0) := (others => '0'); --- begin vga_clock: dcm_32_to_25 port map(			clkin_in => ext_clock,			clkfx_out => clock,			clkin_ibufg_out => open,			clk0_out => open		);

--added 11/17/14 clk_proc: process(clock) begin if rising_edge(clock) then counter <= counter + 1; if counter = 31999999 then --- this is where try to match fpga frequency seconds <= seconds + 1; counter <= (others => '0'); end if; end if; end process; -		update_pixel_counter: process(clock) begin if clock'event and clock = '1' then if pixel_counter = PIXEL_COUNT - 1 then pixel_counter <= (others => '0'); else pixel_counter <= pixel_counter + 1; end if; end if; end process; update_line_counter: process(clock) begin if clock'event and clock = '1' then if line_counter = LINE_COUNT - 1 then line_counter <= (others => '0'); elsif pixel_counter = PIXEL_COUNT - 1 then line_counter <= line_counter + 1; end if; end if; end process; update_hsync: process(clock) begin if clock'event and clock = '1' then if pixel_counter <= 94 then hsync <= '0'; else hsync <= '1'; end if; end if; end process; update_vsync: process(clock) begin if clock'event and clock = '1' then if line_counter <= 1 then vsync <= '0'; else vsync <= '1'; end if; end if; end process; update_pixel: process(clock) begin if clock'event and clock = '1' then if pixel_counter <= 94 or line_counter <= 1 then red <= '0'; green <= '0'; blue <= '0'; elsif (2 <= line_counter and line_counter <= 33) or (514 <= line_counter and line_counter <= 524) then red <= '0'; green <= '0'; blue <= '0'; --			 elsif (34 <= line_counter and line_counter <=513) then --or (700 <= pixel_counter and pixel_counter <= 735) then --and (95 <= pixel_counter and pixel_counter <= 734) --				case counter (24 downto 21) is -- --				when "0000" => elsif (700 <= pixel_counter and pixel_counter <= 705) and (315 <= line_counter and line_counter <=320) and (counter (24 downto 21)="0000")then red <= '0'; green <= '1'; blue <= '1'; --end if; --				when "0001"=> elsif(698 <= pixel_counter and pixel_counter <= 703) and (313 <= line_counter and line_counter <=318) and (counter (24 downto 21)="0001")then red <= '0'; green <= '1'; blue <= '1'; --end if; --				when "0010"=> elsif(695 <= pixel_counter and pixel_counter <= 700) and (310 <= line_counter and line_counter <=315) and (counter (24 downto 21)="0010")then red <= '0'; green <= '1'; blue <= '1'; --end if; --				when "0011"=> elsif(693 <= pixel_counter and pixel_counter <= 698) and (307 <= line_counter and line_counter <=312) and (counter (24 downto 21)="0011") then red <= '0'; green <= '1'; blue <= '1'; --end if; --				when "0100"=> elsif(690 <= pixel_counter and pixel_counter <= 695) and (305 <= line_counter and line_counter <=310) and (counter (24 downto 21)="0100") then red <= '0'; green <= '0'; blue <= '1'; --end if; --				when "0101"=> elsif(688 <= pixel_counter and pixel_counter <= 693) and (303 <= line_counter and line_counter <=308) and (counter (24 downto 21)="0101") then red <= '0'; green <= '0'; blue <= '1'; --end if; --				when "0110"=> elsif(685 <= pixel_counter and pixel_counter <= 690) and (300 <= line_counter and line_counter <=305) and (counter (24 downto 21)="0110") then red <= '0'; green <= '0'; blue <= '1'; --end if; --				when "0111"=> elsif(683 <= pixel_counter and pixel_counter <= 688) and (298 <= line_counter and line_counter <=303) and (counter (24 downto 21)="0111") then red <= '0'; green <= '1'; blue <= '0'; --end if; --				when "1000"=> elsif(680 <= pixel_counter and pixel_counter <= 685) and (295 <= line_counter and line_counter <=300) and (counter (24 downto 21)="1000") then red <= '0'; green <= '1'; blue <= '0'; --end if; --				when Others=> --				--if(675 <= pixel_counter and pixel_counter <= 680) and (290 <= line_counter and line_counter <=295) then --				red <= '0'; --				green <= '0'; --				blue <= '0'; --				--end if; --				end case; else red <= '0'; green <= '0'; blue <= '0'; end if; end if; end process; process(clock) begin c <= clock; end process;

end Behavioral;

https://www.youtube.com/watch?v=9CqLNF_91oI&feature=youtu.be

https://github.com/jtoller7619/flashymovingdot

Stage Four

for step four I combined my previously gained knowledge of the pixel and line composition of the screen to create a smiley face design. I decided to experiment with setting the color values to a portion of the counter to see if I could generate color changes without needing to make a separate elsif statement. The result was that when setting different colors to the same portion of a counter you end up with what appears to be a fade in effect this is because since we are using the same portion of the counter there is a time when all the digits are 0 so the pattern "dissapears" but really it is just black. The "fade in" that occurs afterwards is just due to the darker colors of the lower color combinations and the brighter colors of the higher color combinations. this spectrum is demonstrated in step five using when the switches are used to control the color of the nose. At this point because I wanted a yellow smiley face I decided to change the colors to include all the colors and put them in seperate serial buses for green red and blue. Note: this also required adding the pins for the remaining red green and blue colors to the constraints file.

library ieee; use ieee.std_logic_1164.all; use ieee.numeric_std.all; use IEEE.STD_LOGIC_ARITH.ALL; use IEEE.STD_LOGIC_UNSIGNED.ALL;

entity VGA_Palette is	port(		ext_clock: in std_logic;		--red: out std_logic;		VGA_RED: out STD_LOGIC_VECTOR (2 downto 0);     --green: out  std_logic;		VGA_GREEN: out STD_LOGIC_VECTOR (2 downto 0);      --blue: out  std_logic;		VGA_BLUE: out STD_LOGIC_VECTOR (1 downto 0);      Switches: in STD_LOGIC_VECTOR (7 downto 0);		hsync: out  std_logic;      vsync: out  std_logic		--		--c: out std_logic	); end VGA_Palette;

architecture Behavioral of VGA_Palette is	component dcm_32_to_25 port(			clkin_in: in std_logic;         			clkfx_out: out std_logic;			clkin_ibufg_out: out std_logic;			clk0_out: out std_logic		); end component; constant PIXEL_COUNT: integer := 800; constant LINE_COUNT: integer := 525; signal pixel_counter: unsigned(9 downto 0) := (others => '0'); signal line_counter: unsigned(9 downto 0) := (others => '0'); signal clock: std_logic; ---	--added 11/17/14 signal counter : STD_LOGIC_VECTOR(29 downto 0) := (others => '0'); signal seconds : STD_LOGIC_VECTOR(7 downto 0) := (others => '0'); --- begin vga_clock: dcm_32_to_25 port map(			clkin_in => ext_clock,			clkfx_out => clock,			clkin_ibufg_out => open,			clk0_out => open		);

--added 11/17/14 clk_proc: process(clock) begin if rising_edge(clock) then counter <= counter + 1; if counter = 31999999 then --- this is where try to match fpga frequency seconds <= seconds + 1; counter <= (others => '0'); end if; end if; end process; -		update_pixel_counter: process(clock) begin if clock'event and clock = '1' then if pixel_counter = PIXEL_COUNT - 1 then pixel_counter <= (others => '0'); else pixel_counter <= pixel_counter + 1; end if; end if; end process; update_line_counter: process(clock) begin if clock'event and clock = '1' then if line_counter = LINE_COUNT - 1 then line_counter <= (others => '0'); elsif pixel_counter = PIXEL_COUNT - 1 then line_counter <= line_counter + 1; end if; end if; end process; update_hsync: process(clock) begin if clock'event and clock = '1' then if pixel_counter <= 94 then hsync <= '0'; else hsync <= '1'; end if; end if; end process; update_vsync: process(clock) begin if clock'event and clock = '1' then if line_counter <= 1 then vsync <= '0'; else vsync <= '1'; end if; end if; end process; update_pixel: process(clock) begin if clock'event and clock = '1' then if pixel_counter <= 94 or line_counter <= 1 then --				red <= '0'; --				green <= '0'; -- blue <= '0';

VGA_RED <="000"; VGA_BLUE <="00"; VGA_GREEN <="000"; elsif (2 <= line_counter and line_counter <= 33) or (514 <= line_counter and line_counter <= 524) then --				red <= '0'; --				green <= '0'; -- blue <= '0';

VGA_RED <="000"; VGA_BLUE <="00"; VGA_GREEN <="000"; --			 elsif (34 <= line_counter and line_counter <=513) then --or (700 <= pixel_counter and pixel_counter <= 735) then --and (95 <= pixel_counter and pixel_counter <= 734) --				case counter (24 downto 21) is -- --				when "0000" => --				elsif (700 <= pixel_counter and pixel_counter <= 705) and (315 <= line_counter and line_counter <=320) and (counter (26 downto 21)="0000")then --				red <= '0'; --				green <= '1'; --				-- blue <= '1'; --				--end if; when "0001"=> --				elsif(698 <= pixel_counter and pixel_counter <= 703) and (313 <= line_counter and line_counter <=318) and (counter (24 downto 21)="0001")then --				red <= '0'; --				green <= '1'; --				-- blue <= '1'; --				--end if; when "0010"=> --				elsif(695 <= pixel_counter and pixel_counter <= 700) and (310 <= line_counter and line_counter <=315) and (counter (24 downto 21)="0010")then --				red <= '0'; --				green <= '1'; --				-- blue <= '1'; --				--end if; when "0011"=> --				elsif(693 <= pixel_counter and pixel_counter <= 698) and (307 <= line_counter and line_counter <=312) and (counter (24 downto 21)="0011") then --				red <= '0'; --				green <= '1'; --				-- blue <= '1'; --				--end if; when "0100"=> --				elsif(690 <= pixel_counter and pixel_counter <= 695) and (305 <= line_counter and line_counter <=310) and (counter (24 downto 21)="0100") then --				red <= '0'; --				green <= '0'; --				-- blue <= '1'; --				--end if; when "0101"=> --				elsif(688 <= pixel_counter and pixel_counter <= 693) and (303 <= line_counter and line_counter <=308) and (counter (24 downto 21)="0101") then --				red <= '0'; --				green <= '0'; --				-- blue <= '1'; --				--end if; when "0110"=> --				elsif(685 <= pixel_counter and pixel_counter <= 690) and (300 <= line_counter and line_counter <=305) and (counter (24 downto 21)="0110") then --				red <= '0'; --				green <= '0'; --				-- blue <= '1'; --				--end if; when "0111"=> --				elsif(683 <= pixel_counter and pixel_counter <= 688) and (298 <= line_counter and line_counter <=303) and (counter (24 downto 21)="0111") then --				red <= '0'; --				green <= '1'; --				-- blue <= '0'; --				--end if; when "1000"=> --				elsif(680 <= pixel_counter and pixel_counter <= 685) and (295 <= line_counter and line_counter <=300) and (counter (24 downto 21)="1000") then --				red <= '0'; --				green <= '1'; --				-- blue <= '0'; --			  elsif(678 <= pixel_counter and pixel_counter <= 683) and (293 <= line_counter and line_counter <=298) and (counter (24 downto 21)="1001") then --				red <= '0'; --				green <= '1'; --				-- blue <= '0'; --				elsif(675 <= pixel_counter and pixel_counter <= 680) and (290 <= line_counter and line_counter <=295) and (counter (24 downto 21)="1010") then --				red <= '0'; --				green <= '1'; --				-- blue <= '0';

-- -- making a blinking smiley face --				elsif (225 <= pixel_counter and pixel_counter <= 250) and (100 <= line_counter and line_counter <=125) and ("0000" <= counter (26 downto 21) and counter (26 downto 21) <="1010")then --				red <= '0'; --				green <= '1'; --				-- blue <= '1'; elsif (((300 <= pixel_counter and pixel_counter <= 325) and (100 <= line_counter and line_counter <=125)) or((225 <= pixel_counter and pixel_counter <= 250) and (100 <= line_counter and line_counter <=125))) and ("0000" <= counter (26 downto 21) and counter (26 downto 21) <="1010")then --				red <= '0'; --				green <= '1'; -- blue <= '1'; VGA_RED <=counter(24 downto 22); VGA_BLUE <="00"; VGA_GREEN <=counter(24 downto 22); elsif (225 <= pixel_counter and pixel_counter <= 325) and (200 <= line_counter and line_counter <=215) then --				red <= '0'; --				green <= '1'; -- blue <= '1'; VGA_RED <="111"; VGA_BLUE <="00"; VGA_GREEN <="111"; --end if; --				when "0001"=> elsif(698 <= pixel_counter and pixel_counter <= 703) and (313 <= line_counter and line_counter <=318) and (counter (24 downto 21)="0001")then --				red <= '0'; --				green <= '1'; -- blue <= '1'; VGA_RED <=Switches(7 downto 5); VGA_BLUE <=Switches(4 downto 3); VGA_GREEN <=Switches(2 downto 0); --end if; --				when "0010"=> elsif(695 <= pixel_counter and pixel_counter <= 700) and (310 <= line_counter and line_counter <=315) and (counter (24 downto 21)="0010")then --				red <= '0'; --				green <= '1'; -- blue <= '1'; VGA_RED <="000"; VGA_BLUE <="11"; VGA_GREEN <="010"; --end if; --				when "0011"=> elsif(693 <= pixel_counter and pixel_counter <= 698) and (307 <= line_counter and line_counter <=312) and (counter (24 downto 21)="0011") then --				red <= '0'; --				green <= '1'; -- blue <= '1'; VGA_RED <="000"; VGA_BLUE <="11"; VGA_GREEN <="010"; --end if; --				when "0100"=> elsif(690 <= pixel_counter and pixel_counter <= 695) and (305 <= line_counter and line_counter <=310) and (counter (24 downto 21)="0100") then --				red <= '0'; --				green <= '0'; -- blue <= '1'; VGA_RED <="000"; VGA_BLUE <="11"; VGA_GREEN <="000"; --end if; --				when "0101"=> elsif(688 <= pixel_counter and pixel_counter <= 693) and (303 <= line_counter and line_counter <=308) and (counter (24 downto 21)="0101") then --				red <= '0'; --				green <= '0'; -- blue <= '1'; VGA_RED <="000"; VGA_BLUE <="11"; VGA_GREEN <="000"; --end if; --				when "0110"=> elsif(685 <= pixel_counter and pixel_counter <= 690) and (300 <= line_counter and line_counter <=305) and (counter (24 downto 21)="0110") then --				red <= '0'; --				green <= '0'; -- blue <= '1'; --end if; VGA_RED <="000"; VGA_BLUE <="11"; VGA_GREEN <="000"; --				when "0111"=> elsif(683 <= pixel_counter and pixel_counter <= 688) and (298 <= line_counter and line_counter <=303) and (counter (24 downto 21)="0111") then --				red <= '0'; --				green <= '1'; -- blue <= '0'; --end if; VGA_RED <="000"; VGA_BLUE <="00"; VGA_GREEN <="010"; --				when "1000"=> elsif(680 <= pixel_counter and pixel_counter <= 685) and (295 <= line_counter and line_counter <=300) and (counter (24 downto 21)="1000") then --				red <= '0'; --				green <= '1'; -- blue <= '0'; VGA_RED <="000"; VGA_BLUE <="00"; VGA_GREEN <="010"; elsif(678 <= pixel_counter and pixel_counter <= 683) and (293 <= line_counter and line_counter <=298) and (counter (24 downto 21)="1001") then --				red <= '0'; --				green <= '1'; -- blue <= '0'; VGA_RED <="000"; VGA_BLUE <="00"; VGA_GREEN <="010"; elsif(675 <= pixel_counter and pixel_counter <= 680) and (290 <= line_counter and line_counter <=295) and (counter (24 downto 21)="1010") then --				red <= '0'; --				green <= '1'; -- blue <= '0'; VGA_RED <="000"; VGA_BLUE <="00"; VGA_GREEN <="010"; -- -				--end if; --				when Others=> --				--if(675 <= pixel_counter and pixel_counter <= 680) and (290 <= line_counter and line_counter <=295) then --				red <= '0'; --				green <= '0'; --				blue <= '0'; --				--end if; --				end case; else

VGA_RED <="000"; VGA_BLUE <="00"; VGA_GREEN <="000"; --				red <= '0'; --				green <= '0'; --				blue <= '0'; end if; end if; end process; --	process(clock) --	begin --		c <= clock; --	end process;

end Behavioral;

https://github.com/jtoller7619/smileyfaceWithFadeInEyes

https://www.youtube.com/watch?v=XaJVgLEL9mM

Stage Five

In stage five I combined the ability to make it look like objects are moving across the screen with the knowledge gained from stage four to create an animation of the smiley face having it's nose move from the lower right portion of the screen to it's face in the upper left portion of the screen I also added in the switches to control the color of the nose. Note: the switches also had to be added in the constraints file. the There are 256 different color combinations the Red serial bus was connected to switches (7 downto 5), the Blue serial bus was connected to switches (4 downto 3) and the Green serial bus was connected to switches (2 downto 0).

library ieee; use ieee.std_logic_1164.all; use ieee.numeric_std.all; use IEEE.STD_LOGIC_ARITH.ALL; use IEEE.STD_LOGIC_UNSIGNED.ALL;

entity VGA_Palette is	port(		ext_clock: in std_logic;		--red: out std_logic;		VGA_RED: out STD_LOGIC_VECTOR (2 downto 0);     --green: out  std_logic;		VGA_GREEN: out STD_LOGIC_VECTOR (2 downto 0);      --blue: out  std_logic;		VGA_BLUE: out STD_LOGIC_VECTOR (1 downto 0);      Switches: in STD_LOGIC_VECTOR (7 downto 0);		hsync: out  std_logic;      vsync: out  std_logic		--		--c: out std_logic	); end VGA_Palette;

architecture Behavioral of VGA_Palette is	component dcm_32_to_25 port(			clkin_in: in std_logic;         			clkfx_out: out std_logic;			clkin_ibufg_out: out std_logic;			clk0_out: out std_logic		); end component; constant PIXEL_COUNT: integer := 800; constant LINE_COUNT: integer := 525; signal pixel_counter: unsigned(9 downto 0) := (others => '0'); signal line_counter: unsigned(9 downto 0) := (others => '0'); signal clock: std_logic; ---	--added 11/17/14 signal counter : STD_LOGIC_VECTOR(29 downto 0) := (others => '0'); signal seconds : STD_LOGIC_VECTOR(7 downto 0) := (others => '0'); --- begin vga_clock: dcm_32_to_25 port map(			clkin_in => ext_clock,			clkfx_out => clock,			clkin_ibufg_out => open,			clk0_out => open		);

--added 11/17/14 clk_proc: process(clock) begin if rising_edge(clock) then counter <= counter + 1; if counter = 31999999 then --- this is where try to match fpga frequency seconds <= seconds + 1; counter <= (others => '0'); end if; end if; end process; -		update_pixel_counter: process(clock) begin if clock'event and clock = '1' then if pixel_counter = PIXEL_COUNT - 1 then pixel_counter <= (others => '0'); else pixel_counter <= pixel_counter + 1; end if; end if; end process; update_line_counter: process(clock) begin if clock'event and clock = '1' then if line_counter = LINE_COUNT - 1 then line_counter <= (others => '0'); elsif pixel_counter = PIXEL_COUNT - 1 then line_counter <= line_counter + 1; end if; end if; end process; update_hsync: process(clock) begin if clock'event and clock = '1' then if pixel_counter <= 94 then hsync <= '0'; else hsync <= '1'; end if; end if; end process; update_vsync: process(clock) begin if clock'event and clock = '1' then if line_counter <= 1 then vsync <= '0'; else vsync <= '1'; end if; end if; end process; update_pixel: process(clock) begin if clock'event and clock = '1' then if pixel_counter <= 94 or line_counter <= 1 then --				red <= '0'; --				green <= '0'; -- blue <= '0';

VGA_RED <="000"; VGA_BLUE <="00"; VGA_GREEN <="000"; elsif (2 <= line_counter and line_counter <= 33) or (514 <= line_counter and line_counter <= 524) then --				red <= '0'; --				green <= '0'; -- blue <= '0';

VGA_RED <="000"; VGA_BLUE <="00"; VGA_GREEN <="000"; --			 elsif (34 <= line_counter and line_counter <=513) then --or (700 <= pixel_counter and pixel_counter <= 735) then --and (95 <= pixel_counter and pixel_counter <= 734) --				case counter (24 downto 21) is -- --				when "0000" => --				elsif (700 <= pixel_counter and pixel_counter <= 705) and (315 <= line_counter and line_counter <=320) and (counter (26 downto 21)="0000")then --				red <= '0'; --				green <= '1'; --				-- blue <= '1'; --				--end if; when "0001"=> --				elsif(698 <= pixel_counter and pixel_counter <= 703) and (313 <= line_counter and line_counter <=318) and (counter (24 downto 21)="0001")then --				red <= '0'; --				green <= '1'; --				-- blue <= '1'; --				--end if; when "0010"=> --				elsif(695 <= pixel_counter and pixel_counter <= 700) and (310 <= line_counter and line_counter <=315) and (counter (24 downto 21)="0010")then --				red <= '0'; --				green <= '1'; --				-- blue <= '1'; --				--end if; when "0011"=> --				elsif(693 <= pixel_counter and pixel_counter <= 698) and (307 <= line_counter and line_counter <=312) and (counter (24 downto 21)="0011") then --				red <= '0'; --				green <= '1'; --				-- blue <= '1'; --				--end if; when "0100"=> --				elsif(690 <= pixel_counter and pixel_counter <= 695) and (305 <= line_counter and line_counter <=310) and (counter (24 downto 21)="0100") then --				red <= '0'; --				green <= '0'; --				-- blue <= '1'; --				--end if; when "0101"=> --				elsif(688 <= pixel_counter and pixel_counter <= 693) and (303 <= line_counter and line_counter <=308) and (counter (24 downto 21)="0101") then --				red <= '0'; --				green <= '0'; --				-- blue <= '1'; --				--end if; when "0110"=> --				elsif(685 <= pixel_counter and pixel_counter <= 690) and (300 <= line_counter and line_counter <=305) and (counter (24 downto 21)="0110") then --				red <= '0'; --				green <= '0'; --				-- blue <= '1'; --				--end if; when "0111"=> --				elsif(683 <= pixel_counter and pixel_counter <= 688) and (298 <= line_counter and line_counter <=303) and (counter (24 downto 21)="0111") then --				red <= '0'; --				green <= '1'; --				-- blue <= '0'; --				--end if; when "1000"=> --				elsif(680 <= pixel_counter and pixel_counter <= 685) and (295 <= line_counter and line_counter <=300) and (counter (24 downto 21)="1000") then --				red <= '0'; --				green <= '1'; --				-- blue <= '0'; --			  elsif(678 <= pixel_counter and pixel_counter <= 683) and (293 <= line_counter and line_counter <=298) and (counter (24 downto 21)="1001") then --				red <= '0'; --				green <= '1'; --				-- blue <= '0'; --				elsif(675 <= pixel_counter and pixel_counter <= 680) and (290 <= line_counter and line_counter <=295) and (counter (24 downto 21)="1010") then --				red <= '0'; --				green <= '1'; --				-- blue <= '0';

-- -- making a blinking smiley face --				elsif (225 <= pixel_counter and pixel_counter <= 250) and (100 <= line_counter and line_counter <=125) and ("0000" <= counter (26 downto 21) and counter (26 downto 21) <="1010")then --				red <= '0'; --				green <= '1'; --				-- blue <= '1'; elsif (((300 <= pixel_counter and pixel_counter <= 325) and (100 <= line_counter and line_counter <=125)) or((225 <= pixel_counter and pixel_counter <= 250) and (100 <= line_counter and line_counter <=125))) and ("0000" <= counter (26 downto 21) and counter (26 downto 21) <="1010")then --				red <= '0'; --				green <= '1'; -- blue <= '1'; VGA_RED <=counter(24 downto 22); VGA_BLUE <="00"; VGA_GREEN <=counter(24 downto 22); elsif (225 <= pixel_counter and pixel_counter <= 325) and (200 <= line_counter and line_counter <=215) then --				red <= '0'; --				green <= '1'; -- blue <= '1'; VGA_RED <="111"; VGA_BLUE <="00"; VGA_GREEN <="111"; --end if; --				when "0001"=> elsif(698 <= pixel_counter and pixel_counter <= 703) and (313 <= line_counter and line_counter <=318) and (counter (24 downto 21)="0001")then --				red <= '0'; --				green <= '1'; -- blue <= '1'; VGA_RED <=Switches(7 downto 5); VGA_BLUE <=Switches(4 downto 3); VGA_GREEN <=Switches(2 downto 0); --end if; --				when "0010"=> elsif(695 <= pixel_counter and pixel_counter <= 700) and (310 <= line_counter and line_counter <=315) and (counter (24 downto 21)="0010")then --				red <= '0'; --				green <= '1'; -- blue <= '1'; VGA_RED <="000"; VGA_BLUE <="11"; VGA_GREEN <="010"; --end if; --				when "0011"=> elsif(693 <= pixel_counter and pixel_counter <= 698) and (307 <= line_counter and line_counter <=312) and (counter (24 downto 21)="0011") then --				red <= '0'; --				green <= '1'; -- blue <= '1'; VGA_RED <="000"; VGA_BLUE <="11"; VGA_GREEN <="010"; --end if; --				when "0100"=> elsif(690 <= pixel_counter and pixel_counter <= 695) and (305 <= line_counter and line_counter <=310) and (counter (24 downto 21)="0100") then --				red <= '0'; --				green <= '0'; -- blue <= '1'; VGA_RED <="000"; VGA_BLUE <="11"; VGA_GREEN <="000"; --end if; --				when "0101"=> elsif(688 <= pixel_counter and pixel_counter <= 693) and (303 <= line_counter and line_counter <=308) and (counter (24 downto 21)="0101") then --				red <= '0'; --				green <= '0'; -- blue <= '1'; VGA_RED <="000"; VGA_BLUE <="11"; VGA_GREEN <="000"; --end if; --				when "0110"=> elsif(685 <= pixel_counter and pixel_counter <= 690) and (300 <= line_counter and line_counter <=305) and (counter (24 downto 21)="0110") then --				red <= '0'; --				green <= '0'; -- blue <= '1'; --end if; VGA_RED <="000"; VGA_BLUE <="11"; VGA_GREEN <="000"; --				when "0111"=> elsif(683 <= pixel_counter and pixel_counter <= 688) and (298 <= line_counter and line_counter <=303) and (counter (24 downto 21)="0111") then --				red <= '0'; --				green <= '1'; -- blue <= '0'; --end if; VGA_RED <="000"; VGA_BLUE <="00"; VGA_GREEN <="010"; --				when "1000"=> elsif(680 <= pixel_counter and pixel_counter <= 685) and (295 <= line_counter and line_counter <=300) and (counter (24 downto 21)="1000") then --				red <= '0'; --				green <= '1'; -- blue <= '0'; VGA_RED <="000"; VGA_BLUE <="00"; VGA_GREEN <="010"; elsif(678 <= pixel_counter and pixel_counter <= 683) and (293 <= line_counter and line_counter <=298) and (counter (24 downto 21)="1001") then --				red <= '0'; --				green <= '1'; -- blue <= '0'; VGA_RED <="000"; VGA_BLUE <="00"; VGA_GREEN <="010"; elsif(675 <= pixel_counter and pixel_counter <= 680) and (290 <= line_counter and line_counter <=295) and (counter (24 downto 21)="1010") then --				red <= '0'; --				green <= '1'; -- blue <= '0'; VGA_RED <="000"; VGA_BLUE <="00"; VGA_GREEN <="010"; -- -				--end if; --				when Others=> --				--if(675 <= pixel_counter and pixel_counter <= 680) and (290 <= line_counter and line_counter <=295) then --				red <= '0'; --				green <= '0'; --				blue <= '0'; --				--end if; --				end case; else

VGA_RED <="000"; VGA_BLUE <="00"; VGA_GREEN <="000"; --				red <= '0'; --				green <= '0'; --				blue <= '0'; end if; end if; end process; --	process(clock) --	begin --		c <= clock; --	end process;

end Behavioral;

https://www.youtube.com/watch?v=5jndOt9hVwI&feature=youtu.be

https://github.com/jtoller7619/SmileyWithSwitchesColoredNose =Design=

top level design  File:TopLevelDesign.png|thumb|top level design of my vga project  pixel and line counters  File:Linecounter1.png|thumb|shows line counter and pixel counter inside of the top level design 

=Implement= Final Stage In the final version of this project I combined everything from the previous stages. The color of the nose is controlled by the switches. the nose is "animated" to "move" from the lower right area to the smileys nose postion. the nose is animated to grow then to change color (by setting the colors to different portions of the counter) and "swallow" the smiley face(I added counter values to the smiley face code so once the square grows to it's size the smiley face does not appear).

library ieee; use ieee.std_logic_1164.all; use ieee.numeric_std.all; use IEEE.STD_LOGIC_ARITH.ALL; use IEEE.STD_LOGIC_UNSIGNED.ALL;

entity VGA_Palette is	port(		ext_clock: in std_logic;		--red: out std_logic;		VGA_RED: out STD_LOGIC_VECTOR (2 downto 0);     --green: out  std_logic;		VGA_GREEN: out STD_LOGIC_VECTOR (2 downto 0);      --blue: out  std_logic;		VGA_BLUE: out STD_LOGIC_VECTOR (1 downto 0);      Switches: in STD_LOGIC_VECTOR (7 downto 0);		hsync: out  std_logic;      vsync: out  std_logic		--		--c: out std_logic	); end VGA_Palette;

architecture Behavioral of VGA_Palette is	component dcm_32_to_25 port(			clkin_in: in std_logic;         			clkfx_out: out std_logic;			clkin_ibufg_out: out std_logic;			clk0_out: out std_logic		); end component; constant PIXEL_COUNT: integer := 800; constant LINE_COUNT: integer := 525; signal pixel_counter: unsigned(9 downto 0) := (others => '0'); signal line_counter: unsigned(9 downto 0) := (others => '0'); signal clock: std_logic; ---	--added 11/17/14 signal counter : STD_LOGIC_VECTOR(29 downto 0) := (others => '0'); signal seconds : STD_LOGIC_VECTOR(7 downto 0) := (others => '0'); --- begin vga_clock: dcm_32_to_25 port map(			clkin_in => ext_clock,			clkfx_out => clock,			clkin_ibufg_out => open,			clk0_out => open		);

--added 11/17/14 clk_proc: process(clock) begin if rising_edge(clock) then counter <= counter + 1; if counter = 31999999 then --- this is where try to match fpga frequency seconds <= seconds + 1; counter <= (others => '0'); end if; end if; end process; -		update_pixel_counter: process(clock) begin if clock'event and clock = '1' then if pixel_counter = PIXEL_COUNT - 1 then pixel_counter <= (others => '0'); else pixel_counter <= pixel_counter + 1; end if; end if; end process; update_line_counter: process(clock) begin if clock'event and clock = '1' then if line_counter = LINE_COUNT - 1 then line_counter <= (others => '0'); elsif pixel_counter = PIXEL_COUNT - 1 then line_counter <= line_counter + 1; end if; end if; end process; update_hsync: process(clock) begin if clock'event and clock = '1' then if pixel_counter <= 94 then hsync <= '0'; else hsync <= '1'; end if; end if; end process; update_vsync: process(clock) begin if clock'event and clock = '1' then if line_counter <= 1 then vsync <= '0'; else vsync <= '1'; end if; end if; end process; update_pixel: process(clock) begin if clock'event and clock = '1' then if pixel_counter <= 94 or line_counter <= 1 then --				red <= '0'; --				green <= '0'; -- blue <= '0';

VGA_RED <="000"; VGA_BLUE <="00"; VGA_GREEN <="000"; elsif (2 <= line_counter and line_counter <= 33) or (514 <= line_counter and line_counter <= 524) then --				red <= '0'; --				green <= '0'; -- blue <= '0';

VGA_RED <="000"; VGA_BLUE <="00"; VGA_GREEN <="000"; --			 elsif (34 <= line_counter and line_counter <=513) then --or (700 <= pixel_counter and pixel_counter <= 735) then --and (95 <= pixel_counter and pixel_counter <= 734) --				case counter (24 downto 21) is -- --				when "0000" => --				elsif (700 <= pixel_counter and pixel_counter <= 705) and (315 <= line_counter and line_counter <=320) and (counter (26 downto 21)="0000")then --				red <= '0'; --				green <= '1'; --				-- blue <= '1'; --				--end if; when "0001"=> --				elsif(698 <= pixel_counter and pixel_counter <= 703) and (313 <= line_counter and line_counter <=318) and (counter (24 downto 21)="0001")then --				red <= '0'; --				green <= '1'; --				-- blue <= '1'; --				--end if; when "0010"=> --				elsif(695 <= pixel_counter and pixel_counter <= 700) and (310 <= line_counter and line_counter <=315) and (counter (24 downto 21)="0010")then --				red <= '0'; --				green <= '1'; --				-- blue <= '1'; --				--end if; when "0011"=> --				elsif(693 <= pixel_counter and pixel_counter <= 698) and (307 <= line_counter and line_counter <=312) and (counter (24 downto 21)="0011") then --				red <= '0'; --				green <= '1'; --				-- blue <= '1'; --				--end if; when "0100"=> --				elsif(690 <= pixel_counter and pixel_counter <= 695) and (305 <= line_counter and line_counter <=310) and (counter (24 downto 21)="0100") then --				red <= '0'; --				green <= '0'; --				-- blue <= '1'; --				--end if; when "0101"=> --				elsif(688 <= pixel_counter and pixel_counter <= 693) and (303 <= line_counter and line_counter <=308) and (counter (24 downto 21)="0101") then --				red <= '0'; --				green <= '0'; --				-- blue <= '1'; --				--end if; when "0110"=> --				elsif(685 <= pixel_counter and pixel_counter <= 690) and (300 <= line_counter and line_counter <=305) and (counter (24 downto 21)="0110") then --				red <= '0'; --				green <= '0'; --				-- blue <= '1'; --				--end if; when "0111"=> --				elsif(683 <= pixel_counter and pixel_counter <= 688) and (298 <= line_counter and line_counter <=303) and (counter (24 downto 21)="0111") then --				red <= '0'; --				green <= '1'; --				-- blue <= '0'; --				--end if; when "1000"=> --				elsif(680 <= pixel_counter and pixel_counter <= 685) and (295 <= line_counter and line_counter <=300) and (counter (24 downto 21)="1000") then --				red <= '0'; --				green <= '1'; --				-- blue <= '0'; --			  elsif(678 <= pixel_counter and pixel_counter <= 683) and (293 <= line_counter and line_counter <=298) and (counter (24 downto 21)="1001") then --				red <= '0'; --				green <= '1'; --				-- blue <= '0'; --				elsif(675 <= pixel_counter and pixel_counter <= 680) and (290 <= line_counter and line_counter <=295) and (counter (24 downto 21)="1010") then --				red <= '0'; --				green <= '1'; --				-- blue <= '0';

-- -- making a blinking smiley face --				elsif (225 <= pixel_counter and pixel_counter <= 250) and (100 <= line_counter and line_counter <=125) and ("0000" <= counter (26 downto 21) and counter (26 downto 21) <="1010")then --				red <= '0'; --				green <= '1'; --				-- blue <= '1'; elsif (((300 <= pixel_counter and pixel_counter <= 325) and (100 <= line_counter and line_counter <=125)) or((225 <= pixel_counter and pixel_counter <= 250) and (100 <= line_counter and line_counter <=125))) and ("0000" <= counter (24 downto 21) and counter (24 downto 21) <="1011")then --				red <= '0'; --				green <= '1'; -- blue <= '1'; VGA_RED <=counter(22 downto 20); VGA_BLUE <="00"; VGA_GREEN <=counter(22 downto 20); elsif (225 <= pixel_counter and pixel_counter <= 325) and (200 <= line_counter and line_counter <=215) and ("0000" <= counter (24 downto 21) and counter (24 downto 21) <="1011") then --				red <= '0'; --				green <= '1'; -- blue <= '1'; --				VGA_RED <="111"; --				VGA_BLUE <="00"; --				VGA_GREEN <="111"; VGA_RED <=counter(27 downto 25); VGA_BLUE <=counter(10 downto 9); VGA_GREEN <=counter(10 downto 8); --end if; --				when "0001"=> --- --makes dot that moves from bottom right area of screen to smiley nose elsif(695 <= pixel_counter and pixel_counter <= 705) and (378 <= line_counter and line_counter <=388) and (counter (24 downto 17 )="00000001")then --				red <= '0'; --				green <= '1'; -- blue <= '1'; VGA_RED <=Switches(7 downto 5); VGA_BLUE <=Switches(4 downto 3); VGA_GREEN <=Switches(2 downto 0); elsif(690 <= pixel_counter and pixel_counter <= 700) and (375 <= line_counter and line_counter <=385) and (counter (24 downto 17)="00000010")then --				red <= '0'; --				green <= '1'; -- blue <= '1'; VGA_RED <=Switches(7 downto 5); VGA_BLUE <=Switches(4 downto 3); VGA_GREEN <=Switches(2 downto 0);

elsif(685 <= pixel_counter and pixel_counter <= 695) and (373 <= line_counter and line_counter <=383) and (counter (24 downto 17)="00000011")then --				red <= '0'; --				green <= '1'; -- blue <= '1'; VGA_RED <=Switches(7 downto 5); VGA_BLUE <=Switches(4 downto 3); VGA_GREEN <=Switches(2 downto 0); elsif(680 <= pixel_counter and pixel_counter <= 690) and (370 <= line_counter and line_counter <=380) and (counter (24 downto 17)="00000100")then --				red <= '0'; --				green <= '1'; -- blue <= '1'; VGA_RED <=Switches(7 downto 5); VGA_BLUE <=Switches(4 downto 3); VGA_GREEN <=Switches(2 downto 0);

elsif(675 <= pixel_counter and pixel_counter <= 685) and (368 <= line_counter and line_counter <=378) and (counter (24 downto 17)="00000101")then --				red <= '0'; --				green <= '1'; -- blue <= '1'; VGA_RED <=Switches(7 downto 5); VGA_BLUE <=Switches(4 downto 3); VGA_GREEN <=Switches(2 downto 0);

elsif(670 <= pixel_counter and pixel_counter <= 680) and (365 <= line_counter and line_counter <=375) and (counter (24 downto 17)="00000110")then --				red <= '0'; --				green <= '1'; -- blue <= '1'; VGA_RED <=Switches(7 downto 5); VGA_BLUE <=Switches(4 downto 3); VGA_GREEN <=Switches(2 downto 0);

elsif(665 <= pixel_counter and pixel_counter <= 675) and (363 <= line_counter and line_counter <=373) and (counter (24 downto 17)="00000111")then --				red <= '0'; --				green <= '1'; -- blue <= '1'; VGA_RED <=Switches(7 downto 5); VGA_BLUE <=Switches(4 downto 3); VGA_GREEN <=Switches(2 downto 0);

elsif(660 <= pixel_counter and pixel_counter <= 670) and (360 <= line_counter and line_counter <=370) and (counter (24 downto 17)="00001000")then --				red <= '0'; --				green <= '1'; -- blue <= '1'; VGA_RED <=Switches(7 downto 5); VGA_BLUE <=Switches(4 downto 3); VGA_GREEN <=Switches(2 downto 0);

elsif(655 <= pixel_counter and pixel_counter <= 665) and (358 <= line_counter and line_counter <=368) and (counter (24 downto 17)="00001001")then --				red <= '0'; --				green <= '1'; -- blue <= '1'; VGA_RED <=Switches(7 downto 5); VGA_BLUE <=Switches(4 downto 3); VGA_GREEN <=Switches(2 downto 0);

elsif(650 <= pixel_counter and pixel_counter <= 660) and (355 <= line_counter and line_counter <=365) and (counter (24 downto 17)="00001010")then --				red <= '0'; --				green <= '1'; -- blue <= '1'; VGA_RED <=Switches(7 downto 5); VGA_BLUE <=Switches(4 downto 3); VGA_GREEN <=Switches(2 downto 0);

elsif(645 <= pixel_counter and pixel_counter <= 655) and (353 <= line_counter and line_counter <=363) and (counter (24 downto 17)="00001011")then --				red <= '0'; --				green <= '1'; -- blue <= '1'; VGA_RED <=Switches(7 downto 5); VGA_BLUE <=Switches(4 downto 3); VGA_GREEN <=Switches(2 downto 0);

elsif(640 <= pixel_counter and pixel_counter <= 650) and (350 <= line_counter and line_counter <=360) and (counter (24 downto 17)="00001100")then --				red <= '0'; --				green <= '1'; -- blue <= '1'; VGA_RED <=Switches(7 downto 5); VGA_BLUE <=Switches(4 downto 3); VGA_GREEN <=Switches(2 downto 0);

elsif(635 <= pixel_counter and pixel_counter <= 645) and (348 <= line_counter and line_counter <=358) and (counter (24 downto 17)="00001101")then --				red <= '0'; --				green <= '1'; -- blue <= '1'; VGA_RED <=Switches(7 downto 5); VGA_BLUE <=Switches(4 downto 3); VGA_GREEN <=Switches(2 downto 0); elsif(630 <= pixel_counter and pixel_counter <= 640) and (345 <= line_counter and line_counter <=355) and (counter (24 downto 17)="00001110")then --				red <= '0'; --				green <= '1'; -- blue <= '1'; VGA_RED <=Switches(7 downto 5); VGA_BLUE <=Switches(4 downto 3); VGA_GREEN <=Switches(2 downto 0); elsif(625 <= pixel_counter and pixel_counter <= 635) and (343 <= line_counter and line_counter <=353) and (counter (24 downto 17)="00001111")then --				red <= '0'; --				green <= '1'; -- blue <= '1'; VGA_RED <=Switches(7 downto 5); VGA_BLUE <=Switches(4 downto 3); VGA_GREEN <=Switches(2 downto 0); elsif(620 <= pixel_counter and pixel_counter <= 630) and (340 <= line_counter and line_counter <=350) and (counter (24 downto 17)="00010000")then --				red <= '0'; --				green <= '1'; -- blue <= '1'; VGA_RED <=Switches(7 downto 5); VGA_BLUE <=Switches(4 downto 3); VGA_GREEN <=Switches(2 downto 0); elsif(615 <= pixel_counter and pixel_counter <= 625) and (338 <= line_counter and line_counter <=348) and (counter (24 downto 17)="00010001")then --				red <= '0'; --				green <= '1'; -- blue <= '1'; VGA_RED <=Switches(7 downto 5); VGA_BLUE <=Switches(4 downto 3); VGA_GREEN <=Switches(2 downto 0); elsif(610 <= pixel_counter and pixel_counter <= 620) and (335 <= line_counter and line_counter <=345) and (counter (24 downto 17)="00010010")then --				red <= '0'; --				green <= '1'; -- blue <= '1'; VGA_RED <=Switches(7 downto 5); VGA_BLUE <=Switches(4 downto 3); VGA_GREEN <=Switches(2 downto 0); elsif(605 <= pixel_counter and pixel_counter <= 615) and (333 <= line_counter and line_counter <=343) and (counter (24 downto 17)="00010011")then --				red <= '0'; --				green <= '1'; -- blue <= '1'; VGA_RED <=Switches(7 downto 5); VGA_BLUE <=Switches(4 downto 3); VGA_GREEN <=Switches(2 downto 0); elsif(600 <= pixel_counter and pixel_counter <= 610) and (330 <= line_counter and line_counter <=340) and (counter (24 downto 17)="00010100")then --				red <= '0'; --				green <= '1'; -- blue <= '1'; VGA_RED <=Switches(7 downto 5); VGA_BLUE <=Switches(4 downto 3); VGA_GREEN <=Switches(2 downto 0); elsif(595 <= pixel_counter and pixel_counter <= 605) and (328 <= line_counter and line_counter <=338) and (counter (24 downto 17)="00010101")then --				red <= '0'; --				green <= '1'; -- blue <= '1'; VGA_RED <=Switches(7 downto 5); VGA_BLUE <=Switches(4 downto 3); VGA_GREEN <=Switches(2 downto 0); elsif(590 <= pixel_counter and pixel_counter <= 600) and (325 <= line_counter and line_counter <=335) and (counter (24 downto 17)="00010110")then --				red <= '0'; --				green <= '1'; -- blue <= '1'; VGA_RED <=Switches(7 downto 5); VGA_BLUE <=Switches(4 downto 3); VGA_GREEN <=Switches(2 downto 0);

elsif(585 <= pixel_counter and pixel_counter <= 595) and (323<= line_counter and line_counter <=333) and (counter (24 downto 17)="00010111")then --				red <= '0'; --				green <= '1'; -- blue <= '1'; VGA_RED <=Switches(7 downto 5); VGA_BLUE <=Switches(4 downto 3); VGA_GREEN <=Switches(2 downto 0); elsif(580 <= pixel_counter and pixel_counter <= 590) and (320 <= line_counter and line_counter <=330) and (counter (24 downto 17)="00011000")then --				red <= '0'; --				green <= '1'; -- blue <= '1'; VGA_RED <=Switches(7 downto 5); VGA_BLUE <=Switches(4 downto 3); VGA_GREEN <=Switches(2 downto 0); elsif(575 <= pixel_counter and pixel_counter <= 585) and (318 <= line_counter and line_counter <=328) and (counter (24 downto 17)="00011001")then --				red <= '0'; --				green <= '1'; -- blue <= '1'; VGA_RED <=Switches(7 downto 5); VGA_BLUE <=Switches(4 downto 3); VGA_GREEN <=Switches(2 downto 0); elsif(570 <= pixel_counter and pixel_counter <= 580) and (315 <= line_counter and line_counter <=325) and (counter (24 downto 17)="00011010")then --				red <= '0'; --				green <= '1'; -- blue <= '1'; VGA_RED <=Switches(7 downto 5); VGA_BLUE <=Switches(4 downto 3); VGA_GREEN <=Switches(2 downto 0); elsif(565 <= pixel_counter and pixel_counter <= 575) and (313 <= line_counter and line_counter <=323) and (counter (24 downto 17)="00011011")then --				red <= '0'; --				green <= '1'; -- blue <= '1'; VGA_RED <=Switches(7 downto 5); VGA_BLUE <=Switches(4 downto 3); VGA_GREEN <=Switches(2 downto 0); elsif(560 <= pixel_counter and pixel_counter <= 570) and (310 <= line_counter and line_counter <=320) and (counter (24 downto 17)="00011100")then --				red <= '0'; --				green <= '1'; -- blue <= '1'; VGA_RED <=Switches(7 downto 5); VGA_BLUE <=Switches(4 downto 3); VGA_GREEN <=Switches(2 downto 0); elsif(555 <= pixel_counter and pixel_counter <= 565) and (308 <= line_counter and line_counter <=318) and (counter (24 downto 17)="00011101")then --				red <= '0'; --				green <= '1'; -- blue <= '1'; VGA_RED <=Switches(7 downto 5); VGA_BLUE <=Switches(4 downto 3); VGA_GREEN <=Switches(2 downto 0); elsif(550 <= pixel_counter and pixel_counter <= 560) and (305 <= line_counter and line_counter <=315) and (counter (24 downto 17)="00011110")then --				red <= '0'; --				green <= '1'; -- blue <= '1'; VGA_RED <=Switches(7 downto 5); VGA_BLUE <=Switches(4 downto 3); VGA_GREEN <=Switches(2 downto 0);

elsif(545 <= pixel_counter and pixel_counter <= 555) and (303 <= line_counter and line_counter <=313) and (counter (24 downto 17)="00011111")then --				red <= '0'; --				green <= '1'; -- blue <= '1'; VGA_RED <=Switches(7 downto 5); VGA_BLUE <=Switches(4 downto 3); VGA_GREEN <=Switches(2 downto 0); elsif(540 <= pixel_counter and pixel_counter <= 550) and (300 <= line_counter and line_counter <=310) and (counter (24 downto 17)="00100000")then --				red <= '0'; --				green <= '1'; -- blue <= '1'; VGA_RED <=Switches(7 downto 5); VGA_BLUE <=Switches(4 downto 3); VGA_GREEN <=Switches(2 downto 0); elsif(535 <= pixel_counter and pixel_counter <= 545) and (298 <= line_counter and line_counter <=308) and (counter (24 downto 17)="00100001")then --				red <= '0'; --				green <= '1'; -- blue <= '1'; VGA_RED <=Switches(7 downto 5); VGA_BLUE <=Switches(4 downto 3); VGA_GREEN <=Switches(2 downto 0); elsif(530 <= pixel_counter and pixel_counter <= 540) and (295 <= line_counter and line_counter <=305) and (counter (24 downto 17)="00100010")then --				red <= '0'; --				green <= '1'; -- blue <= '1'; VGA_RED <=Switches(7 downto 5); VGA_BLUE <=Switches(4 downto 3); VGA_GREEN <=Switches(2 downto 0); elsif(525 <= pixel_counter and pixel_counter <= 535) and (293 <= line_counter and line_counter <=303) and (counter (24 downto 17)="00100011")then --				red <= '0'; --				green <= '1'; -- blue <= '1'; VGA_RED <=Switches(7 downto 5); VGA_BLUE <=Switches(4 downto 3); VGA_GREEN <=Switches(2 downto 0); elsif(520 <= pixel_counter and pixel_counter <= 530) and (290 <= line_counter and line_counter <=300) and (counter (24 downto 17)="00100100")then --				red <= '0'; --				green <= '1'; -- blue <= '1'; VGA_RED <=Switches(7 downto 5); VGA_BLUE <=Switches(4 downto 3); VGA_GREEN <=Switches(2 downto 0); elsif(515 <= pixel_counter and pixel_counter <= 525) and (288 <= line_counter and line_counter <=298) and (counter (24 downto 17)="00100101")then --				red <= '0'; --				green <= '1'; -- blue <= '1'; VGA_RED <=Switches(7 downto 5); VGA_BLUE <=Switches(4 downto 3); VGA_GREEN <=Switches(2 downto 0); elsif(510 <= pixel_counter and pixel_counter <= 520) and (285 <= line_counter and line_counter <=295) and (counter (24 downto 17)="00100110")then --				red <= '0'; --				green <= '1'; -- blue <= '1'; VGA_RED <=Switches(7 downto 5); VGA_BLUE <=Switches(4 downto 3); VGA_GREEN <=Switches(2 downto 0); elsif(505 <= pixel_counter and pixel_counter <= 515) and (283 <= line_counter and line_counter <=293) and (counter (24 downto 17)="00100111")then --				red <= '0'; --				green <= '1'; -- blue <= '1'; VGA_RED <=Switches(7 downto 5); VGA_BLUE <=Switches(4 downto 3); VGA_GREEN <=Switches(2 downto 0); elsif(500 <= pixel_counter and pixel_counter <= 510) and (280 <= line_counter and line_counter <=290) and (counter (24 downto 17)="00101000")then --				red <= '0'; --				green <= '1'; -- blue <= '1'; VGA_RED <=Switches(7 downto 5); VGA_BLUE <=Switches(4 downto 3); VGA_GREEN <=Switches(2 downto 0); elsif(495 <= pixel_counter and pixel_counter <= 505) and (278 <= line_counter and line_counter <=288) and (counter (24 downto 17)="00101001")then --				red <= '0'; --				green <= '1'; -- blue <= '1'; VGA_RED <=Switches(7 downto 5); VGA_BLUE <=Switches(4 downto 3); VGA_GREEN <=Switches(2 downto 0); elsif(490 <= pixel_counter and pixel_counter <= 500) and (275 <= line_counter and line_counter <=285) and (counter (24 downto 17)="00101010")then --				red <= '0'; --				green <= '1'; -- blue <= '1'; VGA_RED <=Switches(7 downto 5); VGA_BLUE <=Switches(4 downto 3); VGA_GREEN <=Switches(2 downto 0); elsif(485 <= pixel_counter and pixel_counter <= 495) and (273 <= line_counter and line_counter <=283) and (counter (24 downto 17)="00101011")then --				red <= '0'; --				green <= '1'; -- blue <= '1'; VGA_RED <=Switches(7 downto 5); VGA_BLUE <=Switches(4 downto 3); VGA_GREEN <=Switches(2 downto 0); elsif(480 <= pixel_counter and pixel_counter <= 490) and (270 <= line_counter and line_counter <=280) and (counter (24 downto 17)="00101100")then --				red <= '0'; --				green <= '1'; -- blue <= '1'; VGA_RED <=Switches(7 downto 5); VGA_BLUE <=Switches(4 downto 3); VGA_GREEN <=Switches(2 downto 0); elsif(475 <= pixel_counter and pixel_counter <= 485) and (268 <= line_counter and line_counter <=278) and (counter (24 downto 17)="00101101")then --				red <= '0'; --				green <= '1'; -- blue <= '1'; VGA_RED <=Switches(7 downto 5); VGA_BLUE <=Switches(4 downto 3); VGA_GREEN <=Switches(2 downto 0); elsif(470 <= pixel_counter and pixel_counter <= 480) and (265 <= line_counter and line_counter <=275) and (counter (24 downto 17)="00101110")then --				red <= '0'; --				green <= '1'; -- blue <= '1'; VGA_RED <=Switches(7 downto 5); VGA_BLUE <=Switches(4 downto 3); VGA_GREEN <=Switches(2 downto 0); elsif(465 <= pixel_counter and pixel_counter <= 475) and (263 <= line_counter and line_counter <=273) and (counter (24 downto 17)="00101111")then --				red <= '0'; --				green <= '1'; -- blue <= '1'; VGA_RED <=Switches(7 downto 5); VGA_BLUE <=Switches(4 downto 3); VGA_GREEN <=Switches(2 downto 0); elsif(460 <= pixel_counter and pixel_counter <= 470) and (260 <= line_counter and line_counter <=270) and (counter (24 downto 17)="00110000")then --				red <= '0'; --				green <= '1'; -- blue <= '1'; VGA_RED <=Switches(7 downto 5); VGA_BLUE <=Switches(4 downto 3); VGA_GREEN <=Switches(2 downto 0); elsif(455 <= pixel_counter and pixel_counter <= 465) and (258 <= line_counter and line_counter <=268) and (counter (24 downto 17)="00110001")then --				red <= '0'; --				green <= '1'; -- blue <= '1'; VGA_RED <=Switches(7 downto 5); VGA_BLUE <=Switches(4 downto 3); VGA_GREEN <=Switches(2 downto 0); elsif(450 <= pixel_counter and pixel_counter <= 460) and (255 <= line_counter and line_counter <=265) and (counter (24 downto 17)="00110010")then --				red <= '0'; --				green <= '1'; -- blue <= '1'; VGA_RED <=Switches(7 downto 5); VGA_BLUE <=Switches(4 downto 3); VGA_GREEN <=Switches(2 downto 0); elsif(445 <= pixel_counter and pixel_counter <= 455) and (253 <= line_counter and line_counter <=263) and (counter (24 downto 17)="00110011")then --				red <= '0'; --				green <= '1'; -- blue <= '1'; VGA_RED <=Switches(7 downto 5); VGA_BLUE <=Switches(4 downto 3); VGA_GREEN <=Switches(2 downto 0); elsif(440 <= pixel_counter and pixel_counter <= 450) and (250 <= line_counter and line_counter <=260) and (counter (24 downto 17)="00110100")then --				red <= '0'; --				green <= '1'; -- blue <= '1'; VGA_RED <=Switches(7 downto 5); VGA_BLUE <=Switches(4 downto 3); VGA_GREEN <=Switches(2 downto 0);

elsif(435 <= pixel_counter and pixel_counter <= 445) and (248 <= line_counter and line_counter <=258) and (counter (24 downto 17)="00110101")then --				red <= '0'; --				green <= '1'; -- blue <= '1'; VGA_RED <=Switches(7 downto 5); VGA_BLUE <=Switches(4 downto 3); VGA_GREEN <=Switches(2 downto 0); elsif(430 <= pixel_counter and pixel_counter <= 440) and (245 <= line_counter and line_counter <=255) and (counter (24 downto 17)="00110110")then --				red <= '0'; --				green <= '1'; -- blue <= '1'; VGA_RED <=Switches(7 downto 5); VGA_BLUE <=Switches(4 downto 3); VGA_GREEN <=Switches(2 downto 0); elsif(425 <= pixel_counter and pixel_counter <= 435) and (242 <= line_counter and line_counter <=252) and (counter (24 downto 17)="00110111")then --				red <= '0'; --				green <= '1'; -- blue <= '1'; VGA_RED <=Switches(7 downto 5); VGA_BLUE <=Switches(4 downto 3); VGA_GREEN <=Switches(2 downto 0); elsif(420 <= pixel_counter and pixel_counter <= 430) and (240 <= line_counter and line_counter <=250) and (counter (24 downto 17)="00111000")then --				red <= '0'; --				green <= '1'; -- blue <= '1'; VGA_RED <=Switches(7 downto 5); VGA_BLUE <=Switches(4 downto 3); VGA_GREEN <=Switches(2 downto 0); elsif(415 <= pixel_counter and pixel_counter <= 425) and (238 <= line_counter and line_counter <=248) and (counter (24 downto 17)="00111001")then --				red <= '0'; --				green <= '1'; -- blue <= '1'; VGA_RED <=Switches(7 downto 5); VGA_BLUE <=Switches(4 downto 3); VGA_GREEN <=Switches(2 downto 0); elsif(410 <= pixel_counter and pixel_counter <= 420) and (235 <= line_counter and line_counter <=245) and (counter (24 downto 17)="00111010")then --				red <= '0'; --				green <= '1'; -- blue <= '1'; VGA_RED <=Switches(7 downto 5); VGA_BLUE <=Switches(4 downto 3); VGA_GREEN <=Switches(2 downto 0); elsif(405 <= pixel_counter and pixel_counter <= 415) and (233 <= line_counter and line_counter <=243) and (counter (24 downto 17)="00111011")then --				red <= '0'; --				green <= '1'; -- blue <= '1'; VGA_RED <=Switches(7 downto 5); VGA_BLUE <=Switches(4 downto 3); VGA_GREEN <=Switches(2 downto 0); elsif(400 <= pixel_counter and pixel_counter <= 410) and (230 <= line_counter and line_counter <=240) and (counter (24 downto 17)="00111100")then --				red <= '0'; --				green <= '1'; -- blue <= '1'; VGA_RED <=Switches(7 downto 5); VGA_BLUE <=Switches(4 downto 3); VGA_GREEN <=Switches(2 downto 0); elsif(395 <= pixel_counter and pixel_counter <= 405) and (228 <= line_counter and line_counter <=238) and (counter (24 downto 17)="00111101")then --				red <= '0'; --				green <= '1'; -- blue <= '1'; VGA_RED <=Switches(7 downto 5); VGA_BLUE <=Switches(4 downto 3); VGA_GREEN <=Switches(2 downto 0); elsif(390 <= pixel_counter and pixel_counter <= 400) and (225 <= line_counter and line_counter <=235) and (counter (24 downto 17)="00111110")then --				red <= '0'; --				green <= '1'; -- blue <= '1'; VGA_RED <=Switches(7 downto 5); VGA_BLUE <=Switches(4 downto 3); VGA_GREEN <=Switches(2 downto 0); elsif(385 <= pixel_counter and pixel_counter <= 395) and (223 <= line_counter and line_counter <=233) and (counter (24 downto 17)="00111111")then --				red <= '0'; --				green <= '1'; -- blue <= '1'; VGA_RED <=Switches(7 downto 5); VGA_BLUE <=Switches(4 downto 3); VGA_GREEN <=Switches(2 downto 0); elsif(380 <= pixel_counter and pixel_counter <= 390) and (220 <= line_counter and line_counter <=230) and (counter (24 downto 17)="01000000")then --				red <= '0'; --				green <= '1'; -- blue <= '1'; VGA_RED <=Switches(7 downto 5); VGA_BLUE <=Switches(4 downto 3); VGA_GREEN <=Switches(2 downto 0); elsif(375 <= pixel_counter and pixel_counter <= 385) and (218 <= line_counter and line_counter <=228) and (counter (24 downto 17)="01000001")then --				red <= '0'; --				green <= '1'; -- blue <= '1'; VGA_RED <=Switches(7 downto 5); VGA_BLUE <=Switches(4 downto 3); VGA_GREEN <=Switches(2 downto 0); elsif(370 <= pixel_counter and pixel_counter <= 380) and (215 <= line_counter and line_counter <=225) and (counter (24 downto 17)="01000010")then --				red <= '0'; --				green <= '1'; -- blue <= '1'; VGA_RED <=Switches(7 downto 5); VGA_BLUE <=Switches(4 downto 3); VGA_GREEN <=Switches(2 downto 0); elsif(365 <= pixel_counter and pixel_counter <= 375) and (213 <= line_counter and line_counter <=223) and (counter (24 downto 17)="01000011")then --				red <= '0'; --				green <= '1'; -- blue <= '1'; VGA_RED <=Switches(7 downto 5); VGA_BLUE <=Switches(4 downto 3); VGA_GREEN <=Switches(2 downto 0); elsif(360 <= pixel_counter and pixel_counter <= 370) and (210 <= line_counter and line_counter <=220) and (counter (24 downto 17)="01000100")then --				red <= '0'; --				green <= '1'; -- blue <= '1'; VGA_RED <=Switches(7 downto 5); VGA_BLUE <=Switches(4 downto 3); VGA_GREEN <=Switches(2 downto 0); elsif(355 <= pixel_counter and pixel_counter <= 365) and (208 <= line_counter and line_counter <=218) and (counter (24 downto 17)="01000101")then --				red <= '0'; --				green <= '1'; -- blue <= '1'; VGA_RED <=Switches(7 downto 5); VGA_BLUE <=Switches(4 downto 3); VGA_GREEN <=Switches(2 downto 0); elsif(350 <= pixel_counter and pixel_counter <= 360) and (205 <= line_counter and line_counter <=215) and (counter (24 downto 17)="01000110")then --				red <= '0'; --				green <= '1'; -- blue <= '1'; VGA_RED <=Switches(7 downto 5); VGA_BLUE <=Switches(4 downto 3); VGA_GREEN <=Switches(2 downto 0); elsif(345 <= pixel_counter and pixel_counter <= 355) and (203 <= line_counter and line_counter <=213) and (counter (24 downto 17)="01000111")then --				red <= '0'; --				green <= '1'; -- blue <= '1'; VGA_RED <=Switches(7 downto 5); VGA_BLUE <=Switches(4 downto 3); VGA_GREEN <=Switches(2 downto 0); elsif(340 <= pixel_counter and pixel_counter <= 350) and (200 <= line_counter and line_counter <=210) and (counter (24 downto 17)="01001000")then --				red <= '0'; --				green <= '1'; -- blue <= '1'; VGA_RED <=Switches(7 downto 5); VGA_BLUE <=Switches(4 downto 3); VGA_GREEN <=Switches(2 downto 0); elsif(335 <= pixel_counter and pixel_counter <= 345) and (198 <= line_counter and line_counter <=208) and (counter (24 downto 17)="01001001")then --				red <= '0'; --				green <= '1'; -- blue <= '1'; VGA_RED <=Switches(7 downto 5); VGA_BLUE <=Switches(4 downto 3); VGA_GREEN <=Switches(2 downto 0); elsif(330 <= pixel_counter and pixel_counter <= 340) and (195 <= line_counter and line_counter <=205) and (counter (24 downto 17)="01001010")then --				red <= '0'; --				green <= '1'; -- blue <= '1'; VGA_RED <=Switches(7 downto 5); VGA_BLUE <=Switches(4 downto 3); VGA_GREEN <=Switches(2 downto 0); elsif(325 <= pixel_counter and pixel_counter <= 335) and ( 193 <= line_counter and line_counter <=203) and (counter (24 downto 17)="01001011")then --				red <= '0'; --				green <= '1'; -- blue <= '1'; VGA_RED <=Switches(7 downto 5); VGA_BLUE <=Switches(4 downto 3); VGA_GREEN <=Switches(2 downto 0); elsif(320 <= pixel_counter and pixel_counter <= 330) and (190 <= line_counter and line_counter <=200) and (counter (24 downto 17)="01001100")then --				red <= '0'; --				green <= '1'; -- blue <= '1'; VGA_RED <=Switches(7 downto 5); VGA_BLUE <=Switches(4 downto 3); VGA_GREEN <=Switches(2 downto 0); elsif(315 <= pixel_counter and pixel_counter <= 325) and (188 <= line_counter and line_counter <=198) and (counter (24 downto 17)="01001101")then --				red <= '0'; --				green <= '1'; -- blue <= '1'; VGA_RED <=Switches(7 downto 5); VGA_BLUE <=Switches(4 downto 3); VGA_GREEN <=Switches(2 downto 0); elsif(310 <= pixel_counter and pixel_counter <= 320) and (185 <= line_counter and line_counter <=195) and (counter (24 downto 17)="01001110")then --				red <= '0'; --				green <= '1'; -- blue <= '1'; VGA_RED <=Switches(7 downto 5); VGA_BLUE <=Switches(4 downto 3); VGA_GREEN <=Switches(2 downto 0); elsif(305 <= pixel_counter and pixel_counter <= 315) and (183 <= line_counter and line_counter <=193) and (counter (24 downto 17)="01001111")then --				red <= '0'; --				green <= '1'; -- blue <= '1'; VGA_RED <=Switches(7 downto 5); VGA_BLUE <=Switches(4 downto 3); VGA_GREEN <=Switches(2 downto 0); elsif(300 <= pixel_counter and pixel_counter <= 310) and (180 <= line_counter and line_counter <=190) and (counter (24 downto 17)="001010000")then --				red <= '0'; --				green <= '1'; -- blue <= '1'; VGA_RED <=Switches(7 downto 5); VGA_BLUE <=Switches(4 downto 3); VGA_GREEN <=Switches(2 downto 0); elsif(295 <= pixel_counter and pixel_counter <= 305) and (178 <= line_counter and line_counter <=188) and (counter (24 downto 17)="001010001")then --				red <= '0'; --				green <= '1'; -- blue <= '1'; VGA_RED <=Switches(7 downto 5); VGA_BLUE <=Switches(4 downto 3); VGA_GREEN <=Switches(2 downto 0); elsif(290 <= pixel_counter and pixel_counter <= 300) and (175 <= line_counter and line_counter <=185) and (counter (24 downto 17)="001010010")then --				red <= '0'; --				green <= '1'; -- blue <= '1'; VGA_RED <=Switches(7 downto 5); VGA_BLUE <=Switches(4 downto 3); VGA_GREEN <=Switches(2 downto 0); elsif(285 <= pixel_counter and pixel_counter <= 295) and (173 <= line_counter and line_counter <=183) and (counter (24 downto 17)="001010011")then --				red <= '0'; --				green <= '1'; -- blue <= '1'; VGA_RED <=Switches(7 downto 5); VGA_BLUE <=Switches(4 downto 3); VGA_GREEN <=Switches(2 downto 0); elsif(280 <= pixel_counter and pixel_counter <= 290) and (170 <= line_counter and line_counter <=180) and (counter (24 downto 17)="001010100")then --				red <= '0'; --				green <= '1'; -- blue <= '1'; VGA_RED <=Switches(7 downto 5); VGA_BLUE <=Switches(4 downto 3); VGA_GREEN <=Switches(2 downto 0); elsif(275 <= pixel_counter and pixel_counter <= 285) and (168 <= line_counter and line_counter <=178) and (counter (24 downto 17)="001010101")then --				red <= '0'; --				green <= '1'; -- blue <= '1'; VGA_RED <=Switches(7 downto 5); VGA_BLUE <=Switches(4 downto 3); VGA_GREEN <=Switches(2 downto 0); elsif(270 <= pixel_counter and pixel_counter <= 280) and (165 <= line_counter and line_counter <=175) and (counter (24 downto 17)="001010110")then --				red <= '0'; --				green <= '1'; -- blue <= '1'; VGA_RED <=Switches(7 downto 5); VGA_BLUE <=Switches(4 downto 3); VGA_GREEN <=Switches(2 downto 0); elsif(265 <= pixel_counter and pixel_counter <= 275) and (163 <= line_counter and line_counter <=173) and (counter (24 downto 17)="001010111")then --				red <= '0'; --				green <= '1'; -- blue <= '1'; VGA_RED <=Switches(7 downto 5); VGA_BLUE <=Switches(4 downto 3); VGA_GREEN <=Switches(2 downto 0); elsif(260 <= pixel_counter and pixel_counter <= 270) and (160 <= line_counter and line_counter <=170) and ("01011000" <= counter (24 downto 17) and counter (24 downto 17) <= "001111111")then --				red <= '0'; --				green <= '1'; -- blue <= '1'; VGA_RED <=Switches(7 downto 5); VGA_BLUE <=Switches(4 downto 3); VGA_GREEN <=Switches(2 downto 0); elsif ((160 <= line_counter and line_counter <=170) and (260 <= pixel_counter and pixel_counter <= 270)) and (counter(24 downto 21)="0000") then --				red <= '0'; --				green <= '1'; -- blue <= '1'; VGA_RED <=Switches(7 downto 5); VGA_BLUE <=Switches(4 downto 3); VGA_GREEN <=Switches(2 downto 0); elsif ((155 <= line_counter and line_counter <=175) and (255 <= pixel_counter and pixel_counter <= 275)) and (counter(24 downto 21)="0001") then --				red <= '0'; --				green <= '1'; -- blue <= '1'; VGA_RED <=Switches(7 downto 5); VGA_BLUE <=Switches(4 downto 3); VGA_GREEN <=Switches(2 downto 0); elsif ((145 <= line_counter and line_counter <=185) and (245 <= pixel_counter and pixel_counter <= 285)) and (counter(24 downto 21)="0011") then --				red <= '0'; --				green <= '1'; -- blue <= '1'; VGA_RED <=Switches(7 downto 5); VGA_BLUE <=Switches(4 downto 3); VGA_GREEN <=Switches(2 downto 0); elsif ((140 <= line_counter and line_counter <=190) and (240 <= pixel_counter and pixel_counter <= 290)) and (counter(24 downto 21)="0100") then VGA_RED <=Switches(7 downto 5); VGA_BLUE <=Switches(4 downto 3); VGA_GREEN <=Switches(2 downto 0); elsif ((135 <= line_counter and line_counter <=195) and (235 <= pixel_counter and pixel_counter <= 295)) and (counter(24 downto 21)="0101") then VGA_RED <=Switches(7 downto 5); VGA_BLUE <=Switches(4 downto 3); VGA_GREEN <=Switches(2 downto 0); elsif ((130 <= line_counter and line_counter <=200) and (230 <= pixel_counter and pixel_counter <= 300)) and (counter(24 downto 21)="0110") then VGA_RED <=Switches(7 downto 5); VGA_BLUE <=Switches(4 downto 3); VGA_GREEN <=Switches(2 downto 0); elsif ((125 <= line_counter and line_counter <=205) and (225 <= pixel_counter and pixel_counter <= 305)) and (counter(24 downto 21)="0111") then VGA_RED <=Switches(7 downto 5); VGA_BLUE <=Switches(4 downto 3); VGA_GREEN <=Switches(2 downto 0); elsif ((120 <= line_counter and line_counter <=210) and (220 <= pixel_counter and pixel_counter <= 310)) and (counter(24 downto 21)="1000") then VGA_RED <=Switches(7 downto 5); VGA_BLUE <=Switches(4 downto 3); VGA_GREEN <=Switches(2 downto 0); elsif ((115 <= line_counter and line_counter <=215) and (215 <= pixel_counter and pixel_counter <= 315)) and (counter(24 downto 21)="1001") then VGA_RED <=Switches(7 downto 5); VGA_BLUE <=Switches(4 downto 3); VGA_GREEN <=Switches(2 downto 0); elsif ((110 <= line_counter and line_counter <=220) and (210 <= pixel_counter and pixel_counter <= 320)) and (counter(24 downto 21)="1010") then VGA_RED <=Switches(7 downto 5); VGA_BLUE <=Switches(4 downto 3); VGA_GREEN <=Switches(2 downto 0); elsif ((105 <= line_counter and line_counter <=225) and (205 <= pixel_counter and pixel_counter <= 325)) and (counter(24 downto 21)="1011") then VGA_RED <=counter(4 downto 2); VGA_BLUE <=counter(25 downto 24); VGA_GREEN <=counter(10 downto 8);

elsif ((100 <= line_counter and line_counter <=230) and (200 <= pixel_counter and pixel_counter <= 330)) and (counter(24 downto 21)="1100") then VGA_RED <=counter(4 downto 2); VGA_BLUE <=counter(25 downto 24); VGA_GREEN <=counter(10 downto 8); elsif ((195 <= line_counter and line_counter <=235) and (195 <= pixel_counter and pixel_counter <= 335)) and (counter(24 downto 21)="1101") then VGA_RED <=counter(4 downto 2); VGA_BLUE <=counter(25 downto 24); VGA_GREEN <=counter(10 downto 8);

elsif ((190 <= line_counter and line_counter <=240) and (190 <= pixel_counter and pixel_counter <= 340)) and (counter(24 downto 21)="1110") then VGA_RED <=counter(4 downto 2); VGA_BLUE <=counter(25 downto 24); VGA_GREEN <=counter(10 downto 8);

elsif ((185 <= line_counter and line_counter <=245) and (185 <= pixel_counter and pixel_counter <= 345)) and (counter(24 downto 21)="1111") then VGA_RED <=counter(4 downto 2); VGA_BLUE <=counter(25 downto 24); VGA_GREEN <=counter(10 downto 8);

--				elsif ((180 <= line_counter and line_counter <=250) and (180 <= pixel_counter and pixel_counter <= 350)) and (counter(24 downto 21)="1101") then --				--				VGA_RED <=Switches(7 downto 5); --				VGA_BLUE <=Switches(4 downto 3); --				VGA_GREEN <=Switches(2 downto 0); --												--end if; --				when "0010"=> elsif(695 <= pixel_counter and pixel_counter <= 700) and (310 <= line_counter and line_counter <=315) and (counter (24 downto 21)="0010")then --				red <= '0'; --				green <= '1'; -- blue <= '1'; VGA_RED <="000"; VGA_BLUE <="11"; VGA_GREEN <="010"; --end if; --				when "0011"=> elsif(693 <= pixel_counter and pixel_counter <= 698) and (307 <= line_counter and line_counter <=312) and (counter (24 downto 21)="0011") then --				red <= '0'; --				green <= '1'; -- blue <= '1'; VGA_RED <="000"; VGA_BLUE <="11"; VGA_GREEN <="010"; --end if; --				when "0100"=> elsif(690 <= pixel_counter and pixel_counter <= 695) and (305 <= line_counter and line_counter <=310) and (counter (24 downto 21)="0100") then --				red <= '0'; --				green <= '0'; -- blue <= '1'; VGA_RED <="000"; VGA_BLUE <="11"; VGA_GREEN <="000"; --end if; --				when "0101"=> elsif(688 <= pixel_counter and pixel_counter <= 693) and (303 <= line_counter and line_counter <=308) and (counter (24 downto 21)="0101") then --				red <= '0'; --				green <= '0'; -- blue <= '1'; VGA_RED <="000"; VGA_BLUE <="11"; VGA_GREEN <="000"; --end if; --				when "0110"=> elsif(685 <= pixel_counter and pixel_counter <= 690) and (300 <= line_counter and line_counter <=305) and (counter (24 downto 21)="0110") then --				red <= '0'; --				green <= '0'; -- blue <= '1'; --end if; VGA_RED <="000"; VGA_BLUE <="11"; VGA_GREEN <="000"; --				when "0111"=> elsif(683 <= pixel_counter and pixel_counter <= 688) and (298 <= line_counter and line_counter <=303) and (counter (24 downto 21)="0111") then --				red <= '0'; --				green <= '1'; -- blue <= '0'; --end if; VGA_RED <="000"; VGA_BLUE <="00"; VGA_GREEN <="010"; --				when "1000"=> elsif(680 <= pixel_counter and pixel_counter <= 685) and (295 <= line_counter and line_counter <=300) and (counter (24 downto 21)="1000") then --				red <= '0'; --				green <= '1'; -- blue <= '0'; VGA_RED <="000"; VGA_BLUE <="00"; VGA_GREEN <="010"; elsif(678 <= pixel_counter and pixel_counter <= 683) and (293 <= line_counter and line_counter <=298) and (counter (24 downto 21)="1001") then --				red <= '0'; --				green <= '1'; -- blue <= '0'; VGA_RED <="000"; VGA_BLUE <="00"; VGA_GREEN <="010"; elsif(675 <= pixel_counter and pixel_counter <= 680) and (290 <= line_counter and line_counter <=295) and (counter (24 downto 21)="1010") then --				red <= '0'; --				green <= '1'; -- blue <= '0'; VGA_RED <="000"; VGA_BLUE <="00"; VGA_GREEN <="010"; -- -				--end if; --				when Others=> --				--if(675 <= pixel_counter and pixel_counter <= 680) and (290 <= line_counter and line_counter <=295) then --				red <= '0'; --				green <= '0'; --				blue <= '0'; --				--end if; --				end case; else

VGA_RED <="000"; VGA_BLUE <="00"; VGA_GREEN <="000"; --				red <= '0'; --				green <= '0'; --				blue <= '0'; end if; end if; end process; --	process(clock) --	begin --		c <= clock; --	end process;

end Behavioral;

https://github.com/jtoller7619/vgaSmileyWithNoseThatGrowsandEatsIt

https://www.youtube.com/watch?v=CATyR-gz6Ik

=Operate= use switches to control nose color the red serial bus is controlled by switches (7 downto 5) the blue serial bus is controlled by switches (4 downto 3) and the green serial bus is controlled by switches (2 downto 0). The papillio must be hooked up to the screen with a VGA cable and in order for the screen to display the program it must be switched to Anolog input. With the Dell screens this is done by pushing the button that has a picture of a rounded rectangle with an arrow going into it. when you download the code open and run the bit file.  File:Bottom right of dell screen.jpg|thumb|pushing the leftmost button in this picture allows a change in the screen input between digital input auto detect and analog input

File:Fpga connected to screen with VGA cable.jpg|thumb|xilinx spartan 3E papillio 250 connected to screen with VGA cable 