xiongdh
Member level 4
- Joined
- Jul 18, 2002
- Messages
- 76
- Helped
- 2
- Reputation
- 4
- Reaction score
- 1
- Trophy points
- 1,288
- Location
- china mainland
- Activity points
- 682
///////////////////////////////////////////////////////
style1:
reg reg_temp1,reg_temp2;
initial
begin
reg_temp1<=1'b0;
reg_temp2<=1'b0;
end
always @(posedge clock)
reg_temp1<=!reg_temp1;
always @(posedge clock & reg_temp1)
reg_temp2<=!reg_temp2;
//////////////////////////////////////////////////////
///////////////////////////////////////////////////////
style2:
reg reg_temp1,reg_temp2;
initial
begin
reg_temp1<=1'b0;
reg_temp2<=1'b0;
end
always @(posedge clock)
reg_temp1<=!reg_temp1;
always @(posedge clock )
if(reg_temp1)
reg_temp2<=!reg_temp2;
//////////////////////////////////////////////////////
with simulation tool verilog-xl
the simulation result is not the same. with style 1.the wave of two signal is the same. with style 2 reg_temp1 's frequence is two times of reg_temp2.
Why this happen????????????
style1:
reg reg_temp1,reg_temp2;
initial
begin
reg_temp1<=1'b0;
reg_temp2<=1'b0;
end
always @(posedge clock)
reg_temp1<=!reg_temp1;
always @(posedge clock & reg_temp1)
reg_temp2<=!reg_temp2;
//////////////////////////////////////////////////////
///////////////////////////////////////////////////////
style2:
reg reg_temp1,reg_temp2;
initial
begin
reg_temp1<=1'b0;
reg_temp2<=1'b0;
end
always @(posedge clock)
reg_temp1<=!reg_temp1;
always @(posedge clock )
if(reg_temp1)
reg_temp2<=!reg_temp2;
//////////////////////////////////////////////////////
with simulation tool verilog-xl
the simulation result is not the same. with style 1.the wave of two signal is the same. with style 2 reg_temp1 's frequence is two times of reg_temp2.
Why this happen????????????