4247
- 收藏
- 点赞
- 分享
- 举报
VHDL代码VGA
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;
entity vga is
port( clk,md:in std_logic;
hs,vs,r,g,b:out std_logic);
end vga;
architecture behav of vga is
signal hs1,vs1,fclk,cclk:std_logic;
signal mmd:std_logic_vector(1 downto 0);
signal fs:std_logic_vector (3 downto 0);
signal cc:std_logic_vector (4 downto 0);
signal ll:std_logic_vector (8 downto 0);
signal grbx:std_logic_vector (3 downto 1);
signal grby:std_logic_vector (3 downto 1);
signal grbp:std_logic_vector (3 downto 1);
signal grb2,grb3,grb1 :std_logic;
begin
grb2<=(grbP(2)xor md ) and hs1 and vs1;
grb3<=(grbp(3)xor md ) and hs1 and vs1;
grb1<=(grbp(1) xor md) and hs1 and vs1;
process(md)
begin
if md'event and md='0' then
if mmd="10"then mmd<="00";
else mmd<=mmd+1; end if;
end if;
end process;
process(mmd)
begin
if mmd="00"then grbp<=grbx;
elsif mmd="01" then grbp<=grby;
elsif mmd="10" then grbp<=grbx xor grby;
else grbp<="000"; end if;
end process;
process(clk)
begin
if clk'event and clk='1' then
if cc=32 then cc<="00000";
else cc<=cc+1; end if;
end if;
end process;
cclk<=cc(4);
process(cclk)
begin
if cclk'event and cclk='0' then
if ll=490 then ll<="000000000";
else ll<=ll+1; end if;
end if;
end process;
process(cc,ll)
begin
if cc>23 then hs1<='0';
else hs1<='1'; end if;
if ll>479 then vs1<='0';
else vs1<='1'; end if;
end process;
process(cc,ll)
begin
if cc<3 then grbx<="111";
elsif cc<6 then grbx<="110";
elsif cc<9 then grbx<="101";
elsif cc<12 then grbx<="110";
elsif cc<15 then grbx<="110";
elsif cc<18 then grbx<="110";
elsif cc<21 then grbx<="110";
else grbx<="000"; end if;
if ll<60 then grby<="111";
elsif ll<120 then grby<="110";
elsif ll<180 then grby<="101";
elsif ll<240 then grby<="100";
elsif ll<300 then grby<="011";
elsif ll<360 then grby<="010";
elsif ll<420 then grby<="001";
else grby<="000"; end if;
end process;
hs<=hs1; vs<=vs1; r<=grb2;g<=grb3;b<=grb1;
end behav;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;
entity vga is
port( clk,md:in std_logic;
hs,vs,r,g,b:out std_logic);
end vga;
architecture behav of vga is
signal hs1,vs1,fclk,cclk:std_logic;
signal mmd:std_logic_vector(1 downto 0);
signal fs:std_logic_vector (3 downto 0);
signal cc:std_logic_vector (4 downto 0);
signal ll:std_logic_vector (8 downto 0);
signal grbx:std_logic_vector (3 downto 1);
signal grby:std_logic_vector (3 downto 1);
signal grbp:std_logic_vector (3 downto 1);
signal grb2,grb3,grb1 :std_logic;
begin
grb2<=(grbP(2)xor md ) and hs1 and vs1;
grb3<=(grbp(3)xor md ) and hs1 and vs1;
grb1<=(grbp(1) xor md) and hs1 and vs1;
process(md)
begin
if md'event and md='0' then
if mmd="10"then mmd<="00";
else mmd<=mmd+1; end if;
end if;
end process;
process(mmd)
begin
if mmd="00"then grbp<=grbx;
elsif mmd="01" then grbp<=grby;
elsif mmd="10" then grbp<=grbx xor grby;
else grbp<="000"; end if;
end process;
process(clk)
begin
if clk'event and clk='1' then
if cc=32 then cc<="00000";
else cc<=cc+1; end if;
end if;
end process;
cclk<=cc(4);
process(cclk)
begin
if cclk'event and cclk='0' then
if ll=490 then ll<="000000000";
else ll<=ll+1; end if;
end if;
end process;
process(cc,ll)
begin
if cc>23 then hs1<='0';
else hs1<='1'; end if;
if ll>479 then vs1<='0';
else vs1<='1'; end if;
end process;
process(cc,ll)
begin
if cc<3 then grbx<="111";
elsif cc<6 then grbx<="110";
elsif cc<9 then grbx<="101";
elsif cc<12 then grbx<="110";
elsif cc<15 then grbx<="110";
elsif cc<18 then grbx<="110";
elsif cc<21 then grbx<="110";
else grbx<="000"; end if;
if ll<60 then grby<="111";
elsif ll<120 then grby<="110";
elsif ll<180 then grby<="101";
elsif ll<240 then grby<="100";
elsif ll<300 then grby<="011";
elsif ll<360 then grby<="010";
elsif ll<420 then grby<="001";
else grby<="000"; end if;
end process;
hs<=hs1; vs<=vs1; r<=grb2;g<=grb3;b<=grb1;
end behav;
我来回答
回答4个
时间排序
认可量排序
认可0
认可0
认可0
认可0
或将文件直接拖到这里
悬赏:
E币
网盘
* 网盘链接:
* 提取码:
悬赏:
E币
Markdown 语法
- 加粗**内容**
- 斜体*内容*
- 删除线~~内容~~
- 引用> 引用内容
- 代码`代码`
- 代码块```编程语言↵代码```
- 链接[链接标题](url)
- 无序列表- 内容
- 有序列表1. 内容
- 缩进内容
- 图片![alt](url)
相关问答
-
2008-07-31 01:02:40
-
2012-12-24 15:01:04
-
2012-12-24 15:01:43
-
02012-12-24 15:02:48
-
2020-10-31 10:01:10
-
2012-12-24 14:56:39
-
2008-10-02 20:47:54
-
2018-12-27 14:44:31
-
2008-10-02 20:26:30
-
2008-10-02 20:27:32
-
12017-06-15 10:57:07
-
2008-10-02 20:51:40
-
2008-10-02 20:17:06
-
2008-10-02 20:52:33
-
2008-10-02 20:17:49
-
2008-10-02 20:25:24
-
2008-10-02 20:20:48
-
2013-11-22 22:05:39
-
32016-06-08 09:25:08
无更多相似问答 去提问
点击登录
-- 积分
-- E币
提问
—
收益
—
被采纳
—
我要提问
切换马甲
上一页
下一页
悬赏问答
-
50如何获取vpss chn的图像修改后发送至vo
-
5FPGA通过Bt1120传YUV422数据过来,vi接收不到数据——3516dv500
-
50SS928 运行PQtools 拼接 推到设备里有一半画面会异常
-
53536AV100的sample_vdec输出到CVBS显示
-
10海思板子mpp怎么在vi阶段改变视频数据尺寸
-
10HI3559AV100 多摄像头同步模式
-
9海思ss928单路摄像头vio中加入opencv处理并显示
-
10EB-RV1126-BC-191板子运行自己编码的程序
-
10求HI3519DV500_SDK_V2.0.1.1
-
5有偿求HI3516DV500 + OV5647驱动
举报反馈
举报类型
- 内容涉黄/赌/毒
- 内容侵权/抄袭
- 政治相关
- 涉嫌广告
- 侮辱谩骂
- 其他
详细说明
提醒
你的问题还没有最佳答案,是否结题,结题后将扣除20%的悬赏金
取消
确认
提醒
你的问题还没有最佳答案,是否结题,结题后将根据回答情况扣除相应悬赏金(1回答=1E币)
取消
确认