久久久久久久999_99精品久久精品一区二区爱城_成人欧美一区二区三区在线播放_国产精品日本一区二区不卡视频_国产午夜视频_欧美精品在线观看免费

 找回密碼
 立即注冊(cè)

QQ登錄

只需一步,快速開(kāi)始

搜索
查看: 3765|回復(fù): 0
打印 上一主題 下一主題
收起左側(cè)

帶液晶、數(shù)碼管計(jì)時(shí)和流水燈VHDL程序

[復(fù)制鏈接]
跳轉(zhuǎn)到指定樓層
樓主
ID:51269 發(fā)表于 2014-11-10 15:16 | 只看該作者 回帖獎(jiǎng)勵(lì) |倒序?yàn)g覽 |閱讀模式
Library ieee;
Use ieee.std_logic_1164.all;
Use ieee.std_logic_unsigned.all;
Entity water is
Port(clk:in std_logic;
     RW,EN:out std_logic;
   LCD_Data:out std_logic_vector(8 downto 0);
     LEDR:out std_logic_vector(17 downto 0);
   second:out std_logic;
   Qb0,Qb1:out std_logic_vector(3 downto 0);   
     Qd0,Qd1:out std_logic_vector(6 downto 0));
end;
Architecture dd of water is
signal Qsfp,Qwfp:std_logic_vector(24 downto 0);
signal cps,cpw,LCD_clk:std_logic;
signal qq0,qq1:std_logic_vector(3 downto 0);
signal N:integer range 0 to 73;
signal s:integer range 0 to 1000000;
procedure sum( x:in std_logic_vector(3 downto 0);
               y:out std_logic_vector(6 downto 0))is
begin
     case x is   
     when"0000"=>y:="0111111";
     when"0001"=>y:="0000110";
     when"0010"=>y:="1011011";
     when"0011"=>y:="1001111";
     when"0100"=>y:="1100110";
     when"0101"=>y:="1101101";
     when"0110"=>y:="1111101";
     when"0111"=>y:="0000111";
     when"1000"=>y:="1111111";
     when"1001"=>y:="1101111";
     when others=>y:=Null;
    end case;
end sum;
begin
-------cps means 1s---cpw means flash LED------
Process(clk)
    begin
     if clk'event and clk='1' then
      Qsfp<=Qsfp+1;     --1s court
      Qwfp<=Qwfp+1;     --0.1s court
  s<=s+1;
    ------------------------
      if Qsfp=24999999 then
       Qsfp<="0000000000000000000000000";
       cps<=not cps;  --1Hz  
      end if;
      
    -------------------------
     if Qwfp=1499999 then
       Qwfp<="0000000000000000000000000";
       cpw<=not cpw;   --10Hz
      end if;
    --------------------------
        if s=0 then
      LCD_clk<= not LCD_clk;
      end if;
       end if;
end process;
-------------- 60s court--------------
Process(cps)
    begin
     if cps'event and cps='1' then
         qq0<=qq0+1;
     ------ge-------
     if qq0=9 then
        qq0<="0000";
      qq1<=qq1+1;
     end if;
     ------shi-------
     if qq1=5 and qq0=9 then
         qq1<="0000";
     end if;
   end if;
end process;
----------display   60s court-------
process(qq0,qq1,cps)
    variable y0,y1:std_logic_vector(6 downto 0);
    begin
    second<=cps;
    Qb0<=qq0;
  Qb1<=qq1;
  sum(qq0,y0);
  sum(qq1,y1);
  Qd0<=not y0;
  Qd1<=not y1;
   end process;
---------display flash LED-----------
Process(cpw)

   begin
   if cpw'event and cpw='1' then
      N<=N+1;
      if N=90 then
       N<=0;
      end if;
      if N<18 then  
     LEDR(N)<='1';
  end if;
  if N>17 and N<36 then
      LEDR(35-N)<='0';
  end if;
  if N>35 and N<54 then
     LEDR(N-36)<='0';
   LEDR(N-35)<='1';
  end if;
  if N>53  and N< 73 then
     LEDR(72-N)<='0';
   LEDR(71-N)<='1';
  end if;
  if N>72  and N< 81 then  
    LEDR(N-72)<='1';
    LEDR(90-N)<='1';
  end if;
  If N>80 and N<90 then
     LEDR(N-71)<='0';
   LEDR(90-N)<='0';
  end if;
  ----------------------  
   end if;  
end process;
------------Display LCD------------------
     EN<=LCD_clk;
  RW<='0';
