引起期望仿真错误的正确代码
module Pulse_Or_Level(global_clk,clk,sig_a,o_sig_a);
input global_clk;
input sig_a;
output clk;
output o_sig_a;
wire global_clk;
wire sig_a;
reg o_sig_a;
reg[1:0] f_div4=2'b00;
wire clk;
assign clk=f_div4[1];
always@(posedge global_clk)
begin
f_div4=f_div4+1;
end
always@(posedge clk or posedge sig_a)
begin
if(sig_a)
begin
o_sig_a=1'b1;
end
else
begin
o_sig_a=1'b0;
end
end
endmodule