[RTLLM-p038] Miscellaneous/RISC-V/pe 的題解


記住 在沒有思路時使用題解,不要從它複製貼上程式碼。請尊重題目和題解的作者。
在真正解決題目之前提交題解的程式碼是可以封禁的罪行。

作者: m1145505

module pe(
    input clk,
    input rst,
    input [31:0] a,
    input [31:0] b,

    output [31:0] c
);

reg [31:0] cc;
assign c = cc;
always@(posedge clk or posedge rst)
begin

  if(rst)
  begin
    cc <= 0;
  end

  else
  begin
    cc <= cc + a*b;
  end

end

endmodule

評論

目前沒有評論。