注册 登录
电子工程世界-论坛 返回首页 EEWORLD首页 频道 EE大学堂 下载中心 Datasheet 专题
清风揽月shine的个人空间 https://home.eeworld.com.cn/space-uid-658182.html [收藏] [复制] [分享] [RSS]
日志

Verilog四比特计数器代码

已有 641 次阅读2016-1-3 12:40 | 计数器, 比特

`timescale      1ns/100ps 
module counter 
(     input               clk     ,  
   input               rst_n   ,   
  output  reg [3:0]   counter    
 );   
always @(negedge rst_n or posedge clk) begin 
    if (!rst_n) begin       
  counter <= 4'b0;   
  end    
 else begin      
   counter <= counter+4'b1; 
    end end endmodule
评论 (0 个评论)

facelist doodle 涂鸦板

您需要登录后才可以评论 登录 | 注册

热门文章