jordan76
Full Member level 3
Hi
In the following verilgo code,I want to generate a register with a RESET terminal and a PRESET terminal. But the simulation results show that it did not meet my requirements.
Could anyone help me out?
Thanks in advance!
regards,
jordan76
//define a register
reg out_en;
always @(posedge clk or negedge reset_b or negedge preset_b)
begin
if (!reset_b)
out_en<=1'b0;
else if (!preset_b)
out_en<=1'b1;
else if (condition A) // if condition A is true
out_en<=1'b0;
else if (condition B) // if condition B is true
out_en<1'b1;
end
In the following verilgo code,I want to generate a register with a RESET terminal and a PRESET terminal. But the simulation results show that it did not meet my requirements.
Could anyone help me out?
Thanks in advance!
regards,
jordan76
//define a register
reg out_en;
always @(posedge clk or negedge reset_b or negedge preset_b)
begin
if (!reset_b)
out_en<=1'b0;
else if (!preset_b)
out_en<=1'b1;
else if (condition A) // if condition A is true
out_en<=1'b0;
else if (condition B) // if condition B is true
out_en<1'b1;
end