Board logo

标题: 数字电路设计之同步时钟采样模块 [打印本页]

作者: look_w    时间: 2017-11-7 16:37     标题: 数字电路设计之同步时钟采样模块

同步时钟采样模块:为的是使得外部输入的异步信号需要经过系统时钟的同步化,且将输入的异步信号整形成一个时钟长的脉冲信号。
module clk_syn( clk,rst,s_in,s_out );
  input wire  clk;
  input wire  rst;
  input wire  s_in;
  output wire s_out;   
  reg s_t1,s_t2;
  always@(posedge clk)begin
       if(!rst) begin
           s_t1 <= 0;
           s_t2 <= 0;
      end
      else begin
           s_t1 <= s_in;
           s_t2 <= s_t1;
       end
end
     assign s_out = s_t1 & (~s_t2);
endmodule




欢迎光临 电子技术论坛_中国专业的电子工程师学习交流社区-中电网技术论坛 (http://bbs.eccn.com/) Powered by Discuz! 7.0.0