任何人都可以告诉我如何在verilog中的always block中使用结构建模,
我正在设计2的恭维算术单元。 for opcode = 4'b0001;它应该转到两个恭维添加模块并获得结果。我尝试这样做如下;
always@(posedge clk)
begin
if (start == 1'b1)
done = 1'b0;
begin
case (opcode)
4'b0000:Acc = Acc;//NOP
4'b0001:begin
M = 1'b0;
two_comp tc (clk, a, b, result);
Acc = result;
end
4'b0010:begin
M = 1'b1;
Acc = result;
end
4'b0011:begin
Acc = product;
end
4'b1000:Acc = inp;
endcase
end
end