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

 找回密碼
 立即注冊

QQ登錄

只需一步,快速開始

搜索
查看: 2922|回復: 0
打印 上一主題 下一主題
收起左側

CycloneIV S-50MH顯示60s計時和流水燈

[復制鏈接]
跳轉到指定樓層
樓主
ID:51269 發表于 2014-11-10 15:18 | 只看該作者 回帖獎勵 |倒序瀏覽 |閱讀模式
Library ieee;
Use ieee.std_logic_1164.all;
Use ieee.std_logic_unsigned.all;
Entity water is
Port(clk:in std_logic;
     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:std_logic;
signal qq0,qq1:std_logic_vector(3 downto 0);
signal N:integer range 0 to 73;
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
    ------------------------
          if Qsfp=24999999 then
             Qsfp<="0000000000000000000000000";
           cps<=not cps;  --1Hz  
        end if;            
    -------------------------
    if Qwfp=2499999 then
             Qwfp<="0000000000000000000000000";
           cpw<=not cpw;   --10Hz
        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=89 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  then
     LEDR(N-71)<='0';
   LEDR(90-N)<='0';
  end if;
   end if;
分享到:  QQ好友和群QQ好友和群 QQ空間QQ空間 騰訊微博騰訊微博 騰訊朋友騰訊朋友
收藏收藏 分享淘帖 頂 踩
回復

使用道具 舉報

您需要登錄后才可以回帖 登錄 | 立即注冊

本版積分規則

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

Powered by 單片機教程網

快速回復 返回頂部 返回列表
主站蜘蛛池模板: 成人精品一区二区户外勾搭野战 | 性一交一乱一透一a级 | 欧美区日韩区 | 精品一二区 | 亚洲精品天堂 | h在线| 日本不卡一区 | 久久国产婷婷国产香蕉 | 国产精品久久久久久久久图文区 | 中文字幕一区二区在线观看 | 久久中文视频 | 91精品国产综合久久久久久丝袜 | 欧美一级免费看 | 久久躁日日躁aaaaxxxx | 久久九九99 | 欧美一区二区三区在线 | 国产a视频 | 亚洲网站在线观看 | 中文字幕免费中文 | 天堂视频免费 | 国产日韩亚洲欧美 | 国产日韩欧美一区二区 | 亚洲最色网站 | 91久久爽久久爽爽久久片 | 成人黄色av网址 | 欧美一区二区三区日韩 | 亚洲高清在线免费观看 | 亚洲综合一区二区三区 | 一区二区三区国产精品 | 亚洲国产黄 | 中文久久| 免费久久99精品国产婷婷六月 | 亚洲精品麻豆 | 中文字幕国 | 日日骚视频 | 日韩免费视频 | 久草院线| 精品欧美一区二区三区久久久 | 国产一区中文字幕 | 国产一级精品毛片 | 国产精品99视频 |