process(LCD_clk)
   variable cnt:std_logic_vector(5 downto 0);
   begin
    if LCD_clk'event and LCD_clk='1' then
      cnt:=cnt+1;
    case cnt is
           --------------寫(xiě)指令--------------   
      when "000000"=>LCD_Data<="000111000";--/*設(shè)置8位格式,2行,5*7*/  ,順序2,3的要求   
      when "000001"=>LCD_Data<="000001100";   --/*整體顯示,關(guān)光標(biāo),光標(biāo)閃爍/  ,順序4的要求   
      when "000010"=>LCD_Data<="000000001";--清屏,順序5的要求   
      when "000011"=>LCD_Data<="000000110";  --/*顯示移動(dòng)格式,看最后兩位,10表示光標(biāo)右移,順序6的要求   
      when "000100"=>LCD_Data<="010000000";--設(shè)定顯示的位置在00H+80H,即顯示屏第一行第一個(gè)位置,順序7的要求
      --------------寫(xiě)數(shù)據(jù)---------------
      when "000101"=>LCD_Data<="110100000";--空格   
      when "000110"=>LCD_Data<="110100000";--空格   
      when "000111"=>LCD_Data<="110100000";--空格
      when "001000"=>LCD_Data<="101011001"; --Y   
      when "001001"=>LCD_Data<="101110101";--u   
      when "001010"=>LCD_Data<="101101010";--j   
      when "001011"=>LCD_Data<="101101001";--i   
      when "001100"=>LCD_Data<="101100001";--a   
      when "001101"=>LCD_Data<="101101110";--n   
      when "001110"=>LCD_Data<="101110001";--q      
      when "001111"=>LCD_Data<="101110101";--u   
      when "010000"=>LCD_Data<="101100001";--a   
      when "010001"=>LCD_Data<="101101110";--n   
      when "010010"=>LCD_Data<="110100000";---空格   
      when "010011"=>LCD_Data<="110100000";---空格   
      when "010100"=>LCD_Data<="110100000";---空格
      
      when "010101"=>LCD_Data<="011000000";--設(shè)定顯示的位置在10H+80H,
     
      when "010110"=>LCD_Data<="101000100";---D diangong xueyuan   
      when "010111"=>LCD_Data<="101101001";---i   
      when "011000"=>LCD_Data<="101100001";---a
      when "011001"=>LCD_Data<="101101110";---n   
      when "011010"=>LCD_Data<="101100111";---g   
      when "011011"=>LCD_Data<="101101111";---o
      when "011100"=>LCD_Data<="101101110";--n   
      when "011101"=>LCD_Data<="101100111";---g   
      when "011110"=>LCD_Data<="110100000";--- 空格   
      when "011111"=>LCD_Data<="101011000";---X
      when "100000"=>LCD_Data<="101110101";---u   
      when "100001"=>LCD_Data<="101100101";---e   
      when "100010"=>LCD_Data<="101111001";---y
      when "100011"=>LCD_Data<="101110101";---u   
      when "100100"=>LCD_Data<="101100001";---a   
      when "100101"=>LCD_Data<="101101110";---n      
      when others =>LCD_Data<="110100000";
     --when "01100"=>LCD_Data<="011000000";--設(shè)定顯示的位置在10H+80H,即顯示屏第2行第一個(gè)位置  
     end case;
    end if;
end process;   
end;
分享到:  QQ好友和群QQ好友和群 QQ空間QQ空間 騰訊微博騰訊微博 騰訊朋友騰訊朋友
收藏收藏 分享淘帖 頂 踩
回復(fù)

使用道具 舉報(bào)

本版積分規(guī)則

手機(jī)版|小黑屋|51黑電子論壇 |51黑電子論壇6群 QQ 管理員QQ:125739409;技術(shù)交流QQ群281945664

Powered by 單片機(jī)教程網(wǎng)

快速回復(fù) 返回頂部 返回列表
主站蜘蛛池模板: 亚洲性视频 | 黄色一级毛片免费看 | 久久久网 | 精品一区二区久久久久久久网站 | 日韩精品视频在线 | 亚洲视频在线观看 | www日本在线播放 | 免费看一区二区三区 | 成人午夜精品 | 国产精品99久 | 在线观看中文字幕 | 国内精品一区二区 | 一级毛片免费视频 | 日本高清精品 | 国产精品99久久久久久宅男 | 国产精品久久久久aaaa樱花 | 日本精品一区二区三区四区 | 免费在线黄 | www.99热这里只有精品 | 久久精品亚洲成在人线av网址 | 天天操天天插天天干 | 在线观看亚洲精品视频 | 一区二区三区免费 | 亚洲444kkkk在线观看最新 | 亚洲一区二区三区免费在线观看 | 天天射天天操天天干 | 久久久久久精 | 中文字幕乱码亚洲精品一区 | 国产成人短视频在线观看 | 国产最好的av国产大片 | 毛片国产| 亚洲有码转帖 | 久久精品无码一区二区三区 | 亚洲一区国产精品 | 亚洲一区二区在线播放 | 羞羞视频在线网站观看 | 国产精品视频一二三区 | 在线观看免费黄色片 | 国产精品免费一区二区三区四区 | 一区二区三区视频在线观看 | 粉嫩av在线 |