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

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

手机号码,快捷登录

手机号码,快捷登录

找回密码

  登录   注册  

快捷导航
搜帖子
查看: 1756|回复: 3

ask for help!!

[复制链接]
发表于 2004-8-16 19:47:27 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?注册

x
下面的这个2.5分频程序是verilog100例中的,看完后有几点不解:
1.为什么引入mid?
2. #delaytime out=~out;有何用?
`timescale 1ns/100ps
module frequency5x2(in,out,rst);
input in,rst;
output out;   
reg out;
reg mid;
integer counter;
parameter delaytime=25;
always@(posedge rst )

          begin
          counter=0;
          out=0;
          mid=0;
          end
always@(posedge in)
          begin
             if(counter==4)
                begin
                mid=~mid;
                counter=0;
                end
              else
               counter=counter+1;
           end
           
  always@(negedge in)
          begin
             if(counter==4)
                begin
                mid=~mid;
                counter=0;
                end
              else
               counter=counter+1;
           end
      
always@(posedge mid )
        begin
          out=~out;
          #delaytime out=~out;
        end
always@(negedge mid)
         begin
          out=~out;
          #delaytime out=~out;
         end                                                
endmodule
发表于 2004-8-16 20:31:23 | 显示全部楼层

ask for help!!

该程序完全错误,楼主千万别学
发表于 2004-8-16 20:41:26 | 显示全部楼层

ask for help!!

这段程序是不是完全用来仿真的激励文件吧?否则真的是无法理解.
发表于 2004-10-22 12:49:17 | 显示全部楼层

ask for help!!

behavior model
您需要登录后才可以回帖 登录 | 注册

本版积分规则

关闭

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

×

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

GMT+8, 2024-5-1 05:51 , Processed in 0.037931 second(s), 10 queries , Gzip On, Redis On.

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