zxj123

zxj123

0个粉丝

92

问答

0

专栏

0

资料

zxj123  发布于  2012-12-24 15:00:31
采纳率 0%
92个问答
4114

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;






我来回答
回答4个
时间排序
认可量排序

mcizhy

0个粉丝

0

问答

0

专栏

0

资料

mcizhy 2013-06-25 15:17:33
认可0
好东西啊。学习了。

david

33个粉丝

368

问答

253

专栏

229

资料

david 2013-06-25 16:12:15
认可0
[quote][url=forum.php?mod=redirect&goto=findpost&pid=3257&ptid=1542]mcizhy 发表于 2013-6-25 15:17[/url]
好东西啊。学习了。[/quote]

有没有见过坏东西啊:)

cocow0222

0个粉丝

1

问答

0

专栏

0

资料

cocow0222 2013-07-23 14:51:36
认可0
没有看明白这个代码的意思。初步感觉这个代码意义不大。
产生VGA时序的代码应该这样写。
首先要了解VESA的协议。所有的时序都是按照这个协议产生的。
其次,要使用大量的计数器,来实现HYSNC,VSYNC, DE信号。这三个信号是关键。
其他的R,G,B信号,来源于FIFO。DDR等。

david

33个粉丝

368

问答

253

专栏

229

资料

david 2013-07-23 15:03:40
认可0
[quote][url=forum.php?mod=redirect&goto=findpost&pid=3415&ptid=1542]cocow0222 发表于 2013-7-23 14:51[/url]
没有看明白这个代码的意思。初步感觉这个代码意义不大。
产生VGA时序的代码应该这样写。
首先要了解VESA ...[/quote]

同步信号 和RGB信号。
或将文件直接拖到这里
悬赏:
E币
网盘
* 网盘链接:
* 提取码:
悬赏:
E币

Markdown 语法

  • 加粗**内容**
  • 斜体*内容*
  • 删除线~~内容~~
  • 引用> 引用内容
  • 代码`代码`
  • 代码块```编程语言↵代码```
  • 链接[链接标题](url)
  • 无序列表- 内容
  • 有序列表1. 内容
  • 缩进内容
  • 图片![alt](url)
+ 添加网盘链接/附件

Markdown 语法

  • 加粗**内容**
  • 斜体*内容*
  • 删除线~~内容~~
  • 引用> 引用内容
  • 代码`代码`
  • 代码块```编程语言↵代码```
  • 链接[链接标题](url)
  • 无序列表- 内容
  • 有序列表1. 内容
  • 缩进内容
  • 图片![alt](url)
相关问答
无更多相似问答 去提问
举报反馈

举报类型

  • 内容涉黄/赌/毒
  • 内容侵权/抄袭
  • 政治相关
  • 涉嫌广告
  • 侮辱谩骂
  • 其他

详细说明

易百纳技术社区