两种写法的结果有差异
仿真通过:
always @ ( input1 or input2 or input3 or input4 )
begin
if ( input1 > input2 )
begin
min_output1 <= input2;
if( min_output1 > input3 )
begin
min_output2 <= input3;
if(min_output2 > input4 )
begin
min_output <= input4;
end
else
begin
min_output <= min_output2;
end
end
else
begin
min_output2 <=min_output1;
end
end
else
begin
min_output1 <= input1;
end
end
仿真NG:>换<