利用VHDL实现VGA的时序。
代码如下:
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;
entity vga_ctr is
port(
clk : in std_logic; --系统时钟输入
hsync : out std_logic;--输出行同步、列同步以及R.G.B信号.其中R.G.G信号位数根据自己开发板的情况修改
vsync : out std_logic;
rvb_in: in Bit_Vector(11 downto 0);
rvb_out: out Bit_Vector(11 downto 0);
pixel_counterx:out std_logic_vector(9 downto 0);
pixel_countery:out std_logic_vector(9 downto 0)
);
end vga_ctr;
architecture behave of vga_ctr is
-- horizontal timing signals
constant h_data: integer:=640; --VGA时序中几个关键数据,具体数据根据自身显示屏情况修改
constant h_front: integer:=16;
constant h_back: integer:=48;
constant h_sync: integer:=96;
constant h_period: integer:= h_sync + h_data + h_front + h_back; --800
-- vertical tim