⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 16count2.v

📁 用VERILOG实现的秒表 用VERILOG实现的秒表
💻 V
字号:
module jscount(clk,reset,out1,out2,out3,out4);
  input clk,reset;
  output [3:0] out1,out2,out3,out4;
  wire [3:0] out1,out2,out3,out4;
  reg [15:0] count;
  integer i;

  always@(posedge clk or posedge reset)
     begin
       if (reset==1'b1)
         count[15:0]<=16'h0000;
       else if (count[3:0]<9)
            count<=count+1;
       else if (count[3:0]==4'b1001)
          for(i=0;i<7;i=i+1)
              count<=count+1;
       else if (count[7:0]==8'b10011001)
          for(i=0;i<49;i=i+1)
              count<=count+1;
       else if (count[11:0]==12'b100110011001)
          for(i=0;i<343;i=i+1)
              count<=count+1;     
      end
  assign out1=count[3:0];
  assign out2=count[7:4];
  assign out3=count[11:8];
  assign out4=count[15:12];
 endmodule

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -