|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?注册
x
代码如下,, module top(clk,reset,sync,sync1,sync2,sync3,sync4,carry
);
input clk,reset;
input sync;
output carry;
output sync1,sync2,sync3,sync4;
//
reg sync1,sync2,sync3;
always@(posedge clk or posedge reset)
if(reset)
begin
sync1<=0;
sync2<=0;
sync3<=0;
end
else
begin
sync1<=sync;
sync2<=sync1;
sync3<=sync2;
end
wire sync4;
assign sync4=sync&sync1&sync2&sync3;
reg carry;
always@(posedge clk or posedge reset)
if(reset)
carry<=0;
else if(sync4==1)
carry<=1;
else
carry<=0;
endmodule
我要问的是为啥carry只维持一个高电平?为啥不是2个呢,,困扰了很久,,求大神解答 |
|