我正在阅读一些第三方 Verilog,并发现了这一点:
function [31:0] factorial;
input [3:0] operand;
reg [3:0] index;
begin
factorial = operand ? 1 : 0;
for(index = 2; index <= operand; index = index + 1)
factorial = index * factorial;
end
endfunction
看来begin
andend
关键字在这里是多余的。他们是吗?它们的用途是什么?