在线咨询
eetop公众号 创芯大讲堂 创芯人才网
切换到宽版

EETOP 创芯网论坛 (原名:电子顶级开发网)

手机号码,快捷登录

手机号码,快捷登录

找回密码

  登录   注册  

快捷导航
搜帖子
12
返回列表 发新帖
楼主: shxr

[求助] 求教:如何在检测信号上升沿时,输出一个窄脉冲,

[复制链接]
发表于 2010-11-7 18:00:36 | 显示全部楼层




    用这种办法得到一个时钟周期的窄脉冲,eg. sigplus如果电路下面要用到这个窄脉冲来触发,一个信号out:
              always@(posedge clk or negedge rst_n)
                 if(!rst_n)
                         out <=0;
                 else  
                       if(sigplus)
                           out <=in;
                      else  out <0;

这种用法,会不会出现:虽然产生的sigplus是一个时钟周期的,但是由于信号传递过程中的延时,失真等影响而在上述的always中的clk边沿的时候采集不到signal了,而不能执行 if(sigplus)
                           out <=in; 语句了呢?
发表于 2016-5-6 09:52:04 | 显示全部楼层
回复 8# sprone
haha
发表于 2016-5-6 10:09:18 | 显示全部楼层
回复 8# sprone
为什么要输验证码
发表于 2016-5-8 14:35:19 | 显示全部楼层
本帖最后由 jemmyplus 于 2016-5-8 14:38 编辑

`timescale 1ns/1ps
module pos_det(clk , rst_n,in,out);input clk,rst,in);
input clk;    // system clock
input rst_n; // system reset active low
input in;      // input signal
output out;  // pulse output

reg   in_1d,in_2d;
always@(posedge clk or negedge rst_n)
begin
if(rst_n == 1'b0)
    begin
       in_1d <= #1 1'b0;
       in_2d <= #1 1'b0;
    end
else
    begin
       in_2d <= #1 in_1d;
       in_1d <= #1 in;
    end
end

assign out = in_1d && (~in_2d);
endmodule
您需要登录后才可以回帖 登录 | 注册

本版积分规则

关闭

站长推荐 上一条 /1 下一条

X

小黑屋| 手机版| 关于我们| 联系我们| 隐私声明| EETOP 创芯网
( 京ICP备:10050787号 京公网安备:11010502037710 )

GMT+8, 2025-6-30 03:54 , Processed in 0.015793 second(s), 7 queries , Gzip On, MemCached On.

eetop公众号 创芯大讲堂 创芯人才网
快速回复 返回顶部 返回列表