Unverified Commit 65bf2e89 authored by ktsiam's avatar ktsiam Committed by GitHub
Browse files

Done!

parent 30fb8358
--vga_driver module
--Creates the outputs necessary to drive the display
library IEEE;
use IEEE.std_logic_1164.all;
use IEEE.std_logic_unsigned.all;
......@@ -9,26 +6,27 @@ use IEEE.numeric_std.all;
entity VGA is
port(
tick : in std_logic;
valid : out std_logic;
row : out unsigned (9 downto 0);
col : out unsigned (9 downto 0);
valid : out std_logic := '1';
row : out unsigned (9 downto 0) := 10d"0";
col : out unsigned (9 downto 0) := 10d"0";
HSYNC : out std_logic;
VSYNC : out std_logic
);
end;
architecture synth of VGA is
begin
process (tick) is
begin
if rising_edge(tick) then
HSYNC <= '0' when col >= to_unsigned(656,10) and col < to_unsigned(752,10) else '1';
VSYNC <= '0' when row >= to_unsigned(490,10) and tow < to_unsigned(492,10) else '1';
valid <= '1' when col < to_unsigned(640,10) and row < to_unsigned(480,10) else '1';
col <= (col + 1) mod to_unsigned(800,10);
row <= (row + 1) when col = to_unsigned(799,10) else row;
horz_pos_counter : process(tick)
begin
if(rising_edge(tick)) then
col <= 10d"0" when col = 799 else (col + 1);
row <= 10d"0" when col = 799 and row = 524 else
(row + 1) when col = 799;
HSYNC <= '0' when col > 655 and col < 752 else '1';
VSYNC <= '0' when row > 489 and row < 492 else '1';
valid <= '1' when row < 480 and col < 640 else '0';
end if;
end process;
end process;
end;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment