欧美极品高清xxxxhd,国产日产欧美最新,无码AV国产东京热AV无码,国产精品人与动性XXX,国产传媒亚洲综合一区二区,四库影院永久国产精品,毛片免费免费高清视频,福利所导航夜趣136

 找回密碼
 立即注冊

QQ登錄

只需一步,快速開始

搜索
查看: 4691|回復: 3
收起左側

基于FPGA的數字跑表代碼

[復制鏈接]
ID:460004 發表于 2019-1-2 14:08 | 顯示全部樓層 |閱讀模式
基于Verilog HDL 語言FPGA的數字跑表代碼分享給大家
0.png

源程序:
  1. `timescale 1ns / 1ps
  2. //////////////////////////////////////////////////////////////////////////////////
  3. // Company:
  4. // Engineer:
  5. //
  6. // Create Date:    20:33:30 09/26/2018
  7. // Design Name:
  8. // Module Name:    count
  9. // Project Name:
  10. // Target Devices:
  11. // Tool versions:
  12. // Description:
  13. //
  14. // Dependencies:
  15. //
  16. // Revision:
  17. // Revision 0.01 - File Created
  18. // Additional Comments:
  19. //
  20. //////////////////////////////////////////////////////////////////////////////////
  21. module count(
  22.     input clk_100Hz,
  23.     input rst,
  24.     input E,
  25.     output wire [3:0] s1,
  26.     output wire [3:0] s2,
  27.     output wire [3:0] s3,
  28.     output wire [3:0] s4,
  29.     output wire [3:0] s5,
  30.     output wire [3:0] s6
  31.     );
  32.     reg [3:0]i;
  33.     reg [3:0] count[1:6];
  34.     initial
  35.         begin
  36.             for(i=1;i<5;i=i+1)
  37.                 begin
  38.                     count[i]=4'b0000;
  39.                 end
  40.              i=0;
  41.         end
  42.      always @ (posedge clk_100Hz)
  43.         begin
  44.             if(rst)
  45.                 begin            
  46.                      for(i=1;i<7;i=i+1)
  47.                         count[i]=4'b0000;
  48.                 end
  49.             else if(!E)
  50.                 begin            
  51.                      for(i=1;i<7;i=i+1)
  52.                         count[i]=count[i];
  53.                 end
  54.             else
  55.                 begin
  56.                     if(count[1]<10)  
  57.                         count[1]=count[1]+1;
  58.                     if(count[1]==10)         
  59.                       begin            
  60.                           count[1]=0;     
  61.                           count[2]=count[2]+1;
  62.                       end               
  63.                      if(count[2]==10)         
  64.                         begin            
  65.                             count[2]=0;     
  66.                             count[3]=count[3]+1;
  67.                         end
  68.                     if(count[3]==10)         
  69.                         begin            
  70.                             count[3]=0;     
  71.                             count[4]=count[4]+1;
  72.                         end
  73.                     if(count[4]==6)         
  74.                         begin            
  75.                             count[4]=0;     
  76.                             count[5]=count[5]+1;
  77.                         end
  78.                     if(count[5]==10)         
  79.                         begin            
  80.                             count[5]=0;     
  81.                             count[6]=count[6]+1;
  82.                         end
  83.                     if(count[6]==6)
  84.                         begin            
  85.                              for(i=1;i<7;i=i+1)
  86.                                 count[i]=4'b0000;
  87.                         end
  88.                     end
  89.         end
  90.         assign s1 = count[1];
  91.         assign s2 = count[2];
  92.         assign s3 = count[3];
  93.         assign s4 = count[4];
  94.         assign s5 = count[5];
  95.         assign s6 = count[6];
  96. endmodule
復制代碼

全部資料51hei下載地址:
u7utu7.zip (1.39 MB, 下載次數: 46)

評分

參與人數 1黑幣 +50 收起 理由
admin + 50 共享資料的黑幣獎勵!

查看全部評分

回復

使用道具 舉報

ID:163730 發表于 2019-6-14 16:14 | 顯示全部樓層
tks,just need it!
回復

使用道具 舉報

ID:666179 發表于 2020-6-15 09:31 來自觸屏版 | 顯示全部樓層
sawyou 發表于 2019-6-14 16:14
tks,just need it!

??我要看下這個
回復

使用道具 舉報

ID:684776 發表于 2020-6-17 21:35 | 顯示全部樓層
剛好需要,謝謝!
回復

使用道具 舉報

5#
無效樓層,該帖已經被刪除
您需要登錄后才可以回帖 登錄 | 立即注冊

本版積分規則

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

Powered by 單片機教程網

快速回復 返回頂部 返回列表